소스 검색

修改手机端重点区域查询接口(带分页,筛选)

Wang-Xiao-Ran 1 년 전
부모
커밋
796b7f88c0

+ 18 - 14
src/main/java/com/sooka/sponest/mobile/appbigdata/controller/AppBigDataController.java

@@ -5,6 +5,7 @@ import com.ruoyi.common.core.constant.HttpStatus;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.security.utils.DictUtils;
 import com.ruoyi.system.api.domain.SysMenuEventType;
 import com.sooka.sponest.mobile.aop.NoRepeatSubmit;
 import com.sooka.sponest.mobile.appbigdata.domain.bo.ImportBo;
@@ -430,20 +431,23 @@ public class AppBigDataController extends VisuBaseService {
     @ApiOperation(value = "获取重点区域(分页,筛选)", notes = "获取重点区域(分页,筛选)")
     @GetMapping("getImportAreaListByParams")
     public AjaxResult getImportAreaListByParams(ImportBo bo) {
-        return remoteDataBaseService.getImportAreaListByParams(bo.getAreaName(), bo.getProjectType(), bo.getProjectLevel(), bo.getPageNum(), bo.getPageSize());
-//        for (int i = 0; i < ajax.size(); i++) {
-//            Map map = ajax.get(i);
-//            List<Map> areaList = (List) map.get("areaList");
-//            for (int j = 0; j < areaList.size(); j++) {
-//                Map area = areaList.get(j);
-//                String photoId = area.containsKey(PHOTO_ID) && null != area.get(PHOTO_ID) ? area.get(PHOTO_ID).toString().replaceAll("172.18.1.32:8081", "218.27.3.115:9301") : "";
-//                photoId = photoId.replaceAll("10.6.52.32:8081", "218.27.3.115:9301");
-//                area.put(PHOTO_ID, photoId);
-//                areaList.set(j, area);
-//            }
-//            ajax.set(i, map);
-//        }
-//         AjaxResult.success(ajax);
+        TableDataInfo importAreaListByParams = remoteDataBaseService.getImportAreaListByParams(bo.getAreaName(), bo.getProjectType(), bo.getProjectLevel(), bo.getPageNum(), bo.getPageSize());
+        if (HttpStatus.SUCCESS == importAreaListByParams.getCode()) {
+            List<HashMap<String, Object>> list = (List<HashMap<String, Object>>) importAreaListByParams.getRows();
+            Map<String, Object> areaType = DictUtils.getDictCacheToMap("area_type");
+            Map<String, Object> projectLevel = DictUtils.getDictCacheToMap("centerdata_project_level");
+            for (HashMap<String, Object> area : list) {
+                String photoId = area.containsKey(PHOTO_ID) && null != area.get(PHOTO_ID) ? area.get(PHOTO_ID).toString().replaceAll("172.18.1.32:8081", "218.27.3.115:9301") : "";
+                photoId = photoId.replaceAll("10.6.52.32:8081", "218.27.3.115:9301");
+                area.put(PHOTO_ID, photoId);
+
+                area.put("projectTypeLabel", areaType.get(area.get("projectType")));
+                area.put("projectLevelLabel", projectLevel.get(area.get("projectLevel")));
+            }
+            return AjaxResult.success(list);
+        }else{
+            return AjaxResult.error(importAreaListByParams.getCode(), importAreaListByParams.getMsg());
+        }
     }
 
     /**

+ 2 - 2
src/main/java/com/sooka/sponest/mobile/remoteapi/RemoteDataBaseService.java

@@ -790,7 +790,7 @@ public interface RemoteDataBaseService {
     @GetMapping("/fireControlView/getRYList")
     R<Map<String,Object>> getRyListToFireControlView(@RequestParam("deptId")Long deptId);//查询消防人员类型
 
-    @GetMapping("/commandCenter/getImportAreaListByParams")
-    AjaxResult getImportAreaListByParams(@RequestParam("areaName") String areaName, @RequestParam("projectType")String projectType, @RequestParam("projectLevel")String projectLevel,@RequestParam("pageNum")Integer pageNum, @RequestParam("pageSize")Integer pageSize);
+    @GetMapping("/commandCenter/getImportAreaListOne")
+    TableDataInfo getImportAreaListByParams(@RequestParam("params%5BareaName%5D") String areaName, @RequestParam("params%5BprojectType%5D") String projectType, @RequestParam("params%5BprojectLevel%5D") String projectLevel,@RequestParam("pageNum")Integer pageNum, @RequestParam("pageSize")Integer pageSize);
 }