消息通知

This commit is contained in:
Tankaikai
2025-03-18 11:33:48 +08:00
parent 0abf321d3e
commit 5fbc6b447f

View File

@@ -11,7 +11,11 @@ import com.czg.product.entity.*;
import com.czg.product.enums.InOutItemEnum;
import com.czg.product.enums.InOutTypeEnum;
import com.czg.product.service.ProductRpcService;
import com.czg.service.product.mapper.*;
import com.czg.product.service.ProductStockFlowService;
import com.czg.service.product.mapper.ConsInfoMapper;
import com.czg.service.product.mapper.ConsStockFlowMapper;
import com.czg.service.product.mapper.ProdConsRelationMapper;
import com.czg.service.product.mapper.ProductMapper;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -46,7 +50,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
@Resource
private ConsStockFlowMapper consStockFlowMapper;
@Resource
private ProductStockFlowMapper productStockFlowMapper;
private ProductStockFlowService productStockFlowService;
@Resource
private RabbitPublisher rabbitPublisher;
@@ -77,7 +81,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
flow.setInOutType(InOutTypeEnum.OUT.value());
flow.setInOutItem(InOutItemEnum.ORDER_OUT.value());
flow.setOrderId(orderId);
productStockFlowMapper.insert(flow);
productStockFlowService.saveFlow(flow);
// 查询商品绑定耗材信息
List<ProdConsRelation> relationList = prodConsRelationMapper.selectListByQuery(QueryWrapper.create().eq(ProdConsRelation::getProductId, dto.getProductId()));
if (CollUtil.isEmpty(relationList)) {
@@ -149,7 +153,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
flow.setInOutType(InOutTypeEnum.IN.value());
flow.setInOutItem(InOutItemEnum.ORDER_IN.value());
flow.setOrderId(orderId);
productStockFlowMapper.insert(flow);
productStockFlowService.saveFlow(flow);
// 查询商品绑定耗材信息
List<ProdConsRelation> relationList = prodConsRelationMapper.selectListByQuery(QueryWrapper.create().eq(ProdConsRelation::getProductId, dto.getProductId()));
if (CollUtil.isEmpty(relationList)) {
@@ -222,7 +226,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
flow.setInOutType(InOutTypeEnum.IN.value());
flow.setInOutItem(InOutItemEnum.ORDER_IN.value());
flow.setOrderId(orderId);
productStockFlowMapper.insert(flow);
productStockFlowService.saveFlow(flow);
// 查询商品绑定耗材信息
List<ProdConsRelation> relationList = prodConsRelationMapper.selectListByQuery(QueryWrapper.create().eq(ProdConsRelation::getProductId, dto.getProductId()));
if (CollUtil.isEmpty(relationList)) {