|
|
@@ -30,17 +30,14 @@ public class PerformanceVerificationServiceImpl implements PerformanceVerificati
|
|
|
public ReportDataDTO importExcelRecord(String id, MultipartFile applyFiles) throws IOException {
|
|
|
|
|
|
InspectionConfigVO config = getInspectionConfig(id);
|
|
|
-// InspectionItemVO item = new InspectionItemVO(config);
|
|
|
-// item.importExcelRecord(applyFiles.getInputStream());
|
|
|
PVItemBuilder builder = PVItemBuilder.getInstance(config);
|
|
|
|
|
|
builder.importExcelRecord(applyFiles.getInputStream());
|
|
|
Experimental experimental = experimentalRepository.load(id);
|
|
|
-// if(!item.isDataPass()){
|
|
|
-// throw new IOException(JSONObject.toJSONString(item.getErrorMessage(), SerializerFeature.DisableCircularReferenceDetect));
|
|
|
-// }
|
|
|
+
|
|
|
ReportDataDTO dataDTO = ReportFactory.build(builder);
|
|
|
- experimental.getData().setShiYanShuJu(JSONObject.toJSONString(dataDTO, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
+ experimental.getData().setShiYanShuJu(JSONObject.toJSONString(builder.getPvModel().getData(), SerializerFeature.DisableCircularReferenceDetect));
|
|
|
+ experimental.getData().setJiSuanJieGuo(JSONObject.toJSONString(dataDTO, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
experimental.getData().setShiYanJieLun(builder.getPvModel().generateResult());
|
|
|
experimental.save();
|
|
|
return dataDTO;
|
|
|
@@ -69,10 +66,25 @@ public class PerformanceVerificationServiceImpl implements PerformanceVerificati
|
|
|
@Override
|
|
|
public ReportDataDTO getReportRecord(String id) {
|
|
|
ExperimentalPo experimentalPo = experimentalRepository.get(id);
|
|
|
- InspectionItemVO item = JSON.parseObject(experimentalPo.getShiYanShuJu(), InspectionItemVO.class);
|
|
|
+ InspectionItemVO item = JSON.parseObject(experimentalPo.getJiSuanJieGuo(), InspectionItemVO.class);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ReportDataDTO recalculate(String id) {
|
|
|
+ InspectionConfigVO config = getInspectionConfig(id);
|
|
|
+ PVItemBuilder builder = PVItemBuilder.getInstance(config);
|
|
|
+ Experimental experimental = experimentalRepository.load(id);
|
|
|
+ double[][] object = JSON.parseObject(experimental.getData().getShiYanShuJu(), double[][].class);
|
|
|
+ builder.buildPVModel(object);
|
|
|
+
|
|
|
+ ReportDataDTO dataDTO = ReportFactory.build(builder);
|
|
|
+ experimental.getData().setJiSuanJieGuo(JSONObject.toJSONString(dataDTO, SerializerFeature.DisableCircularReferenceDetect));
|
|
|
+ experimental.getData().setShiYanJieLun(builder.getPvModel().generateResult());
|
|
|
+ experimental.save();
|
|
|
+ return dataDTO;
|
|
|
+ }
|
|
|
+
|
|
|
private InspectionConfigVO getInspectionConfig(String id) {
|
|
|
|
|
|
ExperimentalPo experimentalPo = experimentalRepository.get(id);
|