|
@@ -7,6 +7,7 @@ import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.runeconomy.config.GyeeConfig;
|
|
import com.gyee.runeconomy.config.GyeeConfig;
|
|
|
import com.gyee.runeconomy.controller.agc.AgcDeviateConfig;
|
|
import com.gyee.runeconomy.controller.agc.AgcDeviateConfig;
|
|
|
import com.gyee.runeconomy.controller.agc.FileService;
|
|
import com.gyee.runeconomy.controller.agc.FileService;
|
|
|
|
|
+import com.gyee.runeconomy.model.ProBasicOriginalCode;
|
|
|
import com.gyee.runeconomy.model.TemperatureComponentInfo;
|
|
import com.gyee.runeconomy.model.TemperatureComponentInfo;
|
|
|
import com.gyee.runeconomy.model.TemperatureInfo;
|
|
import com.gyee.runeconomy.model.TemperatureInfo;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
@@ -94,6 +95,9 @@ public class CacheContext implements CommandLineRunner {
|
|
|
@Resource
|
|
@Resource
|
|
|
GyeeConfig config;
|
|
GyeeConfig config;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IProBasicOriginalCodeService proBasicOriginalCodeService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 温度矩阵信息
|
|
* 温度矩阵信息
|
|
|
*/
|
|
*/
|
|
@@ -196,6 +200,10 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
private final List<String> order = Arrays.asList("风机信息", "主轴", "发电机", "齿轮箱", "变桨", "液压", "其他");
|
|
private final List<String> order = Arrays.asList("风机信息", "主轴", "发电机", "齿轮箱", "变桨", "液压", "其他");
|
|
|
|
|
|
|
|
|
|
+ public static Map<String, List<ProBasicOriginalCode>> oriMap = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ public static List<ProBasicOriginalCode> oriLists = new ArrayList<>();
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
public void run(String... args) throws Exception {
|
|
|
logger.info("缓存开始------------------------------------------------------------");
|
|
logger.info("缓存开始------------------------------------------------------------");
|
|
@@ -690,6 +698,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
cacheNewPoints();
|
|
cacheNewPoints();
|
|
|
cacheAGC();
|
|
cacheAGC();
|
|
|
initTemperatureInfo();
|
|
initTemperatureInfo();
|
|
|
|
|
+ initOriginalCode();
|
|
|
|
|
|
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
|
}
|
|
}
|
|
@@ -767,7 +776,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
int index2 = order.indexOf(info2.getName());
|
|
int index2 = order.indexOf(info2.getName());
|
|
|
return Integer.compare(index1, index2);
|
|
return Integer.compare(index1, index2);
|
|
|
};
|
|
};
|
|
|
- temperatureComponentInfos.sort(comparator);
|
|
|
|
|
|
|
+ temperatureComponentInfos.sort(comparator);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -783,4 +792,26 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void initOriginalCode() {
|
|
|
|
|
+ List<ProBasicOriginalCode> orils = proBasicOriginalCodeService.list();
|
|
|
|
|
+ oriLists.addAll(orils);
|
|
|
|
|
+ // 按 getRank 排序后,再按 getWindturbineId 分组
|
|
|
|
|
+ oriMap = orils.stream()
|
|
|
|
|
+ .sorted(Comparator.comparing(ProBasicOriginalCode::getRank))
|
|
|
|
|
+ .collect(Collectors.toMap(
|
|
|
|
|
+ item -> String.valueOf(item.getWindturbineId()),
|
|
|
|
|
+ item -> {
|
|
|
|
|
+ List<ProBasicOriginalCode> list = new ArrayList<>();
|
|
|
|
|
+ list.add(item);
|
|
|
|
|
+ return list;
|
|
|
|
|
+ },
|
|
|
|
|
+ (existing, replacement) -> {
|
|
|
|
|
+ existing.addAll(replacement);
|
|
|
|
|
+ return existing;
|
|
|
|
|
+ },
|
|
|
|
|
+ TreeMap::new
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|