Browse Source

9999替换为统一错误码

master
jianjun 4 years ago
parent
commit
444c837fdc
  1. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java
  2. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  3. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  4. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  6. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
  8. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  9. 7
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java

@ -20,6 +20,7 @@ package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -27,10 +28,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.AddSocietyOrgFormDTO;
import com.epmet.dto.form.EditSocietyOrgFormDTO;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.GetListPlaceOrgResultDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcSocietyOrgExcel;
@ -164,9 +163,9 @@ public class IcSocietyOrgController {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
}
}

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -267,7 +268,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
if (CollectionUtils.isEmpty(result)) {
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
return new Result().error(9999, "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "第" + subList + "行未成功!");
}
List<IcPartyActivityEntity> list = result.stream().map(item -> {
@ -296,7 +297,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
@ -422,4 +423,4 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
formDTO.setEndTime(DateUtils.parse(end.concat(" 23:59:59"), DateUtils.DATE_TIME_PATTERN));
}
}
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -375,7 +375,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
if (CollectionUtils.isEmpty(result)) {
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
return new Result().error(9999, "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "第" + subList + "行未成功!");
}
List<IcPartyUnitEntity> list = result.stream().map(item -> {
@ -405,7 +405,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
@ -493,4 +493,4 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
return StringUtils.join(list, StrConstant.COMMA);
}
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java

@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -195,7 +196,7 @@ public class BuildingController {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str+"第"+subList+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!");
}
return new Result().ok(str);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -226,7 +226,7 @@ public class HouseController implements ResultDataResolver {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str+"第"+subList+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str+"第"+subList+"行未成功!");
}
return new Result().ok(str);
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -223,7 +224,7 @@ public class NeighborHoodController {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -329,7 +329,7 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingUnitService.insertBatch(icBuildingUnitEntityList);
/* if(!"".equals(str)){
return new Result().error(9999, str.append("不存在").toString());
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str.append("不存在").toString());
}*/
return numList;
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -45,7 +46,6 @@ import com.epmet.dto.result.InfoByNamesResultDTO;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import com.epmet.excel.IcBuildingExcel;
import com.epmet.excel.IcNeighborHoodExcel;
import com.epmet.service.IcNeighborHoodPropertyService;
import com.epmet.service.IcNeighborHoodService;
@ -226,10 +226,10 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
*/
public Result disposeImportNeighborhood(ImportInfoFormDTO formDTO, List<IcNeighborHoodExcel> result){
if (CollectionUtils.isEmpty(result)){
return new Result().error(9999,"excel表格内没有数据");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"excel表格内没有数据");
}
List<Integer> nums = new ArrayList<>();
List<String> gridNames = result.stream().map(m -> m.getGridName()).distinct().collect(Collectors.toList());
List<String> gridNames = result.stream().map(IcNeighborHoodExcel::getGridName).distinct().collect(Collectors.toList());
// 1. 查询数据网格是否存在
List<InfoByNamesResultDTO> gridInfos = customerGridDao.selectGridInfoByNames(gridNames, formDTO.getCustomerId());
if (CollectionUtils.isEmpty(gridInfos)){
@ -238,7 +238,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
nums.add(i);
}
String str = String.format("共%s条,成功导入%s条。",result.size(),0);
return new Result().error(9999,str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
}
result.forEach(r -> {
for (InfoByNamesResultDTO g : gridInfos) {
@ -253,7 +253,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
// 只获取能查询到的网格
List<IcNeighborHoodExcel> neighborHoods = groupStatus.get(true);
// 2. 查询组织选中组织下存在的小区
List<String> existNames = baseDao.selectNeighborhoodNameByNames(neighborHoods.stream().map(m -> m.getNeighborHoodName()).distinct().collect(Collectors.toList()), formDTO.getCustomerId());
List<String> existNames = baseDao.selectNeighborhoodNameByNames(neighborHoods.stream().map(IcNeighborHoodExcel::getNeighborHoodName).distinct().collect(Collectors.toList()), formDTO.getCustomerId());
// 为了显示多少行插入成功,未成功
result.forEach(r -> {
for (String s : existNames) {
@ -272,7 +272,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
nums.add(i);
}
String str = String.format("共%s条,成功导入%s条。",result.size(),0);
return new Result().error(9999,str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
}
if (formDTO.getOrgType().equals(CustomerGridConstant.AGENCY)){
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId());
@ -304,7 +304,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
nums.add(i);
}
String str = String.format("共%s条,成功导入%s条。",result.size(),0);
return new Result().error(9999,str +"第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),str +"第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
}
Map<String, Long> collect = finalNeedInsert.stream().collect(Collectors.groupingBy(o -> o.getGridName() + "_" + o.getNeighborHoodName(), Collectors.counting()));
collect.forEach((k,v) -> {
@ -368,7 +368,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}
String str = String.format("共%s条,成功导入%s条。",result.size(),entities.size());
if (CollectionUtils.isNotEmpty(nums)){
return new Result().error(9999,str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),str + "第"+nums.stream().map(String::valueOf).collect(Collectors.joining("、"))+"行未成功!");
}
return new Result().ok(str);
}
@ -406,4 +406,4 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
});
}
}
}

7
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -273,7 +274,7 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
if (CollectionUtils.isEmpty(result)) {
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
return new Result().error(9999, "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "第" + subList + "行未成功!");
}
List<IcPartymemberStyleImageEntity> imageList = new ArrayList<>();
List<IcPartymemberStyleEntity> list = result.stream().map(item -> {
@ -299,9 +300,9 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
Collections.sort(numList);
String subList = numList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
}
}

Loading…
Cancel
Save