diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvOrderServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvOrderServiceImpl.java index bef68f501..0cd952b43 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrInvOrderServiceImpl.java @@ -377,7 +377,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { IoOrderEntity ioOrderEntity = new IoOrderEntity(); ioOrderEntity.setBillNo(newBillNo); ioOrderEntity.setMainAction(thrInvOrder.getMainAction()); - String fromCorp = addInoutService.updateCorp(bussinessTypeEntity, entry.getValue().get(0).getSickerName(), entry.getKey()); + String fromCorp; + if (entry.getValue().get(0).getSickerCode() != null || entry.getValue().get(0).getSickerName() != null) + fromCorp = addInoutService.updateCorp(bussinessTypeEntity, entry.getValue().get(0).getSickerName(), entry.getKey()); + else + fromCorp = entry.getKey(); ioOrderEntity.setFromCorp(fromCorp); ioOrderEntity.setInvCode(thrInvOrder.getInvCode()); ioOrderEntity.setDeptCode(thrInvOrder.getDeptCode()); @@ -872,7 +876,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { (List list, List thrInvOrderDetails, String billNo, String thirdSys, ThrInvOrder thrInvOrder, Integer sourceType) { // Integer inv_set_enable = Integer.valueOf(systemParamConfigService.selectValueByParamKey("inv_set_enable")); - String configValue = systemParamConfigService.selectValueByParamKey("fee_out_filter_high"); + String highFilter = systemParamConfigService.selectValueByParamKey("fee_out_filter_high"); + String cpMutiFilter = systemParamConfigService.selectValueByParamKey("fee_out_filter_cp"); if (sourceType == 0) {//直接明细 不走项目组套 thrInvOrder.setSkProject(0); List thrCodes = list.stream().map(ThrInvResultResponse::getThrCode).collect(Collectors.toList()); @@ -909,7 +914,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { //过滤是否高值 - if (IntUtil.value(configValue) > 0) { + if (IntUtil.value(highFilter) > 0) { UdiRelevanceEntity udiRelevanceEntity = mainIdRelIdMap.get(thrCode); if (IntUtil.value(udiRelevanceEntity.getHcType()) != 1) { thrInvOrderDetails.add(thrInvOrderDetail); @@ -942,31 +947,38 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { //通过thrCode获取到项目组套 List skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode); if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0) { + + Integer finalCount = count; - skProjectDetailEntityList.forEach(sk -> { + if (IntUtil.value(cpMutiFilter) > 0 && IntUtil.value(finalCount) > 1) { + log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已杯过滤!"); + } else { + skProjectDetailEntityList.forEach(sk -> { - ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail(); - BeanUtils.copyProperties(item, thrInvOrderDetail); - thrInvOrderDetail.setOrderIdFk(billNo); - thrInvOrderDetail.setRelId(sk.getRelId()); + ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail(); + BeanUtils.copyProperties(item, thrInvOrderDetail); + thrInvOrderDetail.setOrderIdFk(billNo); + thrInvOrderDetail.setRelId(sk.getRelId()); - Integer skCount = sk.getCount(); - if (skCount != null && skCount > 0) { - thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount)); - } + Integer skCount = sk.getCount(); + if (skCount != null && skCount > 0) { + thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount)); + } - //过滤是否高值 - if (IntUtil.value(configValue) > 0) { - UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId()); - if (IntUtil.value(udiRelevanceEntity.getHcType()) != 1) { + //过滤是否高值 + if (IntUtil.value(highFilter) > 0) { + UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId()); + if (IntUtil.value(udiRelevanceEntity.getHcType()) != 1) { + thrInvOrderDetails.add(thrInvOrderDetail); + } + } else { thrInvOrderDetails.add(thrInvOrderDetail); } - } else { - thrInvOrderDetails.add(thrInvOrderDetail); - } - }); + }); + } + } else { exmsg.append(thrCode + ","); ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail(); diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index c0a484add..c7d95900a 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -1883,6 +1883,7 @@ #{item} + group by bu.id diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index bf10d354c..85bbe2eda 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -723,3 +723,7 @@ CALL Pro_Temp_ColumnWork('thr_inv_order', 'fromCorp', 'varchar(255) NULL DEFAULT INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`, `paramExplain`, `updateTime`) VALUES (200321, 0, '收费出库是否过滤高值耗材', 'fee_out_filter_hight', '0', 1, 0, '收费出库是否过滤高值耗材', '2024-03-13 09:50:48'); + +INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, + `paramType`, `paramExplain`, `updateTime`) +VALUES (200322, 0, '收费出库是否过滤一对多', 'fee_out_filter_cp', '0', 1, 0, '收费出库是否过滤1对多的耗材', '2024-03-13 11:04:02');