浏览代码

山西电量模块-新增功能

chenminghua 2 年之前
父节点
当前提交
2a21a00c17

+ 9 - 6
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java

@@ -258,8 +258,9 @@ public class GhostController {
                          @RequestParam(value = "wtid",required = true)String wtid,
                          @RequestParam(value = "wtid",required = true)String wtid,
                          @RequestParam(value = "faulttype",required = true)String faulttype,
                          @RequestParam(value = "faulttype",required = true)String faulttype,
                          @RequestParam(value = "begin",required = true)Long begin,
                          @RequestParam(value = "begin",required = true)Long begin,
-                       @RequestParam(value = "end",required = true)Long end) throws Exception {
-        List<Faultrecord> resultList = ghostService.faultrecordlist(wpid,wtid,faulttype,begin,end);
+                         @RequestParam(value = "end",required = true)Long end,
+                         @RequestParam(value = "type",required = false) String type) throws Exception {
+        List<Faultrecord> resultList = ghostService.faultrecordlist(wpid,wtid,faulttype,begin,end, type);
         if (StringUtils.isNotNull(resultList)) {
         if (StringUtils.isNotNull(resultList)) {
             return R.ok((long) resultList.size()).data(resultList);
             return R.ok((long) resultList.size()).data(resultList);
         }else{
         }else{
@@ -323,8 +324,9 @@ public class GhostController {
     public R mainrecordlist(@RequestParam(value = "wpid",required = true)String wpid,
     public R mainrecordlist(@RequestParam(value = "wpid",required = true)String wpid,
                              @RequestParam(value = "wtid",required = true)String wtid,
                              @RequestParam(value = "wtid",required = true)String wtid,
                              @RequestParam(value = "begin",required = true)Long begin,
                              @RequestParam(value = "begin",required = true)Long begin,
-                             @RequestParam(value = "end",required = true)Long end) throws Exception {
-        List<Mainrecord> resultList = ghostService.mainrecordlist(wpid,wtid,begin,end);
+                             @RequestParam(value = "end",required = true)Long end,
+                             @RequestParam(value = "type",required = false) String type) throws Exception {
+        List<Mainrecord> resultList = ghostService.mainrecordlist(wpid,wtid,begin,end, type);
         if (StringUtils.isNotNull(resultList)) {
         if (StringUtils.isNotNull(resultList)) {
             return R.ok((long) resultList.size()).data(resultList);
             return R.ok((long) resultList.size()).data(resultList);
         }else{
         }else{
@@ -386,8 +388,9 @@ public class GhostController {
     @CrossOrigin(origins = "*", maxAge = 3600)
     @CrossOrigin(origins = "*", maxAge = 3600)
     public R involvedlist(@RequestParam(value = "wpid",required = true)String wpid,
     public R involvedlist(@RequestParam(value = "wpid",required = true)String wpid,
                             @RequestParam(value = "begin",required = true)Long begin,
                             @RequestParam(value = "begin",required = true)Long begin,
-                            @RequestParam(value = "end",required = true)Long end) throws Exception {
-        List<Involved> resultList = ghostService.involvedlist(wpid,begin,end);
+                            @RequestParam(value = "end",required = true)Long end,
+                            @RequestParam(value = "type",required = false) String type) throws Exception {
+        List<Involved> resultList = ghostService.involvedlist(wpid,begin,end, type);
         if (StringUtils.isNotNull(resultList)) {
         if (StringUtils.isNotNull(resultList)) {
             return R.ok((long) resultList.size()).data(resultList);
             return R.ok((long) resultList.size()).data(resultList);
         }else{
         }else{

+ 4 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Involved.java

@@ -47,5 +47,9 @@ public class Involved extends Model {
 
 
     private Double faultduration;
     private Double faultduration;
 
 
+    private Double impactcapacity;
+
+    private String type;
+
 
 
 }
 }

+ 17 - 3
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java

@@ -427,7 +427,7 @@ public class GhostService {
         return volist;
         return volist;
     }
     }
 
 
-    public List<Faultrecord> faultrecordlist(String wpid, String wtid, String faulttype, Long begin, Long end) {
+    public List<Faultrecord> faultrecordlist(String wpid, String wtid, String faulttype, Long begin, Long end, String type) {
         QueryWrapper<Faultrecord> qw = new QueryWrapper<>();
         QueryWrapper<Faultrecord> qw = new QueryWrapper<>();
 
 
         if (StringUtils.isNotEmpty(wpid)){
         if (StringUtils.isNotEmpty(wpid)){
@@ -439,6 +439,9 @@ public class GhostService {
         if (StringUtils.isNotEmpty(faulttype)){
         if (StringUtils.isNotEmpty(faulttype)){
             qw.eq("faulttype",faulttype);
             qw.eq("faulttype",faulttype);
         }
         }
+        if (StringUtils.isNotEmpty(type)){
+            qw.eq("type",type);
+        }
         qw.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         qw.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         List<Faultrecord> faultrecordList = faultrecordService.list(qw);
         List<Faultrecord> faultrecordList = faultrecordService.list(qw);
 
 
@@ -485,7 +488,7 @@ public class GhostService {
 
 
 
 
 
 
-    public List<Mainrecord> mainrecordlist(String wpid, String wtid,  Long begin, Long end) {
+    public List<Mainrecord> mainrecordlist(String wpid, String wtid,  Long begin, Long end, String type) {
         QueryWrapper<Mainrecord> qw = new QueryWrapper<>();
         QueryWrapper<Mainrecord> qw = new QueryWrapper<>();
 
 
         if (StringUtils.isNotEmpty(wpid)){
         if (StringUtils.isNotEmpty(wpid)){
@@ -494,6 +497,9 @@ public class GhostService {
         if (StringUtils.isNotEmpty(wtid)){
         if (StringUtils.isNotEmpty(wtid)){
             qw.eq("wtid",wtid);
             qw.eq("wtid",wtid);
         }
         }
+        if (StringUtils.isNotEmpty(type)){
+            qw.eq("type",type);
+        }
 
 
         qw.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         qw.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         List<Mainrecord> mainrecordList = mainrecordService.list(qw);
         List<Mainrecord> mainrecordList = mainrecordService.list(qw);
@@ -536,11 +542,14 @@ public class GhostService {
         return mainrecord;
         return mainrecord;
     }
     }
 
 
-    public List<Involved> involvedlist(String wpid, Long begin, Long end) {
+    public List<Involved> involvedlist(String wpid, Long begin, Long end, String type) {
         QueryWrapper<Involved> queryWrapper = new QueryWrapper<>();
         QueryWrapper<Involved> queryWrapper = new QueryWrapper<>();
         if (StringUtils.isNotEmpty(wpid)){
         if (StringUtils.isNotEmpty(wpid)){
             queryWrapper.eq("wpid",wpid);
             queryWrapper.eq("wpid",wpid);
         }
         }
+        if (StringUtils.isNotEmpty(type)){
+            queryWrapper.eq("type",type);
+        }
         queryWrapper.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         queryWrapper.ge("begindate",DateUtils.parseLongToDate(begin)).le("enddate",DateUtils.parseLongToDate(end));
         List<Involved> involvedList = involvedService.list(queryWrapper);
         List<Involved> involvedList = involvedService.list(queryWrapper);
         return involvedList;
         return involvedList;
@@ -560,6 +569,7 @@ public class GhostService {
         Long end = involvedVo.getEnd();
         Long end = involvedVo.getEnd();
         List<Line> lines = involvedVo.getLines();
         List<Line> lines = involvedVo.getLines();
         Double ssdl = involvedVo.getSsdl();
         Double ssdl = involvedVo.getSsdl();
+        Double yxrl = involvedVo.getYxrl();
         String type = involvedVo.getType();
         String type = involvedVo.getType();
         List<Involved> resultList = new ArrayList<>();
         List<Involved> resultList = new ArrayList<>();
         double zcapacity = lines.stream().mapToDouble(line -> lineMap.get(line.getId()).getCapacity()).sum();
         double zcapacity = lines.stream().mapToDouble(line -> lineMap.get(line.getId()).getCapacity()).sum();
@@ -576,8 +586,10 @@ public class GhostService {
             involved.setEnddate(DateUtils.parseLongToDate(end));
             involved.setEnddate(DateUtils.parseLongToDate(end));
             involved.setFaulttype(type);
             involved.setFaulttype(type);
             involved.setPowerloss(ssdl*(lineMap.get(line.getId()).getCapacity()/zcapacity));
             involved.setPowerloss(ssdl*(lineMap.get(line.getId()).getCapacity()/zcapacity));
+            involved.setImpactcapacity(yxrl*(lineMap.get(line.getId()).getCapacity()/zcapacity));
             double hours = DateUtils.hoursDiff2(DateUtils.parseLongToDate(begin), DateUtils.parseLongToDate(end));
             double hours = DateUtils.hoursDiff2(DateUtils.parseLongToDate(begin), DateUtils.parseLongToDate(end));
             involved.setFaultduration(hours);
             involved.setFaultduration(hours);
+            involved.setType(involvedVo.getNwb());  //内报、外报
             resultList.add(involved);
             resultList.add(involved);
         });
         });
         boolean b = involvedService.saveBatch(resultList);
         boolean b = involvedService.saveBatch(resultList);
@@ -589,6 +601,8 @@ public class GhostService {
         involved.setEnddate(involved.getEnddate());
         involved.setEnddate(involved.getEnddate());
         involved.setFaulttype(involved.getFaulttype());
         involved.setFaulttype(involved.getFaulttype());
         involved.setPowerloss(involved.getPowerloss());
         involved.setPowerloss(involved.getPowerloss());
+        involved.setImpactcapacity(involved.getImpactcapacity());
+        involved.setType(involved.getType());
         double hours = DateUtils.hoursDiff2(involved.getBegindate(), involved.getEnddate());
         double hours = DateUtils.hoursDiff2(involved.getBegindate(), involved.getEnddate());
         involved.setFaultduration(hours);
         involved.setFaultduration(hours);
         boolean b = involvedService.saveOrUpdate(involved);
         boolean b = involvedService.saveOrUpdate(involved);

+ 2 - 1
web/gdsx-ghost/src/main/java/com/gyee/ghost/vo/InvolvedVo.java

@@ -17,6 +17,7 @@ public class InvolvedVo {
     public Double ssdl;  //损失电量
     public Double ssdl;  //损失电量
     public List<Line> lines;   //勾选线路
     public List<Line> lines;   //勾选线路
     public String type;  //类型
     public String type;  //类型
-
+    public Double yxrl;  //影响容量
+    public String nwb;  //内报外报
 
 
 }
 }