Parcourir la source

智能看板增加图表统计接口

ZhangManMan il y a 2 ans
Parent
commit
ffddfd8bd3

+ 0 - 2
src/main/java/com/sky/ioc/controller/carbon/PrintController.java

@@ -51,8 +51,6 @@ public class PrintController {
     }
 
 
-
-
     @ApiOperation("文印排放排名")
     @PostMapping("/getPrintInfoOrder")
     public ReturnMsg getPrintInfoOrder(@RequestBody IocParam iocParam){

+ 5 - 1
src/main/java/com/sky/ioc/controller/dashboard/AssetController.java

@@ -45,7 +45,11 @@ public class AssetController {
         return assetsService.getAssetLife();
     }
 
-
+    @ApiOperation("查询智能看板资产画像的图表")
+    @PostMapping("getAssetNumber")
+    public ReturnMsg  getAssetNumber(){
+        return assetsService.getAssetNumber();
+    }
 
 
 }

+ 2 - 0
src/main/java/com/sky/ioc/service/assets/AssetService.java

@@ -27,4 +27,6 @@ public interface AssetService {
     ReturnMsg getAssetCoreIndicators();
 
     ReturnMsg getAssetAge(IocParam iocParam);
+
+    ReturnMsg getAssetNumber();
 }

+ 25 - 4
src/main/java/com/sky/ioc/service/assets/impl/AssetServiceImpl.java

@@ -279,16 +279,16 @@ public class AssetServiceImpl implements AssetService {
         DecimalFormat decimalFormat = new DecimalFormat("#.0");
         compare = Float.parseFloat(decimalFormat.format(compare));
 
-        objects.get(0).put("value",9800);
+        objects.get(0).put("value",1200);
         objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",145000);
+        objects.get(1).put("value",12000);
         objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",79.8);
+        objects.get(2).put("value",120);
         objects.get(2).put("compare",compare);
 
-        objects.get(3).put("value",5);
+        objects.get(3).put("value",120);
         objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("内容");
         indeicator.setList(objects);
@@ -305,4 +305,25 @@ public class AssetServiceImpl implements AssetService {
         List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
         return ReturnMsg.ok(labels1);
     }
+
+    @Override
+    public ReturnMsg getAssetNumber() {
+        String[] param = {"固定资产一级分类","平均使用时间"};
+        String[] labKey = {"办公类","局房类","个人办公类","类别3"};
+       // ThreadLocalRandom random = ThreadLocalRandom.current();
+        List<Label> list = new ArrayList<>();
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        for (int i = 0; i < labKey.length; i++) {
+            Label label = new Label();
+            JSONObject jsonObject = new JSONObject();
+            int i1 = random.nextInt(2, 10);
+            jsonObject.put(param[1],i1);
+            int i0 = random.nextInt(30, 150);
+            jsonObject.put(param[0],i0);
+            label.setJsonObject(jsonObject);
+            label.setLabel(labKey[i]);
+            list.add(label);
+        }
+        return ReturnMsg.ok(list);
+    }
 }