|
|
@ -515,13 +515,13 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
|
errorLineinfoList.add(packageErrorInfo(i, verification)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(data.getTestingTimeStr())) { |
|
|
|
if (StringUtils.isBlank(data.getTestingTime())) { |
|
|
|
errorLineinfoList.add(packageErrorInfo(i, "核酸检测时间为空")); |
|
|
|
} else { |
|
|
|
if (DateUtils.DATE_TIME_PATTERN.length() != data.getTestingTimeStr().length()) { |
|
|
|
if (DateUtils.DATE_TIME_PATTERN.length() != data.getTestingTime().length()) { |
|
|
|
errorLineinfoList.add(packageErrorInfo(i, "核酸检测时间格式不匹配")); |
|
|
|
} else { |
|
|
|
data.setTestingTime(DateUtils.stringToDate(data.getTestingTimeStr(), DateUtils.DATE_TIME_PATTERN)); |
|
|
|
data.setTestingTimeDate(DateUtils.stringToDate(data.getTestingTime(), DateUtils.DATE_TIME_PATTERN)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -529,10 +529,10 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
|
} |
|
|
|
|
|
|
|
public void saveList(List<PersonTestingImportMoudleExcel> excelList) { |
|
|
|
List<PersonTestingEntity> entitys = new ArrayList<>(); |
|
|
|
List<PersonTestingDTO> dtos = ConvertUtils.sourceToTarget(excelList, PersonTestingDTO.class); |
|
|
|
for (PersonTestingImportMoudleExcel excel : excelList) { |
|
|
|
PersonTestingDTO dto = ConvertUtils.sourceToTarget(excel, PersonTestingDTO.class); |
|
|
|
dto.setTestingTime(excel.getTestingTimeDate()); |
|
|
|
|
|
|
|
for (PersonTestingDTO dto : dtos) { |
|
|
|
// 0女;1男
|
|
|
|
String sex = IdentityNoUtils.getSex(dto.getIdcard()); |
|
|
|
dto.setSex(NumConstant.ONE_STR.equals(sex) ? "男" : "女"); |
|
|
@ -542,8 +542,14 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
|
saveScanningInfoForUserV1(dto); |
|
|
|
|
|
|
|
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class); |
|
|
|
entitys.add(entity); |
|
|
|
// 根据身份证号、核酸检测时间比对库里数据,有相同的更新这个人的这条核酸检测记录,匹配不到的插入
|
|
|
|
String idPersonTesting = baseDao.getIdByIdCardAndTestingTime(entity.getIdcard(), entity.getTestingTime()); |
|
|
|
if (null == idPersonTesting) { |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
|
entity.setId(idPersonTesting); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
insertBatch(entitys); |
|
|
|
} |
|
|
|
} |
|
|
|