Browse Source

Merge branch 'master' of http://124.70.43.205:3000/xieshengjie/sis

宁檬 1 year ago
parent
commit
f054731c65

+ 12 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/bmk/BenchmarkingController.java

@@ -505,4 +505,16 @@ public class BenchmarkingController {
         }
     }
 
+    @GetMapping(value = "/wtByWplistxin")
+    @ApiOperation(value = "风机列表", notes = "风机列表")
+    public R wtByWplistxin(@RequestParam(value = "wpids", required = true) String wpids)  {
+
+        List<ProBasicOrganizeEquipment> resultList = benchmarkingService.wtByWplistxin(wpids);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
 }

+ 13 - 4
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/Economic/EconomicService.java

@@ -11,6 +11,7 @@ import com.gyee.runeconomy.model.auto.ProBasicEquipmentPoint;
 import com.gyee.runeconomy.model.auto.ProBasicOrganizeTree;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
 import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay1;
+import com.gyee.runeconomy.model.fitting.ProBasicOrganizeEquipment;
 import com.gyee.runeconomy.service.auto.*;
 import com.gyee.runeconomy.util.DateUtils;
 import com.gyee.runeconomy.util.StringUtils;
@@ -350,7 +351,7 @@ public class EconomicService {
         Map<String, List<List<Glqx>>> resultMap = new HashMap<>();
 
 
-        List<ProBasicOrganizeTree> wtls = CacheContext.wtls;
+        List<ProBasicOrganizeEquipment> wtls = CacheContext.organizeEquipmentList;
         List<EconomicVo> wt = new ArrayList<>();
 
         List<List<Glqx>> tempList = new ArrayList<>();
@@ -360,13 +361,17 @@ public class EconomicService {
 
         Date beginDate = DateUtils.parseDate(starttime);
         Date endDate = DateUtils.parseDate(endtime);
+        Date current = com.gyee.common.util.DateUtils.getCurrentDate();
+        if(endDate.after(current)){
+            endDate = current;
+        }
 
         if (type.equals("-2")) {
 
-            for (ProBasicOrganizeTree wt1: wtls){
-                if (wpids.contains(wt1.getParentCode())){
+            for (ProBasicOrganizeEquipment wt1: wtls){
+                if (wpids.contains(wt1.getWindpowerstationId())){
                     EconomicVo vo1 = new EconomicVo();
-                    vo1.setId(wt1.getId());
+                    vo1.setId(wt1.getWindturbineId());
                     vo1.setName(wt1.getAname());
                     wt.add(vo1);
                 }
@@ -401,7 +406,11 @@ public class EconomicService {
                     temp1 = sjglls.get(i).getPointValueInDouble();
 
                         if (sjgl.getWindturbineId().contains(wt2.getId())){
+//                            Date date = new Date(sjglls.get(i).getPointTime());
+//                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                            String formattedDate = sdf.format(date);
                             vos.setTime(sjglls.get(i).getPointTime());
+//                            vos.setTime(formattedDate);
                             vos.setId(wt2.getId());
                             vos.setName(wt2.getName());
                             vos.setSjgl(StringUtils.round(temp1, 2));

+ 4 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -116,6 +116,10 @@ public class BenchmarkingService {
         return CacheContext.organizeEquipmentList.stream().filter(
                 oe -> wpids.contains(oe.getWindpowerstationId())&&(oe.getNemName().contains("逆变器") || oe.getNemName().contains("风机"))).collect(Collectors.toList());
     }
+    public List<ProBasicOrganizeEquipment> wtByWplistxin(String wpids) {
+        return CacheContext.organizeEquipmentList.stream().filter(
+                oe -> wpids.contains(oe.getWindpowerstationId())||(oe.getNemName().contains("风机"))).collect(Collectors.toList());
+    }
 
     public List<FjjxbVo> performance(String companyid, String getype, String sttype, String beginDate, String endDate, String wpids, String projectids, String lineids, String target, String sort) {
         List<FjjxbVo> resultList = new ArrayList<>();