package com.sooka.sponest.mobile.comprehensive.personBasicInfoController; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.DictKeys; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageDomain; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.core.web.page.TableSupport; import com.ruoyi.common.security.utils.DictUtils; import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.domain.*; import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.service.RemotePersonBasicInfoService; import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentBiggas; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.*; import static com.ruoyi.common.security.utils.DictUtils.getComprehensiveDictCacheToMap; /** * @Author LG * @Date 2023/9/8 - 9:38 */ @RestController @RequestMapping("/AppPersonBasicInfoController") public class AppPersonBasicInfoController { @Resource private RemotePersonBasicInfoService personBasicInfoService; /** * 查询人员信息列表 */ @GetMapping("/PersonBasicInfo/list") public AjaxResult list(PersonBasicInfo info) { PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); Integer delFlag = info.getDelFlag(); List> rows = (List>) personBasicInfoService.getList(pageNum, pageSize, delFlag).getRows(); Map comprehensiveSexMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别字典值 Map comprehensiveNationMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族字典值 Map comprehensiveMaritalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_MARITAL_STATUS);//婚姻状况字典值 Map comprehensiveEducationalBackgroundMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历字典值 Map comprehensiveReligiousBeliefMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);//宗教信仰字典值 Map comprehensivePoliticalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌字典值 Map comprehensiveOccupationalCategoryMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);//职业类别字典值 Map comprehensiveCityCodeMap = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);//2260 for (HashMap row : rows) { row.put("genderLabel", comprehensiveSexMap.get(row.get("gender")));//性别字典值 row.put("nationLabel", comprehensiveNationMap.get(row.get("nation")));//民族字典值 row.put("maritalStatusLabel", comprehensiveMaritalStatusMap.get(row.get("maritalStatus")));//婚姻状况字典值 row.put("educationLabel", comprehensiveEducationalBackgroundMap.get(row.get("education")));//学历字典值 row.put("religiousBeliefLabel", null == row.get("religiousBelief") ? null : comprehensiveReligiousBeliefMap.get(row.get("religiousBelief")));//宗教信仰字典值 row.put("politicalOutlookLabel", comprehensivePoliticalStatusMap.get(row.get("politicalOutlook")));//政治面貌字典值 row.put("occupationalCategoryLabel", comprehensiveOccupationalCategoryMap.get(row.get("occupationalCategory")));//职业类别字典值 row.put("householdRegistrationLabel", comprehensiveCityCodeMap.get(row.get("householdRegistration")));//户籍地 2260 row.put("nativePlaceLabel", comprehensiveCityCodeMap.get(row.get("nativePlace")));//籍贯 2260 } return AjaxResult.success(rows); } /** * 查询人员信息详情 */ @GetMapping("/PersonBasicInfo/edit") public AjaxResult getInfo(EnvironmentBiggas biggas) { AjaxResult ajaxResult = personBasicInfoService.getEdit(biggas.getId()); if ("200".equals(ajaxResult.get("code").toString())) { Map data = (Map) ajaxResult.get("data"); HashMap basicInfo = (HashMap) data.get("basicInfo"); setPersonBasicInfo(basicInfo); List> userBinds = (List>) basicInfo.get("userBinds"); ArrayList> otherInfo = (ArrayList>) data.get("otherInfo"); Map result = new HashMap<>(); result.put("basicInfo",data.get("basicInfo")); userBinds.forEach(bind -> { otherInfo.stream() .filter(info -> info.get("id").equals(bind.get("otherPersonId"))) .findFirst() .ifPresent(info -> setLabel(info, (Integer) bind.get("otherPersonType"))); }); otherInfo.forEach(bind ->{ switch(String.valueOf(bind.get("otherPersonType"))){ case "1": setRegisteredPopulation(bind); RegisteredPopulationInfo registeredPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), RegisteredPopulationInfo.class); result.put("registeredPopulation", registeredPopulationInfo); break; case "2": setFloatingPopulation(bind); FloatingPopulationInfo floatingPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), FloatingPopulationInfo.class); result.put("floatingPopulation", floatingPopulationInfo); break; case "3": setLeftBehindPerson(bind); LeftBehindPersonInfo leftBehindPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), LeftBehindPersonInfo.class); result.put("leftBehindPerson", leftBehindPersonInfo); break; case "4": setCampusAroundPerson(bind); CampusAroundPersonInfo campusAroundPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), CampusAroundPersonInfo.class); result.put("campusAroundPerson", campusAroundPersonInfo); break; case "5": setPrisonReleased(bind); PrisonReleasedInfo prisonReleasedInfo = JSONObject.toJavaObject(new JSONObject(bind), PrisonReleasedInfo.class); result.put("prisonReleased", prisonReleasedInfo); break; case "6": setCommunityCorrectionStaff(bind); CommunityCorrectionStaffInfo communityCorrectionStaffInfo = JSONObject.toJavaObject(new JSONObject(bind), CommunityCorrectionStaffInfo.class); result.put("communityCorrectionStaff", communityCorrectionStaffInfo); break; case "7": setPsychosisPopulation(bind); PsychosisPopulationInfo psychosisPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), PsychosisPopulationInfo.class); result.put("psychosisPopulation", psychosisPopulationInfo); break; case "8": setDrugAddict(bind); DrugAddictInfo drugAddictInfo = JSONObject.toJavaObject(new JSONObject(bind), DrugAddictInfo.class); result.put("drugAddict", drugAddictInfo); break; case "9": setAidsRisk(bind); AidsRiskInfo aidsRiskInfo = JSONObject.toJavaObject(new JSONObject(bind), AidsRiskInfo.class); result.put("aidsRisk", aidsRiskInfo); break; case "10": setKeyYouth(bind); KeyYouthInfo keyYouthInfo = JSONObject.toJavaObject(new JSONObject(bind), KeyYouthInfo.class); result.put("keyYouth", keyYouthInfo); break; } }); return AjaxResult.success(result); } else { return ajaxResult; } } /** * 根据给定的人员类型,设置字典中文值 */ private void setLabel(HashMap json, Integer type) { switch (type) { case 1: setRegisteredPopulation(json); break; case 2: setFloatingPopulation(json); break; case 3: setLeftBehindPerson(json); break; case 4: setCampusAroundPerson(json); break; case 5: setPrisonReleased(json); break; case 6: setCommunityCorrectionStaff(json); break; case 7: setPsychosisPopulation(json); break; case 8: setDrugAddict(json); break; case 9: setAidsRisk(json); break; case 10: setKeyYouth(json); break; } json.put("otherPersonType", type); } /** * 新增人员信息 */ @PostMapping("/PersonBasicInfo") public AjaxResult add(@RequestBody String json) { return personBasicInfoService.add(dataToList(json)); } /** * 修改人员信息 */ @PostMapping("/PersonBasicInfo/put") public AjaxResult edit(@RequestBody String json) { return personBasicInfoService.edit(dataToList(json)); } /** * 数据格式转换,将JSONString类型替换为List */ private String dataToList(String json){ JSONObject jsonObject = JSONObject.parseObject(json); Set strings = jsonObject.keySet(); JSONArray list = new JSONArray(); list.add(jsonObject.getJSONObject("basicInfo")); strings.remove("basicInfo"); for (String string : strings) { list.add(jsonObject.getJSONObject(string)); } return JSONArray.toJSONString(list); } /** * 删除人员信息 */ @GetMapping("/PersonBasicInfo/del") public AjaxResult remove(@RequestParam("id") List id) { return personBasicInfoService.del(id.toArray(new String[0])); } /** * 审核删除人员信息 * state = 2 通过, state = 1 拒绝 */ @GetMapping("/PersonBasicInfo/delInfo") public AjaxResult delInfo(@RequestParam("id") String id, @RequestParam("state") String state){ return personBasicInfoService.delInfo(id, state); } /** * 设置人员基础信息字典值 */ private void setPersonBasicInfo(HashMap basicInfo) {//0 Map comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE); basicInfo.put("genderLabel", getDictData(DictKeys.COMPREHENSIVE_SEX, String.valueOf(basicInfo.get("gender"))));//性别字典值 basicInfo.put("nationLabel", getDictData(DictKeys.COMPREHENSIVE_NATION, String.valueOf(basicInfo.get("nation"))));//民族字典值 basicInfo.put("maritalStatusLabel", getDictData(DictKeys.COMPREHENSIVE_MARITAL_STATUS, String.valueOf(basicInfo.get("maritalStatus"))));//婚姻状况字典值 basicInfo.put("educationLabel", getDictData(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND, String.valueOf(basicInfo.get("education"))));//学历字典值 basicInfo.put("religiousBeliefLabel", null == basicInfo.get("religiousBelief") ? null : getDictData(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF, String.valueOf(basicInfo.get("religiousBelief"))));//宗教信仰字典值 basicInfo.put("politicalOutlookLabel", getDictData(DictKeys.COMPREHENSIVE_POLITICAL_STATUS, String.valueOf(basicInfo.get("politicalOutlook"))));//政治面貌字典值 basicInfo.put("occupationalCategoryLabel", getDictData(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY, String.valueOf(basicInfo.get("occupationalCategory"))));//职业类别字典值 basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(String.valueOf(basicInfo.get("householdRegistration")))); basicInfo.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(String.valueOf(basicInfo.get("nativePlace")))); // basicInfo.put("householdRegistrationLabel", getDictData(DictKeys.COMPREHENSIVE_CITY_CODE, String.valueOf(basicInfo.get("householdRegistration"))));//户籍地 2260 // basicInfo.put("nativePlaceLabel", getDictData(DictKeys.COMPREHENSIVE_CITY_CODE, String.valueOf(basicInfo.get("nativePlace"))));//籍贯 2260 } /** * 设置户籍人口字典值 */ private void setRegisteredPopulation(HashMap json) {//1 json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识 json.put("accountRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("accountRelationship"))));//与户主关系 } /** * 设置流动人口字典值 */ private void setFloatingPopulation(HashMap json) {//2 json.put("inflowCauselabel", getDictData(DictKeys.COMPREHENSIVE_INFLOW_REASON, String.valueOf(json.get("inflowCause"))));//流入原因 json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否重点关注人员 json.put("certificationTypeLabel", null == json.get("certificationType") ? null : getDictData(DictKeys.COMPREHENSIVE_CERTIFICATION_TYPE, String.valueOf(json.get("certificationType"))));//办证类型 json.put("domicileTypeLabel", getDictData(DictKeys.COMPREHENSIVE_RESIDENCE_TYPE, String.valueOf(json.get("domicileType"))));//住所类型 } /** * 设置留守人口字典值 */ private void setLeftBehindPerson(HashMap json) {//3 json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识 json.put("leftBehindTypeLabel", getDictData(DictKeys.COMPREHENSIVE_LEFT_BEHIND_PERSONNEL_TYPE, String.valueOf(json.get("leftBehindType"))));//留守人员类型 json.put("healthStatusLabel", null == json.get("healthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("healthStatus"))));//健康状况 json.put("leftBehindRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("leftBehindRelationship"))));//与留守人员关系 json.put("keyFamilyHealthStatusLabel", null == json.get("keyFamilyHealthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("keyFamilyHealthStatus"))));//家庭主要成员健康状况 } /** * 设置校园周边重点人员字典值 */ private void setCampusAroundPerson(HashMap json) {//4 json.put("harmLevelLabel", getDictData(DictKeys.COMPREHENSIVE_DEGREE_OF_HARM, String.valueOf(json.get("harmLevel"))));//危害程度 json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否关注 } /** * 设置刑满释放人员字典值 */ private void setPrisonReleased(HashMap json) {//5 json.put("originalChargeLabel", getDictData(DictKeys.COMPREHENSIVE_OFFENCES_CLASSIFICATION, String.valueOf(json.get("originalCharge"))));//原罪名 json.put("recidivismLabel", "1".equals(json.get("recidivism")) ? "是" : "否");//是否累犯 json.put("riskAssessmentTypeLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT_TYPE, String.valueOf(json.get("riskAssessmentType"))));//危险性评估类型 json.put("linkUpStatusLabel", getDictData(DictKeys.COMPREHENSIVE_CONNECTION, String.valueOf(json.get("linkUpStatus"))));//衔接情况 json.put("placementStatusLabel", getDictData(DictKeys.COMPREHENSIVE_PLACEMENT, String.valueOf(json.get("placementStatus"))));//安置情况 json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪 } /** * 设置社区矫正人员字典值 */ private void setCommunityCorrectionStaff(HashMap json) {//6 json.put("caseCategoryLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别 json.put("correctiveReleaseTypeLabel", null == json.get("correctiveReleaseType") ? null : getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_RELEASE_TYPE, String.valueOf(json.get("correctiveReleaseType"))));//矫正解除(终止)类型 json.put("receivingModeLabel", getDictData(DictKeys.COMPREHENSIVE_RECEIVING_METHOD, String.valueOf(json.get("receivingMode"))));//接收方式 json.put("correctionClassLabel", getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_CATEGORY, String.valueOf(json.get("correctionClass"))));//矫正类别 json.put("tubeLabel", "1".equals(json.get("tube")) ? "是" : "否");//是否有脱管 json.put("leakingPipesLabel", "1".equals(json.get("leakingPipes")) ? "是" : "否");//是否有漏管 json.put("recidivismLabel", null == json.get("recidivism") ? null : "1".equals(json.get("recidivism")) ? "是" : "否");//是否累惯犯 json.put("establishCorrectionTeamLabel", "1".equals(json.get("establishCorrectionTeam")) ? "是" : "否");//是否建立矫正小组 json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪 json.put("fourHistoriesListLabel", getDictDataList(DictKeys.COMPREHENSIVE_FOUR_HISTORIES_SITUATION, (List) json.get("fourHistoriesList")));//“四史”情况 json.put("threeStepListLabel", getDictDataList(DictKeys.COMPREHENSIVE_THREE_INVOLVED_SITUATION, (List) json.get("threeStepList")));//“三涉”情况 json.put("correctionTeamCompositionListLabel", getDictDataList(DictKeys.COMPREHENSIVE_CORRECTIONS_TEAM_COMPOSITION_TYPE, (List) json.get("correctionTeamCompositionList")));//矫正小组人员组成情况 } /** * 设置肇事肇祸及严重精神障碍患者字典值 */ private void setPsychosisPopulation(HashMap json) {//7 json.put("familyEconomicSituationLabel", null == json.get("familyEconomicSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_FINANCIAL_SITUATION, String.valueOf(json.get("familyEconomicSituation"))));//家庭经济状况 json.put("subsistenceAllowanceLabel", "1".equals(json.get("subsistenceAllowance")) ? "是" : "否");//是否纳入低保 json.put("diagnosisTypeLabel", getDictData(DictKeys.COMPREHENSIVE_CURRENT_DIAGNOSTIC, String.valueOf(json.get("diagnosisType"))));//目前诊断类型 json.put("historyCausingAccidentsLabel", "1".equals(json.get("historyCausingAccidents")) ? "有" : "无");//有无肇事肇祸史 json.put("riskAssessmentLevelLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT, String.valueOf(json.get("riskAssessmentLevel"))));//目前危险性评估等级 json.put("treatmentSituationLabel", getDictData(DictKeys.COMPREHENSIVE_TREATMENT_CONDITIONS, String.valueOf(json.get("treatmentSituation"))));//治疗情况 json.put("reasonsHospitalizationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HOSPITALIZATION_REASONS, (List) json.get("reasonsHospitalizationList")));//实施住院治疗原因 json.put("participatingManagersListLabel", getDictDataList(DictKeys.COMPREHENSIVE_MANAGERS, (List) json.get("participatingManagersList")));//参与管理人员 json.put("assistanceSituationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HELP_SITUATION, (List) json.get("assistanceSituationList")));//帮扶情况 } /** * 设置吸毒人员字典值 */ private void setDrugAddict(HashMap json) {//8 json.put("controlSituationLabel", getDictData(DictKeys.COMPREHENSIVE_GOVERNANCE, String.valueOf(json.get("controlSituation"))));//管控情况 json.put("criminalHistoryLabel", null == json.get("criminalHistory") ? null : "1".equals(json.get("criminalHistory")) ? "有" : "无");//有无犯罪史 json.put("drugUseLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_CONSEQUENCE, String.valueOf(json.get("drugUse"))));//吸毒原因 json.put("drugAbuseLabel", null == json.get("drugAbuse") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CONSEQUENCE, String.valueOf(json.get("drugAbuse"))));//吸毒后果 } /** * 设置艾滋病危险人员字典值 */ private void setAidsRisk(HashMap json) {//9 json.put("routeInfectionLabel", getDictData(DictKeys.COMPREHENSIVE_ROUTE_OF_INFECTION, String.valueOf(json.get("routeInfection"))));//感染途径 json.put("criminalHistoryLabel", "1".equals(json.get("criminalHistory")) ? "是" : "否");//是否有违法犯罪史 json.put("caseCategoryLabel", null == json.get("caseCategory") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别 json.put("concernTypeLabel", getDictData(DictKeys.COMPREHENSIVE_TYPE_OF_CONCERN, String.valueOf(json.get("concernType"))));//关注类型 json.put("admissionSituationLabel", null == json.get("admissionSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_ADMISSION_TO_INERTIA, String.valueOf(json.get("admissionSituation"))));//收治情况 } /** * 设置重点青少年字典值 */ private void setKeyYouth(HashMap json) {//10 json.put("personTypeLabel", null == json.get("personType") ? null : getDictData(DictKeys.COMPREHENSIVE_TYPE_OF_PERSON, String.valueOf(json.get("personType"))));//人员类型 json.put("familySituationLabel", getDictData(DictKeys.COMPREHENSIVE_FAMILY_INERTIA, String.valueOf(json.get("familySituation"))));//家庭情况 json.put("guardianRelationLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("guardianRelation"))));//与监护人关系 json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否违法犯罪 json.put("meansAssistanceLabel", getDictData(DictKeys.COMPREHENSIVE_MEANS_OF_HELP, String.valueOf(json.get("meansAssistance"))));//帮扶手段 } private String getDictData(String dictKey, String value) { return DictUtils.getDictDataByValue(dictKey, value); } private List getDictDataList(String dictKey, List values) { return DictUtils.getDictDataListByValue(dictKey, values); } /** * 查询其他人员类型列表 */ @GetMapping("/PersonBasicInfo/getOtherList") public AjaxResult getOtherList(PersonBasicInfo personBasicInfo){ PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); Integer delFlag = personBasicInfo.getDelFlag(); Integer personType = personBasicInfo.getPersonType(); List> rows = (List>) personBasicInfoService.getOtherList(pageNum, pageSize, delFlag, personType).getRows(); Map comprehensiveSexMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别字典值 Map comprehensiveNationMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族字典值 Map comprehensiveMaritalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_MARITAL_STATUS);//婚姻状况字典值 Map comprehensiveEducationalBackgroundMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历字典值 Map comprehensiveReligiousBeliefMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);//宗教信仰字典值 Map comprehensivePoliticalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌字典值 Map comprehensiveOccupationalCategoryMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);//职业类别字典值 Map comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260 if( null != rows && !rows.isEmpty()){ for (HashMap row : rows) { row.put("genderLabel", comprehensiveSexMap.get(row.get("gender")));//性别字典值 row.put("nationLabel", comprehensiveNationMap.get(row.get("nation")));//民族字典值 row.put("maritalStatusLabel", comprehensiveMaritalStatusMap.get(row.get("maritalStatus")));//婚姻状况字典值 row.put("educationLabel", comprehensiveEducationalBackgroundMap.get(row.get("education")));//学历字典值 row.put("religiousBeliefLabel", null == row.get("religiousBelief") ? null : comprehensiveReligiousBeliefMap.get(row.get("religiousBelief")));//宗教信仰字典值 row.put("politicalOutlookLabel", comprehensivePoliticalStatusMap.get(row.get("politicalOutlook")));//政治面貌字典值 row.put("occupationalCategoryLabel", comprehensiveOccupationalCategoryMap.get(row.get("occupationalCategory")));//职业类别字典值 row.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(row.get("householdRegistration")));//户籍地 2260 row.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(row.get("nativePlace")));//籍贯 2260 } return AjaxResult.success(rows); }else{ return AjaxResult.error(500, "list is null!"); } } /** * 查询其他类型人员详情 */ @GetMapping("/PersonBasicInfo/getOtherEdit") public AjaxResult getOtherEdit(OtherPersonInfo otherPersonInfo){ AjaxResult otherEdit = personBasicInfoService.getOtherEdit(otherPersonInfo.getBasicId(), otherPersonInfo.getPersonType()); if ("200".equals(otherEdit.get("code").toString())){ Map comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260 HashMap> data = (HashMap>) otherEdit.get("data"); setPersonBasicInfo(data.get("basicInfo")); if (!comprehensiveDictCacheToMap.isEmpty()) { data.computeIfPresent("basicInfo", (key, basicInfo) -> { basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(basicInfo.get("householdRegistration")));// 户籍地 2260 basicInfo.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(basicInfo.get("nativePlace")));// 籍贯 2260 return basicInfo; }); } switch (otherPersonInfo.getPersonType()){ case 1: setRegisteredPopulation(data.get("otherInfo")); data.put("registeredPopulation", data.remove("otherInfo")); break; case 2: setFloatingPopulation(data.get("otherInfo")); data.put("floatingPopulation", data.remove("otherInfo")); break; case 3: setLeftBehindPerson(data.get("otherInfo")); data.put("leftBehindPerson", data.remove("otherInfo")); break; case 4: setCampusAroundPerson(data.get("otherInfo")); data.put("campusAroundPerson", data.remove("otherInfo")); break; case 5: setPrisonReleased(data.get("otherInfo")); data.put("prisonReleased", data.remove("otherInfo")); break; case 6: setCommunityCorrectionStaff(data.get("otherInfo")); data.put("communityCorrectionStaff", data.remove("otherInfo")); break; case 7: setPsychosisPopulation(data.get("otherInfo")); data.put("psychosisPopulation", data.remove("otherInfo")); break; case 8: setDrugAddict(data.get("otherInfo")); data.put("drugAddict", data.remove("otherInfo")); break; case 9: setAidsRisk(data.get("otherInfo")); data.put("aidsRisk", data.remove("otherInfo")); break; case 10: setKeyYouth(data.get("otherInfo")); data.put("keyYouth", data.remove("otherInfo")); break; default: break; } return AjaxResult.success(data); }else{ return AjaxResult.error(otherEdit.get("code").toString(), otherEdit.get("msg")); } } /** * 查询全部有效的用户信息 */ @GetMapping("/PersonBasicInfo/getAllUserInfo") public AjaxResult getAllUserInfo(PersonBasicInfo personBasicInfo){ AjaxResult allUserInfo = personBasicInfoService.getAllUserInfo(personBasicInfo.getName()); if ("200".equals(allUserInfo.get("code").toString())){ Map comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260 List> data = (List>) allUserInfo.get("data"); for (Map map : data) { map.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(map.get("householdRegistration")));// 户籍地 2260 map.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(map.get("nativePlace")));// 籍贯 2260 map.put("currentResidencePlaceLabel", comprehensiveDictCacheToMap.get(map.get("currentResidencePlace")));// 2260 } } return allUserInfo; } }