|
@@ -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);
|