ezhizao_zx 3 nedēļas atpakaļ
vecāks
revīzija
08ed966740

+ 2 - 2
src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderController.java

@@ -163,7 +163,7 @@ public class BizInboundOrderController extends BaseController {
         if (productCodes.stream().noneMatch(t -> t.equals(bizInboundOrder.getProductCode()))) {
             productCodes.add(bizInboundOrder.getProductCode());
         }
-        if (productCodes.size() > 4) {
+        if (productCodes.stream().distinct().count() > 4) {
             return error("转运托盘绑定的产品不能超过4个");
         }
         // 入库单号生成
@@ -226,7 +226,7 @@ public class BizInboundOrderController extends BaseController {
         if (productCodes.stream().noneMatch(t -> t.equals(bizInboundOrder.getProductCode()))) {
             productCodes.add(bizInboundOrder.getProductCode());
         }
-        if (productCodes.size() > 4) {
+        if (productCodes.stream().distinct().count() > 4) {
             return error("转运托盘绑定的产品不能超过4个");
         }
         List<BizInboundOrderDetail> oldDetails = bizInboundOrderDetailService.query().eq("inbound_order_id", bizInboundOrder.getId()).list();