Browse Source

修改功率曲线

wangchangsheng 2 years ago
parent
commit
a131339caf

+ 2 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/performance/PerformanceCurvefittingController.java

@@ -32,12 +32,12 @@ public class PerformanceCurvefittingController {
     @GetMapping("/curvefitting")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
-    public R curvefitting(@RequestParam(value = "windpowerstationIds", required = true) String windpowerstationIds,
+    public R curvefitting(@RequestParam(value = "windturbineIds", required = true) String windturbineIds,
                           //单风机0,多风机1
                           @RequestParam(value = "type", required = true) String type,
                           @RequestParam(value = "dateType", required = true) String dateType
     ) {
-        Map<String, List<CurveVo>> curvefitting = performanceCurvefittingService.curvefitting(windpowerstationIds, type, dateType);
+        Map<String, List<CurveVo>> curvefitting = performanceCurvefittingService.curvefitting(windturbineIds, type, dateType);
 
         if (null != curvefitting) {
             return R.data(ResultMsg.ok(curvefitting));

+ 10 - 10
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/PerformanceCurvefittingService.java

@@ -37,33 +37,33 @@ public class PerformanceCurvefittingService {
     private IProEconWtCurveFittingYearService proEconWtCurveFittingYearService;
 
 
-    public Map<String, List<CurveVo>> curvefitting(String windpowerstationIds, String type,String dateType) {
+    public Map<String, List<CurveVo>> curvefitting(String windturbineIds, String type,String dateType) {
         Map<String, List<CurveVo>> resultMap = new HashMap<>();
         Map<String, ProBasicEquipment> wtmap = CacheContext.wtmap;
 
         String zbzgl = redisService.get("ZLLGL");
         Map<String, Map<Double, ZllglDTO>>  zbzglMap = JSONObject.parseObject(zbzgl, new TypeReference<Map<String, Map<Double, ZllglDTO>>>() {
         });
-        Map<String,Map<Double,Double>> znhglMap = getWtCurveFitting(windpowerstationIds,dateType);
+        Map<String,Map<Double,Double>> znhglMap = getWtCurveFitting(windturbineIds,dateType);
         if (type.equals("0")){
             List<CurveVo> tempList = new ArrayList<>();
-            if (znhglMap.containsKey(windpowerstationIds)){
-                Map<Double, Double> zsglmap = znhglMap.get(windpowerstationIds);
-                Map<Double, ZllglDTO> bzglmap = zbzglMap.get(wtmap.get(windpowerstationIds).getModelId());
+            if (znhglMap.containsKey(windturbineIds)){
+                Map<Double, Double> zsglmap = znhglMap.get(windturbineIds);
+                Map<Double, ZllglDTO> bzglmap = zbzglMap.get(wtmap.get(windturbineIds).getModelId());
                 Set<Double> speeds = zsglmap.keySet();
                 speeds.stream().forEach(speed->{
                     CurveVo vo = new CurveVo();
-                    vo.setWtid(windpowerstationIds);
+                    vo.setWtid(windturbineIds);
                     vo.setSpeed(speed);
                     vo.setTheorypower(DoubleUtils.keepPrecision(zsglmap.get(speed),2));
                     vo.setEnsurepower(DoubleUtils.keepPrecision(bzglmap.containsKey(speed)?bzglmap.get(speed).getEnsurePower():zsglmap.get(speed),2));
                     tempList.add(vo);
                 });
                 SortUtils.sort(tempList,"speed",SortUtils.ASC);
-                resultMap.put(windpowerstationIds,tempList);
+                resultMap.put(windturbineIds,tempList);
             }
         }else {
-            String[] wts = windpowerstationIds.split(",");
+            String[] wts = windturbineIds.split(",");
             Arrays.stream(wts).forEach(wt->{
                 List<CurveVo> tempList = new ArrayList<>();
                 if(znhglMap.get(wt) == null || znhglMap.size() == 0)
@@ -91,9 +91,9 @@ public class PerformanceCurvefittingService {
      *
      * @return
      */
-    private Map<String, Map<Double, Double>> getWtCurveFitting(String powerstationIds, String dateType) {
+    private Map<String, Map<Double, Double>> getWtCurveFitting(String windturbineIds, String dateType) {
 
-        String[] wts = powerstationIds.split(",");
+        String[] wts = windturbineIds.split(",");
         Map<String, Map<Double, Double>> zzsglMap = new HashMap<>();
         String strdate = DateUtils.toDate1(new Date());
         Date date = DateUtils.parseDate(strdate);