zengtx 2 سال پیش
والد
کامیت
5b7cc26dca
12فایلهای تغییر یافته به همراه78 افزوده شده و 33 حذف شده
  1. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/entity/SyDeclarationElements.java
  2. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/SyDeclarationElementsMapper.java
  3. 20 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/xml/SyDeclarationElementsMapper.xml
  4. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/service/ISyDeclarationElementsService.java
  5. 14 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/service/impl/SyDeclarationElementsServiceImpl.java
  6. 5 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java
  7. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java
  8. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java
  9. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java
  10. 22 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml
  11. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java
  12. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/entity/SyDeclarationElements.java

@@ -104,4 +104,11 @@ public class SyDeclarationElements {
 
 	//报关单位
 	private String declarationUnit;
+
+	//类型
+	@TableField(exist = false)
+	String type;
+	//销售订单号
+	@TableField(exist = false)
+	String code;
 }

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

@@ -22,11 +22,11 @@ public interface SyDeclarationElementsMapper extends BaseMapper<SyDeclarationEle
     //修改装箱单成衣子表的报关要素ID
     public void updateTailoring(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId);
     //修改装箱单面料子表的报关要素ID
-    public void updateFabric(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId);
+    public void updateFabric(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId,@Param("type") String type,@Param("code") String code);
     //修改预装箱单主表的报关要素ID
     public void updateAssembledPacking(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId);
 
     //修改托书子表的报关要素ID
-    public void updatesyShippingOrderItem(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId);
+    public void updatesyShippingOrderItem(@Param("newElmentId") String newElmentId, @Param("elmentId") String elmentId,@Param("type") String type,@Param("code") String code);
 
 }

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

@@ -4,7 +4,7 @@
 
     <select id="queryList" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
 
-        select a.push_state as pushState,b.id as itemIds from sy_shipping_details a
+        select a.push_state as pushState,b.id as itemIds,inventory_ccode as inventoryCcode from sy_shipping_details a
         left join sy_shipping_details_item b
         on a.id = b.shipping_details_id
         where a.del_flag = '0' and b.del_flag = '0' and b.elements_id = #{elmentId}
@@ -15,23 +15,40 @@
         update sy_pre_assembled_packing_list
         set elements_id = #{newElmentId}
         where elements_id = #{elmentId} and del_flag = '0'
+
+
     </update>
 
     <update id="updateFabric">
         update sy_packing_list_fabric_item
         set elements_Id = #{newElmentId}
-        where elements_Id = #{elmentId} and del_flag = '0'
+        <if test='type !="0"'>
+            where elements_Id = #{elmentId} and del_flag = '0'
+        </if>
+        <if test='type =="0"'>
+
+            where elements_id = #{elmentId} and del_flag = '0' and order_Number = #{code}
+        </if>
+
     </update>
 
     <update id="updateTailoring">
         update sy_packing_list_tailoring_item
         set elements_Id = #{newElmentId}
         where elements_Id = #{elmentId} and del_flag = '0'
+
+
     </update>
 
     <update id="updatesyShippingOrderItem">
         update sy_shipping_order_item
         set elements_Id = #{newElmentId}
-        where elements_Id = #{elmentId} and del_flag = '0'
+        <if test='type !="0"'>
+            where elements_Id = #{elmentId} and del_flag = '0'
+        </if>
+        <if test='type =="0"'>
+            where elements_Id = #{elmentId} and del_flag = '0' and order_number = #{code}
+        </if>
+
     </update>
 </mapper>

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

@@ -13,6 +13,6 @@ public interface ISyDeclarationElementsService extends IService<SyDeclarationEle
 
 
     //新增
-    public SyDeclarationElements syDeclarationElementsAdd(SyDeclarationElements syDeclarationElements);
+    public SyDeclarationElements syDeclarationElementsAdd(SyDeclarationElements syDeclarationElements,String type,String code);
 
 }

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

@@ -58,7 +58,7 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
      * @return
      */
     @Override
-    public SyDeclarationElements syDeclarationElementsAdd(SyDeclarationElements syDeclarationElements) {
+    public SyDeclarationElements syDeclarationElementsAdd(SyDeclarationElements syDeclarationElements,String type,String code) {
         //子表集合
         List<SyDeclarationElementsItem> syDeclarationElementsItemList = new ArrayList<SyDeclarationElementsItem>();
             //获取发运明细子表ID
@@ -133,13 +133,13 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
                     syDeclarationElementsItemService.saveBatch(syDeclarationElementsItemList);
                 }
 
-                //查询其他发运明细是否有相同
+                //查询其他发运明细是否有相同getInventoryCcode().substring(0,2).equals("19")
                 List<SyShippingDetailsVo> list2 = syShippingDetailsMapper.queryAllsyShippingDeial(zero.getItemNumber(),zero.getInventoryName(),zero.getOmpoAccount());
                 for(SyShippingDetailsVo li2:list2){
                     shippingList.add(li2.getItemIds());
                 }
                //修改发运明细报关要素ID
-                syShippingDetailsService.writeBackElenmentId(id,shippingList);
+                syShippingDetailsService.writeBackElenmentId(id,shippingList,type,code);
 
                 boolean ok = save(syDeclarationElements);
                 if(ok){
@@ -151,7 +151,7 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
             //记录未推送的发运明细子表ID集合
             List<String> itemIdsZeor = new ArrayList<>();
 
-            //查询发运明细
+            //查询所有相关发运明细
            List<SyShippingDetailsVo> list1= syDeclarationElementsMapper.queryList(elementid);
 
             for(SyShippingDetailsVo li: list1){
@@ -176,16 +176,16 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
                 syDeclarationElements.setId(uuid);
                 save(syDeclarationElements);
 
-                //修改发运明细报关要素ID
-                syShippingDetailsService.writeBackElenmentId(uuid,itemIdsZeor);
-                //修改预装箱单报关要素ID
-                syDeclarationElementsMapper.updateAssembledPacking(uuid,elementid);
-                //修改装箱成衣单报关要素ID
-                syDeclarationElementsMapper.updateTailoring(uuid,elementid);
-                //修改装箱单面料报关要素ID
-                syDeclarationElementsMapper.updateFabric(uuid,elementid);
-                //修改托书子表报关要素ID
-                syDeclarationElementsMapper.updatesyShippingOrderItem(uuid,elementid);
+                    //修改发运明细报关要素ID
+                    syShippingDetailsService.writeBackElenmentId(uuid,itemIdsZeor,type,code);
+                    //修改预装箱单报关要素ID
+                    syDeclarationElementsMapper.updateAssembledPacking(uuid,elementid);
+                    //修改装箱成衣单报关要素ID
+                    syDeclarationElementsMapper.updateTailoring(uuid,elementid);
+                    //修改装箱单面料报关要素ID
+                    syDeclarationElementsMapper.updateFabric(uuid,elementid,type,code);
+                    //修改托书子表报关要素ID
+                    syDeclarationElementsMapper.updatesyShippingOrderItem(uuid,elementid,type,code);
 
             }
 

+ 5 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -933,7 +933,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
   @AutoLog(value = "发运明细查询订单")
   @ApiOperation(value="发运明细查询订单", notes="发运明细查询订单")
   @GetMapping(value = "/queryOrderData")
-  public Result<IPage<OrderDataVo>> queryOrderData(String itemNumber,String account,String startDeliveryDate,String endDeliveryDate,String smallPo,String refer,
+  public Result<IPage<OrderDataVo>> queryOrderData(String itemNumber,String account,String startDeliveryDate,String endDeliveryDate,String smallPo,String refer,String inventoryCode,
 												   String salesman,String customerName,String flourOrGarment,String preDeliveryDateS,String preDeliveryDateE,String orderNumber,
 												   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 												   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@@ -969,6 +969,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		  queryWrapper.ge("b.pre_delivery_date", preDeliveryDateS);
 		  queryWrapper.le("b.pre_delivery_date", preDeliveryDateE);
 	  }
+	  if (oConvertUtils.isNotEmpty(inventoryCode)) {
+		  queryWrapper.eq("b.inventory_code", inventoryCode);
+	  }
 	  if (oConvertUtils.isNotEmpty(smallPo)) {
 		  queryWrapper.like("b.small_po", smallPo);
 	  }
@@ -1188,7 +1191,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 				result.setSuccess(false);
 				return  result;
 			}
-			 SyDeclarationElements syDeclarationElementsAdd = syDeclarationElementsService.syDeclarationElementsAdd(syDeclarationElements);
+			 SyDeclarationElements syDeclarationElementsAdd = syDeclarationElementsService.syDeclarationElementsAdd(syDeclarationElements,syDeclarationElements.getType(),syDeclarationElements.getCode());
 
 			result.setResult(syDeclarationElementsAdd);
 			result.setMessage("新增成功!");

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java

@@ -471,6 +471,7 @@ public class SyShippingDetailsItem {
         this.factoryUnitPrice = orderDataVo.getITaxPrice().toString();
         this.dArriveDate = orderDataVo.getDArriveDate();
         this.masterMetering = orderDataVo.getMasterMetering();
+        this.isTc = orderDataVo.getIsTc();
 
 	}
 }

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/OrderDataVo.java

@@ -280,4 +280,6 @@ public class OrderDataVo {
     //是否被参照
     @TableField(exist = false)
     private String refer;
+
+    private String isTc;
 }

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

@@ -49,7 +49,7 @@ public interface SyShippingDetailsMapper extends BaseMapper<SyShippingDetails> {
     public void updateElenmentId(@Param("elementsId") String elementsId,@Param("id") String id);
 
     //回写报关要素ID字段
-    public void writeBackElenmentId(@Param("elementsId") String elementsId,@Param("id") List<String> id);
+    public void writeBackElenmentId(@Param("elementsId") String elementsId,@Param("id") List<String> id,@Param("type") String type,@Param("code") String code);
 
     //批量提交/取消提交
     public int batchSubmission(@Param("submitListId") List<String> submitListId,@Param("type") String type);

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

@@ -11,7 +11,7 @@
            b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,guangpei_gate_width as guangpeiGateWidth,b.master_metering as masterMetering,
            b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,b.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%Y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
-            a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,
+            a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,b.is_tc as isTc,
            if(left(b.inventory_ccode,2)='19',
 case a.customer_abbreviation
 when 'International Apparel Group' then a.end_customer
@@ -46,7 +46,7 @@ a.end_customer) as endCustomer,
            a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,b.inventory_code as inventoryCode,
            b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,guangpei_gate_width as guangpeiGateWidth,b.master_metering as masterMetering,
            b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,b.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%Y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
-           a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
+           a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,b.is_tc as isTc,
             a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
              a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription,b.supplier as supplier,b.i_tax_price as iTaxPrice,
              case when b.ymoney is null then '0' else b.ymoney end as ymoney,b.OMPO_id as OMPOId,b.inventory_ccode as inventoryCcode
@@ -177,7 +177,14 @@ ${ew.customSqlSegment} and  t.inventoryCcode not LIKE '19%'
            b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,b.number_of_sets as numberOfSets,b.guangpei_gate_width as guangpeiGateWidth,
            b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,b.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%Y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
-            a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
+            a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,
+            if(left(b.inventory_ccode,2)='19',
+            case a.customer_abbreviation
+            when 'International Apparel Group' then a.end_customer
+            when '宁波森语' then a.end_customer
+            else a.customer_abbreviation end ,
+            a.end_customer) as endCustomer,
+            b.is_tc as isTc,
              a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription,b.supplier as supplier,b.i_tax_price as iTaxPrice,
              case when b.ymoney is null then '0' else b.ymoney end as ymoney,b.ompo_id as ompoId,b.inventory_ccode as inventoryCcode,b.d_arrive_date as dArriveDate,b.master_metering as masterMetering,
              b.ompo_id_item as ompoIdItem,b.ompo_account as ompoAccount,b.ompo_code as purOrSubOrder,b.r_supplier_code as rSupplierCode,b.r_supplier as rSupplier
@@ -221,10 +228,18 @@ ${ew.customSqlSegment}
     <update id="writeBackElenmentId">
         update sy_shipping_details_item
         set elements_id = #{elementsId}
-        where id in
-        <foreach collection="id" item="item"  open="(" separator="," close=")">
-            #{item}
-        </foreach>
+        <if test='type !="0"'>
+            where  id in
+            <foreach collection="id" item="item"  open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test='type =="0"'>
+            where  order_number = #{code}  and id in
+            <foreach collection="id" item="item"  open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
 
     </update>
 

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java

@@ -55,7 +55,7 @@ public interface ISyShippingDetailsService extends IService<SyShippingDetails> {
     public void updateElenmentId(String elementsId,String id);
 
     //回写报关要素ID字段
-    public void writeBackElenmentId(String elementsId,List<String> id);
+    public void writeBackElenmentId(String elementsId,List<String> id,String type,String code);
 
     //批量提交/取消提交
     public int batchSubmission(List<String> submitListId,String type);

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

@@ -395,8 +395,8 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
      * @param id
      */
     @Override
-    public void writeBackElenmentId(String elementsId, List<String> id) {
-        syShippingDetailsMapper.writeBackElenmentId(elementsId, id);
+    public void writeBackElenmentId(String elementsId, List<String> id,String type,String code) {
+        syShippingDetailsMapper.writeBackElenmentId(elementsId, id,type,code);
     }