|
|
@@ -41,15 +41,16 @@ public class PVTest {
|
|
|
|
|
|
@Test
|
|
|
public void testExcelTemplateExport() throws IOException {
|
|
|
-// InspectionConfigVO config = new InspectionConfigVO("批内精密度",1,2,
|
|
|
-// new String[]{"高溶度(R1)","低浓度(R2)"},10, LocalDate.now(),true);
|
|
|
+// InspectionConfigVO config = new InspectionConfigVO("批间精密度",5,2,
|
|
|
+// new String[]{"高溶度(R1)","低浓度(R2)"},3, LocalDate.now(),true);
|
|
|
|
|
|
// InspectionConfigVO config = new InspectionConfigVO("正确度",5,2,
|
|
|
// new String[]{"L2","L4"},2, LocalDate.now(),true);
|
|
|
|
|
|
- InspectionConfigVO config = new InspectionConfigVO("线性范围", 1, 7,
|
|
|
- new String[]{"E8", "E7", "E6", "E5", "E4", "E3", "E2"}, 3, LocalDate.now(), true);
|
|
|
-
|
|
|
+// InspectionConfigVO config = new InspectionConfigVO("线性范围", 1, 7,
|
|
|
+// new String[]{"E8", "E7", "E6", "E5", "E4", "E3", "E2"}, 3, LocalDate.now(), true);
|
|
|
+ InspectionConfigVO config = new InspectionConfigVO("EP15-2A",5,2,
|
|
|
+ new String[]{"L2","L4"},3, LocalDate.now(),true);
|
|
|
InspectionItemVO item = new InspectionItemVO(config);
|
|
|
Workbook workbook = item.exportExcelTemplate();
|
|
|
FileOutputStream fos = new FileOutputStream(String.format("C:/tmp/%s.xlsx", config.getName()));
|
|
|
@@ -68,6 +69,13 @@ public class PVTest {
|
|
|
// File file = new File(String.format("C:/tmp/%sdata.xlsx",config.getName()));
|
|
|
// FileInputStream in = new FileInputStream(file);
|
|
|
// item.importExcelRecord(in);
|
|
|
+ InspectionConfigVO config = new InspectionConfigVO("EP15-2A",5,2,
|
|
|
+ new String[]{"L2","L4"},3, LocalDate.now(),false);
|
|
|
+ config.setFunc(new FunctionEnum[]{FunctionEnum.AVERAGE,FunctionEnum.SD,FunctionEnum.CV});
|
|
|
+ InspectionItemVO item = new InspectionItemVO(config);
|
|
|
+ File file = new File(String.format("C:/tmp/%sdata.xlsx",config.getName()));
|
|
|
+ FileInputStream in = new FileInputStream(file);
|
|
|
+ item.importExcelRecord(in);
|
|
|
//批内精密度
|
|
|
// InspectionConfigVO config2 = new InspectionConfigVO("批内精密度",1,2,
|
|
|
// new String[]{"高溶度(R1)","低浓度(R2)"},10, LocalDate.now(),true);
|
|
|
@@ -88,29 +96,29 @@ public class PVTest {
|
|
|
// item3.importExcelRecord(in3);
|
|
|
|
|
|
//线性范围
|
|
|
- InspectionConfigVO config4 = new InspectionConfigVO("线性范围", 1, 7,
|
|
|
- new String[]{"E8", "E7", "E6", "E5", "E4", "E3", "E2"}, 3, LocalDate.now(), true);
|
|
|
-
|
|
|
- config4.setFunc(new FunctionEnum[]{FunctionEnum.AVERAGE,FunctionEnum.TARGET,FunctionEnum.LRE, FunctionEnum.R});
|
|
|
- config4.setTargetValue(new double[]{8.48, 7.48, 6.48, 5.48, 4.58, 3.58, 2.58});
|
|
|
- InspectionItemVO item4 = new InspectionItemVO(config4);
|
|
|
- File file4 = new File(String.format("C:/tmp/%sdata.xlsx", config4.getName()));
|
|
|
- FileInputStream in4 = new FileInputStream(file4);
|
|
|
- item4.importExcelRecord(in4);
|
|
|
+// InspectionConfigVO config4 = new InspectionConfigVO("线性范围", 1, 7,
|
|
|
+// new String[]{"E8", "E7", "E6", "E5", "E4", "E3", "E2"}, 3, LocalDate.now(), true);
|
|
|
+//
|
|
|
+// config4.setFunc(new FunctionEnum[]{FunctionEnum.AVERAGE,FunctionEnum.TARGET,FunctionEnum.LRE, FunctionEnum.R});
|
|
|
+// config4.setTargetValue(new double[]{8.48, 7.48, 6.48, 5.48, 4.58, 3.58, 2.58});
|
|
|
+// InspectionItemVO item4 = new InspectionItemVO(config4);
|
|
|
+// File file4 = new File(String.format("C:/tmp/%sdata.xlsx", config4.getName()));
|
|
|
+// FileInputStream in4 = new FileInputStream(file4);
|
|
|
+// item4.importExcelRecord(in4);
|
|
|
|
|
|
|
|
|
InspectionVO vo = new InspectionVO();
|
|
|
vo.setName("TEST");
|
|
|
-// vo.getItem().add(item);
|
|
|
+ vo.getItem().add(item);
|
|
|
// vo.getItem().add(item2);
|
|
|
// vo.getItem().add(item3);
|
|
|
- vo.getItem().add(item4);
|
|
|
- final String s = JSONObject.toJSONString(vo,SerializerFeature.PrettyFormat,SerializerFeature.DisableCircularReferenceDetect);
|
|
|
+// vo.getItem().add(item4);
|
|
|
+ final String s = JSONObject.toJSONString(item,SerializerFeature.PrettyFormat,SerializerFeature.DisableCircularReferenceDetect);
|
|
|
InspectionVO voJson = JSON.parseObject(s, InspectionVO.class);
|
|
|
|
|
|
System.out.println(s);
|
|
|
final Workbook workbook = vo.exportExcelReport(false);
|
|
|
- FileOutputStream fos = new FileOutputStream(String.format("C:/tmp/%s.xlsx", vo.getName()));
|
|
|
+ FileOutputStream fos = new FileOutputStream(String.format("C:/tmp/%sReport.xlsx", config.getName()));
|
|
|
workbook.write(fos);
|
|
|
fos.close();
|
|
|
|