|
|
@ -162,7 +162,9 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
result.setTotal(list.size()); |
|
|
|
} |
|
|
|
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ |
|
|
|
formDTO.setIsHistory(NumConstant.ZERO_STR); |
|
|
|
if (StringUtils.isBlank(formDTO.getIsHistory())){ |
|
|
|
formDTO.setIsHistory(NumConstant.ZERO_STR); |
|
|
|
} |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO)); |
|
|
|
result.setList(pageInfo.getList()); |
|
|
@ -380,7 +382,6 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
@Async |
|
|
|
public void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId) { |
|
|
|
List<EpidemicSpecialAttentionErrorModel> errorInfo = new ArrayList<>(); |
|
|
|
|
|
|
|
try { |
|
|
|
List<ImportEpidemicSpecialAttention> list = ExcelPoiUtils.importExcel(inputStream, 0,1,ImportEpidemicSpecialAttention.class); |
|
|
|
if (CollectionUtils.isEmpty(list)){ |
|
|
@ -405,7 +406,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ |
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1)); |
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "证件号不能为空",i+1)); |
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
continue; |
|
|
|
} |
|
|
@ -414,9 +415,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO && StringUtils.isBlank(list.get(i).getIsolatedState()) && !list.get(i).getAddStatus()){ |
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "隔离状态不能为空",i+1)); |
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
Result<List<SysDictDataDTO>> isolatedState = epmetAdminOpenFeignClient.dictDataList("isolatedState"); |
|
|
|
if (!isolatedState.success()){ |
|
|
|
throw new EpmetException("查询字典表数据失败..."+"isolatedState"); |
|
|
|
} |
|
|
|
Map<String, String> dictMap = isolatedState.getData().stream().collect(Collectors.toMap(SysDictDataDTO::getDictLabel, SysDictDataDTO::getDictValue)); |
|
|
|
if (list.size() > errorInfo.size()){ |
|
|
|
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting())); |
|
|
|
Map<String, Long> groupByIdCard = list.stream().filter(l -> StringUtils.isNotBlank(l.getIdCard())).collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting())); |
|
|
|
groupByIdCard.forEach((idCard,count) -> { |
|
|
|
if (Integer.valueOf(count.toString()).compareTo(1) != 0){ |
|
|
|
for (ImportEpidemicSpecialAttention i : list) { |
|
|
@ -428,6 +439,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
} |
|
|
|
}); |
|
|
|
List<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); |
|
|
|
List<IcEpidemicSpecialAttentionEntity> existsEntities = new ArrayList<>(); |
|
|
|
List<String> existList = baseDao.getExistList(attentionType, idCards); |
|
|
|
if (CollectionUtils.isNotEmpty(existList)){ |
|
|
|
for (String s : existList) { |
|
|
@ -436,10 +448,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
// 按照产品指示,去除提示错误信息,并不做操作
|
|
|
|
// errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum()));
|
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO){ |
|
|
|
list.get(i).setIsolatedState(dictMap.get(list.get(i).getIsolatedState())); |
|
|
|
existsEntities.add(ConvertUtils.sourceToTarget(list.get(i),IcEpidemicSpecialAttentionEntity.class)); |
|
|
|
} |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO && CollectionUtils.isNotEmpty(existsEntities)) { |
|
|
|
baseDao.addExistAttention(existsEntities, attentionType); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Map<Boolean, List<ImportEpidemicSpecialAttention>> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus)); |
|
|
@ -447,6 +466,9 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
if (CollectionUtils.isNotEmpty(needInsert)){ |
|
|
|
List<IcEpidemicSpecialAttentionEntity> entities = ConvertUtils.sourceToTarget(needInsert, IcEpidemicSpecialAttentionEntity.class); |
|
|
|
entities.forEach(e -> { |
|
|
|
if (attentionType.compareTo(NumConstant.TWO) == NumConstant.ZERO){ |
|
|
|
e.setIsolatedState(dictMap.get(e.getIsolatedState())); |
|
|
|
} |
|
|
|
e.setIsAttention(NumConstant.ONE); |
|
|
|
e.setOrgId(agencyInfo.getId()); |
|
|
|
e.setPid(agencyInfo.getPid()); |
|
|
@ -579,7 +601,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi |
|
|
|
NatPieResultDTO.IsolatedList dto = new NatPieResultDTO.IsolatedList(); |
|
|
|
dto.setCategoryCode(""); |
|
|
|
dto.setCategoryName("历史关注人数"); |
|
|
|
dto.setColor(NatPieColorEnum.getValueByKey(NumConstant.THREE_STR)); |
|
|
|
dto.setColor(NatPieColorEnum.getValueByKey(NumConstant.ONE_HUNDRED_STR)); |
|
|
|
dto.setTotal(baseDao.getHistoryCount(staffInfo.getAgencyId())); |
|
|
|
result.setIsolatedList(conResult); |
|
|
|
result.setHistoryList(Arrays.asList(dto)); |
|
|
|