|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
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.enums.DictTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
@ -149,6 +150,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous |
|
|
|
} |
|
|
|
//3.新增服务组织数据
|
|
|
|
IcDangerousChemicalsEntity entity = ConvertUtils.sourceToTarget(formDTO, IcDangerousChemicalsEntity.class); |
|
|
|
entity.setSourceType("add"); |
|
|
|
entity.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); |
|
|
|
insert(entity); |
|
|
@ -194,19 +196,18 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous |
|
|
|
|
|
|
|
//封装类别数据
|
|
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
|
resultDTO = list.get(NumConstant.ZERO); |
|
|
|
//危化品种类字典
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); |
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
//企业类别字典数据
|
|
|
|
List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); |
|
|
|
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getLabel, IcCoverageCategoryDictListResultDTO::getValue)); |
|
|
|
for (IcDangerousChemicalsListResultDTO v : list) { |
|
|
|
if (StringUtils.isNotBlank(v.getCategory())) { |
|
|
|
v.setCategoryName(dictMap.get(v.getCategory())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(v.getDangerType())) { |
|
|
|
v.setDangerTypeName(statusMap.get(v.getDangerType())); |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getCategory())) { |
|
|
|
resultDTO.setCategoryName(dictMap.get(resultDTO.getCategory())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(resultDTO.getDangerType())) { |
|
|
|
resultDTO.setDangerTypeName(statusMap.get(resultDTO.getDangerType())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|