|
|
@@ -32,7 +32,12 @@ public class InspectionItemVO {
|
|
|
|
|
|
//样本名 : 检查数据
|
|
|
@JSONField(serialize = false)
|
|
|
- private Map<String, SpecimensCalcVO> record = new HashMap<>();;
|
|
|
+ private Map<String, SpecimensCalcVO> record = new HashMap<>();
|
|
|
+
|
|
|
+ @JSONField(serialize = false)
|
|
|
+ private Map<String, EP15CalcVO> record2 = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
@JSONField(serialize = false)
|
|
|
private ItemCalcVO itemCalcVO;
|
|
|
@JSONField(serialize = false)
|
|
|
@@ -80,12 +85,10 @@ public class InspectionItemVO {
|
|
|
list.add(map);
|
|
|
}
|
|
|
List<ExportParams> exportParamsList = new ArrayList<ExportParams>();
|
|
|
- LocalDate startDate = config.getStartDate();
|
|
|
- for (int i = 0; i < config.getDays(); i++) {
|
|
|
- ExportParams exportParams = new ExportParams(config.getName() + " 数据导入模板", startDate.toString());
|
|
|
+ for (int i = 1; i < config.getDays()+1; i++) {
|
|
|
+ ExportParams exportParams = new ExportParams(config.getName() + " 数据导入模板", String.format("第 %d 天",i));
|
|
|
exportParams.setStyle(PVExcelExportStyler.class);
|
|
|
exportParamsList.add(exportParams);
|
|
|
- startDate = startDate.plusDays(1);
|
|
|
exportParams.setType(ExcelType.XSSF);
|
|
|
}
|
|
|
Workbook workbook = PVExcelUtil.exportExcelTemplateWithMultiSheet(exportParamsList, entity, list);
|
|
|
@@ -168,30 +171,42 @@ public class InspectionItemVO {
|
|
|
params.setHeadRows(1);
|
|
|
params.setSheetNum(config.getDays());
|
|
|
List<ExcelSheetRecord> list = PVExcelUtil.importExcel(inputstream, Map.class, params);
|
|
|
- LocalDate startDate = config.getStartDate();
|
|
|
+ int i = 1;
|
|
|
for (ExcelSheetRecord record : list) {
|
|
|
- record.convert(config, startDate.toString());
|
|
|
+ record.convert(config, String.format("第 %d 天",i));
|
|
|
if (record.getErrors().size() > 0) {
|
|
|
- errorMessage.put(startDate.toString(), record.getErrors());
|
|
|
+ errorMessage.put(String.format("第 %d 天",i), record.getErrors());
|
|
|
}
|
|
|
- startDate = startDate.plusDays(1);
|
|
|
+ i++;
|
|
|
}
|
|
|
if (errorMessage.size() > 0) {
|
|
|
return;
|
|
|
} else {
|
|
|
dataPass = true;
|
|
|
}
|
|
|
- for (String sName : config.getSpecimensName()) {
|
|
|
- final xValue[] total = new xValue[config.getRepeatNum() * config.getDays()];
|
|
|
- for (int j = 0; j < list.size(); j++) {
|
|
|
- final xValue[] xValues = list.get(j).getConvertedData().get(sName);
|
|
|
- for (int k = 0; k < xValues.length; k++) {
|
|
|
- total[j * xValues.length + k] = xValues[k];
|
|
|
+
|
|
|
+ if(config.getName().toLowerCase().contains("ep15")){
|
|
|
+ for (String sName : config.getSpecimensName()) {
|
|
|
+ SpecimensCalcVO[] data = new SpecimensCalcVO[config.getDays()];
|
|
|
+ for (int j = 0; j < list.size(); j++) {
|
|
|
+ final xValue[] xValues = list.get(j).getConvertedData().get(sName);
|
|
|
+ data[j] = new SpecimensCalcVO(xValues, config.isConvert());
|
|
|
}
|
|
|
+ record2.put(sName, new EP15CalcVO(data,config.getDays()));
|
|
|
}
|
|
|
- record.put(sName, new SpecimensCalcVO(total, config.isConvert()));
|
|
|
+ }else {
|
|
|
+ for (String sName : config.getSpecimensName()) {
|
|
|
+ final xValue[] total = new xValue[config.getRepeatNum() * config.getDays()];
|
|
|
+ for (int j = 0; j < list.size(); j++) {
|
|
|
+ final xValue[] xValues = list.get(j).getConvertedData().get(sName);
|
|
|
+ for (int k = 0; k < xValues.length; k++) {
|
|
|
+ total[j * xValues.length + k] = xValues[k];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ record.put(sName, new SpecimensCalcVO(total, config.isConvert()));
|
|
|
+ }
|
|
|
+ buildItemCalcVO();
|
|
|
}
|
|
|
- buildItemCalcVO();
|
|
|
}
|
|
|
|
|
|
private void buildItemCalcVO() {
|
|
|
@@ -202,7 +217,7 @@ public class InspectionItemVO {
|
|
|
for (int i = 0; i < config.getSpecimensNum(); i++) {
|
|
|
String sName = config.getSpecimensName()[i];
|
|
|
record.get(sName).setTargetValue(config.getTargetValue()[i]);
|
|
|
- specimens[i] = record.get(sName).getAverage();
|
|
|
+ specimens[i] = record.get(sName).getMean();
|
|
|
target[i] = new xValue(config.getTargetValue()[i]);
|
|
|
}
|
|
|
itemCalcVO = new ItemCalcVO(specimens, target);
|