|
|
|
@ -92,8 +92,35 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
@Value("${handleUrl}") |
|
|
|
@Value("${handleUrl}") |
|
|
|
private String handleUrl; |
|
|
|
private String handleUrl; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${print}") |
|
|
|
@Value("${print1}") |
|
|
|
private String print; |
|
|
|
private String print1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print2}") |
|
|
|
|
|
|
|
private String print2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print3}") |
|
|
|
|
|
|
|
private String print3; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print4}") |
|
|
|
|
|
|
|
private String print4; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print5}") |
|
|
|
|
|
|
|
private String print5; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print6}") |
|
|
|
|
|
|
|
private String print6; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print7}") |
|
|
|
|
|
|
|
private String print7; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print8}") |
|
|
|
|
|
|
|
private String print8; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print9}") |
|
|
|
|
|
|
|
private String print9; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${print10}") |
|
|
|
|
|
|
|
private String print10; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${reportPrint}") |
|
|
|
@Value("${reportPrint}") |
|
|
|
private String reportPrint; |
|
|
|
private String reportPrint; |
|
|
|
@ -131,7 +158,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
@Value("${simpleReceivePrint}") |
|
|
|
@Value("${simpleReceivePrint}") |
|
|
|
private String simpleReceivePrint; |
|
|
|
private String simpleReceivePrint; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> resultList2 = new ArrayList<>(); |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Entrust addEntrust(Entrust entrust) { |
|
|
|
public Entrust addEntrust(Entrust entrust) { |
|
|
|
@ -157,7 +184,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
addOrUpdateEntrust(entrust, id); |
|
|
|
addOrUpdateEntrust(entrust, id); |
|
|
|
|
|
|
|
|
|
|
|
// 新增或修改 检测集合
|
|
|
|
// 新增或修改 检测集合
|
|
|
|
addOrUpdateExamines(entrust.getExamines(), entrust.getId()); |
|
|
|
addOrUpdateExamines(entrust.getExamines(), entrust); |
|
|
|
return entrust; |
|
|
|
return entrust; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -307,14 +334,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
wrapper.eq(Examine::getEntrustId, id); |
|
|
|
wrapper.eq(Examine::getEntrustId, id); |
|
|
|
List<Examine> examineList = examineService.list(wrapper); |
|
|
|
List<Examine> examineList = examineService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 需要批量生成的map
|
|
|
|
|
|
|
|
List<Map<String, Object>> ItemAndAllList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 填充检验项目、方法、依据
|
|
|
|
// 填充检验项目、方法、依据
|
|
|
|
ItemAndAllList.add(fillExamineItemAndAll(examineList)); |
|
|
|
List<Map<String, Object>> ItemAndAllList = fillExamineItemAndAll(examineList); |
|
|
|
|
|
|
|
|
|
|
|
// 填充报告的主体内容
|
|
|
|
// 填充报告的主体内容
|
|
|
|
Map<String, Object> reportMainBody = fillReportMainBody(entrust, ItemAndAllList); |
|
|
|
Map<String, Object> reportMainBody = fillReportMainBody(entrust, ItemAndAllList, examineList); |
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// 当前使用的模板
|
|
|
|
// 当前使用的模板
|
|
|
|
@ -324,23 +348,23 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
|
|
|
|
|
|
|
// 根据检测的数量判断用按个模板
|
|
|
|
// 根据检测的数量判断用按个模板
|
|
|
|
switch (examineCount) { |
|
|
|
switch (examineCount) { |
|
|
|
case 1: currTemplate = print; break; |
|
|
|
case 1: currTemplate = print1; break; |
|
|
|
case 2: currTemplate = print; break; |
|
|
|
case 2: currTemplate = print2; break; |
|
|
|
case 3: currTemplate = print; break; |
|
|
|
case 3: currTemplate = print3; break; |
|
|
|
case 4: currTemplate = print; break; |
|
|
|
case 4: currTemplate = print4; break; |
|
|
|
case 5: currTemplate = print; break; |
|
|
|
case 5: currTemplate = print5; break; |
|
|
|
case 6: currTemplate = print; break; |
|
|
|
case 6: currTemplate = print6; break; |
|
|
|
case 7: currTemplate = print; break; |
|
|
|
case 7: currTemplate = print7; break; |
|
|
|
case 8: currTemplate = print; break; |
|
|
|
case 8: currTemplate = print8; break; |
|
|
|
case 9: currTemplate = print; break; |
|
|
|
case 9: currTemplate = print9; break; |
|
|
|
case 10: currTemplate = print; break; |
|
|
|
case 10: currTemplate = print10; break; |
|
|
|
default: currTemplate = print; |
|
|
|
default: currTemplate = print10; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<ExamineResultVo> resultList = new ArrayList<>(); |
|
|
|
List<ExamineResultVo> resultList = new ArrayList<>(); |
|
|
|
// 根据检验判断有几个name
|
|
|
|
// 根据检验判断有几个name
|
|
|
|
for (int i = 1; i <= examineList.size(); i++) { |
|
|
|
for (int i = 1; i <= examineList.size(); i++) { |
|
|
|
Examine examine = examineList.get(i); |
|
|
|
Examine examine = examineList.get(i - 1); |
|
|
|
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId()); |
|
|
|
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId()); |
|
|
|
// 检测项目名称
|
|
|
|
// 检测项目名称
|
|
|
|
reportMainBody.put("name" + i, examineItem.getName()); |
|
|
|
reportMainBody.put("name" + i, examineItem.getName()); |
|
|
|
@ -598,7 +622,18 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
// 根据检测编号分组
|
|
|
|
// 根据检测编号分组
|
|
|
|
Map<String, List<ExamineResultVo>> collect = resultList.stream().collect(Collectors.groupingBy(ExamineResultVo::getNum)); |
|
|
|
Map<String, List<ExamineResultVo>> collect = resultList.stream().collect(Collectors.groupingBy(ExamineResultVo::getNum)); |
|
|
|
Set<String> keys = collect.keySet(); |
|
|
|
Set<String> keys = collect.keySet(); |
|
|
|
for (String key : keys) { |
|
|
|
List<String> keyList = new ArrayList<>(); |
|
|
|
|
|
|
|
keyList.addAll(keys); |
|
|
|
|
|
|
|
Collections.sort(keyList, new Comparator<String>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int compare(String o1, String o2) { |
|
|
|
|
|
|
|
Integer expirNum1 = Integer.valueOf(o1.split("-")[2]); |
|
|
|
|
|
|
|
Integer expirNum2 = Integer.valueOf(o2.split("-")[2]); |
|
|
|
|
|
|
|
return expirNum1 - expirNum2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String key : keyList) { |
|
|
|
Map<String, Object> temp = new HashMap<>(); |
|
|
|
Map<String, Object> temp = new HashMap<>(); |
|
|
|
List<ExamineResultVo> everyExamines = collect.get(key); |
|
|
|
List<ExamineResultVo> everyExamines = collect.get(key); |
|
|
|
temp.put("num", key); |
|
|
|
temp.put("num", key); |
|
|
|
@ -606,8 +641,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
for (int i = 0; i < everyExamines.size(); i++) { |
|
|
|
for (int i = 0; i < everyExamines.size(); i++) { |
|
|
|
ExamineResultVo everyObj = everyExamines.get(i); |
|
|
|
ExamineResultVo everyObj = everyExamines.get(i); |
|
|
|
int index = everyObj.getIndex(); |
|
|
|
int index = everyObj.getIndex(); |
|
|
|
temp.put("value" + index, everyObj.getOriginalNum()); |
|
|
|
temp.put("value" + index, everyObj.getValue()); |
|
|
|
temp.put("result" + index, everyObj.getOriginalNum()); |
|
|
|
temp.put("result" + index, everyObj.getResult()); |
|
|
|
} |
|
|
|
} |
|
|
|
resultResultList.add(temp); |
|
|
|
resultResultList.add(temp); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -741,10 +776,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
private void dealAboutPrintStream(HttpServletResponse response, Map<String, Object> reportMainBody, Entrust entrust, String templateUrl) { |
|
|
|
private void dealAboutPrintStream(HttpServletResponse response, Map<String, Object> reportMainBody, Entrust entrust, String templateUrl) { |
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告(模板).docx";
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告(模板).docx";
|
|
|
|
XWPFDocument doc = null; |
|
|
|
XWPFDocument doc = null; |
|
|
|
FileOutputStream fos = null; |
|
|
|
// FileOutputStream fos = null;
|
|
|
|
try { |
|
|
|
try { |
|
|
|
doc = WordExportUtil.exportWord07(templateUrl, reportMainBody); |
|
|
|
doc = WordExportUtil.exportWord07(templateUrl, reportMainBody); |
|
|
|
fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//1111111.docx"); |
|
|
|
// fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//1111111.docx");
|
|
|
|
String filename = "测试.docx"; |
|
|
|
String filename = "测试.docx"; |
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
response.setHeader("content-disposition", "attachment;filename=12344.docx"); |
|
|
|
response.setHeader("content-disposition", "attachment;filename=12344.docx"); |
|
|
|
@ -754,21 +789,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
if (null != doc) { |
|
|
|
// if (null != doc) {
|
|
|
|
// doc.close();
|
|
|
|
//// doc.close();
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
doc.write(fos); |
|
|
|
// doc.write(fos);
|
|
|
|
} catch (IOException e) { |
|
|
|
// } catch (IOException e) {
|
|
|
|
e.printStackTrace(); |
|
|
|
// e.printStackTrace();
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
if (null != fos) { |
|
|
|
// if (null != fos) {
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
fos.close(); |
|
|
|
// fos.close();
|
|
|
|
} catch (IOException e) { |
|
|
|
// } catch (IOException e) {
|
|
|
|
e.printStackTrace(); |
|
|
|
// e.printStackTrace();
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
if (null != doc) { |
|
|
|
if (null != doc) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
doc.close(); |
|
|
|
doc.close(); |
|
|
|
@ -782,8 +817,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 填充报告的主体内容 |
|
|
|
* 填充报告的主体内容 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private Map<String, Object> fillReportMainBody(Entrust entrust, List<Map<String, Object>> ItemAndAllList) { |
|
|
|
private Map<String, Object> fillReportMainBody(Entrust entrust, List<Map<String, Object>> ItemAndAllList, List<Examine> examineList) { |
|
|
|
Map<String, Object> result1 = new HashMap<>(); |
|
|
|
Map<String, Object> result1 = new HashMap<>(); |
|
|
|
|
|
|
|
// 委托单对应任务书
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TaskBlueprint> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
wrapper.eq(TaskBlueprint::getEntrustId, entrust.getId()); |
|
|
|
|
|
|
|
TaskBlueprint taskBlueprint = blueprintService.getOne(wrapper); |
|
|
|
result1.put("acceptanceNum", entrust.getAcceptanceNum()); |
|
|
|
result1.put("acceptanceNum", entrust.getAcceptanceNum()); |
|
|
|
result1.put("simpleName", entrust.getSimpleName()); |
|
|
|
result1.put("simpleName", entrust.getSimpleName()); |
|
|
|
result1.put("takeCompany", entrust.getTakeCompany()); |
|
|
|
result1.put("takeCompany", entrust.getTakeCompany()); |
|
|
|
@ -796,7 +835,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
result1.put("mailAddr", entrust.getMailAddr()); |
|
|
|
result1.put("mailAddr", entrust.getMailAddr()); |
|
|
|
result1.put("phone", entrust.getPhone()); |
|
|
|
result1.put("phone", entrust.getPhone()); |
|
|
|
result1.put("submittedBy", entrust.getSubmittedBy()); |
|
|
|
result1.put("submittedBy", entrust.getSubmittedBy()); |
|
|
|
SimpleDateFormat format3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
SimpleDateFormat format3 = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
|
String format4 = ""; |
|
|
|
String format4 = ""; |
|
|
|
if (entrust.getSamplingDate() != null) { |
|
|
|
if (entrust.getSamplingDate() != null) { |
|
|
|
format4 = format3.format(entrust.getSamplingDate()); |
|
|
|
format4 = format3.format(entrust.getSamplingDate()); |
|
|
|
@ -804,9 +843,22 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
result1.put("samplingDate", format4); |
|
|
|
result1.put("samplingDate", format4); |
|
|
|
result1.put("simpleState", entrust.getSimpleState()); |
|
|
|
result1.put("simpleState", entrust.getSimpleState()); |
|
|
|
result1.put("simpleCount", entrust.getSimpleCount()); |
|
|
|
result1.put("simpleCount", entrust.getSimpleCount()); |
|
|
|
result1.put("code", "仪器");//???
|
|
|
|
String instrumentName = ""; |
|
|
|
result1.put("experieDate", "检测日期");//???
|
|
|
|
if (CollectionUtils.isNotEmpty(examineList)) { |
|
|
|
result1.put("remark", "备注");//???
|
|
|
|
for (Examine examine : examineList) { |
|
|
|
|
|
|
|
LambdaQueryWrapper<ExamineResult> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq(ExamineResult::getExamineId, examine.getId()); |
|
|
|
|
|
|
|
ExamineResult examineResult = examineResultService.getOne(queryWrapper); |
|
|
|
|
|
|
|
String[] split = examineResult.getInstrumentId().split(","); |
|
|
|
|
|
|
|
for (String s : split) { |
|
|
|
|
|
|
|
Instrument instrument = instrumentService.getById(s); |
|
|
|
|
|
|
|
instrumentName += instrument.getCode() + " " + instrument.getName() + ","; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
result1.put("code", instrumentName); |
|
|
|
|
|
|
|
result1.put("experieDate", format3.format(taskBlueprint.getCreateTime())); |
|
|
|
|
|
|
|
result1.put("remark", entrust.getRemark()); |
|
|
|
result1.put("resultList1", ItemAndAllList); |
|
|
|
result1.put("resultList1", ItemAndAllList); |
|
|
|
// 盖章图片
|
|
|
|
// 盖章图片
|
|
|
|
ImageEntity farView = new ImageEntity(); |
|
|
|
ImageEntity farView = new ImageEntity(); |
|
|
|
@ -831,9 +883,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 填充检验项目、方法、依据 |
|
|
|
* 填充检验项目、方法、依据 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private HashMap<String, Object> fillExamineItemAndAll(List<Examine> examineList) { |
|
|
|
private List<Map<String, Object>> fillExamineItemAndAll(List<Examine> examineList) { |
|
|
|
HashMap<String, Object> map = new HashMap<>(4); |
|
|
|
List<Map<String, Object>> ItemAndAllList = new ArrayList<>(); |
|
|
|
for (Examine examine : examineList) { |
|
|
|
for (Examine examine : examineList) { |
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>(4); |
|
|
|
if (examine.getExamineItemId() != null) { |
|
|
|
if (examine.getExamineItemId() != null) { |
|
|
|
ExamineItem byId = examineItemService.getById(examine.getExamineItemId()); |
|
|
|
ExamineItem byId = examineItemService.getById(examine.getExamineItemId()); |
|
|
|
if (byId != null) { |
|
|
|
if (byId != null) { |
|
|
|
@ -853,15 +906,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("examineResult", "符合标准"); |
|
|
|
map.put("examineResult", "符合标准"); |
|
|
|
|
|
|
|
ItemAndAllList.add(map); |
|
|
|
} |
|
|
|
} |
|
|
|
return map; |
|
|
|
return ItemAndAllList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void reportPrint(String examineId, HttpServletResponse response) { |
|
|
|
public void reportPrint(String examineId, HttpServletResponse response) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
List<Map<String, Object>> resultList1 = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> resultList1 = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> resultList2 = new ArrayList<>(); |
|
|
|
|
|
|
|
String url = ""; |
|
|
|
String url = ""; |
|
|
|
// 检测数据
|
|
|
|
// 检测数据
|
|
|
|
Examine examine = examineService.getById(examineId); |
|
|
|
Examine examine = examineService.getById(examineId); |
|
|
|
@ -901,19 +955,54 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
result.put("7", regentName); |
|
|
|
result.put("7", regentName); |
|
|
|
|
|
|
|
|
|
|
|
// 生产厂家及批号
|
|
|
|
// 生产厂家及批号
|
|
|
|
String manu = ""; |
|
|
|
String manufacturer = ""; |
|
|
|
List<String> strList = new ArrayList<>(); |
|
|
|
List<String> strList = new ArrayList<>(); |
|
|
|
for (String o : set) { |
|
|
|
for (String m : set) { |
|
|
|
strList.add(o); |
|
|
|
strList.add(m); |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < strList.size(); i++) { |
|
|
|
for (int i = 0; i < strList.size(); i++) { |
|
|
|
if (i == (strList.size() - 1)) { |
|
|
|
if (i == (strList.size() - 1)) { |
|
|
|
manu += strList.get(i); |
|
|
|
manufacturer += strList.get(i); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
manu += strList.get(i) + ","; |
|
|
|
manufacturer += strList.get(i) + ","; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 1.先拿到批次号
|
|
|
|
|
|
|
|
String batchNos = examineResult.getBatchNos(); |
|
|
|
|
|
|
|
String[] split3 = batchNos.split(","); |
|
|
|
|
|
|
|
Map<String, List<String>> tempListMap = new HashMap(); |
|
|
|
|
|
|
|
for (String batch : split3) { |
|
|
|
|
|
|
|
String reagentId = batch.split("-")[0]; |
|
|
|
|
|
|
|
String realBatch = batch.split("-")[1]; |
|
|
|
|
|
|
|
List<String> list = tempListMap.get(reagentId); |
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|
|
|
|
list.add(realBatch); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
List<String> temp = new ArrayList<>(); |
|
|
|
|
|
|
|
temp.add(realBatch); |
|
|
|
|
|
|
|
tempListMap.put(reagentId, temp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String resultBatchStr = ""; |
|
|
|
|
|
|
|
// 遍历处理批号
|
|
|
|
|
|
|
|
Set<String> strings = tempListMap.keySet(); |
|
|
|
|
|
|
|
for (String reagentId : strings) { |
|
|
|
|
|
|
|
// 根据试剂名称查询厂家名称
|
|
|
|
|
|
|
|
Reagent reagent = reagentService.getById(reagentId); |
|
|
|
|
|
|
|
String manufacturerName = reagent.getManufacturer(); |
|
|
|
|
|
|
|
List<String> list = tempListMap.get(reagentId); |
|
|
|
|
|
|
|
resultBatchStr += manufacturerName + ":批号("; |
|
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
|
|
|
|
String realBatch = list.get(i); |
|
|
|
|
|
|
|
resultBatchStr += realBatch; |
|
|
|
|
|
|
|
if (i != list.size() - 1) { |
|
|
|
|
|
|
|
resultBatchStr += "、"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resultBatchStr += ")"; |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("8", manu + "(批号:" + examineResult.getBatchNos() + ")"); |
|
|
|
result.put("8", resultBatchStr); |
|
|
|
|
|
|
|
|
|
|
|
// 使用仪器名称及编号
|
|
|
|
// 使用仪器名称及编号
|
|
|
|
String[] split2 = examineResult.getInstrumentId().split(","); |
|
|
|
String[] split2 = examineResult.getInstrumentId().split(","); |
|
|
|
@ -1938,7 +2027,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 模板地址
|
|
|
|
// 模板地址
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告2(模板).docx";
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告2(模板).docx";
|
|
|
|
XWPFDocument doc = null; |
|
|
|
XWPFDocument doc = null; |
|
|
|
@ -1982,7 +2070,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
public void simpleRegisterPrint(String id, HttpServletResponse response) { |
|
|
|
public void simpleRegisterPrint(String id, HttpServletResponse response) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
Entrust entrust = this.getById(id); |
|
|
|
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(Simple::getEntrustId, id); |
|
|
|
wrapper.eq(Simple::getEntrustId, id); |
|
|
|
wrapper.eq(Simple::getIsReagent, "1"); |
|
|
|
wrapper.eq(Simple::getIsReagent, "1"); |
|
|
|
@ -1996,6 +2084,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
resultList.add(map); |
|
|
|
resultList.add(map); |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("resultList", resultList); |
|
|
|
result.put("resultList", resultList); |
|
|
|
|
|
|
|
result.put("1", entrust.getAcceptanceNum()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//模板地址
|
|
|
|
//模板地址
|
|
|
|
@ -2045,11 +2134,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void simpleNumberPrint(String id, HttpServletResponse response) { |
|
|
|
public void simpleNumberPrint(String id, HttpServletResponse response) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
|
Entrust entrust = this.getById(id); |
|
|
|
Entrust entrust = this.getById(id); |
|
|
|
result.put("num", entrust.getAcceptanceNum()); |
|
|
|
result.put("num", entrust.getAcceptanceNum()); |
|
|
|
result.put("name", entrust.getSimpleName()); |
|
|
|
result.put("name", entrust.getSimpleName()); |
|
|
|
result.put("count", entrust.getSimpleCount()); |
|
|
|
result.put("count", entrust.getSimpleCount()); |
|
|
|
|
|
|
|
result.put("1", "李玉杰"); |
|
|
|
|
|
|
|
result.put("2", format.format(new Date())); |
|
|
|
List<Map<String, Object>> resultList1 = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> resultList1 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
@ -2292,11 +2383,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void simpleHandlePrint(String id, HttpServletResponse response) { |
|
|
|
public void simpleHandlePrint(String id, HttpServletResponse response) { |
|
|
|
Entrust entrust = new Entrust(); |
|
|
|
Entrust entrust = this.getById(id); |
|
|
|
entrust.setId(Long.valueOf(id)); |
|
|
|
|
|
|
|
entrust.setIsHandle("1"); |
|
|
|
entrust.setIsHandle("1"); |
|
|
|
this.updateById(entrust); |
|
|
|
this.updateById(entrust); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
@ -2316,6 +2407,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
resultList.add(map); |
|
|
|
resultList.add(map); |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("resultList", resultList); |
|
|
|
result.put("resultList", resultList); |
|
|
|
|
|
|
|
result.put("1", entrust.getAcceptanceNum()); |
|
|
|
} |
|
|
|
} |
|
|
|
//模板地址
|
|
|
|
//模板地址
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表(模板).docx";
|
|
|
|
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表(模板).docx";
|
|
|
|
@ -2389,6 +2481,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
list.add(map); |
|
|
|
list.add(map); |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("list", list); |
|
|
|
result.put("list", list); |
|
|
|
|
|
|
|
result.put("1", currEntrust.getAcceptanceNum()); |
|
|
|
XWPFDocument doc = null; |
|
|
|
XWPFDocument doc = null; |
|
|
|
// FileOutputStream fos = null;
|
|
|
|
// FileOutputStream fos = null;
|
|
|
|
try { |
|
|
|
try { |
|
|
|
@ -2864,7 +2957,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
Map<String, Object> map = list.get(sort); |
|
|
|
Map<String, Object> map = list.get(sort); |
|
|
|
// 样品名称
|
|
|
|
// 样品名称
|
|
|
|
String name = (String) map.get("simpleName"); |
|
|
|
String name = (String) map.get("simpleName"); |
|
|
|
simpleName.append(name).append(","); |
|
|
|
if (sort == (list.size() - 1)) { |
|
|
|
|
|
|
|
simpleName.append(name); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
simpleName.append(name).append(","); |
|
|
|
|
|
|
|
} |
|
|
|
// 样品数量
|
|
|
|
// 样品数量
|
|
|
|
Integer count = (Integer) map.get("simpleCount"); |
|
|
|
Integer count = (Integer) map.get("simpleCount"); |
|
|
|
simpleCount += count; |
|
|
|
simpleCount += count; |
|
|
|
@ -2956,7 +3053,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 新增或修改检验集合 |
|
|
|
* 新增或修改检验集合 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void addOrUpdateExamines(List<Examine> examines, Long entrustId) { |
|
|
|
private void addOrUpdateExamines(List<Examine> examines, Entrust entrust) { |
|
|
|
if (CollectionUtils.isNotEmpty(examines)) { |
|
|
|
if (CollectionUtils.isNotEmpty(examines)) { |
|
|
|
List<Examine> saveList = new ArrayList<>(); |
|
|
|
List<Examine> saveList = new ArrayList<>(); |
|
|
|
List<Examine> updateList = new ArrayList<>(); |
|
|
|
List<Examine> updateList = new ArrayList<>(); |
|
|
|
@ -2970,7 +3067,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
examine.setSimpleCount(0); |
|
|
|
examine.setSimpleCount(0); |
|
|
|
examine.setExperieNum(""); |
|
|
|
examine.setExperieNum(""); |
|
|
|
examine.setExamineOrder(i + 1); |
|
|
|
examine.setExamineOrder(i + 1); |
|
|
|
examine.setEntrustId(entrustId); |
|
|
|
examine.setEntrustId(entrust.getId()); |
|
|
|
|
|
|
|
examine.setAcceptanceNum(entrust.getAcceptanceNum()); |
|
|
|
examine.setCreateTime(new Date()); |
|
|
|
examine.setCreateTime(new Date()); |
|
|
|
examine.setUpdateTime(new Date()); |
|
|
|
examine.setUpdateTime(new Date()); |
|
|
|
saveList.add(examine); |
|
|
|
saveList.add(examine); |
|
|
|
|