Prechádzať zdrojové kódy

手机端后台优化代码

Wang-Xiao-Ran 1 rok pred
rodič
commit
463d67d56f

+ 53 - 48
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/AppRoomController.java

@@ -2,7 +2,6 @@ package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutionControl
 
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.core.constant.HttpStatus;
-import com.ruoyi.common.core.domain.DictKeys;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
@@ -13,12 +12,17 @@ import com.ruoyi.common.core.web.page.TableSupport;
 import com.ruoyi.common.security.utils.DictUtils;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.domain.ComprehensiveRoom;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.RemoteRoomService;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import static com.ruoyi.common.core.domain.DictKeys.*;
+
 /**
  * 房间管理
  *
@@ -37,40 +41,30 @@ public class AppRoomController extends BaseController {
      */
     @GetMapping("/comprehensiveroom/list")
     public AjaxResult list(ComprehensiveRoom comprehensiveroom) {
+        System.out.println("start --> " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()));
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Integer pageNum = pageDomain.getPageNum();
-        Integer pageSize = pageDomain.getPageSize();
-        TableDataInfo tableDataInfo = remoteRoomService.selectComprehensiveRoomList(pageNum, pageSize,comprehensiveroom.getName(),comprehensiveroom.getEstateId());
-        if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+        TableDataInfo tableDataInfo = remoteRoomService.selectComprehensiveRoomList(
+                pageDomain.getPageNum(),
+                pageDomain.getPageSize(),
+                comprehensiveroom.getName(),
+                comprehensiveroom.getEstateId(),
+                comprehensiveroom.getTotal()
+        );
+        if (HttpStatus.SUCCESS == tableDataInfo.getCode()) {
             List<ComprehensiveRoom> rows = (List<ComprehensiveRoom>) tableDataInfo.getRows();
-            Map<String, Object> dictCacheToMap = DictUtils.getDictCacheToMap(DictKeys.RFH_FJ_GLFS);
-            Map<String, Object> dictCacheToMap1 = DictUtils.getDictCacheToMap(DictKeys.RFH_FJ_WYH);
-            Map<String, Object> dictCacheToMap2 = DictUtils.getDictCacheToMap(DictKeys.RFH_FJ_FJXZ);
-            Map<String, Object> dictCacheToMap3 = DictUtils.getDictCacheToMap(DictKeys.RFH_FJ_SHLX);
+            String[] dictArray = new String[]{RFH_FJ_GLFS, RFH_FJ_WYH, RFH_FJ_FJXZ, RFH_FJ_SHLX};
+            Map<String, Map<String, Object>> dictMaps = DictUtils.getDictCacheToMapByArray(dictArray);
             String s = JSON.toJSONString(rows);
             rows = JSON.parseArray(s, ComprehensiveRoom.class);
-            if(StringUtils.isNotEmpty(rows)) {
+            if (StringUtils.isNotEmpty(rows)) {
                 for (ComprehensiveRoom data : rows) {
-                    data.setRoomSfpfLabel("1".equals(data.getRoomSfpf()) ? "是" : "否");
-                    data.setRoomSfydxsLabel("1".equals(data.getRoomSfydxs()) ? "是" : "否");
-                    data.setRoomSfzrLabel("1".equals(data.getRoomSfzr()) ? "是" : "否");
-                    data.setRoomSffwLabel("1".equals(data.getRoomSffw()) ? "是" : "否");
-                    data.setRoomWfjzLabel("1".equals(data.getRoomWfjz()) ? "是" : "否");
-                    data.setRoomSfcwLabel("1".equals(data.getRoomSfcw()) ? "是" : "否");
-                    data.setRoomSfgzLabel("1".equals(data.getRoomSfgz()) ? "是" : "否");
-                    data.setRoomSfmsfLabel("1".equals(data.getRoomSfmsf()) ? "是" : "否");
-                    data.setRoomSfgkpyLabel("1".equals(data.getRoomSfgkpy()) ? "是" : "否");
-                    data.setRoomSfjhqLabel("1".equals(data.getRoomSfjhq()) ? "是" : "否");
-                    data.setRoomSfslzLabel("1".equals(data.getRoomSfslz()) ? "是" : "否");
-                    data.setRoomGlfsLabel(dictCacheToMap.get(data.getRoomGlfs()).toString());
-                    data.setRoomWyhLabel(dictCacheToMap1.get(data.getRoomWyh()).toString());
-                    data.setRoomTypeLabel(dictCacheToMap2.get(data.getRoomType()).toString());
-                    data.setRoomShlxLabel(dictCacheToMap3.get(data.getRoomShlx()).toString());
+                    setDictValue(data, dictMaps);
                 }
             }
+            System.out.println("end --> " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()));
             return AjaxResult.success(rows);
-        }else{
-            return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
+        } else {
+            return AjaxResult.error(tableDataInfo.getCode(), tableDataInfo.getMsg());
         }
     }
 
@@ -81,30 +75,37 @@ public class AppRoomController extends BaseController {
     public AjaxResult getInfo(String id) {
         R<ComprehensiveRoom> edit = remoteRoomService.selectComprehensiveRoomById(id);
         ComprehensiveRoom data = edit.getData();
-        data.setRoomSfpfLabel("1".equals(data.getRoomSfpf())? "是":"否");
-        data.setRoomSfydxsLabel("1".equals(data.getRoomSfydxs())? "是":"否");
-        data.setRoomSfzrLabel("1".equals(data.getRoomSfzr())? "是":"否");
-        data.setRoomSffwLabel("1".equals(data.getRoomSffw())? "是":"否");
-        data.setRoomWfjzLabel("1".equals(data.getRoomWfjz())? "是":"否");
-        data.setRoomSfcwLabel("1".equals(data.getRoomSfcw())? "是":"否");
-        data.setRoomSfgzLabel("1".equals(data.getRoomSfgz())? "是":"否");
-        data.setRoomSfmsfLabel("1".equals(data.getRoomSfmsf())? "是":"否");
-        data.setRoomSfgkpyLabel("1".equals(data.getRoomSfgkpy())? "是":"否");
-        data.setRoomSfjhqLabel("1".equals(data.getRoomSfjhq())? "是":"否");
-        data.setRoomSfslzLabel("1".equals(data.getRoomSfslz())? "是":"否");
-        if (HttpStatus.SUCCESS == edit.getCode()){
-            data.setRoomGlfsLabel(DictUtils.getDictDataByValue(DictKeys.RFH_FJ_GLFS,data.getRoomGlfs()));
-            data.setRoomWyhLabel(DictUtils.getDictDataByValue(DictKeys.RFH_FJ_WYH,data.getRoomWyh()));
-            data.setRoomTypeLabel(DictUtils.getDictDataByValue(DictKeys.RFH_FJ_FJXZ,data.getRoomType()));
-            data.setRoomShlxLabel(DictUtils.getDictDataByValue(DictKeys.RFH_FJ_SHLX,data.getRoomShlx()));
+        if (HttpStatus.SUCCESS == edit.getCode()) {
             data.setIsEdit(true);
-        }else if (HttpStatus.ERROR == edit.getCode() && null != edit.getData()) {
+        } else if (HttpStatus.ERROR == edit.getCode() && null != edit.getData()) {
             data.setIsEdit(false);
-        }else {
+        } else {
             return AjaxResult.error(edit.getCode(), edit.getMsg());
         }
+        setDictValue(data, null);
         return AjaxResult.success(data);
+    }
 
+    private void setDictValue(ComprehensiveRoom data, Map<String, Map<String, Object>> dictMaps) {
+        if (StringUtils.isEmpty(dictMaps)) {
+            String[] dictArray = new String[]{RFH_FJ_GLFS, RFH_FJ_WYH, RFH_FJ_FJXZ, RFH_FJ_SHLX};
+            dictMaps = DictUtils.getDictCacheToMapByArray(dictArray);
+        }
+        data.setRoomSfpfLabel("1".equals(data.getRoomSfpf()) ? "是" : "否");
+        data.setRoomSfydxsLabel("1".equals(data.getRoomSfydxs()) ? "是" : "否");
+        data.setRoomSfzrLabel("1".equals(data.getRoomSfzr()) ? "是" : "否");
+        data.setRoomSffwLabel("1".equals(data.getRoomSffw()) ? "是" : "否");
+        data.setRoomWfjzLabel("1".equals(data.getRoomWfjz()) ? "是" : "否");
+        data.setRoomSfcwLabel("1".equals(data.getRoomSfcw()) ? "是" : "否");
+        data.setRoomSfgzLabel("1".equals(data.getRoomSfgz()) ? "是" : "否");
+        data.setRoomSfmsfLabel("1".equals(data.getRoomSfmsf()) ? "是" : "否");
+        data.setRoomSfgkpyLabel("1".equals(data.getRoomSfgkpy()) ? "是" : "否");
+        data.setRoomSfjhqLabel("1".equals(data.getRoomSfjhq()) ? "是" : "否");
+        data.setRoomSfslzLabel("1".equals(data.getRoomSfslz()) ? "是" : "否");
+        data.setRoomGlfsLabel(MapUtils.getString((Map<String, Object>) MapUtils.getMap(dictMaps, RFH_FJ_GLFS), data.getRoomGlfs()));
+        data.setRoomWyhLabel(MapUtils.getString((Map<String, Object>) MapUtils.getMap(dictMaps, RFH_FJ_WYH), data.getRoomWyh()));
+        data.setRoomTypeLabel(MapUtils.getString((Map<String, Object>) MapUtils.getMap(dictMaps, RFH_FJ_FJXZ), data.getRoomType()));
+        data.setRoomShlxLabel(MapUtils.getString((Map<String, Object>) MapUtils.getMap(dictMaps, RFH_FJ_SHLX), data.getRoomShlx()));
     }
 
     /**
@@ -114,6 +115,7 @@ public class AppRoomController extends BaseController {
     public AjaxResult add(@RequestBody String json) {
         return remoteRoomService.insertComprehensiveRoom(json);
     }
+
     /**
      * 修改房间管理
      */
@@ -132,21 +134,23 @@ public class AppRoomController extends BaseController {
 
     /**
      * 楼栋的单元数
+     *
      * @param num
      * @return
      */
     @GetMapping("/comprehensiveroom/getunitList")
-    public AjaxResult getunitList(@RequestParam("num") String num){
+    public AjaxResult getunitList(@RequestParam("num") String num) {
         return remoteRoomService.getunitList(num);
     }
 
     /**
      * 房间id
+     *
      * @param id
      * @return
      */
     @GetMapping("/comprehensiveroom/getAllUserInfo")
-    public AjaxResult getAllUserInfo(@RequestParam("id") String id){
+    public AjaxResult getAllUserInfo(@RequestParam("id") String id) {
         return remoteRoomService.getAllUserInfo(id);
     }
 
@@ -160,11 +164,12 @@ public class AppRoomController extends BaseController {
 
     /**
      * 查询出租屋列表
+     *
      * @param
      * @return
      */
     @GetMapping("/comprehensiveroom/getLet")
-    public AjaxResult getLet(){
+    public AjaxResult getLet() {
         return remoteRoomService.selectComprehensiveLet();
     }
 

+ 100 - 88
src/main/java/com/sooka/sponest/mobile/comprehensive/personBasicInfoController/AppPersonBasicInfoController.java

@@ -4,19 +4,22 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.common.core.constant.HttpStatus;
 import com.ruoyi.common.core.domain.DictKeys;
+import com.ruoyi.common.core.utils.StringUtils;
 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.apache.commons.collections4.MapUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
+import static com.ruoyi.common.core.domain.DictKeys.*;
 import static com.ruoyi.common.security.utils.DictUtils.getComprehensiveDictCacheToMap;
 
 /**
@@ -34,30 +37,20 @@ public class AppPersonBasicInfoController {
      */
     @GetMapping("/PersonBasicInfo/list")
     public AjaxResult list(PersonBasicInfo info) {
+        System.out.println("start --> " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()));
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Integer pageNum = pageDomain.getPageNum();
-        Integer pageSize = pageDomain.getPageSize();
-        Integer delFlag = info.getDelFlag();
-        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getList(info.getName(), pageNum, pageSize, delFlag).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> comprehensiveCityCodeMap = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);//2260
-        for (HashMap<String, Object> 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
+        //noinspection unchecked
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getList(
+                info.getName(),
+                pageDomain.getPageNum(),
+                pageDomain.getPageSize(),
+                info.getDelFlag(),
+                info.getTotal()
+        ).getRows();
+        if (StringUtils.isNotEmpty(rows)) {
+            setDictValue(rows);
         }
+        System.out.println("end --> " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()));
         return AjaxResult.success(rows);
     }
 
@@ -71,19 +64,19 @@ public class AppPersonBasicInfoController {
         if ("200".equals(ajaxResult.get("code").toString())) {
             Map<String, Object> data = (Map<String, Object>) ajaxResult.get("data");
             HashMap<String, Object> basicInfo = (HashMap<String, Object>) data.get("basicInfo");
-            setPersonBasicInfo(basicInfo);
+            setPersonBasicInfo(basicInfo, null, null);
             List<HashMap<String, Object>> userBinds = (List<HashMap<String, Object>>) basicInfo.get("userBinds");
             ArrayList<HashMap<String, Object>> otherInfo = (ArrayList<HashMap<String, Object>>) data.get("otherInfo");
             Map<String, Object> result = new HashMap<>();
-            result.put("basicInfo",data.get("basicInfo"));
+            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"))){
+            otherInfo.forEach(bind -> {
+                switch (String.valueOf(bind.get("otherPersonType"))) {
                     case "1":
                         setRegisteredPopulation(bind);
                         RegisteredPopulationInfo registeredPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), RegisteredPopulationInfo.class);
@@ -201,7 +194,7 @@ public class AppPersonBasicInfoController {
     /**
      * 数据格式转换,将JSONString类型替换为List
      */
-    private String dataToList(String json){
+    private String dataToList(String json) {
         JSONObject jsonObject = JSONObject.parseObject(json);
         Set<String> strings = jsonObject.keySet();
         JSONArray list = new JSONArray();
@@ -226,25 +219,59 @@ public class AppPersonBasicInfoController {
      * state = 2 通过,  state = 1 拒绝
      */
     @GetMapping("/PersonBasicInfo/delInfo")
-    public AjaxResult delInfo(@RequestParam("id") String id, @RequestParam("state") String state){
+    public AjaxResult delInfo(@RequestParam("id") String id, @RequestParam("state") String state) {
         return personBasicInfoService.delInfo(id, state);
     }
 
     /**
      * 设置人员基础信息字典值
      */
-    private void setPersonBasicInfo(HashMap<String, Object> basicInfo) {//0
-        Map<String, Object> 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("currentResidencePlaceLabel", comprehensiveDictCacheToMap.get(String.valueOf(basicInfo.get("currentResidencePlace"))));
+    private void setPersonBasicInfo(HashMap<String, Object> basicInfo, Map<String, Map<String, Object>> dictMaps, Map<String, Object> cityMaps) {//0
+        if(StringUtils.isEmpty(dictMaps)){
+            String[] dictKeys = {
+                    COMPREHENSIVE_SEX, //性别
+                    COMPREHENSIVE_NATION, //民族
+                    COMPREHENSIVE_MARITAL_STATUS, //婚姻状况
+                    COMPREHENSIVE_EDUCATIONAL_BACKGROUND, //学历
+                    COMPREHENSIVE_RELIGIOUS_BELIEF, //宗教信仰
+                    COMPREHENSIVE_POLITICAL_STATUS, //政治面貌
+                    COMPREHENSIVE_OCCUPATIONAL_CATEGORY //职业类别
+            };
+            dictMaps = DictUtils.getDictCacheToMapByArray(dictKeys);
+        }
+        if(StringUtils.isEmpty(cityMaps)){
+            cityMaps = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);
+        }
+        basicInfo.put("genderLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_SEX).get(mapUtilsGetString(basicInfo, "gender")));//性别字典值
+        basicInfo.put("nationLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_NATION).get(mapUtilsGetString(basicInfo, "nation")));//民族字典值
+        basicInfo.put("maritalStatusLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_MARITAL_STATUS).get(mapUtilsGetString(basicInfo, "maritalStatus")));//婚姻状况字典值
+        basicInfo.put("educationLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_EDUCATIONAL_BACKGROUND).get(mapUtilsGetString(basicInfo, "education")));//学历字典值
+        basicInfo.put("religiousBeliefLabel", null == MapUtils.getString(basicInfo, "religiousBelief") ? null : MapUtils.getMap(dictMaps, COMPREHENSIVE_RELIGIOUS_BELIEF).get(MapUtils.getString(basicInfo, "religiousBelief")));//宗教信仰字典值
+        basicInfo.put("politicalOutlookLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_POLITICAL_STATUS).get(mapUtilsGetString(basicInfo, "politicalOutlook")));//政治面貌字典值
+        basicInfo.put("occupationalCategoryLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_OCCUPATIONAL_CATEGORY).get(mapUtilsGetString(basicInfo, "occupationalCategory")));//职业类别字典值
+        basicInfo.put("householdRegistrationLabel", cityMaps.get(mapUtilsGetString(basicInfo, "householdRegistration")));//户籍地 2260
+        basicInfo.put("nativePlaceLabel", cityMaps.get(mapUtilsGetString(basicInfo, "nativePlace")));//籍贯 2260
+        basicInfo.put("currentResidencePlaceLabel", cityMaps.get(mapUtilsGetString(basicInfo,"currentResidencePlace")));
+        basicInfo.put("isResidentLabel", "1".equals(MapUtils.getString(basicInfo, "isResident"))? "是":"否");
+    }
+
+    private void setDictValue(List<HashMap<String, Object>> rows){
+        String[] dictKeys = {
+                COMPREHENSIVE_SEX, //性别
+                COMPREHENSIVE_NATION, //民族
+                COMPREHENSIVE_MARITAL_STATUS, //婚姻状况
+                COMPREHENSIVE_EDUCATIONAL_BACKGROUND, //学历
+                COMPREHENSIVE_RELIGIOUS_BELIEF, //宗教信仰
+                COMPREHENSIVE_POLITICAL_STATUS, //政治面貌
+                COMPREHENSIVE_OCCUPATIONAL_CATEGORY //职业类别
+        };
+        Map<String, Map<String, Object>> dictMaps = DictUtils.getDictCacheToMapByArray(dictKeys);
+        Map<String, Object> cityMaps = getComprehensiveDictCacheToMap(COMPREHENSIVE_CITY_CODE);// 2260
+        if (null != rows && !rows.isEmpty()) {
+            for (HashMap<String, Object> row : rows) {
+                setPersonBasicInfo(row, dictMaps, cityMaps);
+            }
+        }
     }
 
     /**
@@ -354,11 +381,11 @@ public class AppPersonBasicInfoController {
      * 设置重点青少年字典值
      */
     private void setKeyYouth(HashMap<String, Object> 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"))));//帮扶手段
+        json.put("personTypeLabel", null == json.get("personType") ? null : getDictData(COMPREHENSIVE_TYPE_OF_PERSON, mapUtilsGetString(json,"personType")));//人员类型
+        json.put("familySituationLabel", getDictData(COMPREHENSIVE_FAMILY_INERTIA, mapUtilsGetString(json,"familySituation")));//家庭情况
+        json.put("guardianRelationLabel", getDictData(COMPREHENSIVE_RELATION, mapUtilsGetString(json,"guardianRelation")));//与监护人关系
+        json.put("reoffendLabel", "1".equals(MapUtils.getString(json,"reoffend")) ? "是" : "否");//是否违法犯罪
+        json.put("meansAssistanceLabel", getDictData(COMPREHENSIVE_MEANS_OF_HELP, mapUtilsGetString(json,"meansAssistance")));//帮扶手段
     }
 
     private String getDictData(String dictKey, String value) {
@@ -369,53 +396,40 @@ public class AppPersonBasicInfoController {
         return DictUtils.getDictDataListByValue(dictKey, values);
     }
 
+    private String mapUtilsGetString(Map<String, Object> map, String key) {
+        return MapUtils.getString(map,key);
+    }
+
     /**
      * 查询其他人员类型列表
      */
     @GetMapping("/PersonBasicInfo/getOtherList")
-    public AjaxResult getOtherList(PersonBasicInfo personBasicInfo){
+    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<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( 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!");
+        //noinspection unchecked
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getOtherList(
+                pageDomain.getPageNum(),
+                pageDomain.getPageSize(),
+                personBasicInfo.getDelFlag(),
+                personBasicInfo.getPersonType(),
+                personBasicInfo.getTotal()
+        ).getRows();
+        if (null != rows && !rows.isEmpty()) {
+            setDictValue(rows);
         }
+        return AjaxResult.success(rows);
     }
 
     /**
      * 查询其他类型人员详情
      */
     @GetMapping("/PersonBasicInfo/getOtherEdit")
-    public AjaxResult getOtherEdit(OtherPersonInfo otherPersonInfo){
+    public AjaxResult getOtherEdit(OtherPersonInfo otherPersonInfo) {
         AjaxResult otherEdit = personBasicInfoService.getOtherEdit(otherPersonInfo.getBasicId(), otherPersonInfo.getPersonType());
-        if ("200".equals(otherEdit.get("code").toString())){
+        if ("200".equals(otherEdit.get("code").toString())) {
             Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
             HashMap<String, HashMap<String, Object>> data = (HashMap<String, HashMap<String, Object>>) otherEdit.get("data");
-            setPersonBasicInfo(data.get("basicInfo"));
+            setPersonBasicInfo(data.get("basicInfo"), null , null);
             if (!comprehensiveDictCacheToMap.isEmpty()) {
                 data.computeIfPresent("basicInfo", (key, basicInfo) -> {
                     basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(basicInfo.get("householdRegistration")));// 户籍地 2260
@@ -423,7 +437,7 @@ public class AppPersonBasicInfoController {
                     return basicInfo;
                 });
             }
-            switch (otherPersonInfo.getPersonType()){
+            switch (otherPersonInfo.getPersonType()) {
                 case 1:
                     setRegisteredPopulation(data.get("otherInfo"));
                     data.put("registeredPopulation", data.remove("otherInfo"));
@@ -468,7 +482,7 @@ public class AppPersonBasicInfoController {
                     break;
             }
             return AjaxResult.success(data);
-        }else{
+        } else {
             return AjaxResult.error(otherEdit.get("code").toString(), otherEdit.get("msg"));
         }
     }
@@ -477,15 +491,13 @@ public class AppPersonBasicInfoController {
      * 查询全部有效的用户信息
      */
     @GetMapping("/PersonBasicInfo/getAllUserInfo")
-    public AjaxResult getAllUserInfo(PersonBasicInfo personBasicInfo){
+    public AjaxResult getAllUserInfo(PersonBasicInfo personBasicInfo) {
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Integer pageNum = pageDomain.getPageNum();
-        Integer pageSize = pageDomain.getPageSize();
-        AjaxResult allUserInfo = personBasicInfoService.getAllUserInfo(personBasicInfo.getName(), pageNum, pageSize);
-        if (HttpStatus.SUCCESS == Integer.valueOf(allUserInfo.get("code").toString())){
+        AjaxResult allUserInfo = personBasicInfoService.getAllUserInfo(personBasicInfo.getName(), pageDomain.getPageNum(), pageDomain.getPageSize());
+        if (HttpStatus.SUCCESS == Integer.valueOf(allUserInfo.get("code").toString())) {
             Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
             List<Map<String, Object>> data = (List<Map<String, Object>>) allUserInfo.get("data");
-            if(null != data){
+            if (null != data) {
                 for (Map<String, Object> map : data) {
                     map.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(map.get("householdRegistration")));// 户籍地 2260
                     map.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(map.get("nativePlace")));// 籍贯 2260
@@ -493,8 +505,8 @@ public class AppPersonBasicInfoController {
                 }
             }
             return AjaxResult.success(allUserInfo.get("rows"));
-        }else{
-            return AjaxResult.error(allUserInfo.get("code").toString(),allUserInfo.get("msg"));
+        } else {
+            return AjaxResult.error(allUserInfo.get("code").toString(), allUserInfo.get("msg"));
         }
     }