diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java index e8dc749..d5178ba 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoController.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.vaccine.epidemic.service.impl.EpidemicUserInfoExportS import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.Map; @@ -139,4 +140,16 @@ public class EpidemicUserInfoController { public Result updateVaccination() { return epidemicUserInfoService.updateVaccination(); } + + /* + * @describe: 批量导入 + * @author wangtong + * @date 2021/10/27 17:07 + * @params [file, gridId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @PostMapping("importExcel") + public Result importExcel(@RequestParam("file") MultipartFile file, String gridId) { + return epidemicUserInfoService.importEpidemicUser(file,gridId); + } } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java index f18205b..b53f2ca 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicRecordDetailDTO.java @@ -272,8 +272,33 @@ public class EpidemicRecordDetailDTO implements Serializable { */ private String livingSituation; /** - * 所属组织 + * 网格 + */ + private String deptName; + /** + * 网格ID + */ + private Long deptId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 */ private String allDeptNames; + /** + * 详情复现 + */ + private String[] deptIdList; } \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java index b99ef6d..c164ce1 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicReportUserInfoDTO.java @@ -291,5 +291,7 @@ public class EpidemicReportUserInfoDTO implements Serializable { // @ApiModelProperty(value = "接种状态") private Integer vaccinationState; + private String deptId; + } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java index 6bd0e8c..b350837 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoEntity.java @@ -185,6 +185,8 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity { */ private Integer age; + private String liveAddressCode; + /** * 县内居住地镇街 */ @@ -302,4 +304,30 @@ public class EpidemicUserInfoEntity extends BasePingyinEntity { private Integer familyMemberOutMonth; private String houseProperty; + + /** + * 网格 + */ + private String deptName; + /** + * 网格ID + */ + private Long deptId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java index c69d05f..3e6df9a 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoService.java @@ -14,6 +14,7 @@ import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO; import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO; import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; import com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO; +import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; @@ -160,4 +161,12 @@ public interface EpidemicUserInfoService extends CrudService authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); params.putAll(authParams); // 街道和超管有权查看所有数据 - if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) { + if (NumConstant.ZERO == user.getSuperAdmin() && !user.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) { params.put("deptIdList", user.getDeptIdList()); } List list = baseDao.getEpidemicUserRecordList(params); @@ -115,6 +128,10 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl parentAndAllDept = adminVimFeignClient.getParentAndAllDept(dto.getDeptId()); + if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) { + return new Result().error("获取所属组织信息失败"); + } + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + userInfoDTO.setDeptId(parentAndAllDeptDTO.getGridId()); + userInfoDTO.setDeptName(parentAndAllDeptDTO.getGrid()); + userInfoDTO.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + userInfoDTO.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + userInfoDTO.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + userInfoDTO.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + } + this.updateById(userInfoDTO); // inoutRecordService.updateById(userInoutRecordDTO); return new Result(); @@ -496,7 +528,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl authParams = vaccinationUserRoleService.getVaccinationAuthParams(user.getId()); params.putAll(authParams); // 街道和超管有权查看所有数据 - if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) { + if (NumConstant.ZERO == user.getSuperAdmin() && !user.getTypeKey().equals(OrganizationTypeConstant.ORG_TYPE_STREET_PARTY)) { params.put("deptIdList", user.getDeptIdList()); } List list = baseDao.getEpidemicPage(params); @@ -591,4 +623,578 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl parentAndAllDept = adminVimFeignClient.getParentAndAllDept(gridId); + if (!parentAndAllDept.success() || parentAndAllDept.getData() == null) { + return new Result().error("获取归属部门信息失败"); + } + parentAndAllDeptDTO = parentAndAllDept.getData(); + } + //获取字典信息 + SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO = new SysPopulationSimpleDictFormDTO(); + List dicTypes = new ArrayList<>(); + Collections.addAll(dicTypes, PopulationDictConstant.ACCOUNT_TYPE, + PopulationDictConstant.BODY_STATUS, + PopulationDictConstant.EDUCATION_LEVEL, + PopulationDictConstant.EMPLOYMENT_STATUS, + PopulationDictConstant.FAMILY_CATEGORY, + PopulationDictConstant.GENDER, + PopulationDictConstant.HELP_STATUS, + PopulationDictConstant.MARITAL_STATUS, + PopulationDictConstant.MOTOR_VEHICLE_CATEGORY, + PopulationDictConstant.POLITICS_STATUS, + PopulationDictConstant.UNEMPLOYMENT_REASON, + PopulationDictConstant.SPECIAL_CROWD, + PopulationDictConstant.PEOPLE_CATEGORIES); + sysPopulationSimpleDictFormDTO.setDicTypes(dicTypes); + Result> listResult = adminVimFeignClient.listPopulationSimple(sysPopulationSimpleDictFormDTO); + if (listResult == null || !listResult.success()) { + return new Result().error("获取字典信息失败"); + } + List sysPopulationSimpleDictDTOS = listResult.getData(); + + File f = StreamUtils.conversionFile(file); + ImportParams importParams = new ImportParams(); + try { + //获取多个sheet页 + Workbook workBook = ExcelUtils.getWorkBook(file); + //户主身份证和插入的ID,便于保存居住人信息时匹配户主信息 + Map populationIdNoAndIdMap = new HashMap<>(); + //户主导入数据 +// List basePopulationInformationExcels = null; + //户主导入数据异常提示 +// List epdcHouseAndHouseHeadErrorResultDTOS = null; + //居民导入数据 + List BaseResidentInformationUpdateExcels = null; + //居民导入数据异常提示 + List epdcResidentErrorResultDTOS = null; + //户主身份证列表,便于校验居住人页填写的身份证信息是否正确 +// Set residentIdentifyNo = new HashSet<>(); +// for (int numSheet = 0; numSheet < workBook.getNumberOfSheets(); numSheet++) { + //第几个sheet +// importParams.setStartSheetIndex(numSheet); + +// if (numSheet == 0) {//校验和新增房屋和户主信息 +// basePopulationInformationExcels = ExcelImportUtil.importExcel(f, BasePopulationInformationExcel.class, importParams); +// // 校验数据 +// epdcHouseAndHouseHeadErrorResultDTOS = this.checkPopulationExcel(basePopulationInformationExcels, sysPopulationSimpleDictDTOS); +// basePopulationInformationExcels.forEach(basePopulationInformationExcel -> +// residentIdentifyNo.add(basePopulationInformationExcel.getResidentsIdentityNo()) +// ); +// } else if (numSheet == 1) {//检验和新增居住人信息 + BaseResidentInformationUpdateExcels = ExcelImportUtil.importExcel(f, BaseResidentInformationUpdateExcel.class, importParams); + // 校验数据 + epdcResidentErrorResultDTOS = this.checkResidentsExcel(BaseResidentInformationUpdateExcels, sysPopulationSimpleDictDTOS); +// } +// } + // 校验户主和房屋信息 +// if (epdcHouseAndHouseHeadErrorResultDTOS != null && epdcHouseAndHouseHeadErrorResultDTOS.size() > 0) { +// return new Result().ok(epdcHouseAndHouseHeadErrorResultDTOS); +// } + // 校验居住人信息 + if (epdcResidentErrorResultDTOS != null && epdcResidentErrorResultDTOS.size() > 0) { + return new Result().ok(epdcResidentErrorResultDTOS); + } + // 保存户主和房屋信息 +// if (basePopulationInformationExcels != null && basePopulationInformationExcels.size() > 0) { +// populationIdNoAndIdMap = savePopulationListEnd(basePopulationInformationExcels, parentAndAllDeptDTO); +// } + // 保存居住人信息 + if (BaseResidentInformationUpdateExcels != null && BaseResidentInformationUpdateExcels.size() > 0) { + saveResidentList(BaseResidentInformationUpdateExcels, parentAndAllDeptDTO, populationIdNoAndIdMap); + } + } catch (Exception e1) { + throw new RenException("导入失败:请检查导入模板或导入数据"); + } + return new Result(); + } + + + /** + * @return java.util.List + * @Description 校验居住人数据 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [basePopulationInformationExcels, basePopulationInformationExcels1] + **/ + private List checkResidentsExcel(List basePopulationInformationExcels, List sysPopulationSimpleDictDTOS) { + // 不匹配信息 + List errorLineInfoList = new ArrayList<>(); + EpdcPopulationErrorResultDTO errorLineInfoDto = null; + for (int i = 0; i < basePopulationInformationExcels.size(); i++) { + String errorInfo = ""; + BaseResidentInformationUpdateExcel BaseResidentInformationUpdateExcel = basePopulationInformationExcels.get(i); +// String residentsIdentityNo = BaseResidentInformationUpdateExcel.getResidentsIdentityNo() == null ? null : BaseResidentInformationUpdateExcel.getResidentsIdentityNo().trim(); + String selfIdentityNo = BaseResidentInformationUpdateExcel.getSelfIdentityNo() == null ? null : BaseResidentInformationUpdateExcel.getSelfIdentityNo().trim(); +// String houseHeadRelation = BaseResidentInformationUpdateExcel.getHouseHeadRelation() == null ? null : BaseResidentInformationUpdateExcel.getHouseHeadRelation().trim(); + String residentsName = BaseResidentInformationUpdateExcel.getUserName() == null ? null : BaseResidentInformationUpdateExcel.getUserName().trim(); + String residentsSex = BaseResidentInformationUpdateExcel.getGender() == null ? null : BaseResidentInformationUpdateExcel.getGender().trim(); + String residentsNation = BaseResidentInformationUpdateExcel.getNation() == null ? null : BaseResidentInformationUpdateExcel.getNation().trim(); + String currentEmployer = BaseResidentInformationUpdateExcel.getCurrentEmployer() == null ? null : BaseResidentInformationUpdateExcel.getCurrentEmployer().trim(); + String currentAddress = BaseResidentInformationUpdateExcel.getCurrentAddress() == null ? null : BaseResidentInformationUpdateExcel.getCurrentAddress().trim(); + String specialCrowd = BaseResidentInformationUpdateExcel.getSpecialCrowd() == null ? null : BaseResidentInformationUpdateExcel.getSpecialCrowd().trim(); + String peopleCategories = BaseResidentInformationUpdateExcel.getPeopleCategories() == null ? null : BaseResidentInformationUpdateExcel.getPeopleCategories().trim(); + String politicsStatus = BaseResidentInformationUpdateExcel.getPoliticsStatus() == null ? null : BaseResidentInformationUpdateExcel.getPoliticsStatus().trim(); + + String standardOfCulture = BaseResidentInformationUpdateExcel.getStandardOfCulture() == null ? null : BaseResidentInformationUpdateExcel.getStandardOfCulture().trim(); + String health = BaseResidentInformationUpdateExcel.getHealth() == null ? null : BaseResidentInformationUpdateExcel.getHealth().trim(); + String maritalStatus = BaseResidentInformationUpdateExcel.getMaritalStatus() == null ? null : BaseResidentInformationUpdateExcel.getMaritalStatus().trim(); + String accountType = BaseResidentInformationUpdateExcel.getAccountType() == null ? null : BaseResidentInformationUpdateExcel.getAccountType().trim(); + String workStatus = BaseResidentInformationUpdateExcel.getWorkStatus() == null ? null : BaseResidentInformationUpdateExcel.getWorkStatus().trim(); + String unemploymentReason = BaseResidentInformationUpdateExcel.getUnemploymentReason() == null ? null : BaseResidentInformationUpdateExcel.getUnemploymentReason().trim(); + String familyCategory = BaseResidentInformationUpdateExcel.getFamilyCategory() == null ? null : BaseResidentInformationUpdateExcel.getFamilyCategory().trim(); + String helpStatus = BaseResidentInformationUpdateExcel.getHelpStatus() == null ? null : BaseResidentInformationUpdateExcel.getHelpStatus().trim(); + String motorVehicleCategory = BaseResidentInformationUpdateExcel.getMotorVehicleCategory() == null ? null : BaseResidentInformationUpdateExcel.getMotorVehicleCategory().trim(); + + if (StringUtils.isBlank(selfIdentityNo)) { + errorInfo += "本人身份证号为空;"; + } else if (StringUtils.isNotBlank(selfIdentityNo)) { + String result = IdentityNoUtils.IdentityNoVerification(selfIdentityNo); + if (result != null) { + errorInfo += "本人身份证号码有误;"; + } else { + BaseResidentInformationUpdateExcel.setGender(IdentityNoUtils.getSex(selfIdentityNo)); + BaseResidentInformationUpdateExcel.setAge(IdentityNoUtils.getAge(selfIdentityNo)); + BaseResidentInformationUpdateExcel.setBirthday(IdentityNoUtils.getBirthday(selfIdentityNo)); + } + BaseResidentInformationUpdateExcel.setSelfIdentityNo(selfIdentityNo); + } + if (StringUtils.isBlank(residentsName)) { + errorInfo += "姓名为空;"; + } else if (StringUtils.isNotBlank((residentsName))) { + BaseResidentInformationUpdateExcel.setUserName(residentsName); + } + if (StringUtils.isNotBlank((residentsSex))) { + BaseResidentInformationUpdateExcel.setGender(residentsSex); + } + if (StringUtils.isNotBlank(residentsSex) && !"0".equals(residentsSex) && !"1".equals(residentsSex)) { + errorInfo += "性别不匹配;"; + } + if (StringUtils.isNotBlank((residentsNation))) { + BaseResidentInformationUpdateExcel.setNation(residentsNation); + } + if (StringUtils.isNotBlank((currentEmployer))) { + BaseResidentInformationUpdateExcel.setCurrentEmployer(currentEmployer); + } + if (StringUtils.isNotBlank((currentAddress))) { + BaseResidentInformationUpdateExcel.setCurrentAddress(currentAddress); + } + if (StringUtils.isNotBlank(politicsStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.POLITICS_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDictList = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDictList) { + if (politicsStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setPoliticsStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "政治面貌数据不匹配;"; + } + } + if (StringUtils.isNotBlank(specialCrowd)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.SPECIAL_CROWD.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (specialCrowd.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setSpecialCrowd(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "特殊人群数据不匹配;"; + } + } + if (StringUtils.isNotBlank(peopleCategories)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.PEOPLE_CATEGORIES.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (peopleCategories.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setPeopleCategories(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "人口类型数据不匹配;"; + } + } + //新增字典校验 + if (StringUtils.isNotBlank(standardOfCulture)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.EDUCATION_LEVEL.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (standardOfCulture.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setStandardOfCulture(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "文化程度数据不匹配;"; + } + } + if (StringUtils.isNotBlank(health)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.BODY_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (health.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setHealth(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "身体状况数据不匹配;"; + } + } + if (StringUtils.isNotBlank(maritalStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MARITAL_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (maritalStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setMaritalStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "婚姻状况数据不匹配;"; + } + } + if (StringUtils.isNotBlank(accountType)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.ACCOUNT_TYPE.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (accountType.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setAccountType(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "户口类型数据不匹配;"; + } + } + if (StringUtils.isNotBlank(workStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.EMPLOYMENT_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (workStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setWorkStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "就业情况数据不匹配;"; + } + } + if (StringUtils.isNotBlank(unemploymentReason)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.UNEMPLOYMENT_REASON.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (unemploymentReason.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setUnemploymentReason(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "失业原因数据不匹配;"; + } + } + if (StringUtils.isNotBlank(familyCategory)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.FAMILY_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (familyCategory.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setFamilyCategory(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "家庭类别数据不匹配;"; + } + } + if (StringUtils.isNotBlank(helpStatus)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.HELP_STATUS.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (helpStatus.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setHelpStatus(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "救助情况数据不匹配;"; + } + } + if (StringUtils.isNotBlank(motorVehicleCategory)) { + boolean isMatch = false; + for (SysPopulationSimpleDictDTO sysPopulationSimpleDictDTO : sysPopulationSimpleDictDTOS) { + if (PopulationDictConstant.MOTOR_VEHICLE_CATEGORY.equals(sysPopulationSimpleDictDTO.getDicType())) { + List sysSimpleDicts = sysPopulationSimpleDictDTO.getSysSimpleDicts(); + for (SysSimpleDictDTO sysSimpleDict : sysSimpleDicts) { + if (motorVehicleCategory.equals(sysSimpleDict.getDictName())) { + isMatch = true; + BaseResidentInformationUpdateExcel.setMotorVehicleCategory(sysSimpleDict.getDictValue()); + } + } + } + } + if (!isMatch) { + errorInfo += "机动车类型数据不匹配;"; + } + } + //如果有错误信息 + if(StringUtils.isNotBlank(errorInfo)){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorInfo(errorInfo); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoList.add(errorLineInfoDto); + } + } + return errorLineInfoList; + } + + + /** + * @return void + * @Description 校验完成后插入居民信息 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [baseResidentInformationExcels] + **/ + private void saveResidentList(List baseResidentInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO, Map populationIdNoAndIdMap) { + for (BaseResidentInformationUpdateExcel baseResidentInformationExcel : baseResidentInformationExcels) { + //插入居民信息 + EpidemicUserInfoEntity epidemicUserInfoEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, EpidemicUserInfoEntity.class); +// populationInformationEntity.setResidentsIdentityNo(baseResidentInformationExcel.getResidentsFamilyIdentityNo()); +// EpidemicUserInfoEntity epidemicUserInfoEntity = convertInformationToUserInfo(populationInformationEntity); + epidemicUserInfoEntity.setIdCard(baseResidentInformationExcel.getSelfIdentityNo()); + epidemicUserInfoEntity.setMotorVehicleNum(Integer.valueOf(baseResidentInformationExcel.getMotorVehicleNum())); + if(null != parentAndAllDeptDTO){ + epidemicUserInfoEntity.setDeptId(parentAndAllDeptDTO.getGridId()); + epidemicUserInfoEntity.setDeptName(parentAndAllDeptDTO.getGrid()); + epidemicUserInfoEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + epidemicUserInfoEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + epidemicUserInfoEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + epidemicUserInfoEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + } + //备注字典转换,不是数据字典 + //再就业优惠证 + if("无".equals(epidemicUserInfoEntity.getReemploymentPermit())){ + epidemicUserInfoEntity.setReemploymentPermit("0"); + }else if("有".equals(epidemicUserInfoEntity.getReemploymentPermit())){ + epidemicUserInfoEntity.setReemploymentPermit("1"); + }else{ + epidemicUserInfoEntity.setReemploymentPermit(""); + } + //失业登记 + if("否".equals(epidemicUserInfoEntity.getUnemploymentRegister())){ + epidemicUserInfoEntity.setUnemploymentRegister("0"); + }else if("是".equals(epidemicUserInfoEntity.getUnemploymentRegister())){ + epidemicUserInfoEntity.setUnemploymentRegister("1"); + }else{ + epidemicUserInfoEntity.setUnemploymentRegister(""); + } + // 已存在的居民信息进行更新,否则进行插入操作 + EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(baseResidentInformationExcel.getSelfIdentityNo()); + if (null == check) { +// epidemicUserInfoEntity.setRelation(baseResidentInformationExcel.getHouseHeadRelation()); + epidemicUserInfoService.insert(epidemicUserInfoEntity); + } else { +// check.setRelation(baseResidentInformationExcel.getHouseHeadRelation()); + check.setUserName(epidemicUserInfoEntity.getUserName()); + check.setGender(epidemicUserInfoEntity.getGender()); + check.setNation(epidemicUserInfoEntity.getNation()); + check.setMobile(epidemicUserInfoEntity.getMobile()); + check.setWorkUnits(epidemicUserInfoEntity.getWorkUnits()); + check.setLiveAddressName(epidemicUserInfoEntity.getLiveAddressName()); + check.setHouseholdRegisterDetail(epidemicUserInfoEntity.getLiveAddressName()); + check.setPeopleCategories(epidemicUserInfoEntity.getPeopleCategories()); + check.setSpecialCrowd(epidemicUserInfoEntity.getSpecialCrowd()); + check.setPoliticsStatus(epidemicUserInfoEntity.getPoliticsStatus()); + + + check.setStandardOfCulture(epidemicUserInfoEntity.getStandardOfCulture()); + check.setHealth(epidemicUserInfoEntity.getHealth()); + check.setMaritalStatus(epidemicUserInfoEntity.getMaritalStatus()); + check.setAccountType(epidemicUserInfoEntity.getAccountType()); + check.setWorkStatus(epidemicUserInfoEntity.getWorkStatus()); + check.setUnemploymentReason(epidemicUserInfoEntity.getUnemploymentReason()); + check.setFamilyCategory(epidemicUserInfoEntity.getFamilyCategory()); + check.setHelpStatus(epidemicUserInfoEntity.getHelpStatus()); + check.setMotorVehicleCategory(epidemicUserInfoEntity.getMotorVehicleCategory()); + check.setJoinTime(epidemicUserInfoEntity.getJoinTime()); + check.setOrganizationalRelationshipLocation(epidemicUserInfoEntity.getOrganizationalRelationshipLocation()); + check.setMilitary(epidemicUserInfoEntity.getMilitary()); + check.setCurrentEmployerAddress(epidemicUserInfoEntity.getCurrentEmployerAddress()); + check.setReemploymentPermit(epidemicUserInfoEntity.getReemploymentPermit()); + check.setUnemploymentRegister(epidemicUserInfoEntity.getUnemploymentRegister()); + check.setUnemploymentRegisterTime(epidemicUserInfoEntity.getUnemploymentRegisterTime()); + check.setMotorVehicleNum(epidemicUserInfoEntity.getMotorVehicleNum()); + check.setDogStatus(epidemicUserInfoEntity.getDogStatus()); + + check.setDeptId(epidemicUserInfoEntity.getDeptId()); + check.setDeptName(epidemicUserInfoEntity.getDeptName()); + check.setParentDeptIds(epidemicUserInfoEntity.getParentDeptIds()); + check.setParentDeptNames(epidemicUserInfoEntity.getParentDeptNames()); + check.setAllDeptIds(epidemicUserInfoEntity.getAllDeptIds()); + check.setAllDeptNames(epidemicUserInfoEntity.getAllDeptNames()); + epidemicUserInfoService.updateById(check); + } + //插入房屋人员关联关系表 +// HouseResidentEntity houseResidentEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, HouseResidentEntity.class); +// if (null == check) { +// houseResidentEntity.setResidentId(epidemicUserInfoEntity.getId().toString()); +// } else { +// houseResidentEntity.setResidentId(check.getId().toString()); +// } + + //根据身份证获取户主ID + //查找户主ID +// String houseHeadId; +// String houseId; +// EpidemicUserInfoEntity infoByIdentityNo = epidemicUserInfoDao.selectInfoByIdCard(baseResidentInformationExcel.getResidentsIdentityNo()); +// if (infoByIdentityNo == null) { +// //查找不到户主则从Map中取 +// houseHeadId = populationIdNoAndIdMap.get(baseResidentInformationExcel.getResidentsIdentityNo()); +// houseId = populationIdNoAndIdMap.get(houseHeadId); +// } else { +// houseHeadId = infoByIdentityNo.getId().toString(); +// houseId = populationIdNoAndIdMap.get(houseHeadId); +// } +// houseResidentEntity.setHouseHeadId(houseHeadId); +// houseResidentEntity.setHouseId(houseId); +// houseResidentEntity.setIsHouseHead("0"); +// houseResidentEntity.setHouseHeadRelation(baseResidentInformationExcel.getHouseHeadRelation()); +// houseResidentDao.insert(houseResidentEntity); + if (null != parentAndAllDeptDTO) { + // 更新疫苗接种记录 + vaccinationInfoHandle(baseResidentInformationExcel.getSelfIdentityNo(), parentAndAllDeptDTO); + } + + } + + } + + /** + * 转换新旧人员信息实体类 + * + * @param informationEntity + * @return com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity + * @author zhy + * @date 2021/9/3 16:36 + */ + private EpidemicUserInfoEntity convertInformationToUserInfo(PopulationInformationEntity informationEntity) { + EpidemicUserInfoEntity entity = new EpidemicUserInfoEntity(); + if (informationEntity.getId() != null) { + entity.setId(Long.parseLong(informationEntity.getId())); + } + entity.setUserName(informationEntity.getResidentsName()); + entity.setGender(informationEntity.getResidentsSex()); + entity.setNation(informationEntity.getResidentsNation()); + if (informationEntity.getResidentsBirthday() != null) { + entity.setBirthday(DateUtils.format(informationEntity.getResidentsBirthday())); + } + entity.setStandardOfCulture(informationEntity.getEducationLevel()); + entity.setPoliticsStatus(informationEntity.getPoliticsStatus()); + entity.setJoinTime(informationEntity.getJoinTime()); + entity.setOrganizationalRelationshipLocation(informationEntity.getOrganizationalRelationshipLocation()); + entity.setIdCard(informationEntity.getResidentsIdentityNo()); + entity.setMobile(informationEntity.getResidentsPhone()); + entity.setHealth(informationEntity.getBodyStatus()); + entity.setMaritalStatus(informationEntity.getMaritalStatus()); + entity.setAccountType(informationEntity.getAccountType()); + entity.setMilitary(informationEntity.getMilitaryService()); + entity.setHouseholdRegisterDetail(informationEntity.getHouseholdRegistrationPlace()); + entity.setWorkStatus(informationEntity.getEmploymentStatus()); + entity.setWorkUnits(informationEntity.getCurrentEmployer()); + entity.setCurrentEmployerAddress(informationEntity.getCurrentEmployerAddress()); + entity.setUnemploymentReason(informationEntity.getUnemploymentReason()); + entity.setReemploymentPermit(informationEntity.getReemploymentPermit()); + entity.setUnemploymentRegister(informationEntity.getUnemploymentRegister()); + entity.setUnemploymentRegisterTime(informationEntity.getUnemploymentRegisterTime()); + entity.setSpecialCrowd(informationEntity.getSpecialCrowd()); + entity.setFamilyCategory(informationEntity.getFamilyCategory()); + entity.setHelpStatus(informationEntity.getHelpStatus()); + entity.setMotorVehicleNum(informationEntity.getMotorVehicleNum()); + entity.setMotorVehicleCategory(informationEntity.getMotorVehicleCategory()); + entity.setDogStatus(informationEntity.getDogStatus()); + entity.setFamilyMemberNum(informationEntity.getFamilyMemberNum()); + entity.setFamilyMemberOutNum(informationEntity.getFamilyMemberOutNum()); + entity.setFamilyMemberOutMonth(informationEntity.getFamilyMemberOutMonth()); + entity.setFamilyMemberOutReason(informationEntity.getFamilyMemberOutReason()); + entity.setSpecialCrowd(informationEntity.getSpecialCrowd()); + entity.setPeopleCategories(informationEntity.getPeopleCategories()); + entity.setRelation(NumConstant.ONE_STR); + entity.setLiveAddressName(informationEntity.getCurrentAddress()); + entity.setHouseholdRegisterDetail(informationEntity.getCurrentAddress()); + return entity; + } + + /** + * 更新疫苗接种信息 + * + * @param idCard + * @param parentAndAllDeptDTO + * @return void + * @author zhy + * @date 2021/9/16 14:09 + */ + private void vaccinationInfoHandle(String idCard, ParentAndAllDeptDTO parentAndAllDeptDTO) { + // 更新疫苗接种网格信息 + VaccinationInfoEntity vaccinationInfoEntity = new VaccinationInfoEntity(); + vaccinationInfoEntity.setIdentityNo(idCard); + vaccinationInfoEntity.setGridId(parentAndAllDeptDTO.getGridId()); + vaccinationInfoEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + vaccinationInfoEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + vaccinationInfoEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + vaccinationInfoEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + vaccinationInfoDao.updateDeptInfo(vaccinationInfoEntity); + } + } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java index 6243768..e3e8311 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/feign/VimAdminFeignClient.java @@ -7,10 +7,10 @@ import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; import com.elink.esua.epdc.vaccine.feign.fallback.VimAdminFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -51,6 +51,6 @@ public interface VimAdminFeignClient { * @Date 2020/8/31 * @Param [sysPopulationSimpleDictFormDTO] **/ - @PostMapping("sys/dict/listPopulationSimple") - Result> listPopulationSimple(@RequestBody SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO); + @PostMapping(value = "sys/dict/listPopulationSimple", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listPopulationSimple(SysPopulationSimpleDictFormDTO sysPopulationSimpleDictFormDTO); } diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationUpdateExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationUpdateExcel.java new file mode 100644 index 0000000..aa13ffd --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/excel/BaseResidentInformationUpdateExcel.java @@ -0,0 +1,117 @@ +package com.elink.esua.epdc.vaccine.house.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: 人口信息导入 -改版 + * @description: + * @author: wangtong + * @create: 2021-10-27 17:58 + **/ +@Data +public class BaseResidentInformationUpdateExcel implements Serializable { + + + @Excel(name = "姓名") + private String userName; + + @Excel(name = "性别", replace = {"女_0", "男_1"}) + private String gender; + + @Excel(name = "民族") + private String nation; + + @Excel(name = "现工作单位") + private String currentEmployer; + + @Excel(name = "居民身份证号码") + private String residentsFamilyIdentityNo; + + @Excel(name = "现居住地") + private String currentAddress; + + @Excel(name = "特殊人群") + private String specialCrowd; + + @Excel(name = "联系电话",width = 20) + private String mobile; + + @Excel(name = "政治面貌") + private String politicsStatus; + + @Excel(name = "人口类型") + private String peopleCategories; + + @Excel(name = "身份证号码") + private String selfIdentityNo; + + private String birthday; + + @Excel(name = "文化程度") + private String standardOfCulture; + + @Excel(name = "身体状况") + private String health; + + @Excel(name = "婚姻状况") + private String maritalStatus; + + @Excel(name = "户口类型") + private String accountType; + + @Excel(name = "就业情况") + private String workStatus; + + @Excel(name = "失业原因") + private String unemploymentReason; + + @Excel(name = "家庭类别") + private String familyCategory; + + @Excel(name = "救助情况") + private String helpStatus; + + @Excel(name = "机动车类型") + private String motorVehicleCategory; + + //无字典 + + @Excel(name = "入党时间") + private String joinTime; + + @Excel(name = "组织关系所在地") + private String organizationalRelationshipLocation; + + @Excel(name = "服兵役") + private String military; + +// @Excel(name = "户籍地") +// private String motorVehicleCategory; + + @Excel(name = "现单位地址") + private String currentEmployerAddress; + + @Excel(name = "再就业优惠证") + private String reemploymentPermit; + + @Excel(name = "失业登记") + private String unemploymentRegister; + + @Excel(name = "失业登记时间") + private String unemploymentRegisterTime; + + @Excel(name = "机动车数量") + private String motorVehicleNum; + + @Excel(name = "宠物犬状况") + private String dogStatus; + + @Excel(name = "年龄") + private Integer age; + + + +} \ No newline at end of file diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java index bcc3e17..ac91348 100644 --- a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/service/impl/VaccinationInfoServiceImpl.java @@ -5,14 +5,13 @@ import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; 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.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; -import com.elink.esua.epdc.commons.tools.utils.FileUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl; import com.elink.esua.epdc.vaccine.epidemic.constant.StrConstant; @@ -48,9 +47,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import javax.annotation.Resource; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; @@ -113,7 +114,7 @@ public class VaccinationInfoServiceImpl extends BaseVimCurdServiceImpl + and ( ui.DEPT_ID != '' and ui.DEPT_ID is not null) + + + and ( ui.DEPT_ID = '' or ui.DEPT_ID is null) + and ui.check_state = #{checkState} @@ -104,19 +108,19 @@ and ui.HOUSEHOLD_REGISTER_NAME like '%${householdRegisterName}%' - AND (find_in_set(#{streetId},hi.PARENT_DEPT_IDS) - OR find_in_set(#{streetId},hi.ALL_DEPT_IDS)) + AND (find_in_set(#{streetId},ui.PARENT_DEPT_IDS) + OR find_in_set(#{streetId},ui.ALL_DEPT_IDS)) - AND (find_in_set(#{communityId},hi.PARENT_DEPT_IDS) - OR find_in_set(#{communityId},hi.ALL_DEPT_IDS)) + AND (find_in_set(#{communityId},ui.PARENT_DEPT_IDS) + OR find_in_set(#{communityId},ui.ALL_DEPT_IDS)) - and (hi.grid_id = #{gridId} - OR find_in_set(#{gridId},hi.ALL_DEPT_IDS)) + and (ui.dept_id = #{gridId} + OR find_in_set(#{gridId},ui.ALL_DEPT_IDS)) - and hi.grid_id in + and ui.dept_id in #{id} @@ -127,6 +131,7 @@