Browse Source

update

feature/yujt_vim
yujt 4 years ago
parent
commit
fd7c70b47a
  1. 13
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java
  2. 45
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java

13
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java

@ -7,7 +7,6 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.CrudServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
@ -99,19 +98,11 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
}
}
Long countryId = new Long(370124001);
//榆山街道账号可以看所有数据
// if (!countryId.equals(SecurityUser.getUser().getDeptId())) {
// params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
// }
IPage<EpidemicRecordListDTO> page = getPage(params);
List<EpidemicRecordListDTO> list = baseDao.getEpidemicUserRecordList(params);
for (EpidemicRecordListDTO eru : list) {
// eru.setIdCard(idEncrypt(eru.getIdCard()));
// eru.setMobile(mobileEncrypt(eru.getMobile()));
eru.setUserName(nameDesensitization(eru.getUserName()));
eru.setRelationPeople(nameDesensitization(eru.getRelationPeople()));
// eru.setRelationPeopleMobile(mobileEncrypt(eru.getRelationPeopleMobile()));
}
return new PageData<>(list, page.getTotal());
}
@ -454,8 +445,8 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
@Override
public List<EpidemicRecordListDTO> getList(Map<String, Object> params) {
// params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
params.put("age",new ArrayList<>());
params.put("company",new ArrayList<>());
params.put("age", new ArrayList<>());
params.put("company", new ArrayList<>());
// for (EpidemicRecordListDTO eru : list) {
// eru.setIdCard(idEncrypt(eru.getIdCard()));
// eru.setMobile(mobileEncrypt(eru.getMobile()));

45
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java

@ -199,7 +199,8 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
VaccinationInfoAllExcel epidemicReportUserInfoAllExcel;
VaccinationInfoDTO vaccinationInfoDTO;
VaccineDto vimCompanyOrSiteByExcel;
String idCard;
String excelIdCard;
Integer excelDose;
Integer maxDose;
for (int i = 0; i < recordList.size(); i++) {
@ -207,21 +208,20 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
vaccinationInfoDTO = ConvertUtils.sourceToTarget(epidemicReportUserInfoAllExcel, VaccinationInfoDTO.class);
// 校验是否存在空单元格(校验必填)
if (checkNullCell(epidemicReportUserInfoAllExcel)) {
// checkInfo.append("第").append(i + 1).append("条、");
epidemicReportUserInfoAllExcel.setErrorInfo("存在空单元格");
addErrorList.add(epidemicReportUserInfoAllExcel);
continue;
}
idCard = epidemicReportUserInfoAllExcel.getIdentityNo();
excelIdCard = epidemicReportUserInfoAllExcel.getIdentityNo();
// 人员校验
if (!allUserIdCards.contains(idCard)) {
if (!allUserIdCards.contains(excelIdCard)) {
epidemicReportUserInfoAllExcel.setErrorInfo("查无此人");
addErrorList.add(epidemicReportUserInfoAllExcel);
continue;
}
// 校验身份证号是否合法
if (StringUtils.isBlank(idCard) || idCard.length() != 18) {
if (StringUtils.isBlank(excelIdCard) || excelIdCard.length() != 18) {
epidemicReportUserInfoAllExcel.setErrorInfo("身份证号不合法");
addErrorList.add(epidemicReportUserInfoAllExcel);
continue;
@ -259,20 +259,21 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
addErrorList.add(epidemicReportUserInfoAllExcel);
continue;
}
excelDose = epidemicReportUserInfoAllExcel.getDose();
// map用来记录身份证号的最大剂次
if (maxDoseMap.containsKey(epidemicReportUserInfoAllExcel.getIdentityNo())) {
if (maxDoseMap.get(epidemicReportUserInfoAllExcel.getIdentityNo()).getVaccinationNum() < epidemicReportUserInfoAllExcel.getDose()) {
if (maxDoseMap.containsKey(excelIdCard)) {
if (maxDoseMap.get(excelIdCard).getVaccinationNum() < excelDose) {
EpidemicUserInfoDTO dto = new EpidemicUserInfoDTO();
dto.setVaccinationNum(epidemicReportUserInfoAllExcel.getDose());
dto.setVaccinationNum(excelDose);
dto.setMaxDose(maxDose);
maxDoseMap.put(epidemicReportUserInfoAllExcel.getIdentityNo(), dto);
maxDoseMap.put(excelIdCard, dto);
}
} else {
EpidemicUserInfoDTO dto = new EpidemicUserInfoDTO();
dto.setVaccinationNum(epidemicReportUserInfoAllExcel.getDose());
dto.setVaccinationNum(excelDose);
dto.setMaxDose(maxDose);
maxDoseMap.put(epidemicReportUserInfoAllExcel.getIdentityNo(), dto);
maxDoseMap.put(excelIdCard, dto);
}
addList.add(epidemicReportUserInfoAllExcel);
@ -287,18 +288,29 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
List<String> idCards = new ArrayList<>(maxDoseMap.keySet());
List<EpidemicUserInfoDTO> updateList = new ArrayList<>();
EpidemicUserInfoDTO epidemicUserInfo;
String idCard;
if (!idCards.isEmpty()) {
List<EpidemicUserInfoDTO> existUserList = epidemicUserInfoDao.selectByIdCards(idCards);
EpidemicUserInfoDTO updateDto;
for (EpidemicUserInfoDTO item : existUserList) {
if (null == item) {
continue;
}
idCard = item.getIdCard();
epidemicUserInfo = maxDoseMap.get(idCard);
if (null == epidemicUserInfo) {
log.error(idCard);
continue;
}
updateDto = new EpidemicUserInfoDTO();
epidemicUserInfo = maxDoseMap.get(idCard);
// 已经接种完的不需要处理,excel的剂次数据小于数据库时不需要处理,已经接种完的不需要处理
if (item.getVaccinationState() != NumConstant.TWO && item.getVaccinationNum() <= maxDoseMap.get(item.getIdCard()).getVaccinationNum()) {
updateDto.setIdCard(item.getIdCard());
updateDto.setVaccinationNum(maxDoseMap.get(item.getIdCard()).getVaccinationNum());
if (maxDoseMap.get(item.getIdCard()).getVaccinationNum().equals(maxDoseMap.get(item.getIdCard()).getMaxDose())) {
if (item.getVaccinationState() != NumConstant.TWO && item.getVaccinationNum() <= epidemicUserInfo.getVaccinationNum()) {
updateDto.setIdCard(idCard);
updateDto.setVaccinationNum(epidemicUserInfo.getVaccinationNum());
if (epidemicUserInfo.getVaccinationNum().equals(epidemicUserInfo.getMaxDose())) {
// 如果最大剂次同于excel的剂次就是接种完成,否则是接种中
updateDto.setVaccinationState(2);
} else {
@ -335,6 +347,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl<Vaccinati
return new Result().ok("数据异常,请下载Excel后重新导入!");
}
} catch (Exception e) {
e.printStackTrace();
return new Result().error("数据异常,解析Excel文件失败");
} finally {
// 删除文件

Loading…
Cancel
Save