浏览代码

网格长手机列表2260字典值

吕宣芝 1 年之前
父节点
当前提交
8c1c7d7067

+ 41 - 2
src/main/java/com/sooka/sponest/mobile/comprehensive/comprehensiveconflictdefuseController/AppGridLeaderController.java

@@ -1,17 +1,23 @@
 package com.sooka.sponest.mobile.comprehensive.comprehensiveconflictdefuseController;
 
 import com.ruoyi.common.core.constant.HttpStatus;
+import com.ruoyi.common.core.domain.DictKeys;
 import com.ruoyi.common.core.web.controller.BaseController;
 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.comprehensiveOrganizationAndInstitution.domain.ComprehensiveRfhGridLeader;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.RemoteRfhGridLeaderService;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
+
+import static com.ruoyi.common.security.utils.DictUtils.getComprehensiveDictCacheToMap;
 
 /**
  * 网格长管理App
@@ -36,6 +42,17 @@ public class    AppGridLeaderController extends BaseController {
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = remoteRfhGridLeaderService.selectComprehensiveRfhGridLeaderList(pageNum, pageSize, comprehensiveRfhGridLeader.getUserName(), comprehensiveRfhGridLeader.getMemberName());
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            List<Map<String,Object>> rows = (List<Map<String, Object>>) tableDataInfo.getRows();
+            Map<String,Object> map = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别
+            Map<String,Object> map1 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族
+            Map<String,Object> map2 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌
+            Map<String,Object> map3 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历
+            for (Map<String, Object> row : rows) {
+                row.put("genderLabel",map.get(MapUtils.getString(row,"gender")));
+                row.put("nationLabel",map1.get(MapUtils.getString(row,"nation")));
+                row.put("politicalOutlookLabel",map2.get(MapUtils.getString(row,"politicalOutlook")));
+                row.put("educationLabel",map3.get(MapUtils.getString(row,"education")));
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
@@ -44,7 +61,21 @@ public class    AppGridLeaderController extends BaseController {
 
     @GetMapping("/leader/listAll")
     public AjaxResult listAll(ComprehensiveRfhGridLeader comprehensiveRfhGridLeader) {
-      return remoteRfhGridLeaderService.listAll();
+        AjaxResult ajaxResult = remoteRfhGridLeaderService.listAll();
+        if ("200".equals(ajaxResult.get("code").toString())){
+            Map<String,Object> map = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别
+            Map<String,Object> map1 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族
+            Map<String,Object> map2 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌
+            Map<String,Object> map3 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历
+            List<Map<String, Object>> data = (List<Map<String, Object>>) ajaxResult.get("data");
+            for (Map<String, Object> row : data) {
+                row.put("genderLabel",map.get(MapUtils.getString(row,"gender")));
+                row.put("nationLabel",map1.get(MapUtils.getString(row,"nation")));
+                row.put("politicalOutlookLabel",map2.get(MapUtils.getString(row,"politicalOutlook")));
+                row.put("educationLabel",map3.get(MapUtils.getString(row,"education")));
+            }
+        }
+        return ajaxResult;
     }
 
     /**
@@ -52,7 +83,15 @@ public class    AppGridLeaderController extends BaseController {
      */
     @GetMapping("/leader/edit")
     public AjaxResult getInfo(String id) {
-        return remoteRfhGridLeaderService.selectComprehensiveRfhGridLeaderById(id);
+        AjaxResult ajaxResult = remoteRfhGridLeaderService.selectComprehensiveRfhGridLeaderById(id);
+        if ("200".equals(ajaxResult.get("code").toString())){
+            Map<String, Object> data = (Map<String, Object>) ajaxResult.get("data");
+            data.put("genderLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_SEX, MapUtils.getString(data,"gender")));
+            data.put("nationLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_NATION, MapUtils.getString(data,"nation")));
+            data.put("politicalOutlookLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_POLITICAL_STATUS, MapUtils.getString(data,"politicalOutlook")));
+            data.put("educationLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND, MapUtils.getString(data,"education")));
+        }
+        return ajaxResult;
     }
 
     /**