zhangyuan 3 years ago
parent
commit
36b0a7b59f
  1. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

@ -475,35 +475,45 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
// 历史记录
IcEnterpriseChangeRecordEntity record = ConvertUtils.sourceToTarget(origin, IcEnterpriseChangeRecordEntity.class);
List<IcCoverageCategoryDictListResultDTO> categoryList = coverageService.dictMap(loginUserUtil.getLoginUserCustomerId(), "enterprise_patrol");
Map<String, String> categoryMap = categoryList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel));
CustomerGridEntity originGrid = customerGridDao.selectById(origin.getGridId());
Map<String, String> scaleMap;
Result<Map<String, String>> result = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode());
if (!result.success() || null == result.getData()) {
throw new EpmetException("查询字典信息失败" + JSON.toJSONString(result));
} else {
scaleMap = result.getData();
}
if (formDTO != null) {
if (!origin.getPlaceType().equals(formDTO.getPlaceType())) {
record.setPlaceType(origin.getPlaceType().concat("->").concat(formDTO.getPlaceType()));
List<IcCoverageCategoryDictListResultDTO> categoryList = coverageService.dictMap(loginUserUtil.getLoginUserCustomerId(), "enterprise_patrol");
Map<String, String> categoryMap = categoryList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel));
record.setPlaceType(categoryMap.get(origin.getPlaceType()).concat("->").concat(categoryMap.get(formDTO.getPlaceType())));
} else {
record.setPlaceType(categoryMap.get(origin.getPlaceType()));
}
if (!origin.getGridId().equals(formDTO.getGridId())) {
CustomerGridEntity originGrid = customerGridDao.selectById(origin.getGridId());
CustomerGridEntity thisGrid = customerGridDao.selectById(formDTO.getGridId());
record.setGridId(origin.getGridId().concat("->").concat(thisGrid.getGridName()));
if (originGrid != null && thisGrid != null) {
record.setGridId(originGrid.getGridName().concat("->").concat(formDTO.getGridId()));
}
} else {
record.setGridId(originGrid.getGridName());
}
if (!origin.getPlaceOrgName().equals(formDTO.getPlaceOrgName())) {
record.setPlaceOrgName(origin.getPlaceOrgName().concat("->").concat(formDTO.getPlaceOrgName()));
}
if (!origin.getScale().equals(formDTO.getScale())) {
record.setScale(origin.getScale().concat("->").concat(formDTO.getScale()));
Result<Map<String, String>> result = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode());
if (!result.success() || null == result.getData()) {
throw new EpmetException("查询字典信息失败" + JSON.toJSONString(result));
} else {
Map<String, String> scaleMap = result.getData();
record.setScale(scaleMap.get(origin.getScale()).concat("->").concat(scaleMap.get(formDTO.getScale())));
}
record.setScale(scaleMap.get(origin.getScale()).concat("->").concat(scaleMap.get(formDTO.getScale())));
} else {
record.setScale(scaleMap.get(origin.getScale()));
}
if (!origin.getPersonInCharge().equals(formDTO.getPersonInCharge())) {
record.setPersonInCharge(origin.getPersonInCharge().concat("->").concat(formDTO.getPersonInCharge()));
}

Loading…
Cancel
Save