Parcourir la source

核心指标接口修改

ZhangManMan il y a 2 ans
Parent
commit
eec4083ecb

+ 13 - 2
src/main/java/com/sky/ioc/service/Parking/impl/ParkingServiceImpl.java

@@ -32,7 +32,7 @@ public class ParkingServiceImpl implements ParkingService {
     public ReturnMsg getCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+        /*ThreadLocalRandom random = ThreadLocalRandom.current();
         int totalParking = random.nextInt(1000, 3000);
         int dayParking = random.nextInt(1000,3000);
         while (dayParking>totalParking){
@@ -53,7 +53,18 @@ public class ParkingServiceImpl implements ParkingService {
         objects.get(2).put("compare",-compare);
 
         objects.get(3).put("value",unParking);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+        objects.get(0).put("value",2000);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",180);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",20);
+        objects.get(2).put("compare",-0.4);
+
+        objects.get(3).put("value",40);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("建议增加停车位180个");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

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

@@ -10,6 +10,7 @@ import com.sky.ioc.tool.GeneralMethod;
 import com.sky.ioc.tool.ReturnMsg;
 import org.springframework.stereotype.Service;
 
+import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -58,11 +59,19 @@ public class AssetServiceImpl implements AssetService {
     public ReturnMsg getOperAssetCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",1.3);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        double totalAsset = random.nextDouble(1,10);
+        totalAsset = Double.parseDouble(decimalFormat.format(totalAsset));
+        int assetCount = random.nextInt(100, 1000);
+        float compare = (float) Math.random();
+        compare = Float.parseFloat(decimalFormat.format(compare));
+
+        objects.get(0).put("value",totalAsset);
+        objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",5000);
-        objects.get(1).put("compare",0.4);
+        objects.get(1).put("value",assetCount);
+        objects.get(1).put("compare",compare);
 
         objects.get(2).put("value","项目1");
         objects.get(2).put("compare",60);
@@ -113,6 +122,9 @@ public class AssetServiceImpl implements AssetService {
         int totalyear = random.nextInt(1,10);
         int totalAsset = 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",yearAsset);
         objects.get(0).put("compare",compare);
 

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

@@ -51,7 +51,7 @@ public class RestaurantServiceImpl implements RestaurantService {
     public ReturnMsg getCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+       /* ThreadLocalRandom random = ThreadLocalRandom.current();
         int totalPerson = random.nextInt(100, 3000);
         int dayPerson = random.nextInt(150,500);
         while (dayPerson>totalPerson){
@@ -72,7 +72,19 @@ public class RestaurantServiceImpl implements RestaurantService {
         objects.get(2).put("compare",-compare);
 
         objects.get(3).put("value",price);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+
+        objects.get(0).put("value",400);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",2000);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",18);
+        objects.get(2).put("compare",-0.4);
+
+        objects.get(3).put("value",18);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("员工偏爱川菜,建议增加");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

+ 129 - 45
src/main/java/com/sky/ioc/service/carbon/impl/CarbonServiceImpl.java

@@ -48,7 +48,7 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getPrintingCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+        /*ThreadLocalRandom random = ThreadLocalRandom.current();
         int personCost = random.nextInt(10, 100);
         int personPaper = random.nextInt(10,20);
         int personC = random.nextInt(15,100);
@@ -66,7 +66,18 @@ public class CarbonServiceImpl implements CarbonService {
         objects.get(2).put("compare",compare);
 
         objects.get(3).put("value",personNum);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+        objects.get(0).put("value",10);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",80);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",80);
+        objects.get(2).put("compare",0.4);
+
+        objects.get(3).put("value",80);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("今日人流高峰在9:00/17:00,记得提前做好应对喔");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -92,7 +103,7 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getBusCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+       /* ThreadLocalRandom random = ThreadLocalRandom.current();
         int carCost = random.nextInt(10000, 1000000);
         int carTimes = random.nextInt(10,80);
         int carC = random.nextInt(150,500);
@@ -110,7 +121,18 @@ public class CarbonServiceImpl implements CarbonService {
         objects.get(2).put("compare",compare);
 
         objects.get(3).put("value",carHours);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+        objects.get(0).put("value",100);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",80);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",80);
+        objects.get(2).put("compare",0.4);
+
+        objects.get(3).put("value",80);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("增加20个公车数量");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -136,19 +158,35 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getFloorCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",60);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        int stockCarbon = random.nextInt(10, 100);
+        int totalCarbon = random.nextInt(100,8000);
+        int areaCarbon = random.nextInt(10,800);
+        int personCarbon = random.nextInt(10,80);
+        while (areaCarbon>totalCarbon){
+            areaCarbon = random.nextInt(10,800);
+        }
+        while (personCarbon>totalCarbon){
+            personCarbon = random.nextInt(10,80);
+        }
+        int derCarbon = random.nextInt(10,80);
+        float compare = (float) Math.random();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));
 
-        objects.get(1).put("value",500);
-        objects.get(1).put("compare",0.4);
+        objects.get(0).put("value",stockCarbon);
 
-        objects.get(2).put("value",380);
-        objects.get(2).put("compare",0.4);
+        objects.get(1).put("value",totalCarbon);
+        objects.get(1).put("compare",compare);
 
-        objects.get(3).put("value",80);
-        objects.get(3).put("compare",0.4);
+        objects.get(2).put("value",areaCarbon);
+        objects.get(2).put("compare",compare);
+
+        objects.get(3).put("value",personCarbon);
+        objects.get(3).put("compare",compare);
         objects.add(new JSONObject());
-        objects.get(4).put("value",40);
-        objects.get(4).put("compare",0.4);
+        objects.get(4).put("value",derCarbon);
+        objects.get(4).put("compare",compare);
 
         indeicator.setWorthAttention("减少2辆车出行一周");
         indeicator.setList(objects);
@@ -195,17 +233,29 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getVehicleCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",60);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        int totalDistance = random.nextInt(50, 200);
+        int avgDistance = random.nextInt(5,100);
+        int avgHours = random.nextInt(1,10);
+        int avgCarbon = random.nextInt(50,500);
+        while (avgDistance>totalDistance){
+            avgDistance = random.nextInt(5,100);
+        }
+        float compare = (float) Math.random();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));
 
-        objects.get(1).put("value",50);
-        objects.get(1).put("compare",0.4);
+        objects.get(0).put("value",totalDistance);
+        objects.get(0).put("compare",compare);
 
-        objects.get(2).put("value",5);
-        objects.get(2).put("compare",0.4);
+        objects.get(1).put("value",avgDistance);
+        objects.get(1).put("compare",compare);
 
-        objects.get(3).put("value",80);
-        objects.get(3).put("compare",0.4);
+        objects.get(2).put("value",avgHours);
+        objects.get(2).put("compare",compare);
+
+        objects.get(3).put("value",avgCarbon);
+        objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("减少2辆车出行一周");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -231,17 +281,31 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getPrintCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",60);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        int totalPrint = random.nextInt(100, 1000);
+        int avgPrint = random.nextInt(50,500);
+        int avgPaper = random.nextInt(1,200);
+        int avgCartridge = random.nextInt(10,100);
+        while (avgCartridge>avgPaper){
+            avgCartridge = random.nextInt(10,100);
+        }
+        while (avgPrint>totalPrint){
+            avgPrint = random.nextInt(50,500);
+        }
+        float compare = (float) Math.random();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));
+        objects.get(0).put("value",totalPrint);
+        objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",50);
-        objects.get(1).put("compare",0.4);
+        objects.get(1).put("value",avgPrint);
+        objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",500);
-        objects.get(2).put("compare",0.4);
+        objects.get(2).put("value",avgPaper);
+        objects.get(2).put("compare",compare);
 
-        objects.get(3).put("value",80);
-        objects.get(3).put("compare",0.4);
+        objects.get(3).put("value",avgCartridge);
+        objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("限制人均每天打印100张以内");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -283,17 +347,26 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getPhotovoltaicCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",60);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        int reduPhotovoltaic = random.nextInt(1000, 10000);
+        int elecPhotovoltaic = random.nextInt(500,5000);
+        int savePhotovoltaic = random.nextInt(500,5000);
+        int subPhotovoltaic = random.nextInt(100,1000);
 
-        objects.get(1).put("value",50);
-        objects.get(1).put("compare",0.4);
+        float compare = (float) Math.random();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        compare = Float.parseFloat(decimalFormat.format(compare));
+        objects.get(0).put("value",reduPhotovoltaic);
+        objects.get(0).put("compare",compare);
 
-        objects.get(2).put("value",500);
-        objects.get(2).put("compare",0.4);
+        objects.get(1).put("value",elecPhotovoltaic);
+        objects.get(1).put("compare",compare);
 
-        objects.get(3).put("value",80);
-        objects.get(3).put("compare",0.4);
+        objects.get(2).put("value",savePhotovoltaic);
+        objects.get(2).put("compare",compare);
+
+        objects.get(3).put("value",subPhotovoltaic);
+        objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("建议扩大光伏发电面积");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -312,17 +385,28 @@ public class CarbonServiceImpl implements CarbonService {
     public ReturnMsg getAnalyseCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",98);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        int totalKwh = random.nextInt(10, 100);
+        int totalM = random.nextInt(10, 100);
+        int costCount = random.nextInt(1000, 5000);
+        int costAvg = random.nextInt(300, 1000);
+        while (costAvg>costCount){
+            costAvg = random.nextInt(300, 1000);
+        }
+        float compare = (float) Math.random();
+        compare = Float.parseFloat(decimalFormat.format(compare));
+        objects.get(0).put("value",totalKwh);
+        objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",50);
-        objects.get(1).put("compare",0.4);
+        objects.get(1).put("value",totalM);
+        objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",100);
-        objects.get(2).put("compare",0.4);
+        objects.get(2).put("value",costCount);
+        objects.get(2).put("compare",compare);
 
-        objects.get(3).put("value",1000);
-        objects.get(3).put("compare",0.4);
+        objects.get(3).put("value",costAvg);
+        objects.get(3).put("compare",compare);
         indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

+ 11 - 2
src/main/java/com/sky/ioc/service/fitness/impl/HealthServiceImpl.java

@@ -29,7 +29,7 @@ public class HealthServiceImpl implements HealthService {
     public ReturnMsg getCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+       /* ThreadLocalRandom random = ThreadLocalRandom.current();
         int totalPerson = random.nextInt(100, 300);
         int healthPerson = random.nextInt(50,260);
         while (healthPerson>totalPerson){
@@ -47,7 +47,16 @@ public class HealthServiceImpl implements HealthService {
 
         objects.get(2).put("value",unHealthPerson);
         objects.get(2).put("compare",-compare);
-        objects.get(3).put("value","腰椎问题");
+        objects.get(3).put("value","腰椎问题");*/
+        objects.get(0).put("value",100);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",20);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",21);
+        objects.get(2).put("compare",-0.4);
+        objects.get(3).put("value","高血压");
         indeicator.setWorthAttention("员工腰椎问题持续上升");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

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

@@ -9,6 +9,7 @@ import com.sky.ioc.tool.GeneralMethod;
 import com.sky.ioc.tool.ReturnMsg;
 import org.springframework.stereotype.Service;
 
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.ThreadLocalRandom;
@@ -84,17 +85,21 @@ public class PersonnelServiceImpl implements PersonnelService {
         while (arrivedCount>orderCount){
             arrivedCount = random.nextInt(1000, 3000);
         }
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        float compare = (float) Math.random();
+        compare = Float.parseFloat(decimalFormat.format(compare));
+
         objects.get(0).put("value",enterCount);
-        objects.get(0).put("compare",0.4);
+        objects.get(0).put("compare",compare);
 
         objects.get(1).put("value",inCount);
-        objects.get(1).put("compare",0.4);
+        objects.get(1).put("compare",compare);
 
         objects.get(2).put("value",orderCount);
-        objects.get(2).put("compare",0.4);
+        objects.get(2).put("compare",compare);
 
         objects.get(3).put("value",arrivedCount);
-        objects.get(3).put("compare",-0.4);
+        objects.get(3).put("compare",-compare);
         indeicator.setWorthAttention("防控疫情,缩减访客预约");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);

+ 23 - 8
src/main/java/com/sky/ioc/service/security/impl/SecurityServiceImpl.java

@@ -11,8 +11,10 @@ import com.sky.ioc.tool.GeneralMethod;
 import com.sky.ioc.tool.ReturnMsg;
 import org.springframework.stereotype.Service;
 
+import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ThreadLocalRandom;
 
 /**
  * TODO
@@ -29,18 +31,31 @@ public class SecurityServiceImpl implements SecurityService {
     public ReturnMsg getLinkageCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",1000);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        int totalThings = random.nextInt(100, 2000);
+        int urgencyThings = random.nextInt(10, 100);
+        int doneThings = random.nextInt(100, 2000);
+        while (urgencyThings>totalThings){
+            urgencyThings = random.nextInt(10, 100);
+        }
+        while (doneThings>totalThings){
+            doneThings = random.nextInt(100, 2000);
+        }
+        float compare = (float) Math.random();
+        compare = Float.parseFloat(decimalFormat.format(compare));
+        objects.get(0).put("value",totalThings);
+        objects.get(0).put("compare",compare);
 
-        objects.get(1).put("value",500);
-        objects.get(1).put("compare",0.4);
+        objects.get(1).put("value",urgencyThings);
+        objects.get(1).put("compare",compare);
 
-        objects.get(2).put("value",200);
-        objects.get(2).put("compare",0.4);
+        objects.get(2).put("value",doneThings);
+        objects.get(2).put("compare",compare);
 
         objects.get(3).put("value","设备离线");
-        objects.get(3).put("compare",0.4);
-        indeicator.setWorthAttention("防控疫情,缩减访客预约");
+        objects.get(3).put("compare",compare);
+        indeicator.setWorthAttention("稳定性有待增强");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
     }

+ 47 - 14
src/main/java/com/sky/ioc/service/space/impl/SpaceServiceImpl.java

@@ -45,7 +45,7 @@ public class SpaceServiceImpl implements SpaceService {
     public ReturnMsg getFloorCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+       /* ThreadLocalRandom random = ThreadLocalRandom.current();
         int totalSite = random.nextInt(100, 800);
         int total = random.nextInt(500,2000);
         while (totalSite>total){
@@ -71,7 +71,15 @@ public class SpaceServiceImpl implements SpaceService {
         objects.add(new JSONObject());
         objects.add(new JSONObject());
         objects.get(4).put("value",leader);
-        objects.get(5).put("value",other);
+        objects.get(5).put("value",other);*/
+        objects.get(0).put("value",90);
+        objects.get(1).put("value",500);
+        objects.get(2).put("value",380);
+        objects.get(3).put("value",80);
+        objects.add(new JSONObject());
+        objects.add(new JSONObject());
+        objects.get(4).put("value",40);
+        objects.get(5).put("value",20);
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
     }
@@ -90,7 +98,7 @@ public class SpaceServiceImpl implements SpaceService {
     public ReturnMsg getMeetingCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+        /*ThreadLocalRandom random = ThreadLocalRandom.current();
         int monthMeeting = random.nextInt(10, 100);
         int dayMeeting = random.nextInt(10,100);
         int dayPrice = random.nextInt(15,500);
@@ -108,7 +116,18 @@ public class SpaceServiceImpl implements SpaceService {
         objects.get(2).put("compare",compare);
 
         objects.get(3).put("value",personDayPrice);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+        objects.get(0).put("value",95);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",80);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",80);
+        objects.get(2).put("compare",0.4);
+
+        objects.get(3).put("value",8);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("增加会议室");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);
@@ -140,20 +159,34 @@ public class SpaceServiceImpl implements SpaceService {
     public ReturnMsg getSpaceCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        objects.get(0).put("value",98);
-        objects.get(0).put("compare",0.4);
+        ThreadLocalRandom random = ThreadLocalRandom.current();
+        DecimalFormat decimalFormat = new DecimalFormat("#.0");
+        int siteUsed = random.nextInt(10, 100);
+        int meettingUsed = random.nextInt(10, 100);
+        int flowCount = random.nextInt(100, 500);
+        int fixedCount = random.nextInt(300, 1000);
+        int playCount = random.nextInt(100, 500);
+        int workCount = random.nextInt(300, 1000);
+        while (playCount>workCount){
+            playCount = random.nextInt(100, 500);
+        }
+        float compare = (float) Math.random();
+        compare = Float.parseFloat(decimalFormat.format(compare));
 
-        objects.get(1).put("value",50);
-        objects.get(1).put("compare",0.4);
+        objects.get(0).put("value",siteUsed);
+        objects.get(0).put("compare",compare);
 
-        objects.get(2).put("value",100);
-        objects.get(2).put("compare",0.4);
+        objects.get(1).put("value",meettingUsed);
+        objects.get(1).put("compare",compare);
 
-        objects.get(3).put("value",1000);
-        objects.get(3).put("compare",0.4);
+        objects.get(2).put("value",flowCount);
+        objects.get(2).put("compare",compare);
+
+        objects.get(3).put("value",fixedCount);
+        objects.get(3).put("compare",compare);
         objects.add(new JSONObject());
-        objects.get(4).put("value","40/100");
-        objects.get(4).put("compare",0.4);
+        objects.get(4).put("value",playCount+"/"+workCount);
+        objects.get(4).put("compare",compare);
 
         indeicator.setWorthAttention("会议室使用率过低,建议出租");
         indeicator.setList(objects);

+ 13 - 2
src/main/java/com/sky/ioc/service/supermarket/impl/SupermarketServiceImpl.java

@@ -29,7 +29,7 @@ public class SupermarketServiceImpl implements SupermarketService {
     public ReturnMsg getCoreIndicators(IocDateParam iocDateParam) {
         Indeicator indeicator = new Indeicator();
         List<JSONObject> objects = indeicator.getList();
-        ThreadLocalRandom random = ThreadLocalRandom.current();
+        /*ThreadLocalRandom random = ThreadLocalRandom.current();
         int orderCount = random.nextInt(100, 3000);
         int orderprice = random.nextInt(50,150);
         int price = random.nextInt(1,20);
@@ -54,7 +54,18 @@ public class SupermarketServiceImpl implements SupermarketService {
         objects.get(2).put("compare",-compare);
 
         objects.get(3).put("value",price);
-        objects.get(3).put("compare",compare);
+        objects.get(3).put("compare",compare);*/
+        objects.get(0).put("value",100);
+        objects.get(0).put("compare",0.4);
+
+        objects.get(1).put("value",2100);
+        objects.get(1).put("compare",0.4);
+
+        objects.get(2).put("value",21);
+        objects.get(2).put("compare",-0.4);
+
+        objects.get(3).put("value",1);
+        objects.get(3).put("compare",0.4);
         indeicator.setWorthAttention("本月盈利将达12万元");
         indeicator.setList(objects);
         return ReturnMsg.ok(indeicator);