新增收费出库是否过滤高值耗材

dev_fifo1.0
anthonywj 1 year ago
parent 778258acec
commit fba3db5d38

@ -1,6 +1,7 @@
package com.glxp.api.res.basic;
import com.glxp.api.entity.basic.BasicProductsEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import lombok.Data;
import java.util.Map;
@ -8,8 +9,8 @@ import java.util.Map;
@Data
public class MainIdRelIdAndProductResponse {
private Map<String,Long> mainIdRelIdMap;
private Map<String, UdiRelevanceEntity> mainIdRelIdMap;
private Map<Long, BasicProductsEntity> relIdBasicProductsEntityMap;
private Map<Long, BasicProductsEntity> relIdBasicProductsEntityMap;
}

@ -427,14 +427,16 @@ public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRel
@Override
public MainIdRelIdAndProductResponse selectMainIdRelIdAndProductMap(List<String> thrCodes, String thirdSys) {
MainIdRelIdAndProductResponse mainIdRelIdAndProductResponse = new MainIdRelIdAndProductResponse();
Map<String, Long> mainIdRelIdMap = new HashMap<>();
Map<String, UdiRelevanceEntity> mainIdRelIdMap = new HashMap<>();
Map<Long, BasicProductsEntity> relIdBasicProductsEntityMap = new HashMap<>();
QueryWrapper<UdiRelevanceEntity> qw = new QueryWrapper<>();
qw.in(thirdSys,thrCodes);
qw.select("id","mainId");
qw.in(thirdSys, thrCodes);
qw.ne("isDisable", true);
qw.select("id", "mainId");
List<UdiRelevanceEntity> udiRelevanceEntityList = udiRelevanceDao.selectList(qw);
if (CollectionUtil.isNotEmpty(udiRelevanceEntityList)){
mainIdRelIdMap = udiRelevanceEntityList.stream().collect(Collectors.toMap(UdiRelevanceEntity::getMainId, UdiRelevanceEntity::getId));
if (CollectionUtil.isNotEmpty(udiRelevanceEntityList)) {
mainIdRelIdMap = udiRelevanceEntityList.stream().collect(Collectors.toMap(UdiRelevanceEntity::getMainId, udiRelevanceEntity -> udiRelevanceEntity));
// List<Long> relIds = udiRelevanceEntityList.stream().map(UdiRelevanceEntity::getId).collect(Collectors.toList());
// List<BasicProductsEntity> basicProductsEntities = udiRelevanceDao.selectProductByRelIds(relIds);
// if (CollectionUtil.isNotEmpty(basicProductsEntities)){

@ -575,12 +575,12 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
.map(ThrInvOrderDetail::getThrCode).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(thrCodes)) {
MainIdRelIdAndProductResponse map = udiRelevanceService.selectMainIdRelIdAndProductMap(thrCodes, thirdSysFk);
Map<String, Long> mainIdRelIdMap = map.getMainIdRelIdMap();
Map<String, UdiRelevanceEntity> mainIdRelIdMap = map.getMainIdRelIdMap();
thrInvOrderDetails.forEach(item -> {
if (ObjectUtil.isNull(item.getRelId())) {
String thrCode = item.getThrCode();
Long relId = mainIdRelIdMap.get(thrCode);
Long relId = mainIdRelIdMap.get(thrCode).getId();
if (ObjectUtil.isNotNull(relId)) {
item.setRelId(relId);
@ -872,17 +872,18 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
(List<ThrInvResultResponse> list, List<ThrInvOrderDetail> 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");
if (sourceType == 0) {//直接明细 不走项目组套
thrInvOrder.setSkProject(0);
List<String> thrCodes = list.stream().map(ThrInvResultResponse::getThrCode).collect(Collectors.toList());
MainIdRelIdAndProductResponse map = udiRelevanceService.selectMainIdRelIdAndProductMap(thrCodes, thirdSys);
Map<String, Long> mainIdRelIdMap = map.getMainIdRelIdMap();
Map<String, UdiRelevanceEntity> mainIdRelIdMap = map.getMainIdRelIdMap();
StringBuilder exmsg = new StringBuilder("");
list.forEach(item -> {
String mainAction = item.getMainAction();
String thrCode = item.getThrCode();
Long relId = mainIdRelIdMap.get(thrCode);
Long relId = mainIdRelIdMap.get(thrCode).getId();
Integer count;
if (ConstantType.TYPE_PUT.equals(mainAction)) {
count = IntUtil.value(item.getInCount());
@ -906,6 +907,17 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
else
exmsg.append(thrCode + "供应商未关联");
//过滤是否高值
if (IntUtil.value(configValue) > 0) {
UdiRelevanceEntity udiRelevanceEntity = mainIdRelIdMap.get(thrCode);
if (IntUtil.value(udiRelevanceEntity.getHcType()) != 1) {
thrInvOrderDetails.add(thrInvOrderDetail);
}
} else {
thrInvOrderDetails.add(thrInvOrderDetail);
}
});
if (exmsg.length() > 0) {
exmsg.deleteCharAt(exmsg.length() - 1);
@ -914,6 +926,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
}
} else {//走项目组套
thrInvOrder.setSkProject(1);
StringBuilder exmsg = new StringBuilder("");
list.forEach(item -> {
@ -930,19 +944,31 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0) {
Integer finalCount = count;
skProjectDetailEntityList.forEach(sk -> {
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));
}
thrInvOrderDetails.add(thrInvOrderDetail);
//过滤是否高值
if (IntUtil.value(configValue) > 0) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId());
if (IntUtil.value(udiRelevanceEntity.getHcType()) != 1) {
thrInvOrderDetails.add(thrInvOrderDetail);
}
} else {
thrInvOrderDetails.add(thrInvOrderDetail);
}
});
} else {
exmsg.append(thrCode + ",");
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
BeanUtils.copyProperties(item, thrInvOrderDetail);
thrInvOrderDetail.setOrderIdFk(billNo);

@ -718,3 +718,8 @@ CALL Pro_Temp_ColumnWork('io_code_temp', 'errUdiCode', 'varchar(255) NULL DEFAUL
CALL Pro_Temp_ColumnWork('io_code', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1);
CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);
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');

Loading…
Cancel
Save