zxc 4 years ago
parent
commit
ecf2914573
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -250,9 +250,7 @@ public enum EpmetErrorCode {
ORG_ADD_FAILED(8919,"添加失败"),
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,"%s内包含楼宇信息,暂无法删除"),
BUILDING_DEL_FAILED(8923,"%s内包含房屋信息,暂无法删除"),
HOUSE_DEL_FAILED(8924,"%s内包含居民信息,暂无法删除"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
//通用错误码 start

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -365,8 +365,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icNeighborHoodDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getMsg(),collect));
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(""));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼宇信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){
@ -385,9 +385,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icBuildingDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.BUILDING_DEL_FAILED.setMsg(String.format(EpmetErrorCode.BUILDING_DEL_FAILED.getMsg(),collect));
throw new EpmetException(EpmetErrorCode.BUILDING_DEL_FAILED.getCode());
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(""));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含房屋信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
Result<List<String>> existUsers = epmetUserOpenFeignClient.getExistUserByHouseIds(ids);
@ -410,9 +410,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
if (!CollectionUtils.isEmpty(exists)){
List<String> list = icHouseDao.selectHouseNames(exists);
String collect = list.stream().collect(Collectors.joining(","));
EpmetErrorCode.HOUSE_DEL_FAILED.setMsg(String.format(EpmetErrorCode.HOUSE_DEL_FAILED.getMsg(),collect));
throw new EpmetException(EpmetErrorCode.HOUSE_DEL_FAILED.getCode());
String collect = list.stream().collect(Collectors.joining(""));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含居民信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}
}

Loading…
Cancel
Save