Преглед изворни кода

手机端接口查询其他人员类型,修改返回的key,设置字典值

Wang-Xiao-Ran пре 1 година
родитељ
комит
d34b1e8759

+ 69 - 9
src/main/java/com/sooka/sponest/mobile/comprehensive/personBasicInfoController/AppPersonBasicInfoController.java

@@ -315,15 +315,28 @@ public class AppPersonBasicInfoController {
         Integer pageSize = pageDomain.getPageSize();
         Integer delFlag = personBasicInfo.getDelFlag();
         Integer personType = personBasicInfo.getPersonType();
-        TableDataInfo list = personBasicInfoService.getOtherList(pageNum, pageSize, delFlag, personType);
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getOtherList(pageNum, pageSize, delFlag, personType).getRows();
+        Map<String, Object> comprehensiveSexMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别字典值
+        Map<String, Object> comprehensiveNationMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族字典值
+        Map<String, Object> comprehensiveMaritalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_MARITAL_STATUS);//婚姻状况字典值
+        Map<String, Object> comprehensiveEducationalBackgroundMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历字典值
+        Map<String, Object> comprehensiveReligiousBeliefMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);//宗教信仰字典值
+        Map<String, Object> comprehensivePoliticalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌字典值
+        Map<String, Object> comprehensiveOccupationalCategoryMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);//职业类别字典值
         Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
-        if(!"".equals(list) && null != list){
-            for (Object row : list.getRows()) {
-                HashMap r = (HashMap) row;
-                r.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(r.get("householdRegistration")));//户籍地 2260
-                r.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(r.get("nativePlace")));//籍贯 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(list);
+            return AjaxResult.success(rows);
         }else{
             return AjaxResult.error(500, "list is null!");
         }
@@ -334,7 +347,8 @@ public class AppPersonBasicInfoController {
         AjaxResult otherEdit = personBasicInfoService.getOtherEdit(otherPersonInfo.getBasicId(), otherPersonInfo.getPersonType());
         if ("200".equals(otherEdit.get("code").toString())){
             Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
-            Map<String, Map<String, Object>> data = (Map<String, Map<String, Object>>) otherEdit.get("data");
+            HashMap<String, HashMap<String, Object>> data = (HashMap<String, HashMap<String, Object>>) otherEdit.get("data");
+            setPersonBasicInfo(data.get("basicInfo"));
             if (!comprehensiveDictCacheToMap.isEmpty()) {
                 data.computeIfPresent("basicInfo", (key, basicInfo) -> {
                     basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(basicInfo.get("householdRegistration")));// 户籍地 2260
@@ -342,8 +356,54 @@ public class AppPersonBasicInfoController {
                     return basicInfo;
                 });
             }
+            switch (otherPersonInfo.getPersonType()){
+                case 1:
+                    setRegisteredPopulation(data.get("otherInfo"));
+                    data.put("registeredPopulation", data.remove("otherInfo"));
+                    break;
+                case 2:
+                    setFloatingPopulation(data.get("ohterInfo"));
+                    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"));
         }
-        return AjaxResult.success(otherEdit);
     }
 
     @GetMapping("/PersonBasicInfo/getAllUserInfo")