|
@@ -4,20 +4,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.gyee.gradeevaluation.init.CacheContext;
|
|
import com.gyee.gradeevaluation.init.CacheContext;
|
|
import com.gyee.gradeevaluation.model.auto.Faulteliminatedefects;
|
|
import com.gyee.gradeevaluation.model.auto.Faulteliminatedefects;
|
|
import com.gyee.gradeevaluation.model.auto.Statetransitionrates;
|
|
import com.gyee.gradeevaluation.model.auto.Statetransitionrates;
|
|
|
|
+import com.gyee.gradeevaluation.model.auto.Windpowerstation;
|
|
import com.gyee.gradeevaluation.model.vo.FwjslVo;
|
|
import com.gyee.gradeevaluation.model.vo.FwjslVo;
|
|
import com.gyee.gradeevaluation.model.vo.QxjslVo;
|
|
import com.gyee.gradeevaluation.model.vo.QxjslVo;
|
|
import com.gyee.gradeevaluation.service.auto.IFaulteliminatedefectsService;
|
|
import com.gyee.gradeevaluation.service.auto.IFaulteliminatedefectsService;
|
|
import com.gyee.gradeevaluation.service.auto.IStatetransitionratesService;
|
|
import com.gyee.gradeevaluation.service.auto.IStatetransitionratesService;
|
|
|
|
+import com.gyee.gradeevaluation.service.auto.IWindpowerstationService;
|
|
import com.gyee.gradeevaluation.util.DateUtils;
|
|
import com.gyee.gradeevaluation.util.DateUtils;
|
|
import com.gyee.gradeevaluation.util.DoubleUtils;
|
|
import com.gyee.gradeevaluation.util.DoubleUtils;
|
|
|
|
+import com.gyee.gradeevaluation.util.SortUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @ClassName : ThreeRateService
|
|
* @ClassName : ThreeRateService
|
|
@@ -32,6 +37,9 @@ public class ThreeRateService {
|
|
@Autowired
|
|
@Autowired
|
|
private IFaulteliminatedefectsService faulteliminatedefectsService;
|
|
private IFaulteliminatedefectsService faulteliminatedefectsService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IWindpowerstationService windpowerstationService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 复位及时率
|
|
* 复位及时率
|
|
* @param beginDate
|
|
* @param beginDate
|
|
@@ -46,6 +54,9 @@ public class ThreeRateService {
|
|
// qw.groupBy("windpwoerid");
|
|
// qw.groupBy("windpwoerid");
|
|
List<Statetransitionrates> list = statetransitionratesService.listZdy(beginDate,endDate);
|
|
List<Statetransitionrates> list = statetransitionratesService.listZdy(beginDate,endDate);
|
|
getData(resultList, list);
|
|
getData(resultList, list);
|
|
|
|
+
|
|
|
|
+ SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
|
|
|
|
+
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -59,7 +70,7 @@ public class ThreeRateService {
|
|
Map<String, List<FwjslVo>> resultMap = new HashMap<>();
|
|
Map<String, List<FwjslVo>> resultMap = new HashMap<>();
|
|
List<FwjslVo> resultList1 = new ArrayList<>();
|
|
List<FwjslVo> resultList1 = new ArrayList<>();
|
|
List<FwjslVo> resultList2 = new ArrayList<>();
|
|
List<FwjslVo> resultList2 = new ArrayList<>();
|
|
- List<FwjslVo> resultList3= new ArrayList<>();
|
|
|
|
|
|
+ List<FwjslVo> resultList3 = new ArrayList<>();
|
|
resultMap.put("小于3米风速",resultList1);
|
|
resultMap.put("小于3米风速",resultList1);
|
|
resultMap.put("大于3米风速",resultList2);
|
|
resultMap.put("大于3米风速",resultList2);
|
|
resultMap.put("大于4米风速",resultList3);
|
|
resultMap.put("大于4米风速",resultList3);
|
|
@@ -68,13 +79,24 @@ public class ThreeRateService {
|
|
// qw.ge("recorddate", DateUtils.parseDate(beginDate)).le("recorddate",DateUtils.parseDate(endDate));
|
|
// qw.ge("recorddate", DateUtils.parseDate(beginDate)).le("recorddate",DateUtils.parseDate(endDate));
|
|
// qw.groupBy("windpwoerid");
|
|
// qw.groupBy("windpwoerid");
|
|
List<Statetransitionrates> list = statetransitionratesService.listZdyztzhl(beginDate, endDate);
|
|
List<Statetransitionrates> list = statetransitionratesService.listZdyztzhl(beginDate, endDate);
|
|
|
|
+
|
|
getData1(resultList1, list);
|
|
getData1(resultList1, list);
|
|
getData2(resultList2, list);
|
|
getData2(resultList2, list);
|
|
getData3(resultList3, list);
|
|
getData3(resultList3, list);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ SortUtils.sort(resultList1,"ordernum",SortUtils.ASC);
|
|
|
|
+ SortUtils.sort(resultList2,"ordernum",SortUtils.ASC);
|
|
|
|
+ SortUtils.sort(resultList3,"ordernum",SortUtils.ASC);
|
|
|
|
+
|
|
|
|
+
|
|
return resultMap;
|
|
return resultMap;
|
|
}
|
|
}
|
|
private void getData(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
private void getData(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
|
|
+
|
|
|
|
+ Map<String, BigDecimal> station = windpowerstationService.list()
|
|
|
|
+ .stream().collect(Collectors.toMap(Windpowerstation::getId,Windpowerstation::getOrdernum));
|
|
|
|
+
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
@@ -87,6 +109,9 @@ public class ThreeRateService {
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate19())));
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate19())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate20())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate20())));
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(station.get(i.getWindpwoerid()));
|
|
|
|
+
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setYfwcs(i.getTimerate20());
|
|
vo.setYfwcs(i.getTimerate20());
|
|
|
|
|
|
@@ -103,6 +128,9 @@ public class ThreeRateService {
|
|
});
|
|
});
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
vo.setWpid("合计");
|
|
vo.setWpid("合计");
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(BigDecimal.valueOf(station.size()+1));
|
|
|
|
+
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setSfz(sfz.get());
|
|
vo.setSfz(sfz.get());
|
|
@@ -115,6 +143,10 @@ public class ThreeRateService {
|
|
resultList.add(vo);
|
|
resultList.add(vo);
|
|
}
|
|
}
|
|
private void getData1(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
private void getData1(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
|
|
+
|
|
|
|
+ Map<String, BigDecimal> station = windpowerstationService.list()
|
|
|
|
+ .stream().collect(Collectors.toMap(Windpowerstation::getId,Windpowerstation::getOrdernum));
|
|
|
|
+
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
@@ -127,6 +159,9 @@ public class ThreeRateService {
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate4())));
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate4())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate13())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate13())));
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(station.get(i.getWindpwoerid()));
|
|
|
|
+
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setYfwcs(i.getTimerate13());
|
|
vo.setYfwcs(i.getTimerate13());
|
|
|
|
|
|
@@ -143,6 +178,9 @@ public class ThreeRateService {
|
|
});
|
|
});
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
vo.setWpid("合计");
|
|
vo.setWpid("合计");
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(BigDecimal.valueOf(station.size()+1));
|
|
|
|
+
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setSfz(sfz.get());
|
|
vo.setSfz(sfz.get());
|
|
@@ -156,6 +194,12 @@ public class ThreeRateService {
|
|
}
|
|
}
|
|
|
|
|
|
private void getData2(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
private void getData2(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, BigDecimal> station = windpowerstationService.list()
|
|
|
|
+ .stream().collect(Collectors.toMap(Windpowerstation::getId,Windpowerstation::getOrdernum));
|
|
|
|
+
|
|
|
|
+
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
@@ -168,6 +212,11 @@ public class ThreeRateService {
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate8())));
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate8())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate14())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate14())));
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(station.get(i.getWindpwoerid()));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setYfwcs(i.getTimerate14());
|
|
vo.setYfwcs(i.getTimerate14());
|
|
|
|
|
|
@@ -184,6 +233,10 @@ public class ThreeRateService {
|
|
});
|
|
});
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
vo.setWpid("合计");
|
|
vo.setWpid("合计");
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(BigDecimal.valueOf(station.size()+1));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setSfz(sfz.get());
|
|
vo.setSfz(sfz.get());
|
|
@@ -197,6 +250,12 @@ public class ThreeRateService {
|
|
}
|
|
}
|
|
|
|
|
|
private void getData3(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
private void getData3(List<FwjslVo> resultList, List<Statetransitionrates> list) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, BigDecimal> station = windpowerstationService.list()
|
|
|
|
+ .stream().collect(Collectors.toMap(Windpowerstation::getId,Windpowerstation::getOrdernum));
|
|
|
|
+
|
|
|
|
+
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> wfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> sfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
AtomicReference<Double> swfz = new AtomicReference<>((double) 0);
|
|
@@ -209,6 +268,10 @@ public class ThreeRateService {
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate12())));
|
|
esfz.updateAndGet(v -> new Double((double) (v + i.getTimerate12())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate15())));
|
|
yfwcs.updateAndGet(v -> new Double((double) (v + i.getTimerate15())));
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(station.get(i.getWindpwoerid()));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpwoerid()).getName());
|
|
vo.setYfwcs(i.getTimerate15());
|
|
vo.setYfwcs(i.getTimerate15());
|
|
|
|
|
|
@@ -225,6 +288,11 @@ public class ThreeRateService {
|
|
});
|
|
});
|
|
FwjslVo vo = new FwjslVo();
|
|
FwjslVo vo = new FwjslVo();
|
|
vo.setWpid("合计");
|
|
vo.setWpid("合计");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(BigDecimal.valueOf(station.size()+1));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setYfwcs(yfwcs.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setWfz(wfz.get());
|
|
vo.setSfz(sfz.get());
|
|
vo.setSfz(sfz.get());
|
|
@@ -244,6 +312,13 @@ public class ThreeRateService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<QxjslVo> xqjsl(String beginDate, String endDate) {
|
|
public List<QxjslVo> xqjsl(String beginDate, String endDate) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, BigDecimal> station = windpowerstationService.list()
|
|
|
|
+ .stream().collect(Collectors.toMap(Windpowerstation::getId,Windpowerstation::getOrdernum));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
List<QxjslVo> resultList = new ArrayList<>();
|
|
List<QxjslVo> resultList = new ArrayList<>();
|
|
QueryWrapper<Faulteliminatedefects> qw = new QueryWrapper<>();
|
|
QueryWrapper<Faulteliminatedefects> qw = new QueryWrapper<>();
|
|
qw.select("windpowerstationid,sum(faultcount) faultcount,sum(rightcount) rightcount");
|
|
qw.select("windpowerstationid,sum(faultcount) faultcount,sum(rightcount) rightcount");
|
|
@@ -256,6 +331,10 @@ public class ThreeRateService {
|
|
gzCount.updateAndGet(v -> new Long((long) (v + i.getFaultcount())));
|
|
gzCount.updateAndGet(v -> new Long((long) (v + i.getFaultcount())));
|
|
xqCount.updateAndGet(v -> new Long((long) (v + i.getRightcount())));
|
|
xqCount.updateAndGet(v -> new Long((long) (v + i.getRightcount())));
|
|
QxjslVo vo = new QxjslVo();
|
|
QxjslVo vo = new QxjslVo();
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(station.get(i.getWindpowerstationid()));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpowerstationid()).getName());
|
|
vo.setWpid(CacheContext.wpmap.get(i.getWindpowerstationid()).getName());
|
|
vo.setGzCount(i.getFaultcount());
|
|
vo.setGzCount(i.getFaultcount());
|
|
vo.setXqCount(i.getRightcount());
|
|
vo.setXqCount(i.getRightcount());
|
|
@@ -264,9 +343,18 @@ public class ThreeRateService {
|
|
});
|
|
});
|
|
QxjslVo vo = new QxjslVo();
|
|
QxjslVo vo = new QxjslVo();
|
|
vo.setWpid("合计");
|
|
vo.setWpid("合计");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ vo.setOrdernum(BigDecimal.valueOf(station.size()+1));
|
|
|
|
+
|
|
|
|
+
|
|
vo.setGzCount(gzCount.get());
|
|
vo.setGzCount(gzCount.get());
|
|
vo.setXqCount(xqCount.get());
|
|
vo.setXqCount(xqCount.get());
|
|
vo.setXqjsl(gzCount.get()!=0?DoubleUtils.getRoundingNum(((double)(xqCount.get())/(double) (gzCount.get())*100.0),2):0.0);
|
|
vo.setXqjsl(gzCount.get()!=0?DoubleUtils.getRoundingNum(((double)(xqCount.get())/(double) (gzCount.get())*100.0),2):0.0);
|
|
|
|
+
|
|
|
|
+ SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
|
|
|
|
+
|
|
|
|
+
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
}
|
|
}
|