| 
						
						
							
								
							
						
						
					 | 
					@ -3,14 +3,18 @@ package com.epmet.model; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.context.AnalysisContext; | 
					 | 
					 | 
					import com.alibaba.excel.context.AnalysisContext; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.event.AnalysisEventListener; | 
					 | 
					 | 
					import com.alibaba.excel.event.AnalysisEventListener; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.enums.DictTypeEnum; | 
					 | 
					 | 
					import com.epmet.commons.tools.enums.DictTypeEnum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.ExceptionUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.ValidateException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.Result; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.validator.ValidatorUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.validator.ValidatorUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; | 
					 | 
					 | 
					import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.IcDangerousChemicalsEntity; | 
					 | 
					 | 
					import com.epmet.entity.IcDangerousChemicalsEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.excel.IcCityManagementExcel; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.feign.EpmetAdminOpenFeignClient; | 
					 | 
					 | 
					import com.epmet.feign.EpmetAdminOpenFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.CoverageService; | 
					 | 
					 | 
					import com.epmet.service.CoverageService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.IcDangerousChemicalsService; | 
					 | 
					 | 
					import com.epmet.service.IcDangerousChemicalsService; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -54,58 +58,30 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void invoke(DangerousChemicalsModel data, AnalysisContext context) { | 
					 | 
					 | 
					    public void invoke(DangerousChemicalsModel data, AnalysisContext context) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Integer rowNum = context.readRowHolder().getRowIndex() + NumConstant.ONE; | 
					 | 
					 | 
					        Integer rowNum = context.readRowHolder().getRowIndex() + NumConstant.ONE; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (StringUtils.isBlank(data.getName())){ | 
					 | 
					 | 
					        try { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					            ValidatorUtils.validateEntity(data); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					            IcDangerousChemicalsEntity e = ConvertUtils.sourceToTarget(data, IcDangerousChemicalsEntity.class); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setErrorInfo("企业名称不能为空"); | 
					 | 
					 | 
					            e.setSourceType("import"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					            e.setAgencyId(agencyInfo.getId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            return; | 
					 | 
					 | 
					            e.setCustomerId(agencyInfo.getCustomerId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            e.setAgencyIdPath(agencyInfo.getPids().equals(NumConstant.ZERO_STR) || agencyInfo.getPids().equals("") ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId())); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (StringUtils.isBlank(data.getCategoryName())){ | 
					 | 
					 | 
					            insertList.add(e); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					            if (insertList.size() == NumConstant.ONE_HUNDRED){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					                execPersist(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setErrorInfo("企业类型不能为空"); | 
					 | 
					 | 
					            } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					        }catch (Exception e){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            return; | 
					 | 
					 | 
					            String errorMsg = null; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            if (e instanceof ValidateException) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (StringUtils.isBlank(data.getAddress())){ | 
					 | 
					 | 
					                errorMsg = ((ValidateException) e).getMsg(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					            } else { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					                errorMsg = "未知错误"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            row.setErrorInfo("经营地址不能为空"); | 
					 | 
					 | 
					                log.error("【重点危化品企业导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					            } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            return; | 
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage errorRow = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        } | 
					 | 
					 | 
					            errorRow.setRowNum(rowNum); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (data.getName().trim().length() > NumConstant.FIFTY){ | 
					 | 
					 | 
					            errorRow.setErrorInfo(errorMsg); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					            errorRows.add(errorRow); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setErrorInfo("企业名称长度超出50字限制"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (data.getPrincipalMobile().trim().length() > NumConstant.FIFTY){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setErrorInfo("联系电话长度超出50字限制"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (data.getAddress().trim().length() > NumConstant.FIFTY){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            DangerousChemicalsModel.RowRemarkMessage row = ConvertUtils.sourceToTarget(data, DangerousChemicalsModel.RowRemarkMessage.class); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setRowNum(rowNum); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            row.setErrorInfo("经营地址长度超出50字限制"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            errorRows.add(row); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IcDangerousChemicalsEntity e = ConvertUtils.sourceToTarget(data, IcDangerousChemicalsEntity.class); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        e.setSourceType("import"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        e.setAgencyId(agencyInfo.getId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        e.setCustomerId(agencyInfo.getCustomerId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        e.setAgencyIdPath(agencyInfo.getPids().equals(NumConstant.ZERO_STR) || agencyInfo.getPids().equals("") ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId())); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        insertList.add(e); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (insertList.size() == NumConstant.ONE_HUNDRED){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            execPersist(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -126,7 +102,7 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(16); | 
					 | 
					 | 
					                Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(16); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //企业类别字典数据
 | 
					 | 
					 | 
					                //企业类别字典数据
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(agencyInfo.getCustomerId(), "dangerous_chemicals"); | 
					 | 
					 | 
					                List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(agencyInfo.getCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); | 
					 | 
					 | 
					                Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                insertList.forEach(i -> { | 
					 | 
					 | 
					                insertList.forEach(i -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    statusMap.forEach((k,v) -> { | 
					 | 
					 | 
					                    statusMap.forEach((k,v) -> { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |