|
|
|
|
@ -192,7 +192,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
hour1 = "" + hour; |
|
|
|
|
} |
|
|
|
|
// 检测编号前缀
|
|
|
|
|
String s = "W-" + year + month1 + day1 + hour1 + "-"; |
|
|
|
|
String[] strings = entrust.getAcceptanceNum().split("-"); |
|
|
|
|
String s = strings[1] + year + month1 + day1 + hour1 + "-"; |
|
|
|
|
|
|
|
|
|
StringBuilder simpleName = new StringBuilder(); |
|
|
|
|
Integer simpleCount = 0; |
|
|
|
|
@ -230,7 +231,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
simpleRel.setSort(sort); |
|
|
|
|
rels.add(simpleRel); |
|
|
|
|
} |
|
|
|
|
sort ++; |
|
|
|
|
sort++; |
|
|
|
|
} |
|
|
|
|
simpleRelService.saveBatch(rels); |
|
|
|
|
|
|
|
|
|
@ -689,7 +690,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
instrumentName += s2 + ","; |
|
|
|
|
} |
|
|
|
|
result.put("9", instrumentName); |
|
|
|
|
String value = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examineResult.getSimpleStatus()); |
|
|
|
|
String value = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examineResult.getSimpleStatus()); |
|
|
|
|
result.put("10", value); |
|
|
|
|
result.put("11", "温度" + examineResult.getTemperature() + "℃; " + "湿度" + examineResult.getHumidity() + "%RH"); |
|
|
|
|
result.put("12", examineWay.getOperation()); |
|
|
|
|
@ -704,7 +705,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
farView.setHeight(50);//设置高度
|
|
|
|
|
farView.setWidth(90);//设置宽度
|
|
|
|
|
farView.setType(ImageEntity.Data);//类型
|
|
|
|
|
// farView.setData(getFileStream("http://192.168.1.5:81/static/jianming.PNG"));
|
|
|
|
|
String s1 = path + user.getElectronicSignature(); |
|
|
|
|
System.out.println(s1); |
|
|
|
|
FileInputStream fis = null; |
|
|
|
|
@ -803,14 +803,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
if (examineResult.getPicturePath() != null && !"".equals(examineResult.getPicturePath())) { |
|
|
|
|
String[] sp = examineResult.getPicturePath().split(","); |
|
|
|
|
for (String s2 : sp) { |
|
|
|
|
for (String picturePath : sp) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
ImageEntity farView1 = new ImageEntity(); |
|
|
|
|
farView1.setHeight(400);//设置高度
|
|
|
|
|
farView1.setWidth(700);//设置宽度
|
|
|
|
|
farView1.setHeight(350);//设置高度
|
|
|
|
|
farView1.setWidth(550);//设置宽度
|
|
|
|
|
farView1.setType(ImageEntity.Data);//类型
|
|
|
|
|
|
|
|
|
|
String s1 = path + s2; |
|
|
|
|
String s1 = path + picturePath; |
|
|
|
|
FileInputStream fis = null; |
|
|
|
|
try { |
|
|
|
|
fis = new FileInputStream(new File(s1)); |
|
|
|
|
@ -819,9 +819,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
map.put("picture", farView1); |
|
|
|
|
map.put("p", farView1); |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
// String picturePath = examineResult.getPicturePath();
|
|
|
|
|
// ImageEntity farView1 = new ImageEntity();
|
|
|
|
|
// farView1.setHeight(350);//设置高度
|
|
|
|
|
// farView1.setWidth(550);//设置宽度
|
|
|
|
|
// farView1.setType(ImageEntity.Data);//类型
|
|
|
|
|
//
|
|
|
|
|
// String s1 = path + picturePath;
|
|
|
|
|
// FileInputStream fis = null;
|
|
|
|
|
// try {
|
|
|
|
|
// fis = new FileInputStream(new File(s1));
|
|
|
|
|
// byte[] bytes = readInputStream(fis);
|
|
|
|
|
// farView1.setData(bytes);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// result.put("16", farView1);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
result.put("list1", resultList2); |
|
|
|
|
@ -1461,10 +1477,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
// 模板地址
|
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告2(模板).docx";
|
|
|
|
|
XWPFDocument doc = null; |
|
|
|
|
// FileOutputStream fos = null;
|
|
|
|
|
FileOutputStream fos = null; |
|
|
|
|
try { |
|
|
|
|
doc = WordExportUtil.exportWord07(url, result); |
|
|
|
|
// fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//检测报告2.docx");
|
|
|
|
|
fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//检测报告2.docx"); |
|
|
|
|
String filename = "测试.docx"; |
|
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
|
response.setHeader("content-disposition", "attachment;filename=12344.docx"); |
|
|
|
|
@ -1472,21 +1488,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} finally { |
|
|
|
|
// if (null != doc) {
|
|
|
|
|
//// doc.close();
|
|
|
|
|
// try {
|
|
|
|
|
// doc.write(fos);
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (null != fos) {
|
|
|
|
|
// try {
|
|
|
|
|
// fos.close();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (null != doc) { |
|
|
|
|
// doc.close();
|
|
|
|
|
try { |
|
|
|
|
doc.write(fos); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != fos) { |
|
|
|
|
try { |
|
|
|
|
fos.close(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != doc) { |
|
|
|
|
try { |
|
|
|
|
doc.close(); |
|
|
|
|
@ -1895,7 +1911,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
for (Simple simple : list1) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("acceptanceNum", simpleSet.getAcceptanceNum()); |
|
|
|
|
|
|
|
|
|
map.put("samplingDate", format.format(simpleSet.getSamplingDate())); |
|
|
|
|
map.put("entrustCustomerName", currEntrust.getEntrustCustomerName()); |
|
|
|
|
map.put("simpleName", simpleSet.getSimpleName()); |
|
|
|
|
|