Commit 8e3005c1 by wangweidong

hmhj增加原始记录样品信息

parent e0c67824
......@@ -366,12 +366,20 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
e.printStackTrace();
}
Map<String, String> mapReplace = new HashMap<>();
mapReplace.put("#{nowDate}", DateUtils.toYearMonthDay(new Date()));
mapReplace.put("#{sampleNum}", entrustSampleService.countByEntrustId(entrust.getId())+"");
if (null != template.getMoreItem() && 1 == template.getMoreItem()) {
Set<Long> sampleIdsList = new HashSet<>();
for (EntrustSampleItemVO itemVO : voList) {
sampleIdsList.add(itemVO.getEntrustSampleId());
}
List<EntrustSample> sampleList = entrustSampleService.list(Condition.create().in("id", sampleIdsList));
if (CollectionUtils.isNotEmpty(sampleList)){
mapReplace.put("#{sampleFrom}",sampleList.get(0).getSampleFrom());
mapReplace.put("#{sampleName}",sampleList.get(0).getName());
}
List<EntrustSampleVO> sampleVOList = new ArrayList<>(sampleList.size());
for (EntrustSample sample : sampleList) {
......@@ -394,6 +402,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
} else {
if (CollectionUtils.isNotEmpty(voList)){
mapReplace.put("#{sampleFrom}",voList.get(0).getSampleFrom());
mapReplace.put("#{sampleName}",voList.get(0).getSampleName());
}
OriginalFactory factory = new OriginalFactory(template, voList, entrust, configList, xssfWorkbook);
Operation operation = factory.getOperation();
if (null != operation) {
......@@ -403,9 +417,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
Map<String, String> mapReplace = new HashMap<>();
mapReplace.put("#{nowDate}", DateUtils.toYearMonthDay(new Date()));
mapReplace.put("#{sampleNum}", entrustSampleService.countByEntrustId(entrust.getId())+"");
HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,0);
FileOutputStream os = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment