瀏覽代碼

no message

FengChaoYu 10 月之前
父節點
當前提交
186d3e36df

+ 4 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/stock/WebsitGoodsStockLogic.java

@@ -17,6 +17,7 @@ import com.gree.mall.manager.plus.service.WorkerStockService;
 import com.gree.mall.manager.utils.ValidateUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.integration.redis.util.RedisLockRegistry;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.support.TransactionSynchronization;
@@ -111,6 +112,9 @@ public class WebsitGoodsStockLogic {
             WorkerStockDTO workerStockDTO = stockList.get(i);
             try {
                 ValidateUtil.validate(workerStockDTO);
+                if ("销售订单".equals(workerStockDTO.getRefType()) && StringUtils.isBlank(workerStockDTO.getWebsitId())) {
+                    throw new RemoteServiceException("销售网点编号不能空");
+                }
                 if (workerStockDTO.getChangeQty().compareTo(BigDecimal.ZERO) <= 0) {
                     throw new RuntimeException("变动数量不能少于0");
                 }