Browse Source

综治中心字典值迁移到手机端

刘浩男 1 năm trước cách đây
mục cha
commit
e8d881d382

+ 12 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/APPComprehensiveTPreventionOrganizationController.java

@@ -1,18 +1,22 @@
 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.domain.R;
 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.ComprehensiveHousingEstate;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.domain.ComprehensiveTPreventionOrganization;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.ComprehensiveTPreventionOrganizationService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author zhaozhan
@@ -33,7 +37,15 @@ public class APPComprehensiveTPreventionOrganizationController {
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = comprehensiveTPreventionOrganizationService.list(pageNum, pageSize, comprehensiveTPreventionOrganization.getOrganizationName(), comprehensiveTPreventionOrganization.getOrganizationType(), comprehensiveTPreventionOrganization.getLevel(), comprehensiveTPreventionOrganization.getGuidanceDepartment(), comprehensiveTPreventionOrganization.getPersonnel(), comprehensiveTPreventionOrganization.getFunctions());
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) tableDataInfo.getRows();
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> comprehensiveOrganizationTypeLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_ORGANIZATION_TYPE);
+            Map<String, Object> comprehensiveLevelLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_LEVELS);
+            for (HashMap<String, Object> row:
+                 rows) {
+                row.put("OrganizationTypeLabel",comprehensiveOrganizationTypeLabel.get(row.get("OrganizationType").toString()));
+                row.put("LevelLabel",comprehensiveLevelLabel.get(row.get("Level").toString()));
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());

+ 15 - 0
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/APPComprehensiveTPreventionTeam.java

@@ -12,7 +12,9 @@ import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstituti
 import com.ruoyi.common.core.domain.DictKeys;
 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,7 +34,20 @@ public class APPComprehensiveTPreventionTeam {
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = comprehensiveTPreventionTeamService.list(pageNum, pageSize, comprehensiveTPreventionTeam.getName());
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) tableDataInfo.getRows();
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> comprehensiveGenderLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
+            Map<String, Object> comprehensiveNationLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);
+            Map<String, Object> comprehensivePoliticalOutlookLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);
+            Map<String, Object> comprehensiveCodeLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CERTIFICATE_CODE);
+            Map<String, Object> comprehensiveEducationLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);
+            for (HashMap<String ,Object> row:rows) {
+                row.put("GenderLabel",comprehensiveGenderLabel.get(row.get("Gender").toString()));
+                row.put("NationLabel",comprehensiveNationLabel.get(row.get("Nation").toString()));
+                row.put("PoliticalOutlookLabel",comprehensivePoliticalOutlookLabel.get(row.get("PoliticalOutlook").toString()));
+                row.put("EducationLabel",comprehensiveEducationLabel.get(row.get("Education").toString()));
+                row.put("CodeLabel",comprehensiveCodeLabel.get(row.get("Code").toString()));
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());

+ 35 - 1
src/main/java/com/sooka/sponest/mobile/comprehensive/organizationAndInstitutionController/AppTeamController.java

@@ -1,17 +1,22 @@
 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.ComprehensiveTeam;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.RemoteTeamService;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 综治队伍
@@ -35,7 +40,24 @@ public class AppTeamController extends BaseController {
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
         TableDataInfo tableDataInfo = remoteTeamService.selectComprehensiveTeamList(pageNum, pageSize,comprehensiveTeam.getName(),comprehensiveTeam.getInstitutionId(),comprehensiveTeam.getIdentityNumber() );
+        List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) tableDataInfo.getRows();
         if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
+            Map<String, Object> comprehensiveGenderLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
+            Map<String, Object> comprehensiveNationLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);
+            Map<String, Object> comprehensivePoliticalOutlookLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);
+            Map<String, Object> comprehensiveLevelLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_PERSONNEL_LEVEL);
+            Map<String, Object> comprehensiveDutiesLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_PERSONNEL_JOB);
+            Map<String, Object> comprehensiveEducationLabel = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);
+            for (HashMap<String, Object> row:
+                    rows ) {
+                row.put("GenderLabel",comprehensiveGenderLabel.get(row.get("Gender").toString()));
+                row.put("NationLabel",comprehensiveNationLabel.get(row.get("Nation").toString()));
+                row.put("PoliticalOutlookLabel",comprehensivePoliticalOutlookLabel.get(row.get("PoliticalOutlook").toString()));
+                row.put("LevelLabel",comprehensiveLevelLabel.get(row.get("Level").toString()));
+                row.put("DutiesLabel",comprehensiveDutiesLabel.get(row.get("Duties").toString()));
+                row.put("EducationLabel",comprehensiveEducationLabel.get(row.get("Education").toString()));
+
+            }
             return AjaxResult.success(tableDataInfo.getRows());
         }else{
             return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
@@ -47,7 +69,19 @@ public class AppTeamController extends BaseController {
      */
     @GetMapping("/comprehensiveTeam/edit")
     public AjaxResult getInfo(String id) {
-        return remoteTeamService.selectComprehensiveTeamById(id);
+        AjaxResult ajaxResult = remoteTeamService.selectComprehensiveTeamById(id);
+        if("200".equals(String.valueOf(ajaxResult.get("code")))){
+            HashMap<String,Object> comprehensiveTeam = (HashMap<String, Object>) ajaxResult.get("data");
+            comprehensiveTeam.put("GenderLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_SEX, MapUtils.getString(comprehensiveTeam,"Gender")));
+            comprehensiveTeam.put("NationLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_NATION, MapUtils.getString(comprehensiveTeam,"Nation")));
+            comprehensiveTeam.put("PoliticalOutlookLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_POLITICAL_STATUS, MapUtils.getString(comprehensiveTeam,"PoliticalOutlook")));
+            comprehensiveTeam.put("LevelLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_PERSONNEL_LEVEL, MapUtils.getString(comprehensiveTeam,"Level")));
+            comprehensiveTeam.put("DutiesLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_PERSONNEL_JOB,MapUtils.getString(comprehensiveTeam,"Duties")));
+            comprehensiveTeam.put("EducationLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND,MapUtils.getString(comprehensiveTeam,"Education")));
+            return AjaxResult.success(comprehensiveTeam);
+        }else{
+            return AjaxResult.error(ajaxResult.get("code").toString(), ajaxResult.get("msg"));
+        }
     }
 
     /**

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

@@ -1,12 +1,14 @@
 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.domain.R;
 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.ComprehensiveVideoNetworking;
 import com.sooka.sponest.comprehensive.api.comprehensiveOrganizationAndInstitution.service.RemoteVideoNetworkingService;
 import org.springframework.web.bind.annotation.*;
@@ -49,9 +51,14 @@ public class AppVideoNetworkingController extends BaseController {
     @GetMapping("/videoNetworking/edit")
     public AjaxResult getInfo(String id) {
         R<ComprehensiveVideoNetworking> edit = remoteVideoNetworkingService.selectComprehensiveVideoNetworkingById(id);
-        ComprehensiveVideoNetworking data = edit.getData();
-
-        return AjaxResult.success(data);
+        if(HttpStatus.SUCCESS == edit.getCode()){
+            ComprehensiveVideoNetworking data = edit.getData();
+            data.setLevelLabel(DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_LEVELS,data.getLevel()));
+            data.setMannedLabel("1".equals(data.getManned()) ? "是" : "否");
+            return AjaxResult.success(data);
+        }else{
+            return AjaxResult.error(edit.getCode(), edit.getMsg());
+        }
     }
 
     /**