| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -6,17 +6,18 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.ExceptionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.ValidateException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.validator.ValidatorUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.IcResiUserConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.IcTripReportRecordEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.excel.IcPsTripReportRecordExcel; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.excel.data.IcTripReportExcelData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.excel.error.IcPsTripReportRecordErrorExcel; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.impl.IcTripReportRecordServiceImpl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Date; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.List; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.atomic.AtomicBoolean; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -78,18 +79,45 @@ public class IcPsTripReportExcelImportListener implements ReadListener<IcPsTripR | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            AtomicBoolean bl = new AtomicBoolean(false); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            StringBuffer errMsg = new StringBuffer(""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcTripReportRecordEntity e = ConvertUtils.sourceToTarget(data, IcTripReportRecordEntity.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setAgencyId(staffInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setPids(staffInfo.getAgencyPIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setUserType(IcResiUserConstant.USER_TYPE_IMPORT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setNatOutcome("阳性".equals(e.getNatOutcome()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (trafficTypeMap.containsKey(data.getTrafficType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setTrafficType(trafficTypeMap.get(data.getTrafficType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //先对一下字段值填写是否正确做判断
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!"阳性".equals(e.getNatOutcome()) && !"阴性".equals(e.getNatOutcome())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘48小时核酸检测’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!trafficTypeMap.containsKey(e.getTrafficType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘返回方式’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if ("其他".equals(e.getTrafficType()) && StringUtils.isBlank(e.getTrafficTypeExplain())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("返回方式为其他时,请补充‘其他返回方式’;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(e.getSojournHistory()) && !sojournHistoryMap.containsKey(e.getSojournHistory())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘7天内旅居史情况’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if ("其他".equals(data.getTrafficType()) && StringUtils.isBlank(data.getTrafficTypeExplain())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("返回方式为其他时,请补充“其他返回方式”;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(e.getIsolateType()) && !isolateTypeMap.containsKey(e.getIsolateType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘隔离状态’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(e.getIsArriveCheck()) && !"是".equals(e.getIsArriveCheck()) && !"否".equals(e.getIsArriveCheck())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘是否落实“落地检”’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(e.getIsArrive()) && !"是".equals(e.getIsArrive()) && !"否".equals(e.getIsArrive())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘是否达到曹县’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(e.getTripDataType()) && !tripDataTypeMap.containsKey(e.getTripDataType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("‘类型(省内、省外、市内、县内)’值填写错误;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            /*//必要字段没值的
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isEmpty(e.getSourceAddress()) || StringUtils.isEmpty(e.getPresentAddress()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    || StringUtils.isEmpty(e.getTrafficType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("数据不完整,请检查‘来源地’、‘在曹居住地点’、‘返回方式’信息是否填写完整;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }*/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(data.getSojournHistory())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setSojournHistory(sojournHistoryMap.get(data.getSojournHistory())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -103,20 +131,7 @@ public class IcPsTripReportExcelImportListener implements ReadListener<IcPsTripR | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    e.setSojournHistory(areaMap.get(str[2])); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(data.getIsolateType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setIsolateType(isolateTypeMap.get(data.getIsolateType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(data.getTripDataType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setTripDataType(tripDataTypeMap.get(data.getTripDataType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setIsArriveCheck("是".equals(data.getIsArriveCheck()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setIsArrive("是".equals(data.getIsArrive()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //必要字段没值的
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isEmpty(e.getSourceAddress()) || StringUtils.isEmpty(e.getPresentAddress()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    || StringUtils.isEmpty(e.getTrafficType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errMsg.append("数据不完整,请检查‘来源地’、‘在曹居住地点’、‘返回方式’信息是否填写完整;"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                bl.set(true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //错误数据记录到错误文件
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (bl.get()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IcPsTripReportRecordErrorExcel errorRow = new IcPsTripReportRecordErrorExcel(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errorRow.setName(data.getName()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -126,6 +141,24 @@ public class IcPsTripReportExcelImportListener implements ReadListener<IcPsTripR | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                errorRows.add(errorRow); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setAgencyId(staffInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setPids(staffInfo.getAgencyPIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setUserType(IcResiUserConstant.USER_TYPE_IMPORT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setNatOutcome("阳性".equals(e.getNatOutcome()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (trafficTypeMap.containsKey(data.getTrafficType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setTrafficType(trafficTypeMap.get(data.getTrafficType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(data.getIsolateType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setIsolateType(isolateTypeMap.get(data.getIsolateType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(data.getTripDataType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                e.setTripDataType(tripDataTypeMap.get(data.getTripDataType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setIsArriveCheck("是".equals(data.getIsArriveCheck()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setIsArrive("是".equals(data.getIsArrive()) ? "1" : "0"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.setReportingTime(DateUtils.integrate(new Date(), "yyyy-MM-dd")); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            datas.add(e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (datas.size() == MAX_THRESHOLD) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |