瀏覽代碼

接口调整,物业服务近6个月报修

yangbq 3 月之前
父節點
當前提交
17463f7e58

+ 17 - 2
project-common/src/main/java/com/project/common/utils/StringUtils.java

@@ -3,11 +3,9 @@ package com.project.common.utils;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
-import com.alibaba.fastjson2.TypeReference;
 import com.project.common.constant.Constants;
 import com.project.common.core.text.StrFormatter;
 import org.springframework.util.AntPathMatcher;
-import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -723,6 +721,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
         return list;
     }
 
+
+    public static Map<String, Object> getListToMap(String jsonStr) {
+        // 将JSON字符串转换为JSONArray
+        Map<String, Object> jsonMap = JSON.parseObject(jsonStr, Map.class);
+
+        // 将JSONArray转换为List<Map<String, Object>>
+       /* List<Map<String, Object>> list = new ArrayList<>();
+
+        for (String key : jsonMap.keySet()) {
+            Map<String, Object> map = Maps.newHashMap();
+            map.put(key, jsonMap.get(key));
+            list.add(map);
+        }*/
+
+        return jsonMap;
+    }
+
     /**
      * 根据两个值计算百分比
      * @param value 当前值

+ 1 - 1
project-framework/src/main/java/com/project/framework/config/SecurityConfig.java

@@ -123,7 +123,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
 //                // 获取授权登录Url
 //                .antMatchers("/au/weiXinMp/getLoginUrl").anonymous()
 //                // 授权登录回调地址
-//                .antMatchers("/au/weiXinMp/callback").anonymous()
+                .antMatchers("/large/**").anonymous()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                 .antMatchers("/login", "/register", "/captchaImage").anonymous()
                 // 静态资源,可匿名访问

+ 15 - 15
project-zcustom/src/main/java/com/project/zcustom/domain/post/PlatPostStationChart.java

@@ -49,71 +49,71 @@ public class PlatPostStationChart extends CustomBaseEntity {
     /**
      * 消防
      */
-    @Excel(name = "消防")
-    @ApiModelProperty("消防")
+    @Excel(name = "办公家具")
+    @ApiModelProperty("办公家具")
     private Long colNum;
 
     /**
      * 电梯
      */
-    @Excel(name = "电梯")
-    @ApiModelProperty("电梯")
+    @Excel(name = "空调")
+    @ApiModelProperty("空调")
     private Long elevatorNum;
 
     /**
      * 照明灯具
      */
     @Excel(name = "照明灯具")
-    @ApiModelProperty("照明灯具")
+    @ApiModelProperty("冷热水故障")
     private Long laNum;
 
     /**
      * 安防
      */
     @Excel(name = "安防")
-    @ApiModelProperty("安防")
+    @ApiModelProperty("门禁")
     private Long seNum;
 
     /**
      * 卫生间
      */
     @Excel(name = "卫生间")
-    @ApiModelProperty("卫生间")
+    @ApiModelProperty("其他报修故障")
     private Long toNum;
 
     /**
      * 公区
      */
     @Excel(name = "公区")
-    @ApiModelProperty("公区")
+    @ApiModelProperty("墙类/地类报修")
     private Long arNum;
 
     /**
      * 空调
      */
     @Excel(name = "空调")
-    @ApiModelProperty("空调")
+    @ApiModelProperty("电气故障报修")
     private Long diNum;
 
     /**
      * 其它维修
      */
-    @Excel(name = "其它维修")
-    @ApiModelProperty("其它维修")
+    @Excel(name = "电梯故障")
+    @ApiModelProperty("电梯故障")
     private Long otNum;
 
     /**
      * 会议保障
      */
-    @Excel(name = "会议保障")
-    @ApiModelProperty("会议保障")
+    @Excel(name = "消防设施设备故障")
+    @ApiModelProperty("消防设施设备故障")
     private Long meNum;
 
     /**
      * 办公室
      */
-    @Excel(name = "办公室")
-    @ApiModelProperty("办公室")
+    @Excel(name = "保洁服务")
+    @ApiModelProperty("保洁服务")
     private Long ofNum;
 
 }

+ 22 - 21
project-zcustom/src/main/java/com/project/zcustom/service/post/impl/PlatPostStationServiceImpl.java

@@ -234,6 +234,7 @@ public class PlatPostStationServiceImpl extends ServiceImpl<PlatPostStationMappe
 
     /**
      * 处理表格数据
+     * 物业服务 近六个月报修分类占比
      * @param appOrg
      * @param mapField
      */
@@ -243,32 +244,32 @@ public class PlatPostStationServiceImpl extends ServiceImpl<PlatPostStationMappe
         // 删除当前地区所有数据
         iPlatPostStationChartService.remove(chartQueryWrapper);
         List<PlatPostStationChart> chartList = new ArrayList<>();
-        List<Map<String, Object>> coList = StringUtils.getListMap(mapField.get("coList").toString());
-        List<Map<String, Object>> elevatorList = StringUtils.getListMap(mapField.get("ElevatorList").toString());
-        List<Map<String, Object>> laList = StringUtils.getListMap(mapField.get("laList").toString());
-        List<Map<String, Object>> seList = StringUtils.getListMap(mapField.get("seList").toString());
-        List<Map<String, Object>> toList = StringUtils.getListMap(mapField.get("toList").toString());
-        List<Map<String, Object>> arList = StringUtils.getListMap(mapField.get("arList").toString());
-        List<Map<String, Object>> diList = StringUtils.getListMap(mapField.get("diList").toString());
-        List<Map<String, Object>> otList = StringUtils.getListMap(mapField.get("otList").toString());
-        List<Map<String, Object>> meList = StringUtils.getListMap(mapField.get("meList").toString());
-        List<Map<String, Object>> ofList = StringUtils.getListMap(mapField.get("ofList").toString());
+        Map<String, Object> coList = StringUtils.getListToMap(mapField.get("coList").toString());
+        Map<String, Object> elevatorList = StringUtils.getListToMap(mapField.get("elevatorList").toString());
+        Map<String, Object> laList = StringUtils.getListToMap(mapField.get("laList").toString());
+        Map<String, Object> seList = StringUtils.getListToMap(mapField.get("seList").toString());
+        Map<String, Object> toList = StringUtils.getListToMap(mapField.get("toList").toString());
+        Map<String, Object> arList = StringUtils.getListToMap(mapField.get("arList").toString());
+        Map<String, Object> diList = StringUtils.getListToMap(mapField.get("diList").toString());
+        Map<String, Object> otList = StringUtils.getListToMap(mapField.get("otList").toString());
+        Map<String, Object> meList = StringUtils.getListToMap(mapField.get("meList").toString());
+        Map<String, Object> ofList = StringUtils.getListToMap(mapField.get("ofList").toString());
 //        List<String> prefixList = Arrays.asList("co","el","la","se","to","ar","di","ot","me","of");
-        List<String> keyAppendList = Arrays.asList("One","Two","Three","Four","Five","Six");
+        List<String> keyAppendList = Arrays.asList("one","two","three","four","five","six");
         for (int i = 0; i < keyAppendList.size();i++){
             PlatPostStationChart platPostStationChart = new PlatPostStationChart();
             platPostStationChart.setAppOrg(appOrg);
             platPostStationChart.setAppMonth((long) (i+1));
-            platPostStationChart.setColNum(Long.parseLong(coList.get(0).get("co" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setElevatorNum(Long.parseLong(elevatorList.get(0).get("el" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setLaNum(Long.parseLong(laList.get(0).get("la" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setSeNum(Long.parseLong(seList.get(0).get("se" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setToNum(Long.parseLong(toList.get(0).get("to" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setArNum(Long.parseLong(arList.get(0).get("ar" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setDiNum(Long.parseLong(diList.get(0).get("di" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setOtNum(Long.parseLong(otList.get(0).get("ot" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setMeNum(Long.parseLong(meList.get(0).get("me" +keyAppendList.get(i)).toString()));
-            platPostStationChart.setOfNum(Long.parseLong(ofList.get(0).get("of" +keyAppendList.get(i)).toString()));
+            platPostStationChart.setColNum(Long.parseLong(coList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setElevatorNum(Long.parseLong(elevatorList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setLaNum(Long.parseLong(laList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setSeNum(Long.parseLong(seList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setToNum(Long.parseLong(toList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setArNum(Long.parseLong(arList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setDiNum(Long.parseLong(diList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setOtNum(Long.parseLong(otList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setMeNum(Long.parseLong(meList.get(keyAppendList.get(i)).toString()));
+            platPostStationChart.setOfNum(Long.parseLong(ofList.get(keyAppendList.get(i)).toString()));
             chartList.add(platPostStationChart);
         }
         iPlatPostStationChartService.saveBatch(chartList);