Commit 2f8c62b5 by jiangxuming

feat: 单委托取消排序

parent 7c715008
...@@ -585,6 +585,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -585,6 +585,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override @Override
public OriginalRecord saveExcelOriginalRecords(Long[] ids, Long templateId, Account account) { public OriginalRecord saveExcelOriginalRecords(Long[] ids, Long templateId, Account account) {
TimeWatch timeWatch = new TimeWatch();
RestAssert.fail(ArrayUtils.isEmpty(ids), "请选择试验项目!"); RestAssert.fail(ArrayUtils.isEmpty(ids), "请选择试验项目!");
RestAssert.fail(null == templateId, "请选择原始记录模板"); RestAssert.fail(null == templateId, "请选择原始记录模板");
OriginalTemplate template = originalTemplateService.getById(templateId); OriginalTemplate template = originalTemplateService.getById(templateId);
...@@ -669,7 +670,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -669,7 +670,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
} }
/* 获取采集数据,并保存到SampleVO中 */ /* 获取采集数据,并保存到SampleVO中 */
getCollectionData(null,null, sampleVOList, itemNameMap, template, entrustCodes); getCollectionData(timeWatch,null, sampleVOList, itemNameMap, template, entrustCodes);
if (null == template.getSampleBeginRow() || null == template.getSampleMergerNum() || null == template.getTemplateSampleNum()) { if (null == template.getSampleBeginRow() || null == template.getSampleMergerNum() || null == template.getTemplateSampleNum()) {
return null; return null;
...@@ -680,7 +681,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -680,7 +681,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
} else { } else {
/* 获取采集到的数据 */ /* 获取采集到的数据 */
getCollectionData(null,voList, null, itemNameMap, template, entrustCodes); getCollectionData(timeWatch,voList, null, itemNameMap, template, entrustCodes);
EntrustSampleItemVO firstVO = null; EntrustSampleItemVO firstVO = null;
for (EntrustSampleItemVO vo : voList) { for (EntrustSampleItemVO vo : voList) {
...@@ -749,7 +750,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -749,7 +750,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if (null != template.getBlankBeginNum() && blank.size() > 0) { if (null != template.getBlankBeginNum() && blank.size() > 0) {
RestAssert.fail("所选原始记录模板中已配置空白开始行,请删除空白标样!"); RestAssert.fail("所选原始记录模板中已配置空白开始行,请删除空白标样!");
} }
voList = voList.stream().sorted(Comparator.comparing(EntrustSampleItemVO::getOrderBy)).collect(Collectors.toList()); // voList = voList.stream().sorted(Comparator.comparing(EntrustSampleItemVO::getOrderBy)).collect(Collectors.toList());
Entrust entrust = entrustService.getById(voList.get(0).getEntrustId()); Entrust entrust = entrustService.getById(voList.get(0).getEntrustId());
logger.info("二阶段耗时:{} ms", timeWatch.pointTime()); logger.info("二阶段耗时:{} ms", timeWatch.pointTime());
InputStream io = ossClient.download(template.getObjectKey()); InputStream io = ossClient.download(template.getObjectKey());
...@@ -792,7 +793,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -792,7 +793,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
logger.info("条件1"); logger.info("条件1");
// 压片分析单独处理 // 压片分析单独处理
/* 获取采集到的数据 */ /* 获取采集到的数据 */
getCollectionData(null,voList, null, itemNameMap, template, entrustCode); getCollectionData(timeWatch,voList, null, itemNameMap, template, entrustCode);
EntrustSampleItemVO firstVO = null; EntrustSampleItemVO firstVO = null;
for (EntrustSampleItemVO vo : voList) { for (EntrustSampleItemVO vo : voList) {
...@@ -862,7 +863,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -862,7 +863,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
} else { } else {
logger.info("条件3"); logger.info("条件3");
/* 获取采集到的数据 */ /* 获取采集到的数据 */
getCollectionData(null,voList, null, itemNameMap, template, entrustCode); getCollectionData(timeWatch,voList, null, itemNameMap, template, entrustCode);
EntrustSampleItemVO firstVO = null; EntrustSampleItemVO firstVO = null;
for (EntrustSampleItemVO vo : voList) { for (EntrustSampleItemVO vo : voList) {
...@@ -953,7 +954,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -953,7 +954,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
logger.info("7-4-3阶段耗时:{} ms", timeWatch.pointTime()); logger.info("7-4-3阶段耗时:{} ms", timeWatch.pointTime());
/* 设置采集数据的Map -- itemVo */ /* 设置采集数据的Map -- itemVo */
if (itemVOList != null) { if (itemVOList != null) {
itemVOList.forEach(vo -> { for (EntrustSampleItemVO vo : itemVOList) {
List<String> datas = mapByNumItemName.get(vo.getSampleCode() + itemNameMap.get(vo.getName())); List<String> datas = mapByNumItemName.get(vo.getSampleCode() + itemNameMap.get(vo.getName()));
if (CollectionUtils.isNotEmpty(datas)) { if (CollectionUtils.isNotEmpty(datas)) {
ArrayList<Map<String, String>> collectionDataList = new ArrayList<>(); ArrayList<Map<String, String>> collectionDataList = new ArrayList<>();
...@@ -961,7 +962,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -961,7 +962,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
for (String data : datas) { for (String data : datas) {
Map<String, String> stringStringMap = toStringStringMap(data); Map<String, String> stringStringMap = toStringStringMap(data);
/* 找到曲线数据和空白数据 */ /* 找到曲线数据和空白数据 */
List<Map<String, String>> curveDatas = new ArrayList<Map<String, String>>(); List<Map<String, String>> curveDatas = new ArrayList<>();
if (stringStringMap.containsKey(curve) && !filledCur.get()) { if (stringStringMap.containsKey(curve) && !filledCur.get()) {
filledCur.set(true); filledCur.set(true);
curveDatas = (List<Map<String, String>>) (JSONArray.parse(stringStringMap.get(curve))); curveDatas = (List<Map<String, String>>) (JSONArray.parse(stringStringMap.get(curve)));
...@@ -986,7 +987,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -986,7 +987,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
} }
vo.setCollectionDataList(collectionDataList); vo.setCollectionDataList(collectionDataList);
} }
}); }
} }
logger.info("7-4-4阶段耗时:{} ms", timeWatch.pointTime()); logger.info("7-4-4阶段耗时:{} ms", timeWatch.pointTime());
/* sampleVo */ /* sampleVo */
......
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