合并相同处方产品

jydyyy
yewj 7 months ago
parent 4255c5d756
commit 5955b69ea0

@ -1768,9 +1768,7 @@ public class CtqyyClient extends CommonHttpClient {
} else {
errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";");
}
// List<VYpzsPresInfo> vYpzsPresInfos = vYpzsPresInfoMapper.selectList(new LambdaQueryWrapper<VYpzsPresInfo>().eq(VYpzsPresInfo::getPRESCRIBE_NUMBER, entity.getPRESCRIBE_NUMBER()).eq(VYpzsPresInfo::getPHYSIC_CODE, entity.getPHYSIC_CODE()));
// if (CollUtil.isNotEmpty(vYpzsPresInfos)) {
// VYpzsPresInfo vYpzsPresInfo = vYpzsPresInfos.get(0);
//
@ -1782,36 +1780,36 @@ public class CtqyyClient extends CommonHttpClient {
collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE());
if (StrUtil.isNotEmpty(entity.getCODE_LIST())) {
String[] codeArray = entity.getCODE_LIST().split(";");
if (codeArray != null && codeArray.length > 0) {
List<String> codeList = Arrays.asList(codeArray);
for (String code : codeList) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
IoCollectOrderCodeMan.builder()
.udiCode(code)
.orderIdFk(ioCollectOrder.getBillNo())
.bizIdFk(collectOrderBiz.getId())
.relId(collectOrderBiz.getRelId())
.nameCode(udiEntity.getUdi())
.batchNo(udiEntity.getBatchNo())
.serialNo(udiEntity.getSerialNo())
.productDate(udiEntity.getProduceDate())
.expireDate(udiEntity.getExpireDate())
.createTime(new Date())
.createUser(1l)
.updateTime(new Date())
.updateUser(1l)
.scanCount(1)
.isSplitCode(true)
.scanActCount(1)
.build();
}
}
}
// if (StrUtil.isNotEmpty(entity.getCODE_LIST())) {
// String[] codeArray = entity.getCODE_LIST().split(";");
// if (codeArray != null && codeArray.length > 0) {
// List<String> codeList = Arrays.asList(codeArray);
// for (String code : codeList) {
// UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
// IoCollectOrderCodeMan.builder()
// .udiCode(code)
// .orderIdFk(ioCollectOrder.getBillNo())
// .bizIdFk(collectOrderBiz.getId())
// .relId(collectOrderBiz.getRelId())
// .nameCode(udiEntity.getUdi())
// .batchNo(udiEntity.getBatchNo())
// .serialNo(udiEntity.getSerialNo())
// .productDate(udiEntity.getProduceDate())
// .expireDate(udiEntity.getExpireDate())
// .createTime(new Date())
// .createUser(1l)
// .updateTime(new Date())
// .updateUser(1l)
// .scanCount(1)
// .isSplitCode(true)
// .scanActCount(1)
// .build();
// }
//
// }
//
//
// }
// collectOrderBiz.setRemark1(entity.get() + "");
collectOrderBiz.setTagStatus(1);
@ -1822,7 +1820,7 @@ public class CtqyyClient extends CommonHttpClient {
ioCollectOrder.setErrorMsg(errorMsg.toString());
ioCollectOrder.setTagStatus(4);
}
ioCollectOrder.setBizList(bizList);
ioCollectOrder.setBizList(summarizeByCode(bizList));
ioCollectOrders.add(ioCollectOrder);
});
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
@ -1834,6 +1832,25 @@ public class CtqyyClient extends CommonHttpClient {
}
}
public static List<IoCollectOrderBiz> summarizeByCode(List<IoCollectOrderBiz> bizList) {
Map<String, IoCollectOrderBiz> summarizedMap = new HashMap<>();
for (IoCollectOrderBiz biz : bizList) {
String code = biz.getThrCode();
if (summarizedMap.containsKey(code)) {
IoCollectOrderBiz existingBiz = summarizedMap.get(code);
existingBiz.setCount(existingBiz.getCount() + biz.getCount());
} else {
summarizedMap.put(code, biz);
}
}
return new ArrayList<>(summarizedMap.values());
}
/**
*
*

@ -74,8 +74,5 @@ public class VYpzsPresInfo implements Serializable {
@TableField(value = "DEPT_CODE")
private String DEPT_CODE;
@TableField(value = "CODE_LIST")
private String CODE_LIST;
private static final long serialVersionUID = 1L;
}

Loading…
Cancel
Save