Browse Source

srm推送调整

fenghaifu 3 days ago
parent
commit
5bd55ea232

+ 8 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -277,7 +277,7 @@ ${ew.customSqlSegment}
 
         update sy_shipping_details_item
         <if test='type == "1"'>
-            set submit_status = 1
+            set submit_status = 1,push_srm_state = '0'
             where group_id in
             <foreach collection="submitListId" item="item"  open="(" separator="," close=")">
                 #{item}
@@ -363,7 +363,7 @@ ${ew.customSqlSegment}
         b.group_Id 'syShippingDetailGroupId',b.order_Number 'orderCode',
         b.item_number 'styleNo',b.inventory_code 'invCode',b.colour 'color',
         b.inventory_name 'invName',b.specification_and_model 'invSpec',
-        sum(b.shipment_quantity) 'quantity',b.coding_rules 'codingRules',
+        b.shipment_quantity 'quantity',b.coding_rules 'codingRules',
         a.id 'syShippingId',b.submit_status 'submitStatus',b.weight 'weight',
         b.guangpei_gate_width 'guangpeiGateWidth',b.small_Po 'smallPo',
         b.distribution_Point 'distributionPoint',b.pack_id 'packId',
@@ -371,7 +371,8 @@ ${ew.customSqlSegment}
         b.pre_delivery_date 'arriveDate',
         b.ompo_Id_Item 'purchaseId',
         c.declaration_name,c.declaration_unit,
-        b.inventory_ccode as invccode,b.ompo_id as purchase_order_id,b.ompo_account as sys_org_code
+        b.inventory_ccode as invccode,b.ompo_id as purchase_order_id,b.ompo_account as sys_org_code,
+        b.id 'syShippingDetailsId'
         from sy_shipping_details a
         left join sy_shipping_details_item b
         on a.id=b.shipping_details_id
@@ -380,8 +381,9 @@ ${ew.customSqlSegment}
         <foreach collection="id" item="item"  open="(" separator="," close=")">
             #{item}
         </foreach>
+        <!--
         group by b.group_Id
-        order by size+0
+        order by size+0-->
     </select>
 
     <select id="getPurchasePreDeliverDetailSizeVo" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PurchasePreDeliverDetailSizeVo">
@@ -414,7 +416,7 @@ ${ew.customSqlSegment}
 
         update sy_shipping_details_item
         <if test='type == "1"'>
-            set submit_status = 1
+            set submit_status = 1,push_srm_state = '0'
             where group_id in
             <foreach collection="submitListId" item="item"  open="(" separator="," close=")">
                 #{item}
@@ -442,7 +444,7 @@ ${ew.customSqlSegment}
 
         update sy_shipping_details_item
         set push_srm_state = #{status},push_srm_message=#{message}
-        where group_id in
+        where id in
         <foreach collection="groupIdList" item="item"  open="(" separator="," close=")">
             #{item}
         </foreach>

+ 16 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

@@ -413,7 +413,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         idList.add(id);
         List<PurchasePreDeliverVo> deliverVoList = new ArrayList<>();
         List<PurchasePreDeliverDetailVo> deliverDetailVoList=syShippingDetailsMapper.getPurchasePreDeliverDetailVo(idList);
-        List<PurchasePreDeliverDetailSizeVo> deliverDetailSizeVoList=syShippingDetailsMapper.getPurchasePreDeliverDetailSizeVo(idList);
+        //List<PurchasePreDeliverDetailSizeVo> deliverDetailSizeVoList=syShippingDetailsMapper.getPurchasePreDeliverDetailSizeVo(idList);
 
         String invccode = deliverDetailVoList.get(0).getInvccode();
         // 判断是否成衣
@@ -436,6 +436,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         //   2)如果尺码为空不需要合并的,直接加分组编号;
         //   3)如果尺码不为空的,根据标识,吧多个分组逗号分割加入;
         //   4) 对每个分组id轮询分组
+        /*
         if (!isCloth){
             List<String> groupIdList = new ArrayList<>();
             for (PurchasePreDeliverDetailVo purchasePreDeliverDetailVo : deliverDetailVoList){
@@ -465,7 +466,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
                 groupDetailVoList.add(findDetailVo);
             }
             deliverDetailVoList = groupDetailVoList;
-        }
+        }*/
         // 单据拆分
         List<String> billIdList = deliverDetailVoList.stream().map(PurchasePreDeliverDetailVo::toBillId).distinct().collect(Collectors.toList());
         for (String billId : billIdList){
@@ -478,12 +479,22 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
             deliverVo.setPurchasePreDeliverDetailList(findDetailVoList);
             deliverVo.setSysOrgCode(findDetailVo.getSysOrgCode());
             deliverVo.setQuantity(BigDecimal.ZERO);
-            findDetailVoList.forEach(d->{
+            findDetailVoList.forEach(d -> {
                 deliverVo.setQuantity(deliverVo.getQuantity().add(d.getQuantity()));
+                /*
                 List<PurchasePreDeliverDetailSizeVo> findDetailSizeVoList = deliverDetailSizeVoList.stream().
-                        filter(p1->d.getSyShippingDetailGroupId().indexOf(p1.getSyShippingDetailGroupId())>-1).collect(Collectors.toList());
-                d.setPurchasePreDeliverDetailSizeList(findDetailSizeVoList);
+                        filter(p1 -> d.getSyShippingDetailGroupId().indexOf(p1.getSyShippingDetailGroupId()) > -1).collect(Collectors.toList());
+                d.setPurchasePreDeliverDetailSizeList(findDetailSizeVoList);*/
             });
+            /*
+                deliverVo.setQuantity(BigDecimal.ZERO);
+                findDetailVoList.forEach(d -> {
+                    deliverVo.setQuantity(deliverVo.getQuantity().add(d.getQuantity()));
+                    List<PurchasePreDeliverDetailSizeVo> findDetailSizeVoList = deliverDetailSizeVoList.stream().
+                            filter(p1 -> d.getSyShippingDetailGroupId().indexOf(p1.getSyShippingDetailGroupId()) > -1).collect(Collectors.toList());
+                    d.setPurchasePreDeliverDetailSizeList(findDetailSizeVoList);
+                });
+            */
             deliverVoList.add(deliverVo);
         }
         return deliverVoList;