检验委托生成样品修改
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
import com.alibaba.qlexpress4.Express4Runner;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
import com.alibaba.qlexpress4.QLOptions;
|
import com.alibaba.qlexpress4.QLOptions;
|
||||||
import com.alibaba.qlexpress4.QLResult;
|
import com.alibaba.qlexpress4.QLResult;
|
||||||
@@ -534,10 +535,10 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
} else {
|
} else {
|
||||||
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||||
}
|
}
|
||||||
JSONObject assayDataJson = new JSONObject();
|
Map<String, ReportFieldValueData> assayDataJson = new HashMap<>();
|
||||||
String assayData = businessAssayReportDataDO.getAssayData();
|
String assayData = businessAssayReportDataDO.getAssayData();
|
||||||
if (StringUtils.isNotBlank(assayData)) {
|
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());
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId()) && "normal".equals(f.getAssessmentStatus())).collect(Collectors.toList());
|
||||||
@@ -582,11 +583,10 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES);
|
businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES);
|
||||||
}
|
}
|
||||||
if (busDataSources.size() > 0) {//计算
|
if (busDataSources.size() > 0) {//计算
|
||||||
|
|
||||||
Map<String, Object> calcContext = assayDataJson.entrySet().stream().collect(Collectors.toMap(
|
Map<String, Object> calcContext = assayDataJson.entrySet().stream().collect(Collectors.toMap(
|
||||||
Map.Entry::getKey,
|
Map.Entry::getKey,
|
||||||
entry -> {
|
entry -> {
|
||||||
ReportFieldValueData data = (ReportFieldValueData) entry.getValue();
|
ReportFieldValueData data = entry.getValue();
|
||||||
String fieldValue = data != null ? data.getFieldValue() : null;
|
String fieldValue = data != null ? data.getFieldValue() : null;
|
||||||
if (fieldValue == null || fieldValue.isEmpty()) {
|
if (fieldValue == null || fieldValue.isEmpty()) {
|
||||||
return BigDecimal.ZERO;
|
return BigDecimal.ZERO;
|
||||||
@@ -633,14 +633,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
reportFieldValueData.setMethodName(null);
|
reportFieldValueData.setMethodName(null);
|
||||||
assayDataJson.put(configReportFieldCalculated.getField(), reportFieldValueData);
|
assayDataJson.put(configReportFieldCalculated.getField(), reportFieldValueData);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString());
|
businessAssayReportDataDO.setAssayData(JSON.toJSONString(assayDataJson));
|
||||||
businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource));
|
businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user