浙江无线报表调整

This commit is contained in:
2024-12-24 15:01:37 +08:00
parent f0ffb63cff
commit 43af977942

View File

@@ -1180,8 +1180,8 @@ public class CustomReportServiceImpl implements CustomReportService {
//组装最后监测点条件
List<WlRecord> temList = wlRecordFeignClient.getWlAssByWlId(reportSearchParam.getLineId()).getData();
List<WlRecord> wlRecordList = temList.stream().filter(it -> it.getType() == 1).collect(Collectors.toList());
if (CollUtil.isEmpty(wlRecordList)) {
//List<WlRecord> wlRecordList = temList.stream().filter(it -> it.getType() == 1).collect(Collectors.toList());
if (CollUtil.isEmpty(temList) && temList.size()==1) {
throw new BusinessException("当前测试项无测试数据");
}
@@ -1209,13 +1209,13 @@ public class CustomReportServiceImpl implements CustomReportService {
phaseMap.forEach((phaseKey, phaseVal) -> {
StringBuilder sql = new StringBuilder(InfluxDbSqlConstant.SELECT);
if (InfluxDbSqlConstant.MAX.equalsIgnoreCase(valueTypeKey)) {
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, wlRecordList, pqdMap);
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, temList, pqdMap);
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(valueTypeKey)) {
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, wlRecordList, pqdMap);
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, temList, pqdMap);
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(valueTypeKey)) {
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, wlRecordList, pqdMap);
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, temList, pqdMap);
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(valueTypeKey)) {
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, wlRecordList, pqdMap);
assSqlZhejiang(phaseVal, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam, limitTargetMapX, limitMap, assNoPassMap, temList, pqdMap);
}
});
});
@@ -1247,7 +1247,7 @@ public class CustomReportServiceImpl implements CustomReportService {
finalTerminalMap.put("pt",wlRecordMain.getCt().toString());
finalTerminalMap.put("ct",wlRecordMain.getPt().toString());
finalTerminalMap.put("Standard_Capacity",wlRecordMain.getCapacitySi().toString());
finalTerminalMap.put("Standard_Capacity",wlRecordMain.getCapacitySscb().toString());
finalTerminalMap.put("Short_Capacity",wlRecordMain.getCapacitySscmin().toString());
finalTerminalMap.put("Deal_Capacity",wlRecordMain.getCapacitySi().toString());
finalTerminalMap.put("Dev_Capacity",wlRecordMain.getCapacitySt().toString());
@@ -1336,7 +1336,10 @@ public class CustomReportServiceImpl implements CustomReportService {
.append(InfluxDbSqlConstant.QM);
List<Map<String, Object>> allList = new ArrayList<>();
WlRecord ceShiItem = wlRecordList.stream().filter(it->it.getType()==0).collect(Collectors.toList()).get(0);
for (WlRecord wlRecord : wlRecordList) {
if(wlRecord.getType().equals(1)) {
StringBuilder temSql = new StringBuilder(sql);
String start = LocalDateTimeUtil.format(wlRecord.getStartTime(), DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
String end = LocalDateTimeUtil.format(wlRecord.getEndTime(), DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN));
@@ -1357,9 +1360,13 @@ public class CustomReportServiceImpl implements CustomReportService {
String key = entry.getKey();
double val = (double) entry.getValue();
String zi = key.substring(0, key.indexOf("#"));
zi = zi.substring(0,zi.lastIndexOf("_"));
if (pqdMap.containsKey(zi)) {
EleEpdPqd eleEpdPqd = pqdMap.get(zi).get(0);
double vRes = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(), val / 1000, (double) wlRecord.getPt(), (double) wlRecord.getCt());
if(!eleEpdPqd.getPrimaryFormula().equals("*CT")){
val = val / 1000;
}
double vRes = DataChangeUtil.secondaryToPrimary(eleEpdPqd.getPrimaryFormula(),val, (double) ceShiItem.getPt(), (double) ceShiItem.getCt());
entry.setValue(vRes);
}
}
@@ -1369,6 +1376,7 @@ public class CustomReportServiceImpl implements CustomReportService {
allList.add(temMapList.get(0));
}
}
}
Map<String, Object> resultMap = dealResultMap(method, allList);
if (resultMap.isEmpty()) {