Bladeren bron

智能看板统计画像数据

ZhangManMan 2 jaren geleden
bovenliggende
commit
8879cdd8fe

+ 8 - 8
src/main/java/com/sky/ioc/service/canteen/impl/RestaurantServiceImpl.java

@@ -328,7 +328,7 @@ public class RestaurantServiceImpl implements RestaurantService {
     public ReturnMsg getRestaurantConsumption(IocParam iocParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        double thirdPay = 0d;
+       /* double thirdPay = 0d;
         ThreadLocalRandom random = ThreadLocalRandom.current();
         Double totalPrice = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,null);
         totalPrice = totalPrice == null ? 0 : totalPrice;
@@ -342,17 +342,17 @@ public class RestaurantServiceImpl implements RestaurantService {
             }
         }
         DecimalFormat decimalFormat = new DecimalFormat("#.0");
-        totalPrice = Double.parseDouble(decimalFormat.format(totalPrice));
-        double compare = random.nextDouble(-1, 1);
-        compare = Double.parseDouble(decimalFormat.format(compare));
-        objects.get(0).put("value",totalPrice);
+        totalPrice = Double.parseDouble(decimalFormat.format(totalPrice));*/
+        double compare = 0.5;
+        //compare = Double.parseDouble(decimalFormat.format(compare));
+        objects.get(0).put("value",16278.5);
         objects.get(0).put("compare",compare);
-        objects.get(1).put("value",totalOrder);
+        objects.get(1).put("value",1182);
         objects.get(1).put("compare",compare);
-        objects.get(2).put("value",avgPrice);
+        objects.get(2).put("value",13.8);
         objects.get(2).put("compare",compare);
 
-        objects.get(3).put("value",thirdPay);
+        objects.get(3).put("value",41.81);
         indeicator.setWorthAttention("餐厅今⽇运⾏状态良好");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

+ 66 - 32
src/main/java/com/sky/ioc/service/energy/impl/EnergyServiceImpl.java

@@ -28,25 +28,25 @@ public class EnergyServiceImpl implements EnergyService {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
         ThreadLocalRandom random = ThreadLocalRandom.current();
-        int todayElec = random.nextInt(8000, 11000);//今日用电
+       /* int todayElec = random.nextInt(8000, 11000);//今日用电
         int personElec = random.nextInt(120,250);//人均
         int top = random.nextInt(0,20);//同比上升
-        int totalElec = random.nextInt(100000, 300000);
-        float compare = (float) Math.random();
-        DecimalFormat decimalFormat = new DecimalFormat("#.0");
-        compare = Float.parseFloat(decimalFormat.format(compare));
+        int totalElec = random.nextInt(100000, 300000);*/
+        float compare = 0.6f;
+     /*   DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));*/
 
-        objects.get(0).put("value",totalElec);
+        objects.get(0).put("value",257116.3);
         objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",todayElec);
+        objects.get(1).put("value",13532.4);
         objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",top);
+        objects.get(2).put("value",-5.1);
 
-        objects.get(3).put("value",personElec);
+        objects.get(3).put("value",240.1);
         objects.get(3).put("compare",compare);
-        indeicator.setWorthAttention("⼈均⽤电量过⾼,建议合理搭配智慧场景调整⽤电策略");
+        indeicator.setWorthAttention("⼈均⽤电量过⾼");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
     }
@@ -57,7 +57,18 @@ public class EnergyServiceImpl implements EnergyService {
         //String[] labKey = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};
         List<String> lists = DateUtil.getBetweenDays("2023/03/01", "2023/03/31");
         String[] labKey = lists.toArray(new String[0]);
-        List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
+        List<Label> labels1 = new ArrayList<>();
+        //GeneralMethod.getInstance().dataGeneration(param, labKey);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        for (int i = 0; i < labKey.length; i++) {
+            Label label = new Label();
+            JSONObject jsonObject = new JSONObject();
+            int i1 = random.nextInt(8000, 9000);
+            jsonObject.put(param[0],i1);
+            label.setJsonObject(jsonObject);
+            label.setLabel(labKey[i]);
+            labels1.add(label);
+        }
         return ReturnMsg.ok(labels1);
     }
 
@@ -77,22 +88,22 @@ public class EnergyServiceImpl implements EnergyService {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
         ThreadLocalRandom random = ThreadLocalRandom.current();
-        int todayWater = random.nextInt(25, 300);//今日
+        /*int todayWater = random.nextInt(25, 300);//今日
         int personWater = random.nextInt(10,50);//人均
         int top = random.nextInt(0,100);//同比上升
-        int totalWater = random.nextInt(500, 3000);
-        float compare = (float) Math.random();
-        DecimalFormat decimalFormat = new DecimalFormat("#.0");
-        compare = Float.parseFloat(decimalFormat.format(compare));
-        objects.get(0).put("value",totalWater);
+        int totalWater = random.nextInt(500, 3000);*/
+        float compare = 0.3f;
+      /*  DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));*/
+        objects.get(0).put("value",376.9);
         objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",todayWater);
+        objects.get(1).put("value",19.8);
         objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",top);
+        objects.get(2).put("value",-3.5);
 
-        objects.get(3).put("value",personWater);
+        objects.get(3).put("value",1.2);
         objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("建议合理搭配智慧场景调整⽤⽔策略");
         indeicator.setList(objects);
@@ -105,7 +116,18 @@ public class EnergyServiceImpl implements EnergyService {
       /*  String[] labKey = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};*/
         List<String> lists = DateUtil.getBetweenDays("2023/03/01", "2023/03/31");
         String[] labKey = lists.toArray(new String[0]);
-        List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
+        List<Label> labels1 = new ArrayList<>();
+        //GeneralMethod.getInstance().dataGeneration(param, labKey);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        for (int i = 0; i < labKey.length; i++) {
+            Label label = new Label();
+            JSONObject jsonObject = new JSONObject();
+            int i1 = random.nextInt(10, 15);
+            jsonObject.put(param[0],i1);
+            label.setJsonObject(jsonObject);
+            label.setLabel(labKey[i]);
+            labels1.add(label);
+        }
         return ReturnMsg.ok(labels1);
     }
 
@@ -158,21 +180,21 @@ public class EnergyServiceImpl implements EnergyService {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
         ThreadLocalRandom random = ThreadLocalRandom.current();
-        int percentHeat = random.nextInt(10, 100);
+        /*int percentHeat = random.nextInt(10, 100);
         int personHeat = random.nextInt(10,50);
         int top = random.nextInt(0,100);//同比上升
-        int totalHeat = random.nextInt(500, 3000);
-        float compare = (float) Math.random();
-        DecimalFormat decimalFormat = new DecimalFormat("#.0");
-        compare = Float.parseFloat(decimalFormat.format(compare));
-        objects.get(0).put("value",totalHeat);
+        int totalHeat = random.nextInt(500, 3000);*/
+        float compare = 0.6f;
+        /*DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));*/
+        objects.get(0).put("value",243.8);
         objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",top);
+        objects.get(1).put("value",-1.2);
 
-        objects.get(2).put("value",10);
+        objects.get(2).put("value","微量");
 
-        objects.get(3).put("value",personHeat);
+        objects.get(3).put("value","微量");
         objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("建议合理搭配智慧场景调整⽤热策略");
         indeicator.setList(objects);
@@ -182,10 +204,22 @@ public class EnergyServiceImpl implements EnergyService {
     @Override
     public ReturnMsg getUseHeatInfoList() {
         String[] param = {"heatConsumption","temperature"};
-      /*  String[] labKey = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};*/
         List<String> lists = DateUtil.getBetweenDays("2023/03/01", "2023/03/31");
         String[] labKey = lists.toArray(new String[0]);
-        List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
+        List<Label> labels1 = new ArrayList<>();
+                //GeneralMethod.getInstance().dataGeneration(param, labKey);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        for (int i = 0; i < labKey.length; i++) {
+            Label label = new Label();
+            JSONObject jsonObject = new JSONObject();
+            int i1 = random.nextInt(0, 10);
+            int i2 = random.nextInt(5, 30);
+            jsonObject.put(param[0],i1);
+            jsonObject.put(param[1],i2);
+            label.setJsonObject(jsonObject);
+            label.setLabel(labKey[i]);
+            labels1.add(label);
+        }
         return ReturnMsg.ok(labels1);
     }
 }

+ 9 - 8
src/main/java/com/sky/ioc/service/personnel/impl/PersonnelServiceImpl.java

@@ -31,27 +31,28 @@ public class PersonnelServiceImpl implements PersonnelService {
         List<JSONObject> objects = indeicator.getList();
         ThreadLocalRandom random = ThreadLocalRandom.current();
         DecimalFormat decimalFormat = new DecimalFormat("#.0");
-        int enterCount = random.nextInt(1600, 2300);
+       /* int enterCount = random.nextInt(1600, 2300);
         int outCount = random.nextInt(500, 800);
         int enterBeforeNineCount = random.nextInt(800, 1500);
         while (enterBeforeNineCount>enterCount){
             enterBeforeNineCount = random.nextInt(800, 1500);
         }
         int inCount = enterCount-outCount;
-        double compare = random.nextDouble(-1, 1);
+        */
+        double compare = 0.5;
         compare = Double.parseDouble(decimalFormat.format(compare));
-        objects.get(0).put("value",enterCount);
+        objects.get(0).put("value",1949);
         objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",outCount);
+        objects.get(1).put("value",680);
         objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",enterBeforeNineCount);
+        objects.get(2).put("value",1034);
         objects.get(2).put("compare",compare);
 
-        objects.get(3).put("value",inCount);
+        objects.get(3).put("value",1269);
         objects.get(3).put("compare",compare);
-        indeicator.setWorthAttention("明⽇⼈流⾼峰在9:00/17:00,记得提前做好应对喔");
+        indeicator.setWorthAttention("明⽇⼈流⾼峰在9:00/17:00");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
     }
@@ -67,7 +68,7 @@ public class PersonnelServiceImpl implements PersonnelService {
         for (int i = 0; i < labKey.length; i++) {
             Label label = new Label();
             JSONObject jsonObject = new JSONObject();
-            int ownEmployees = random.nextInt(50, 150);
+            int ownEmployees = random.nextInt(500, 900);
             int outsourcingStaff = random.nextInt(0, ownEmployees);
             int visitors = random.nextInt(0, 50);
             jsonObject.put(param[0],ownEmployees);