吕宣芝 1 рік тому
батько
коміт
04fe6d3fab

+ 20 - 1
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/APPComprehensiveManagementCenterController.java

@@ -1,17 +1,21 @@
 package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutionController;
 
 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.ComprehensiveManagementCenter;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.ComprehensiveManagementCenterService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author zhaozhan
@@ -36,6 +40,13 @@ public class APPComprehensiveManagementCenterController extends BaseController {
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = comprehensiveManagementCenterService.list(pageNum, pageSize, comprehensiveManagementCenter.getCenterName(), comprehensiveManagementCenter.getPrincipalName(), comprehensiveManagementCenter.getLevel());
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> comprehensiveDictCacheToMap = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
+            Map<String, Object> levelsCacheToMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_LEVELS);// levels
+            for (Object row : tableDataInfo.getRows()) {
+                HashMap r = (HashMap) row;
+                r.put("placeLabel", comprehensiveDictCacheToMap.get(r.get("place").toString()));//所在地 2260
+                r.put("levelLabel", levelsCacheToMap.get(r.get("level").toString()));//levels
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
@@ -49,7 +60,15 @@ public class APPComprehensiveManagementCenterController extends BaseController {
      */
     @GetMapping("/ComprehensiveManagementCenter/edit")
     public AjaxResult edit(String id) {
-        return comprehensiveManagementCenterService.edit(id);
+        AjaxResult info = comprehensiveManagementCenterService.edit(id);
+        if ("200".equals(info.get("code").toString())){
+            Map<String, Object> comprehensiveDictCacheToMap = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
+            Map<String, Object> levelsCacheToMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_LEVELS);// levels
+            Map<String, Object> data = (Map<String, Object>) info.get("data");
+            data.put("placeLabel", comprehensiveDictCacheToMap.get(data.get("place").toString()));//所在地 2260
+            data.put("levelLabel", levelsCacheToMap.get(data.get("level").toString()));//levels
+        }
+        return info;
     }
 
     /**

+ 20 - 1
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/APPComprehensiveTGrossCaseController.java

@@ -1,16 +1,20 @@
 package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutionController;
 
 import com.ruoyi.common.core.constant.HttpStatus;
+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.comprehensiveOrganizationAndInstitution.domain.ComprehensiveTGrossCase;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.ComprehensiveTGrossCaseService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author zhaozhan
@@ -32,6 +36,13 @@ public class APPComprehensiveTGrossCaseController {
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = comprehensiveTGrossCaseService.list(pageNum, pageSize, comprehensiveTGrossCase.getEventName());
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> cacheGrading = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CASES_GRADING);// 案(事)件分级
+            Map<String, Object> cacheType = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CASES_TYPE);// 案(事)件类型
+            for (Object row : tableDataInfo.getRows()) {
+                HashMap r = (HashMap) row;
+                r.put("eventLevelLabel", cacheGrading.get(r.get("eventLevel").toString()));
+                r.put("eventTypeLabel", cacheType.get(r.get("eventType").toString()));
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
@@ -42,7 +53,15 @@ public class APPComprehensiveTGrossCaseController {
      */
     @GetMapping(value = "/grossCase/edit")
     public AjaxResult getInfo(String id) {
-        return comprehensiveTGrossCaseService.getInfo(id);
+        AjaxResult info = comprehensiveTGrossCaseService.getInfo(id);
+        if ("200".equals(info.get("code").toString())){
+            Map<String, Object> cacheGrading = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CASES_GRADING);// 案(事)件分级
+            Map<String, Object> cacheType = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CASES_TYPE);// 案(事)件类型
+            Map<String, Object> data = (Map<String, Object>) info.get("data");
+            data.put("eventLevelLabel", cacheGrading.get(data.get("eventLevel").toString()));
+            data.put("eventTypeLabel", cacheType.get(data.get("eventType").toString()));
+        }
+        return AjaxResult.success(info);
     }
     /**
      * 新增重特大案(事)件

+ 3 - 3
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/AppBuildingLeaderController.java

@@ -40,11 +40,11 @@ public class AppBuildingLeaderController extends BaseController {
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = remoteBuildingLeaderService.selectComprehensiveBuildingLeaderList(pageNum, pageSize,comprehensivebuildingleader.getUserName());
-        Map<String, Object> maps = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);
-        Map<String, Object> maps1 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);
-        Map<String, Object> maps2 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
         List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) tableDataInfo.getRows();
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> maps = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);
+            Map<String, Object> maps1 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);
+            Map<String, Object> maps2 = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
             if (!rows.isEmpty()) {
                 for (HashMap<String, Object> row : rows) {
                     row.put("politicalOutlookLabel", maps.get(row.get("politicalOutlook")));