|
@@ -193,13 +193,13 @@ public class SpecificService {
|
|
|
Optional<TurbineInfoDay> monthFirst = monthList.stream().findFirst();
|
|
|
if (monthFirst.isPresent()) {
|
|
|
TurbineInfoDay monthSpecific = monthFirst.get();
|
|
|
- dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 10000, 2));
|
|
|
- dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss().doubleValue() / 10000 + monthSpecific.getFjhjxss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss().doubleValue() / 10000, 2));
|
|
|
+ dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 1000, 2));
|
|
|
+ dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl() / 1000, 2));
|
|
|
+ dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss() / 1000 + monthSpecific.getFjhjxss() / 1000, 2));
|
|
|
+ dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss() / 1000, 2));
|
|
|
+ dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss() / 1000, 2));
|
|
|
+ dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss() / 1000, 2));
|
|
|
+ dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss() / 1000, 2));
|
|
|
if (dqvo.getYllfdl() != 0) {
|
|
|
dqvo.setYfnlyl(DoubleUtils.getRoundingNum(dqvo.getYsjfdl() / dqvo.getYllfdl() * 100, 2));
|
|
|
dqvo.setYwhssl(DoubleUtils.getRoundingNum(dqvo.getYwhssdl() / dqvo.getYllfdl() * 100, 2));
|
|
@@ -312,13 +312,13 @@ public class SpecificService {
|
|
|
Optional<TurbineInfoDay> monthFirst = monthList.stream().findFirst();
|
|
|
if (monthFirst.isPresent()) {
|
|
|
TurbineInfoDay monthSpecific = monthFirst.get();
|
|
|
- dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 10000, 2));
|
|
|
- dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss().doubleValue() / 10000 + monthSpecific.getFjhjxss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss().doubleValue() / 10000, 2));
|
|
|
+ dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 1000, 2));
|
|
|
+ dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl() / 1000, 2));
|
|
|
+ dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss() / 1000 + monthSpecific.getFjhjxss() / 1000, 2));
|
|
|
+ dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss() / 1000, 2));
|
|
|
+ dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss() / 1000, 2));
|
|
|
+ dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss() / 1000, 2));
|
|
|
+ dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss() / 1000, 2));
|
|
|
if (dqvo.getYllfdl() != 0) {
|
|
|
dqvo.setYfnlyl(DoubleUtils.getRoundingNum(dqvo.getYsjfdl() / dqvo.getYllfdl() * 100, 2));
|
|
|
dqvo.setYwhssl(DoubleUtils.getRoundingNum(dqvo.getYwhssdl() / dqvo.getYllfdl() * 100, 2));
|
|
@@ -431,13 +431,13 @@ public class SpecificService {
|
|
|
Optional<TurbineInfoDay> yearFirsts = yearList.stream().findFirst();
|
|
|
if (yearFirsts.isPresent()) {
|
|
|
TurbineInfoDay yearSpecific = yearFirsts.get();
|
|
|
- dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 10000, 2));
|
|
|
- dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss().doubleValue() / 10000 + yearSpecific.getFjhjxss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss().doubleValue() / 10000, 2));
|
|
|
+ dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 1000, 2));
|
|
|
+ dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl() / 1000, 2));
|
|
|
+ dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss() / 1000 + yearSpecific.getFjhjxss() / 1000, 2));
|
|
|
+ dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss() / 1000, 2));
|
|
|
+ dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss() / 1000, 2));
|
|
|
+ dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss() / 1000, 2));
|
|
|
+ dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss() / 1000, 2));
|
|
|
if (dqvo.getYllfdl() != 0) {
|
|
|
dqvo.setNfnlyl(DoubleUtils.getRoundingNum(dqvo.getNsjfdl() / dqvo.getNllfdl() * 100, 2));
|
|
|
dqvo.setNwhssl(DoubleUtils.getRoundingNum(dqvo.getNwhssdl() / dqvo.getNllfdl() * 100, 2));
|
|
@@ -551,12 +551,12 @@ public class SpecificService {
|
|
|
if (yearFirsts.isPresent()) {
|
|
|
TurbineInfoDay yearSpecific = yearFirsts.get();
|
|
|
dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 10000, 2));
|
|
|
- dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss().doubleValue() / 10000 + yearSpecific.getFjhjxss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss().doubleValue() / 10000, 2));
|
|
|
- dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss().doubleValue() / 10000, 2));
|
|
|
+ dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl() / 10000, 2));
|
|
|
+ dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss() / 10000 + yearSpecific.getFjhjxss() / 10000, 2));
|
|
|
+ dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss() / 10000, 2));
|
|
|
+ dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss() / 10000, 2));
|
|
|
+ dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss() / 10000, 2));
|
|
|
+ dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss() / 10000, 2));
|
|
|
if (dqvo.getYllfdl() != 0) {
|
|
|
dqvo.setNfnlyl(DoubleUtils.getRoundingNum(dqvo.getNsjfdl() / dqvo.getNllfdl() * 100, 2));
|
|
|
dqvo.setNwhssl(DoubleUtils.getRoundingNum(dqvo.getNwhssdl() / dqvo.getNllfdl() * 100, 2));
|
|
@@ -697,6 +697,7 @@ public class SpecificService {
|
|
|
i.setWpid(wpmap.get(i.getWpid()).getAname());
|
|
|
|
|
|
});
|
|
|
+
|
|
|
yearresultList.stream().forEach(i -> {
|
|
|
i.setOrdernum(wpmap.get(i.getWpid()).getOrderNum());
|
|
|
i.setWpid(wpmap.get(i.getWpid()).getAname());
|
|
@@ -720,7 +721,7 @@ public class SpecificService {
|
|
|
* @param yearmonth
|
|
|
* @param monthresultList
|
|
|
*/
|
|
|
- private void setCenterYtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
+ private void setCenterYtqInfo2(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
|
|
|
// HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
// List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
|
|
@@ -803,13 +804,80 @@ public class SpecificService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置月同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
+ *
|
|
|
+ * @param companys
|
|
|
+ * @param type
|
|
|
+ * @param yearmonth
|
|
|
+ * @param monthresultList
|
|
|
+ */
|
|
|
+ private void setCenterYtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
+ List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
|
|
|
+ String yearString = yearmonth.split("-")[0];
|
|
|
+ String year = String.valueOf(Integer.parseInt(yearString) - 1);
|
|
|
+ String yearMonth = year + "-" + yearmonth.split("-")[1];
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
|
|
|
+
|
|
|
+ qw.select("foreign_key_id,sum(rmtbf) ymtbf,sum(rmttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
|
|
|
+ qw.eq("location", "wp");
|
|
|
+ qw.like("foreign_key_id", "_FDC_");
|
|
|
+ qw.eq("to_char(record_date,'yyyy-MM')", yearMonth);
|
|
|
+ qw2.eq("to_char(record_date,'yyyy-MM')", yearmonth);
|
|
|
+ qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
|
|
|
+ if (StringUtils.isNotEmpty(tqList)) {
|
|
|
+ tqList.stream().forEach(i -> {
|
|
|
+ Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ SpecificCenterVo leftVo = optionMonth.get();
|
|
|
+ if (optionMonth.isPresent()) {
|
|
|
+ if (null != list && !list.isEmpty()) {
|
|
|
+ leftVo.setTqmtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
|
|
|
+ leftVo.setTqmttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
|
|
|
+ } else {
|
|
|
+ leftVo.setTqmtbf(0.0);
|
|
|
+ leftVo.setTqmttr(0.0);
|
|
|
+ }
|
|
|
+ leftVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(), 2));
|
|
|
+ leftVo.setTqztzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(), 2));
|
|
|
+ leftVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(), 2));
|
|
|
+ } else {
|
|
|
+ leftVo.setTqmtbf(0.0);
|
|
|
+ leftVo.setTqmttr(0.0);
|
|
|
+ leftVo.setTqfwjsl(0.0);
|
|
|
+ leftVo.setTqztzhl(0.0);
|
|
|
+ leftVo.setTqxqjsl(0.0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
|
|
|
+ wpls.stream().forEach(wp -> {
|
|
|
+ Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(wp.getId())).findFirst();
|
|
|
+ if (optionMonth.isPresent()) {
|
|
|
+ SpecificCenterVo leftVo = optionMonth.get();
|
|
|
+ leftVo.setTqmtbf(0.0);
|
|
|
+ leftVo.setTqmttr(0.0);
|
|
|
+ leftVo.setTqfwjsl(0.0);
|
|
|
+ leftVo.setTqztzhl(0.0);
|
|
|
+ leftVo.setTqxqjsl(0.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 设置年同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
*
|
|
|
* @param companys
|
|
|
* @param yearresultList
|
|
|
*/
|
|
|
- private void setCenterNtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
|
|
|
+ private void setCenterNtqInfo2(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
// List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
|
|
@@ -884,13 +952,70 @@ public class SpecificService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 设置年同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
+ *
|
|
|
+ * @param companys
|
|
|
+ * @param yearresultList
|
|
|
+ */
|
|
|
+ private void setCenterNtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
|
|
|
+ String yearString = yearmonth.split("-")[0];
|
|
|
+ String year = String.valueOf(Integer.parseInt(yearString) - 1);
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,sum(rmtbf) nmtbf,sum(rmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
|
|
|
+ qw2.select("station_id,avg(mtbf) as mtbf,avg(mttr) as mttr");
|
|
|
+ qw.eq("location", "wp");
|
|
|
+ qw.like("foreign_key_id", "_FDC_");
|
|
|
+ qw.eq("to_char(record_date,'yyyy')", year);
|
|
|
+ qw2.eq("to_char(record_date,'yyyy')", year);
|
|
|
+ qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
+ qw2.groupBy("to_char(record_date,'yyyy'),station_id");
|
|
|
+ List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
|
|
|
+ if (StringUtils.isNotEmpty(tqList)) {
|
|
|
+ tqList.stream().forEach(i -> {
|
|
|
+ Optional<SpecificCenterVo> optionYear = yearresultList.stream().filter(j -> j.getWpid().equals(i.getWindpowerstationId())||j.getWpid().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ if (optionYear.isPresent()) {
|
|
|
+ SpecificCenterVo rightVo = optionYear.get();
|
|
|
+ if (null != list && !list.isEmpty()) {
|
|
|
+ rightVo.setTqmtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
|
|
|
+ rightVo.setTqmttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
|
|
|
+ } else {
|
|
|
+ rightVo.setTqmtbf(0.0);
|
|
|
+ rightVo.setTqmttr(0.0);
|
|
|
+ }
|
|
|
+ rightVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(), 2));
|
|
|
+ rightVo.setTqztzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(), 2));
|
|
|
+ rightVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(), 2));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
|
|
|
+ wpls.stream().forEach(wp -> {
|
|
|
+ Optional<SpecificCenterVo> optionMonth = yearresultList.stream().filter(j -> j.getWpid().equals(wp.getId())).findFirst();
|
|
|
+ if (optionMonth.isPresent()) {
|
|
|
+ SpecificCenterVo leftVo = optionMonth.get();
|
|
|
+ leftVo.setTqmtbf(0.0);
|
|
|
+ leftVo.setTqmttr(0.0);
|
|
|
+ leftVo.setTqfwjsl(0.0);
|
|
|
+ leftVo.setTqztzhl(0.0);
|
|
|
+ leftVo.setTqxqjsl(0.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 设置当月mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
*
|
|
|
* @param companys
|
|
|
* @param type
|
|
|
* @param monthresultList
|
|
|
*/
|
|
|
- private void setCenterDyInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
+ private void setCenterDyInfo2(String companys, String type, String
|
|
|
+ yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
// List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
|
|
@@ -961,13 +1086,64 @@ public class SpecificService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void setCenterDyInfo(String companys, String type, String
|
|
|
+ yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
+
|
|
|
+ HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
+ List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,sum(rmtbf) ymtbf,sum(rmttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
|
|
|
+ qw.eq("location", "wp");
|
|
|
+ qw.like("foreign_key_id", "_FDC_");
|
|
|
+ qw.eq("to_char(record_date,'yyyy-MM')", yearmonth);
|
|
|
+ qw2.eq("to_char(record_date,'yyyy-MM')", yearmonth);
|
|
|
+ qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
|
|
|
+ if (StringUtils.isNotEmpty(dyList)) {
|
|
|
+ dyList.stream().forEach(i -> {
|
|
|
+ SpecificCenterVo leftVo = new SpecificCenterVo();
|
|
|
+ leftVo.setWpid(i.getForeignKeyId());
|
|
|
+ if (null != list && !list.isEmpty()) {
|
|
|
+ leftVo.setMtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
|
|
|
+ leftVo.setMttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
|
|
|
+ } else {
|
|
|
+ leftVo.setMtbf(0.0);
|
|
|
+ leftVo.setMttr(0.0);
|
|
|
+ }
|
|
|
+ leftVo.setFwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(), 2));
|
|
|
+ leftVo.setZtzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(), 2));
|
|
|
+ leftVo.setXqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(), 2));
|
|
|
+
|
|
|
+ monthresultList.add(leftVo);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
|
|
|
+ wpls.stream().forEach(i -> {
|
|
|
+ SpecificCenterVo leftVo = new SpecificCenterVo();
|
|
|
+ leftVo.setWpid(i.getId());
|
|
|
+ leftVo.setMtbf(0.0);
|
|
|
+ leftVo.setMttr(0.0);
|
|
|
+ leftVo.setFwjsl(0.0);
|
|
|
+ leftVo.setZtzhl(0.0);
|
|
|
+ leftVo.setXqjsl(0.0);
|
|
|
+ monthresultList.add(leftVo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 设置当年mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
*
|
|
|
* @param companys
|
|
|
* @param yearresultList
|
|
|
*/
|
|
|
- private void setCenterDnInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) {
|
|
|
+ private void setCenterDnInfo2(String companys, String type, String
|
|
|
+ yearmonth, List<SpecificCenterVo> yearresultList) {
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
// List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
|
|
@@ -1038,6 +1214,58 @@ public class SpecificService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 设置当年mtbf,mttr,复位及时率,状态转换率,消缺及时率
|
|
|
+ *
|
|
|
+ * @param companys
|
|
|
+ * @param yearresultList
|
|
|
+ */
|
|
|
+ private void setCenterDnInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) {
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,sum(rmtbf) nmtbf,sum(rmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
|
|
|
+ qw2.select("station_id,avg(mtbf) as mtbf,avg(mttr) as mttr");
|
|
|
+ qw.eq("location", "wp");
|
|
|
+ qw.like("foreign_key_id", "_FDC_");
|
|
|
+ qw.eq("to_char(record_date,'yyyy')", yearmonth.split("-")[0]);
|
|
|
+ qw2.eq("to_char(record_date,'yyyy')", yearmonth.split("-")[0]);
|
|
|
+ qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
+ qw2.groupBy("to_char(record_date,'yyyy'),station_id");
|
|
|
+ List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
|
|
|
+ if (StringUtils.isNotEmpty(dyList)) {
|
|
|
+ dyList.stream().forEach(i -> {
|
|
|
+ SpecificCenterVo rightVo = new SpecificCenterVo();
|
|
|
+ rightVo.setWpid(i.getForeignKeyId());
|
|
|
+ if (null != list && !list.isEmpty()) {
|
|
|
+ rightVo.setMtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
|
|
|
+ rightVo.setMttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
|
|
|
+ } else {
|
|
|
+ rightVo.setMtbf(0.0);
|
|
|
+ rightVo.setMttr(0.0);
|
|
|
+ }
|
|
|
+ rightVo.setFwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(), 2));
|
|
|
+ rightVo.setZtzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(), 2));
|
|
|
+ rightVo.setXqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(), 2));
|
|
|
+
|
|
|
+ yearresultList.add(rightVo);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
|
|
|
+ wpls.stream().forEach(i -> {
|
|
|
+ SpecificCenterVo rightVo = new SpecificCenterVo();
|
|
|
+ rightVo.setWpid(i.getId());
|
|
|
+ rightVo.setMtbf(0.0);
|
|
|
+ rightVo.setMttr(0.0);
|
|
|
+ rightVo.setFwjsl(0.0);
|
|
|
+ rightVo.setZtzhl(0.0);
|
|
|
+ rightVo.setXqjsl(0.0);
|
|
|
+ yearresultList.add(rightVo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取风能利用率
|
|
|
*
|
|
|
* @param companys
|