@@ -19,4 +19,8 @@ public interface IssueSingleEquityRepo extends AbstractJpaRepo<IssueSingleEquity | |||
@Query(value = "select sum(discountPrice) from IssueSingleEquity where singleEquityId in ?1") | |||
Long sumFeeBySingleEquityId(List<String> collect); | |||
List<IssueSingleEquity> findByCouponId(String couponId); | |||
} |
@@ -28,7 +28,7 @@ public class ServiceHallAddOneRequestDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank | |||
@FixedLength(length = 19, message = "中心网点编号必须是19位") | |||
@ApiModelProperty(value = "中心网点编号") | |||
private String centerServiceHallId; | |||
private String mapChannelId; | |||
@ApiModelProperty(value = "联系人") | |||
private String contact; | |||
@NotBlank(message = "网点名称不能为空") |
@@ -44,7 +44,7 @@ public class ServiceHallUpdateRequestDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank | |||
@FixedLength(length = 19,message = "中心网点编号必须是19位") | |||
@ApiModelProperty(value = "中心网点编号") | |||
private String centerServiceHallId; | |||
private String mapChannelId; | |||
// 位置信息 | |||
@Valid | |||
private List<ServiceHallLocationModel> locationModels; |
@@ -47,10 +47,10 @@ public class ServiceHallRegisterFullBatchListener implements ReadListener<Servic | |||
if (StringTools.isEmpty(data.getLongitude())) builder.append("经度不能为空").append(","); | |||
if (StringTools.isEmpty(data.getLatitude())) builder.append("纬度不能为空").append(","); | |||
if (StringTools.isEmpty(data.getRadial())) builder.append("半径距(米)不能为空").append(","); | |||
if (StringTools.isEmpty(data.getCenterServiceHallId())) { | |||
if (StringTools.isEmpty(data.getMapChannelId())) { | |||
builder.append("中心网点编号不为空").append(","); | |||
} else { | |||
QtkServicehallMap serviceHallId = serviceHallMapRepo.findByCenterServiceHallId(data.getCenterServiceHallId()); | |||
QtkServicehallMap serviceHallId = serviceHallMapRepo.findByCenterServiceHallId(data.getMapChannelId()); | |||
if (serviceHallId == null) { | |||
builder.append("中心网点编号不存在").append(","); | |||
} else { |
@@ -94,9 +94,18 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
@Override | |||
public List<ServiceHallSonQueryModel> querySon(ServiceHallSonQueryRequestDTO reqDto) { | |||
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); | |||
} | |||
//递归 | |||
@@ -109,6 +118,7 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
model.setServicehallId(serviceHallId); | |||
model.setServicehallName(serviceHall.getName()); | |||
List<QtkServiceHall> serviceHalls1 = collect.get(serviceHallId); | |||
if (serviceHalls1 != null) { | |||
model.setChildrens(querySon(serviceHalls1, collect)); | |||
} | |||
@@ -148,7 +158,6 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
newServiceHall.setLongitude(reqDto.getLongitude()); | |||
newServiceHall.setLatitude(reqDto.getLatitude()); | |||
newServiceHall.setRadial(reqDto.getRadial()); | |||
newServiceHall.setMapChannelId(reqDto.getCenterServiceHallId()); | |||
serviceHallRepo.save(newServiceHall); | |||
if (!isEmpty(reqDto.getLocationModels())) { | |||
List<QtkServicehallLocation> locations = Lists.newArrayList(); | |||
@@ -208,7 +217,6 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
qtkServiceHall.setContact(reqDto.getContact()); | |||
qtkServiceHall.setLongitude(reqDto.getLongitude()); | |||
qtkServiceHall.setLatitude(reqDto.getLatitude()); | |||
qtkServiceHall.setMapChannelId(reqDto.getCenterServiceHallId()); | |||
qtkServiceHall.setUpdateTime(now); | |||
// 更新 | |||
serviceHallRepo.merge(qtkServiceHall); |
@@ -33,7 +33,7 @@ public class ServiceHallRegisterData { | |||
@ExcelProperty(index = 3, value = "网点编号") | |||
private String serviceHallId; | |||
@ExcelProperty(index = 4, value = "中心网点编号") | |||
private String centerServiceHallId; | |||
private String mapChannelId; | |||
@ExcelProperty(index = 5, value = "网点名称") | |||
private String name; | |||
@ExcelProperty(index = 6, value = "地址") |