|
@@ -171,12 +171,20 @@ public class HealthMainService {
|
|
|
uniformcode = ContantXk.JKYC006;
|
|
|
break;
|
|
|
case 2:
|
|
|
+ cal.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
+ cal.set(Calendar.MINUTE, 0);
|
|
|
+ cal.set(Calendar.SECOND, 0);
|
|
|
+ num=7;
|
|
|
+ uniformcode = ContantXk.JKYC021;
|
|
|
+ // uniformcode = ContantXk.YCFJJKZT7DAY;
|
|
|
+ break;
|
|
|
case 3:
|
|
|
cal.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
cal.set(Calendar.MINUTE, 0);
|
|
|
cal.set(Calendar.SECOND, 0);
|
|
|
-
|
|
|
+ num=30;
|
|
|
uniformcode = ContantXk.JKYC021;
|
|
|
// uniformcode = ContantXk.YCFJJKZT7DAY;
|
|
|
break;
|
|
@@ -315,7 +323,7 @@ public class HealthMainService {
|
|
|
|
|
|
String wpId = wp.getId();
|
|
|
|
|
|
- if (wpId.endsWith("FDC")) {
|
|
|
+ if (wpId.contains("FDC")) {
|
|
|
|
|
|
double tqyb = 1.0;// 天气预报
|
|
|
double ycfs = 0.0;// 预测风速
|
|
@@ -478,8 +486,8 @@ public class HealthMainService {
|
|
|
if (CacheContext.wtmap.containsKey(wtId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
|
|
|
if (StringUtils.notEmp(wt.getId())) {
|
|
|
- String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
- vo.setName(num);
|
|
|
+// String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
+ vo.setName(wt.getNemCode());
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -500,8 +508,8 @@ public class HealthMainService {
|
|
|
if (CacheContext.wtmap.containsKey(wtId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
|
|
|
if (StringUtils.notEmp(wt.getId())) {
|
|
|
- String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
- vo.setName(num);
|
|
|
+// String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
+ vo.setName(wt.getNemCode());
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -557,7 +565,7 @@ public class HealthMainService {
|
|
|
List<Map<String, String>> gzls = new ArrayList<>();
|
|
|
if (StringUtils.notEmp(wpId) && CacheContext.wpmap.containsKey(wpId)) {
|
|
|
|
|
|
- if (wpId.endsWith("FDC")) {
|
|
|
+ if (wpId.contains("FDC")) {
|
|
|
int ysl = 0;// 优数量
|
|
|
int lsl = 0;// 良数量
|
|
|
int csl = 0;// 差数量
|
|
@@ -581,12 +589,13 @@ public class HealthMainService {
|
|
|
ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RFDL);
|
|
|
String wppintId1 = point.getNemCode();
|
|
|
PointData ssfspoint1 = realApiUtil.getRealData(wppintId1);
|
|
|
- double rfdl = StringUtils.round(ssfspoint1.getPointValueInDouble(), digit);
|
|
|
+ double rfdl = new BigDecimal(ssfspoint1.getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
|
|
ProBasicPowerstationPoint point2 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.YFDL);
|
|
|
String wppintId2 = point2.getNemCode();
|
|
|
PointData ssfspoint2 = realApiUtil.getRealData(wppintId2);
|
|
|
- double yfdl = StringUtils.round(ssfspoint2.getPointValueInDouble(), digit);
|
|
|
+ double yfdl = new BigDecimal(ssfspoint2.getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+
|
|
|
|
|
|
List<String[]> wtIdls = new ArrayList<>();// 风机编号集合
|
|
|
List<Integer> yhls = new ArrayList<>();// 隐患集合
|
|
@@ -715,23 +724,33 @@ public class HealthMainService {
|
|
|
int minutesDiff = DateUtils.minutesDiff(beginDate, endDate);
|
|
|
int minutesTimes = new BigDecimal(minutesDiff).divide(new BigDecimal(15), 0, RoundingMode.HALF_EVEN).intValue();
|
|
|
if (minutesTimes != 0) {
|
|
|
- ycdl15minute = new BigDecimal(rfdl).divide(new BigDecimal(minutesTimes), 2, RoundingMode.HALF_EVEN).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
+ ycdl15minute = new BigDecimal(rfdl).divide(new BigDecimal(minutesTimes), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
ycdl15minute = StringUtils.round(ycdl15minute, 2);
|
|
|
} else {
|
|
|
- ycdl15minute = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
+ ycdl15minute = new BigDecimal(rfdl)
|
|
|
+ .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
ycdl15minute = StringUtils.round(ycdl15minute, 2);
|
|
|
}
|
|
|
|
|
|
int hoursDiff1 = DateUtils.hoursDiff1(beginDate, endDate);
|
|
|
if (hoursDiff1 != 0) {
|
|
|
- ycdl1hour = new BigDecimal(rfdl).divide(new BigDecimal(hoursDiff1), 2, RoundingMode.HALF_EVEN).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
+ ycdl1hour = new BigDecimal(rfdl).divide(new BigDecimal(hoursDiff1), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
ycdl1hour = StringUtils.round(ycdl1hour, 2);
|
|
|
} else {
|
|
|
- ycdl1hour = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
+ ycdl1hour = new BigDecimal(rfdl)
|
|
|
+ .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
ycdl1hour = StringUtils.round(ycdl1hour, 2);
|
|
|
}
|
|
|
|
|
|
- ycdl1day = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
+ ycdl1day = new BigDecimal(rfdl)
|
|
|
+ .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
|
|
|
+ .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
|
|
|
ycdl1day = StringUtils.round(ycdl1day, 2);
|
|
|
|
|
|
|
|
@@ -814,24 +833,29 @@ public class HealthMainService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- String[] str = new String[3];
|
|
|
+ String[] str = new String[4];
|
|
|
str[0] = wtId;
|
|
|
+
|
|
|
str[1] = "3";
|
|
|
if (CacheContext.wtmap.containsKey(wtId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
|
|
|
+ str[3] = wt.getNemCode();
|
|
|
if (StringUtils.notEmp(wt.getId())) {
|
|
|
String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
str[2] = num;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
wtIdls.add(str);
|
|
|
csl++;
|
|
|
} else {
|
|
|
- String[] str = new String[3];
|
|
|
+ String[] str = new String[4];
|
|
|
+
|
|
|
if (jk == HealthStatusValue.ZC.getCode()) {
|
|
|
str[0] = wtId;
|
|
|
str[1] = "1";
|
|
|
+
|
|
|
wtIdls.add(str);
|
|
|
ysl++;
|
|
|
} else if (jk == HealthStatusValue.LH.getCode() || jk == HealthStatusValue.ZY.getCode()) {
|
|
@@ -847,6 +871,7 @@ public class HealthMainService {
|
|
|
}
|
|
|
if (CacheContext.wtmap.containsKey(wtId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
|
|
|
+ str[3] = wt.getNemCode();
|
|
|
if (StringUtils.notEmp(wt.getId())) {
|
|
|
String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
str[2] = num;
|