Преглед изворни кода

万里牛订单同步逻辑修改

24282 пре 1 година
родитељ
комит
94f790c9e0

+ 0 - 5
sd-business/src/main/java/com/sd/business/entity/order/vo/OrderSkuVo.java

@@ -19,11 +19,6 @@ import java.util.List;
 public class OrderSkuVo extends OrderSku {
 
     /**
-     * bom规格 id
-     */
-    private Long bomSpecId;
-
-    /**
      * 品名
      */
     private String name;

+ 36 - 0
sd-business/src/main/java/com/sd/business/entity/production/vo/ProductionOrderDetailVo.java

@@ -10,8 +10,14 @@ import java.util.List;
 @Setter
 public class ProductionOrderDetailVo {
 
+    /**
+     * 一键包装产品
+     */
     private List<SkuSpec> skuSpecList;
 
+    /**
+     * 一键包装快递包材
+     */
     private List<OrderPackage> packageList;
 
 
@@ -19,12 +25,24 @@ public class ProductionOrderDetailVo {
     @Setter
     public static class SkuSpec {
 
+        /**
+         * sku规格id
+         */
         private Long skuSpecId;
 
+        /**
+         * sku规格编号
+         */
         private String skuSpecCode;
 
+        /**
+         * sku规格名称
+         */
         private String skuSpecName;
 
+        /**
+         * 数量
+         */
         private BigDecimal quantity;
 
     }
@@ -33,16 +51,34 @@ public class ProductionOrderDetailVo {
     @Setter
     public static class OrderPackage {
 
+        /**
+         * bom规格id
+         */
         private Long bomSpecId;
 
+        /**
+         * bom规格编号
+         */
         private String bomSpecCode;
 
+        /**
+         * bom规格名称
+         */
         private String bomSpecName;
 
+        /**
+         * 数量
+         */
         private BigDecimal quantity;
 
+        /**
+         * 成本价
+         */
         private BigDecimal costPrice;
 
+        /**
+         * 对内销售价(含税)
+         */
         private BigDecimal internalSellingPrice;
 
     }

+ 0 - 1
sd-business/src/main/java/com/sd/business/service/order/impl/OrderServiceImpl.java

@@ -110,7 +110,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
         List<OrderSku> tempOrderSkuList = orderSkuService.list(q -> q.eq(OrderSku::getOrderId, id));
         List<OrderSkuVo> orderSkuList = BeanUtil.copyToList(tempOrderSkuList, OrderSkuVo.class);
         skuSpecService.attributeAssign(orderSkuList, OrderSkuVo::getSkuSpecId, (item, skuSpec) -> {
-            item.setBomSpecId(skuSpec.getBomSpecId());
             item.setName(skuSpec.getName());
             item.setCode(skuSpec.getCode());
         });

+ 4 - 3
sd-business/src/main/java/com/sd/business/service/production/impl/StockPreparationServiceImpl.java

@@ -179,11 +179,12 @@ public class StockPreparationServiceImpl implements StockPreparationService {
         for (OrderSku orderSku : orderSkuList) {
 
             Long skuSpecId = orderSku.getSkuSpecId();
-            BigDecimal quantity = orderSku.getQuantity();
+            Long bomSpecId = orderSku.getBomSpecId();
             Integer printType = orderSku.getPrintType();
+            BigDecimal quantity = orderSku.getQuantity();
 
             ProductionTask productionTask = skuSpecIdProductionTaskMap.computeIfAbsent(
-                    skuSpecId + ":" + printType,
+                    skuSpecId + ":" + bomSpecId + ":" + printType,
                     item -> {
                         SkuSpec skuSpec = skuSpecService.getById(skuSpecId);
                         Sku sku = skuService.getById(skuSpec.getSkuId());
@@ -192,7 +193,7 @@ public class StockPreparationServiceImpl implements StockPreparationService {
                         tempProductionTask.setId(IdWorker.getId());
                         tempProductionTask.setOrderId(orderSku.getOrderId());
                         tempProductionTask.setSkuSpecId(skuSpecId);
-                        tempProductionTask.setBomSpecId(skuSpec.getBomSpecId());
+                        tempProductionTask.setBomSpecId(bomSpecId);
                         tempProductionTask.setCraftProductionLineId(sku.getCraftProductionLineId());
                         tempProductionTask.setMachinedPanel(skuSpec.getMachinedPanel());
                         tempProductionTask.setPrintType(printType);

+ 1 - 1
sd-business/src/main/resources/mapper/order/OrderSkuMapper.xml

@@ -39,7 +39,7 @@
         from order_sku os
                  left join order_info oi on oi.id = os.order_id
                  left join sku_spec ss on os.sku_spec_id = ss.id
-                 left join bom_spec bs on ss.bom_spec_id = bs.id
+                 left join bom_spec bs on os.bom_spec_id = bs.id
                  left join department d on oi.department_id = d.id
             ${ew.customSqlSegment}
     </select>

+ 1 - 1
sd-business/src/main/resources/mapper/production/StockPreparationMapper.xml

@@ -28,7 +28,7 @@
                  inner join order_sku os on oi.id = os.order_id
                  left join department d on oi.department_id = d.id
                  left join sku_spec ss on os.sku_spec_id = ss.id
-                 left join bom_spec bs on ss.bom_spec_id = bs.id
+                 left join bom_spec bs on os.bom_spec_id = bs.id
             ${ew.customSqlSegment}
     </sql>