|
@@ -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);
|
|
|
}
|
|
|
}
|