|
@@ -1,15 +1,21 @@
|
|
|
package com.sky.ioc.service.carbon.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.sky.ioc.entity.Indeicator;
|
|
|
+import com.sky.ioc.entity.Label;
|
|
|
import com.sky.ioc.entity.params.IocDateParam;
|
|
|
import com.sky.ioc.service.carbon.CarbonService;
|
|
|
+import com.sky.ioc.tool.GeneralMethod;
|
|
|
import com.sky.ioc.tool.ReturnMsg;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.security.PublicKey;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
|
|
/**
|
|
|
* TODO 双碳
|
|
@@ -248,4 +254,142 @@ public class CarbonServiceImpl implements CarbonService {
|
|
|
indeicator.setList(objects);
|
|
|
return ReturnMsg.ok(indeicator);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getPhotovoltaicPower() {
|
|
|
+ String[] param = {"realTime"};
|
|
|
+ String[] labelKey = {"8:00-10:00","10:00-12:00","12:00-14:00","14:00-16:00","16:00-18:00"};
|
|
|
+ List<Label> labels = GeneralMethod.getInstance().dataGeneration(param, labelKey);
|
|
|
+ return ReturnMsg.ok(labels);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ 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);
|
|
|
+
|
|
|
+ objects.get(1).put("value",50);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getAnalyseWaterCoreIndicators(IocDateParam iocDateParam) {
|
|
|
+ Indeicator indeicator = new Indeicator();
|
|
|
+ List<JSONObject> objects = indeicator.getList();
|
|
|
+ objects.get(0).put("value",98);
|
|
|
+ objects.get(0).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(1).put("value",50);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getAnalysePowerCoreIndicators(IocDateParam iocDateParam) {
|
|
|
+ Indeicator indeicator = new Indeicator();
|
|
|
+ List<JSONObject> objects = indeicator.getList();
|
|
|
+ objects.get(0).put("value",98);
|
|
|
+ objects.get(0).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(1).put("value",30);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getAnalyseHotCoreIndicators(IocDateParam iocDateParam) {
|
|
|
+ Indeicator indeicator = new Indeicator();
|
|
|
+ List<JSONObject> objects = indeicator.getList();
|
|
|
+ objects.get(0).put("value",98);
|
|
|
+ objects.get(0).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(1).put("value",50);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getAnalyseColdCoreIndicators(IocDateParam iocDateParam) {
|
|
|
+ Indeicator indeicator = new Indeicator();
|
|
|
+ List<JSONObject> objects = indeicator.getList();
|
|
|
+ objects.get(0).put("value",98);
|
|
|
+ objects.get(0).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(1).put("value",50);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getAnalyseCpvCoreIndicators(IocDateParam iocDateParam) {
|
|
|
+ Indeicator indeicator = new Indeicator();
|
|
|
+ List<JSONObject> objects = indeicator.getList();
|
|
|
+ objects.get(0).put("value",98);
|
|
|
+ objects.get(0).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(1).put("value",50);
|
|
|
+ objects.get(1).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(2).put("value",100);
|
|
|
+ objects.get(2).put("compare",0.4);
|
|
|
+
|
|
|
+ objects.get(3).put("value",1000);
|
|
|
+ objects.get(3).put("compare",0.4);
|
|
|
+ indeicator.setWorthAttention("人均成本过高,请购买智能源服务");
|
|
|
+ indeicator.setList(objects);
|
|
|
+ return ReturnMsg.ok(indeicator);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getPhotovoltaicProfit() {
|
|
|
+ ThreadLocalRandom current = ThreadLocalRandom.current();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("amountSubsidy",current.nextInt(50,150));
|
|
|
+ jsonObject.put("",current.nextInt(50,150));
|
|
|
+ return ReturnMsg.ok(jsonObject);
|
|
|
+ }
|
|
|
}
|