@Query(value = "select sum(discountPrice) from IssueSingleEquity where singleEquityId in ?1") | @Query(value = "select sum(discountPrice) from IssueSingleEquity where singleEquityId in ?1") | ||||
Long sumFeeBySingleEquityId(List<String> collect); | Long sumFeeBySingleEquityId(List<String> collect); | ||||
List<IssueSingleEquity> findByCouponId(String couponId); | |||||
} | } |
@NotBlank | @NotBlank | ||||
@FixedLength(length = 19, message = "中心网点编号必须是19位") | @FixedLength(length = 19, message = "中心网点编号必须是19位") | ||||
@ApiModelProperty(value = "中心网点编号") | @ApiModelProperty(value = "中心网点编号") | ||||
private String centerServiceHallId; | |||||
private String mapChannelId; | |||||
@ApiModelProperty(value = "联系人") | @ApiModelProperty(value = "联系人") | ||||
private String contact; | private String contact; | ||||
@NotBlank(message = "网点名称不能为空") | @NotBlank(message = "网点名称不能为空") |
@NotBlank | @NotBlank | ||||
@FixedLength(length = 19,message = "中心网点编号必须是19位") | @FixedLength(length = 19,message = "中心网点编号必须是19位") | ||||
@ApiModelProperty(value = "中心网点编号") | @ApiModelProperty(value = "中心网点编号") | ||||
private String centerServiceHallId; | |||||
private String mapChannelId; | |||||
// 位置信息 | // 位置信息 | ||||
@Valid | @Valid | ||||
private List<ServiceHallLocationModel> locationModels; | private List<ServiceHallLocationModel> locationModels; |
if (StringTools.isEmpty(data.getLongitude())) builder.append("经度不能为空").append(","); | if (StringTools.isEmpty(data.getLongitude())) builder.append("经度不能为空").append(","); | ||||
if (StringTools.isEmpty(data.getLatitude())) builder.append("纬度不能为空").append(","); | if (StringTools.isEmpty(data.getLatitude())) builder.append("纬度不能为空").append(","); | ||||
if (StringTools.isEmpty(data.getRadial())) builder.append("半径距(米)不能为空").append(","); | if (StringTools.isEmpty(data.getRadial())) builder.append("半径距(米)不能为空").append(","); | ||||
if (StringTools.isEmpty(data.getCenterServiceHallId())) { | |||||
if (StringTools.isEmpty(data.getMapChannelId())) { | |||||
builder.append("中心网点编号不为空").append(","); | builder.append("中心网点编号不为空").append(","); | ||||
} else { | } else { | ||||
QtkServicehallMap serviceHallId = serviceHallMapRepo.findByCenterServiceHallId(data.getCenterServiceHallId()); | |||||
QtkServicehallMap serviceHallId = serviceHallMapRepo.findByCenterServiceHallId(data.getMapChannelId()); | |||||
if (serviceHallId == null) { | if (serviceHallId == null) { | ||||
builder.append("中心网点编号不存在").append(","); | builder.append("中心网点编号不存在").append(","); | ||||
} else { | } else { |
@Override | @Override | ||||
public List<ServiceHallSonQueryModel> querySon(ServiceHallSonQueryRequestDTO reqDto) { | public List<ServiceHallSonQueryModel> querySon(ServiceHallSonQueryRequestDTO reqDto) { | ||||
List<QtkServiceHall> all = serviceHallRepo.findAll(); | List<QtkServiceHall> all = serviceHallRepo.findAll(); | ||||
Map<String, List<QtkServiceHall>> collect = all.stream().collect(Collectors.groupingBy(QtkServiceHall::getSuperServiceHallId)); | |||||
List<QtkServiceHall> remove = collect.remove(null); | |||||
return querySon(remove, collect); | |||||
if (CollectionUtil.isEmpty(all)) return null; | |||||
List<QtkServiceHall> top = new ArrayList<>();//最顶级的网点 | |||||
List<QtkServiceHall> son = new ArrayList<>();//子网点 | |||||
for (QtkServiceHall qtkServiceHall : all) { | |||||
if (qtkServiceHall.getSuperServiceHallId() == null) { | |||||
top.add(qtkServiceHall); | |||||
}else { | |||||
son.add(qtkServiceHall); | |||||
} | |||||
} | |||||
Map<String, List<QtkServiceHall>> collect = son.stream().collect(Collectors.groupingBy(QtkServiceHall::getSuperServiceHallId)); | |||||
return querySon(top, collect); | |||||
} | } | ||||
//递归 | //递归 | ||||
model.setServicehallId(serviceHallId); | model.setServicehallId(serviceHallId); | ||||
model.setServicehallName(serviceHall.getName()); | model.setServicehallName(serviceHall.getName()); | ||||
List<QtkServiceHall> serviceHalls1 = collect.get(serviceHallId); | List<QtkServiceHall> serviceHalls1 = collect.get(serviceHallId); | ||||
if (serviceHalls1 != null) { | if (serviceHalls1 != null) { | ||||
model.setChildrens(querySon(serviceHalls1, collect)); | model.setChildrens(querySon(serviceHalls1, collect)); | ||||
} | } | ||||
newServiceHall.setLongitude(reqDto.getLongitude()); | newServiceHall.setLongitude(reqDto.getLongitude()); | ||||
newServiceHall.setLatitude(reqDto.getLatitude()); | newServiceHall.setLatitude(reqDto.getLatitude()); | ||||
newServiceHall.setRadial(reqDto.getRadial()); | newServiceHall.setRadial(reqDto.getRadial()); | ||||
newServiceHall.setMapChannelId(reqDto.getCenterServiceHallId()); | |||||
serviceHallRepo.save(newServiceHall); | serviceHallRepo.save(newServiceHall); | ||||
if (!isEmpty(reqDto.getLocationModels())) { | if (!isEmpty(reqDto.getLocationModels())) { | ||||
List<QtkServicehallLocation> locations = Lists.newArrayList(); | List<QtkServicehallLocation> locations = Lists.newArrayList(); | ||||
qtkServiceHall.setContact(reqDto.getContact()); | qtkServiceHall.setContact(reqDto.getContact()); | ||||
qtkServiceHall.setLongitude(reqDto.getLongitude()); | qtkServiceHall.setLongitude(reqDto.getLongitude()); | ||||
qtkServiceHall.setLatitude(reqDto.getLatitude()); | qtkServiceHall.setLatitude(reqDto.getLatitude()); | ||||
qtkServiceHall.setMapChannelId(reqDto.getCenterServiceHallId()); | |||||
qtkServiceHall.setUpdateTime(now); | qtkServiceHall.setUpdateTime(now); | ||||
// 更新 | // 更新 | ||||
serviceHallRepo.merge(qtkServiceHall); | serviceHallRepo.merge(qtkServiceHall); |
@ExcelProperty(index = 3, value = "网点编号") | @ExcelProperty(index = 3, value = "网点编号") | ||||
private String serviceHallId; | private String serviceHallId; | ||||
@ExcelProperty(index = 4, value = "中心网点编号") | @ExcelProperty(index = 4, value = "中心网点编号") | ||||
private String centerServiceHallId; | |||||
private String mapChannelId; | |||||
@ExcelProperty(index = 5, value = "网点名称") | @ExcelProperty(index = 5, value = "网点名称") | ||||
private String name; | private String name; | ||||
@ExcelProperty(index = 6, value = "地址") | @ExcelProperty(index = 6, value = "地址") |