|
@@ -6,17 +6,14 @@ import com.alibaba.fastjson.TypeReference;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.model.fitting.ProBasicOrganizeEquipment;
|
|
|
-import com.gyee.runeconomy.model.fitting.ProEconInPowerCurveFitting;
|
|
|
import com.gyee.runeconomy.service.auto.*;
|
|
|
import com.gyee.runeconomy.service.fitting.IProBasicOrganizeEquipmentService;
|
|
|
-import com.gyee.runeconomy.service.fitting.IProEconInPowerCurveFittingService;
|
|
|
import com.gyee.runeconomy.service.fitting.ProBasicOrganizeEquipmentServiceImpl;
|
|
|
import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
|
|
|
import com.gyee.runeconomy.util.redis.RedisService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
-import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -31,7 +28,6 @@ import java.util.stream.Collectors;
|
|
|
* @Description : 缓存
|
|
|
*/
|
|
|
@Component
|
|
|
-@Order(1)
|
|
|
public class CacheContext implements CommandLineRunner {
|
|
|
Logger logger = LoggerFactory.getLogger(CacheContext.class);
|
|
|
|
|
@@ -92,8 +88,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
|
|
|
@Resource
|
|
|
private IProEconWtPowerCurveFittingService wtPowerCurveFittingService;
|
|
|
- @Resource
|
|
|
- private IProEconInPowerCurveFittingService inPowerCurveFittingService;
|
|
|
|
|
|
public static List<ProBasicBranch> bnls = new ArrayList<>();
|
|
|
// public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
@@ -184,7 +178,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String, ProBasicOrganizeTree> proBasicOrganizeTreesMap;
|
|
|
public static List<ProBasicOrganizeEquipment> organizeEquipmentList;//把树形展开的设备列表
|
|
|
public static List<ProEconWtPowerCurveFitting> wtPowerCurveFittingList;
|
|
|
- public static List<ProEconInPowerCurveFitting> inPowerCurveFittingList;
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
@@ -195,7 +188,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
organizeEquipmentList = proBasicOrganizeEquipmentService.list().stream().filter(pboe -> pboe.getIsAble() == 1).collect(Collectors.toList());
|
|
|
wtPowerCurveFittingList = wtPowerCurveFittingService.list();
|
|
|
- inPowerCurveFittingList = inPowerCurveFittingService.list();
|
|
|
|
|
|
//List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
|
|
|
//Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
|
|
@@ -203,7 +195,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
bnls = proBasicBranchService.list();
|
|
|
//List<String> bnlids = bnls.stream().map(bnl -> bnl.getId()).collect(Collectors.toList());
|
|
|
//Map<String, Object> objectMap = redisService.batchGetKeys(bnlids);
|
|
|
- /*bnls.stream().forEach(bn -> {
|
|
|
+ bnls.stream().forEach(bn -> {
|
|
|
String bnString = redisService.get(bn.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(bnString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
@@ -216,7 +208,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
bns.add(bn);
|
|
|
wtbnmap.put(bn.getInteverId(), bns);
|
|
|
}
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
equipmentmodels = proEconEquipmentmodelService.list();
|
|
|
equipmentmodels.stream().forEach(e -> {
|
|
@@ -403,7 +395,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
wtmap.put(wt.getId(), wt);
|
|
|
//标杆风机初始化
|
|
|
wtstandardmap.put(wt.getId(), wt.getId());
|
|
|
- /*String wtString = redisService.get(wt.getId());
|
|
|
+ String wtString = redisService.get(wt.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
|
wtpAimap.put(wt.getId(), stringWindturbinetestingpointnewMap);
|
|
@@ -461,7 +453,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
Map<String, ProBasicOrganizeTree> map = new HashMap<>();
|
|
|
map.put(wt.getId(), wt);
|
|
|
cmwtmap.put(wt.getOrgType().contains("ZGS"), map);
|
|
|
- }*/
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
|
|
@@ -502,7 +494,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
//期次场站树形
|
|
|
pjls = proBasicOrganizeTrees.stream().filter(i -> i.getOrgType().contains("EG")).collect(Collectors.toList());
|
|
|
|
|
|
- /*pjls.stream().forEach(p -> {
|
|
|
+ pjls.stream().forEach(p -> {
|
|
|
pjmap.put(p.getId(), p);
|
|
|
if (wppromap.containsKey(p.getOrgType().contains("STA"))) {
|
|
|
wppromap.get(p.getOrgType().contains("STA")).add(p);
|
|
@@ -516,23 +508,23 @@ public class CacheContext implements CommandLineRunner {
|
|
|
});
|
|
|
propointmap.put(p.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
|
subwpls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("SBS")).collect(Collectors.toList());
|
|
|
- /*subwpls.stream().forEach(sub->{
|
|
|
+ subwpls.stream().forEach(sub->{
|
|
|
|
|
|
String subString = redisService.get(sub.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
subwppointmap.put(sub.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
|
|
|
weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
- /*weawpls.stream().forEach(weather -> {
|
|
|
+ weawpls.stream().forEach(weather -> {
|
|
|
|
|
|
String subString = redisService.get(weather.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
@@ -540,13 +532,13 @@ public class CacheContext implements CommandLineRunner {
|
|
|
weatherwppointmap.put(weather.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
|
//树形线路
|
|
|
lnls = proBasicOrganizeTrees.stream().filter(i -> StringUtils.isNotNull(pjmap.get(i.getParentCode()))).collect(Collectors.toList());
|
|
|
- /*lnls.stream().forEach(l -> {
|
|
|
+ lnls.stream().forEach(l -> {
|
|
|
lnmap.put(l.getId(), l);
|
|
|
if (prolinemap.containsKey(l.getOrgType().contains("EG"))) {
|
|
|
prolinemap.get(l.getOrgType().contains("EG")).add(l);
|
|
@@ -559,7 +551,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
linepointmap.put(l.getId(), stringWindpowerstationpointnewMap);
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
|
|
|
for (ProBasicOrganizeTree wp : wpls) {
|
|
@@ -576,14 +568,14 @@ public class CacheContext implements CommandLineRunner {
|
|
|
meterpointMap.put(meterpoint.getId(), meterpoint);
|
|
|
});
|
|
|
|
|
|
- /*wpls.stream().forEach(wp->{
|
|
|
+ wpls.stream().forEach(wp->{
|
|
|
|
|
|
wpmap.put(wp.getId(), wp);
|
|
|
String wpString = redisService.get(wp.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
wppointmap.put(wp.getId(), stringMapMap);
|
|
|
- });*/
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
@@ -626,4 +618,4 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
|
}
|
|
|
-}
|
|
|
+}
|