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