微调
This commit is contained in:
@@ -1474,10 +1474,10 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
||||
//String scriptId = adPlan.getScriptId();
|
||||
Integer devChns = pqDevVO.getDevChns();
|
||||
for (int i = 1; i <= devChns; i++) {
|
||||
String path="/model/report_table.docx";
|
||||
String path = "/model/report_table.docx";
|
||||
DevType devType = devTypeService.getById(pqDevVO.getDevType());
|
||||
if(devType.getName().equals("PQ-COM")){
|
||||
path="/model/report_table - PQ-COM.docx";
|
||||
if (devType.getName().equals("PQ-COM")) {
|
||||
path = "/model/report_table - PQ-COM.docx";
|
||||
}
|
||||
ClassPathResource resource = new ClassPathResource(path);
|
||||
XWPFDocument dataModelDocumentTemp = new XWPFDocument(resource.getInputStream());
|
||||
@@ -1507,11 +1507,20 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
||||
List<AdHarmonicResult> adHarmonicResultList = adHarmonicService.listAllResultData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + i);
|
||||
|
||||
// 填充数据
|
||||
int finalI = i;
|
||||
indexKeysMap.forEach((index, keys) -> {
|
||||
String s1 = keys.stream().findFirst().get();
|
||||
// 谐波类
|
||||
if (DetectionCodeEnum.V2_50.getCode().equals(s1) || DetectionCodeEnum.I2_50.getCode().equals(s1) || DetectionCodeEnum.SV_1_49.getCode().equals(s1) || DetectionCodeEnum.SI_1_49.getCode().equals(s1)) {
|
||||
fillMapValueHarm(adHarmonicResultList, dataModelMap, keys, index);
|
||||
// 查找一下U1
|
||||
double u1 = 57.74;
|
||||
List<AdHarmonicResult> rawData = adHarmonicService.listAllRawData(devReportParam.getScriptId(), devReportParam.getPlanCode(), devReportParam.getDevId() + "_" + finalI);
|
||||
AdHarmonicResult adHarmonicResult = rawData.stream().filter(obj -> obj.getAdType().equals(DetectionCodeEnum.V2_50.getCode())).sorted((obj1, obj2) -> obj2.getTimeId().compareTo(obj1.getTimeId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotNull(adHarmonicResult)) {
|
||||
String aValue1 = adHarmonicResult.getAValue1();
|
||||
u1 = Double.parseDouble(aValue1);
|
||||
}
|
||||
fillMapValueHarm(adHarmonicResultList, dataModelMap, keys, index, u1);
|
||||
} else {
|
||||
// 非谐波类
|
||||
if (DetectionCodeEnum.V_UNBAN.getCode().equals(s1) || DetectionCodeEnum.FREQ.getCode().equals(s1)) {
|
||||
@@ -1579,14 +1588,14 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
||||
* @param keys
|
||||
* @param index
|
||||
*/
|
||||
private void fillMapValueHarm(List<AdHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index) {
|
||||
private void fillMapValueHarm(List<AdHarmonicResult> allHarmonicResultList, Map<String, String> dataModelMap, Set<String> keys, String index, double baseValue) {
|
||||
keys.forEach(key -> {
|
||||
List<AdHarmonicResult> resultList = allHarmonicResultList.stream().filter(obj -> obj.getAdType().equals(key) && obj.getSort().toString().equals(index)).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||
AdHarmonicResult adHarmonicResult = resultList.get(0);
|
||||
if (Objects.nonNull(adHarmonicResult)) {
|
||||
if (DetectionCodeEnum.V2_50.getCode().equals(key) || DetectionCodeEnum.SV_1_49.getCode().equals(key)) {
|
||||
fillHarm(dataModelMap, adHarmonicResult, index, key, 57.74, 100);
|
||||
fillHarm(dataModelMap, adHarmonicResult, index, key, baseValue, 100);
|
||||
}
|
||||
if (DetectionCodeEnum.I2_50.getCode().equals(key) || DetectionCodeEnum.SI_1_49.getCode().equals(key)) {
|
||||
fillHarm(dataModelMap, adHarmonicResult, index, key, 1, 1);
|
||||
|
||||
Reference in New Issue
Block a user