Commit 93814ef6 by lijingjing

处理原铝重取添加多个的情况;

parent c5c848bd
......@@ -1478,6 +1478,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
log("数据为空,不发送!");
return;
}
// 获取编号集
List<String> sampleCodeList = sampleList.stream().map(EntrustSample::getCode).collect(Collectors.toList());
logger.error("sample code is : {}", sampleCodeList);
//
EntrustSample sample = sampleList.get(0);
String sampleName = sample.getName();
......@@ -1496,7 +1499,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if (Objects.equals(ylname, sampleName)) {
// 当为原铝时,判断是否存在重取,如果存在重取,需要在重取时触发,也就是下个条件下触发,如果不存在重取,那么直接发
// == 若存在,那么需要在重取阶段处理(重取样品,报告发送再处理)
List<String> sampleCodeList = sampleList.stream().map(EntrustSample::getCode).collect(Collectors.toList());
if (itemComparisonService.isExistCompareData(sampleCodeList)) {
log("存在需要重取的样品,需要重取时再发送!");
return;
......@@ -1513,10 +1515,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
//Y2201086159C1
//Y2112052110C2
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
List<String> sampleCodes = getSampleCodes(sampleList);
logger.error("sample code is : {}", sampleCodes);
//根据样品编号,查询出委托id
List<Long> entrustIds = entrustSampleService.getEntrustIdsBySampleCodes(sampleCodes);
List<Long> entrustIds = entrustSampleService.getEntrustIdsBySampleCodes(sampleCodeList);
logger.error("entrust id is : {}", entrustIds);
// 基本上不可能为空的
......@@ -1535,7 +1535,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
dataList.forEach(t -> {
// 根据有无ID判断是属于哪一种数据来源
Object oid = t.get("id"), obrand = t.get("brand");
if (Objects.nonNull(oid) && Objects.isNull(obrand)) {
logger.error("循环处理牌号:样品id:{},牌号:{}", oid, obrand);
if (Objects.nonNull(oid) && (Objects.isNull(obrand) || StringUtils.isBlank(obrand.toString()))) {
Long sampleId = Long.valueOf(oid.toString());
t.put("brand", sampleBrandMap.get(sampleId));
t.remove("id");
......
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