Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
FCL
2025-12-25 10:30:19 +08:00
2 changed files with 169 additions and 118 deletions

View File

@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.alibaba.qlexpress4.Express4Runner;
import com.alibaba.qlexpress4.QLOptions;
import com.alibaba.qlexpress4.QLResult;
@@ -534,10 +535,10 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
} else {
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
}
JSONObject assayDataJson = new JSONObject();
Map<String, ReportFieldValueData> assayDataJson = new HashMap<>();
String assayData = businessAssayReportDataDO.getAssayData();
if (StringUtils.isNotBlank(assayData)) {
assayDataJson = JSON.parseObject(assayData);
assayDataJson = JSON.parseObject(assayData, new TypeReference<Map<String, ReportFieldValueData>>() {});
}
//循环判定值
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId()) && "normal".equals(f.getAssessmentStatus())).collect(Collectors.toList());
@@ -581,12 +582,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) {
businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES);
}
if (busDataSources.size() > 0) {//计算
if (busDataSources.size() > 0) {//计算
Map<String, Object> calcContext = assayDataJson.entrySet().stream().collect(Collectors.toMap(
Map.Entry::getKey,
entry -> {
ReportFieldValueData data = (ReportFieldValueData) entry.getValue();
ReportFieldValueData data = entry.getValue();
String fieldValue = data != null ? data.getFieldValue() : null;
if (fieldValue == null || fieldValue.isEmpty()) {
return BigDecimal.ZERO;
@@ -633,14 +633,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
reportFieldValueData.setMethodName(null);
assayDataJson.put(configReportFieldCalculated.getField(), reportFieldValueData);
}
}
}
businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString());
businessAssayReportDataDO.setAssayData(JSON.toJSONString(assayDataJson));
businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource));
}