فهرست منبع

申报要素提交时,预装箱单更新申报要素id逻辑调整

fenghaifu 2 هفته پیش
والد
کامیت
304b32660c

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/SyDeclarationElementsMapper.java

@@ -26,6 +26,10 @@ public interface SyDeclarationElementsMapper extends BaseMapper<SyDeclarationEle
     //修改预装箱单主表的报关要素ID
     public void updateAssembledPacking(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId);
 
+    // 根据出运明细id设置预装箱但申报要素id
+    public void updateAssembledPackingByShippingDetailItemId(@Param("elementsId") String elementsId,
+                                                             @Param("itemIdList")List<String> itemIdList);
+
     //修改托书子表的报关要素ID
     public void updatesyShippingOrderItem(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId,@Param("type") String type,@Param("code") String code);
 

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/xml/SyDeclarationElementsMapper.xml

@@ -47,5 +47,20 @@
         where a.elements_Id = #{elmentId} and a.del_flag = '0' and b.sy_stuta = '0'
 
 
+    </update>
+
+    <update id="updateAssembledPackingByShippingDetailItemId">
+        update sy_pre_assembled_packing_list
+        set elements_id = #{elementsId}
+        where id in (
+            select sy_pre_assembled_packing_list_id from sy_pre_assembled_packing_list_item
+            where sy_declaration_elements_item_id in
+            <foreach collection="itemIdList" item="item"  open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        )
+
+
+
     </update>
 </mapper>

+ 5 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/service/impl/SyDeclarationElementsServiceImpl.java

@@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -146,6 +147,8 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
                 }
                //修改发运明细报关要素ID
                 syShippingDetailsService.writeBackElenmentId(id,shippingList,type,code);
+                // 修改预装箱单报关要素ID
+            syDeclarationElementsMapper.updateAssembledPackingByShippingDetailItemId(id,shippingList);
 
                 boolean ok = save(syDeclarationElements);
                 if(ok){
@@ -195,7 +198,8 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
                     //修改发运明细报关要素ID
                     syShippingDetailsService.writeBackElenmentId(uuid,itemIdsZeor,type,code);
                     //修改预装箱单报关要素ID
-                    syDeclarationElementsMapper.updateAssembledPacking(uuid,elementid);
+                    //syDeclarationElementsMapper.updateAssembledPacking(uuid,elementid);
+                syDeclarationElementsMapper.updateAssembledPackingByShippingDetailItemId(uuid, Arrays.asList(ids.split(",")));
                     //修改装箱成衣单报关要素ID
                     syDeclarationElementsMapper.updateTailoring(uuid,elementid);
                     //修改装箱单面料报关要素ID