zengtx il y a 3 ans
Parent
commit
98fda9424f

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

@@ -11,11 +11,14 @@ import javax.servlet.http.HttpServletResponse;
 import com.alibaba.fastjson.JSONObject;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
+//import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.common.system.vo.LoginUser;
+//import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElementsItem;
 import org.jeecg.modules.documents.seclarationElements.service.ISyDeclarationElementsItemService;
@@ -30,7 +33,7 @@ import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsIte
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
 
 import java.util.logging.SimpleFormatter;
-
+import org.jeecg.modules.system.util.oConvertUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -38,8 +41,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.modules.openApi.entity.DxpDataPlan;
 import org.jeecg.modules.openApi.service.IDxpDataPlanService;
+import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.util.InterfaceConnUtils;
 import org.jeecg.modules.system.util.JsonChangeUtils;
+import org.jeecg.modules.system.util.SecurityUtil;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -93,6 +98,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 								   HttpServletRequest req) {
+
 		Result<IPage<SyShippingDetailsVo>> result = new Result<IPage<SyShippingDetailsVo>>();
 		QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
 		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
@@ -138,6 +144,15 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 				result.setMessage("请填写信息再保存!");
 				return result;
 			}
+			//设置创建人
+			LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
+
+			syShippingDetails.setCreateBy(sysUser.getRealname());
+			//设置创建时间
+			SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+			String createTime = sf.format(new Date());
+			syShippingDetails.setCreateTime(sf.parse(createTime));
+
 			List<SyShippingDetailsItem> syShippingDetailsItemList = syShippingDetails.getSyShippingDetailsItemList();
 			if (syShippingDetailsItemList.size() == 0) {
 				result.setMessage("表体信息不能为空!");
@@ -403,6 +418,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		  queryWrapper.eq("a.account", account);
 	  }
 	  queryWrapper.eq("a.del_flag", 0);
+	  queryWrapper.gt("b.surplus_num", 0);
 	  queryWrapper.orderByDesc("a.order_number");
 
 	  IPage<OrderDataVo> pageList = syShippingDetailsService.queryOrderData(page, queryWrapper);
@@ -504,7 +520,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	 @AutoLog(value = "查询报关要素")
 	 @ApiOperation(value="查询报关要素", notes="查询报关要素")
 	 @GetMapping(value = "/queryDeclarationElements")
-  public Result<SyDeclarationElements> queryDeclarationElements(String hsCode,
+  public Result<SyDeclarationElements> queryDeclarationElements(String hsCode,String id,
 																HttpServletRequest request, HttpServletResponse response){
 
   	Result<SyDeclarationElements> result = new Result<SyDeclarationElements>();
@@ -514,12 +530,21 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
   		result.setSuccess(false);
   		return result;
 	}
+  	 //查询发运明细主表 获取报关品名、hscode、英文品名
+		 SyShippingDetails entity =  syShippingDetailsService.getById(id);
+
   	     //查询报关要素主表
 		 QueryWrapper<SyDeclarationElements> queryWrapper = new QueryWrapper<SyDeclarationElements>();
   	     queryWrapper.eq("hs_code",hsCode).eq("del_flag",0);
   	     List<SyDeclarationElements> syDeclarationElements = syDeclarationElementsService.list(queryWrapper);
 		 if(syDeclarationElements.size()==0){
 			 SyDeclarationElements syDeclarationElementsEntityNull = new SyDeclarationElements();
+			 syDeclarationElementsEntityNull.setHsCode(entity.getHsCode());
+			 syDeclarationElementsEntityNull.setEnglishProductName(entity.getEnglishProductName());
+			 syDeclarationElementsEntityNull.setDeclarationName(entity.getDeclarationName());
+
+			 List<SyDeclarationElementsItem> entityList = new ArrayList<>();
+			 syDeclarationElementsEntityNull.setSyDeclarationElementsItemList(entityList);
 			 result.setMessage("查询成功!");
 			 result.setSuccess(true);
 			 result.setResult(syDeclarationElementsEntityNull);

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

@@ -137,4 +137,25 @@ public class SyShippingDetails {
 	@ApiModelProperty(value = "提交(1)/取消提交(2)")
 	@TableField(exist = false)
 	private String type;
+
+	@Excel(name = "成衣工厂", width = 15)
+	@ApiModelProperty(value = "成衣工厂")
+	private String garmentFactory;
+
+	@Excel(name = "订单类型", width = 15)
+	@ApiModelProperty(value = "订单类型")
+	private String orderType;
+
+	@Excel(name = "账套", width = 15)
+	@ApiModelProperty(value = "账套")
+	private String account;
+
+	@Excel(name = "中文品名", width = 15)
+	@ApiModelProperty(value = "中文品名")
+	private String chineseName;
+
+	/**整单合计*/
+	@Excel(name = "整单合计", width = 15)
+	@ApiModelProperty(value = "整单合计")
+	private java.math.BigDecimal wholeOrderTotal;
 }

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.documents.shippingDetails.entity;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -47,7 +48,7 @@ public class SyShippingDetailsItem {
 	/**账套*/
 	@Excel(name = "账套", width = 15)
     @ApiModelProperty(value = "账套")
-	private java.lang.String acSetNo;
+	private java.lang.String account;
 	/**订单号*/
 	@Excel(name = "订单号", width = 15)
     @ApiModelProperty(value = "订单号")
@@ -118,10 +119,7 @@ public class SyShippingDetailsItem {
 	@Excel(name = "汇率", width = 15)
     @ApiModelProperty(value = "汇率")
 	private java.math.BigDecimal exchangeRate;
-	/**整单合计*/
-	@Excel(name = "整单合计", width = 15)
-    @ApiModelProperty(value = "整单合计")
-	private java.math.BigDecimal wholeOrderTotal;
+
 	/**销售部门*/
 	@Excel(name = "销售部门", width = 15)
     @ApiModelProperty(value = "销售部门")
@@ -243,9 +241,7 @@ public class SyShippingDetailsItem {
 	@Excel(name = "采购/委外订单号", width = 15)
 	@ApiModelProperty(value = "采购/委外订单号")
 	private String purOrSubOrder;
-	@Excel(name = "订单类型", width = 15)
-	@ApiModelProperty(value = "订单类型")
-	private String orderType;
+
 	@Excel(name = "工厂单价", width = 15)
 	@ApiModelProperty(value = "工厂单价")
 	private String factoryUnitPrice;
@@ -254,14 +250,22 @@ public class SyShippingDetailsItem {
 	private String declarationElements;
 	@Excel(name = "套装件数", width = 15)
 	@ApiModelProperty(value = "套装件数")
-	private String numberOfSets;
-	@Excel(name = "中文品名", width = 15)
-	@ApiModelProperty(value = "中文品名")
-	private String chineseName;
-	@Excel(name = "英文品名", width = 15)
-	@ApiModelProperty(value = "英文品名")
-	private String englishName;
-	@Excel(name = "成衣工厂", width = 15)
-	@ApiModelProperty(value = "成衣工厂")
-	private String garmentFactory;
+	private int numberOfSets;
+
+	@Excel(name = "处理方式", width = 15)
+	@ApiModelProperty(value = "处理方式")
+	private String treatmentMethod;
+
+	@Excel(name = "是否手册纱", width = 15)
+	@ApiModelProperty(value = "是否手册纱")
+	private int manualYarnFlag;
+
+	@Excel(name = "手册纱单价", width = 15)
+	@ApiModelProperty(value = "手册纱单价")
+	private BigDecimal manualYarnUnitPrice;
+
+	@Excel(name = "手册纱占比", width = 15)
+	@ApiModelProperty(value = "手册纱占比")
+	private String manualYarnProportion;
+
 }

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

@@ -166,4 +166,17 @@ public class OrderDataVo {
     @Excel(name = "订单剩余数量", width = 15)
     @ApiModelProperty(value = "订单剩余数量")
     private String surplusNum;
+
+    @Excel(name = "含税单价", width = 15)
+    @ApiModelProperty(value = "含税单价")
+    private String unitPriceIncludingTax;
+
+    @Excel(name = "订单主表ID", width = 15)
+    @ApiModelProperty(value = "订单主表ID")
+    private String syOrderDataId;
+
+    @Excel(name = "订单子表ID", width = 15)
+    @ApiModelProperty(value = "订单子表ID")
+    private String syOrderDataItemId;
+
 }

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

@@ -142,7 +142,7 @@ public class SyShippingDetailsVo {
     private String chineseName;
     @Excel(name = "英文品名", width = 15)
     @ApiModelProperty(value = "英文品名")
-    private String englishName;
+    private String englishProductName;
     @Excel(name = "成衣工厂", width = 15)
     @ApiModelProperty(value = "成衣工厂")
     private String garmentFactory;
@@ -260,4 +260,5 @@ public class SyShippingDetailsVo {
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "预完工日期")
     private java.util.Date preCompletionDate;
+
 }

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

@@ -4,11 +4,11 @@
 
     <select id="queryOrderData" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
 
-        select a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
+        select b.sy_order_data_id as syOrderDataId,b.id as syOrderDataItemId ,a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
          b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as quantity,a.business_type_text as businessTypeText,a.customer_order_number as customerOrderNumber,
-           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,surplus_num as surplusNum,
+           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,b.surplus_num as surplusNum,
            a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,
-           b.distribution_point as distributionPoint,pack_id as packId,a.supplier as supplier,
+           b.distribution_point as distributionPoint,pack_id as packId,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
            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.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription from sy_order_data a
@@ -26,13 +26,13 @@
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
     b.is_tc as isTc,a.hs_code as hsCode,b.distribution_point as distributionPoint,b.item_number as itemNumber,b.business_type_text as businessTypeText,
     b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,b.order_remaining_quantity as orderRemainingQuantity,
-    b.pur_or_sub_order as purOrSubOrder,b.order_type as orderType,b.factory_unit_price as factoryUnitPrice,b.third_party as thirdParty,b.customer_order as customerOrder,
+    b.pur_or_sub_order as purOrSubOrder,a.order_type as orderType,b.factory_unit_price as factoryUnitPrice,b.third_party as thirdParty,b.customer_order as customerOrder,
     b.material_composition as materialComposition,b.currency_text as currencyText,b.brand_side as brandSide,b.deposit_ratio as depositRatio,
     b.deposit as deposit,b.collaborative_route as collaborativeRoute,b.term_of_payment as termOfPayment,b.end_customer as endCustomer,
     b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,a.pre_completion_date as preCompletionDate,
-    b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,b.whole_order_total as wholeOrderTotal,
-    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,b.chinese_name as chineseName,b.ac_set_no as acSetNo,
-    b.english_name as englishName,b.garment_factory as garmentFactory from sy_shipping_details a
+    b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
+    b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,
+    a.english_product_name as englishProductName,a.garment_factory as garmentFactory from sy_shipping_details a
 left join sy_shipping_details_item b
 on a.id = b.shipping_details_id and b.del_flag = 0
 where a.del_flag = 0 group by a.id order by a.document_no desc) as t
@@ -49,10 +49,18 @@ ${ew.customSqlSegment}
 
     <select id="pushSyShipping" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingVO">
 
-        select '103' as tenantId,id as accessoriesHeaderId,'ACCESSORIES0609-2' as packingHeaderNum,
-        'ACCESSORIES' as packingType,'NEW' as packingStatus,'PO36202206070001' as poNo,'JAZS001' as containerNumm,
-         '2022-06-07' as loadingDate,'01000229' as supplierNumber,
-          '' as invoiceNum,'蒋岗峰' as preparer,'2022-06-02 08:26:24' as preparationTime
+        select account as tenantId,
+        id as accessoriesHeaderId,
+        document_no as packingHeaderNum,--'ACCESSORIES0609-2'
+        'ACCESSORIES' as packingType,
+        'NEW' as packingStatus,
+        --'PO36202206070001' as poNo,
+        --'JAZS001' as containerNumm,
+       --  '2022-06-07' as loadingDate,
+         '01000229' as supplierNumber,
+          --'' as invoiceNum,
+          create_by as preparer,
+          create_time as preparationTime
           from sy_shipping_details
          where del_flag = 0 and id = #{id}
 
@@ -61,13 +69,43 @@ ${ew.customSqlSegment}
     <select id="pushSyShippingDeial" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo">
 
         select '103' as tenantId,
-          id as accessoriesLineId,id as accessoriesHeaderIdD,'1' as packingLineNum,'T0036' as merchandiser,'PO36202206070001' as poNo,
-          '' as moDetailId,'' as poId, 'W21-W20-MSP-SPW0001' as styleNo, 'C156St2' as batchNo,'藏青' as color,'N0201002139' as itemCode,'' as itemId,
-          '全涤绒布' as itemDesc,'针织布' as declarationName,'全涤' as composition,'190' as width,'' as rolls, '43' as planPackingQty,
-          '21' as actualPackingQty,'33' as grossWeight,'21' as netWeight,'32' as length,'' as clothWeight,'12' as cartons,
-          '6.32' as unitPrice,'45.21' as totalPrice,'' as gramWeight,'01000229' as supplierNumber,'' as supplierId,'' as supplierTenantId,
-          '打卷' as packingMethod,'染色' as treatmentMethod,'1' as manualYarnFlag,'0' as manualYarnUnitPrice,'0' as manualYarnProportion,
-          '无' as remark,'111' as cabinetNum
+          id as accessoriesLineId,
+          id as accessoriesHeaderIdD,
+          sort as packingLineNum,
+          'T0036' as merchandiser,
+          order_number as poNo,--'PO36202206070001'
+          sy_order_data_item_id as moDetailId,
+          sy_order_data_id as poId,
+          item_number as styleNo, --'W21-W20-MSP-SPW0001'
+           'C156St2' as batchNo,
+           '藏青' as color,
+           'N0201002139' as itemCode,
+           '' as itemId,
+          '全涤绒布' as itemDesc,
+          '针织布' as declarationName,
+          '全涤' as composition,
+          '190' as width,
+          '' as rolls,
+          '43' as planPackingQty,
+          '21' as actualPackingQty,
+          '33' as grossWeight,
+          '21' as netWeight,
+          '32' as length,
+          '' as clothWeight,
+          '12' as cartons,
+          '6.32' as unitPrice,
+          '45.21' as totalPrice,
+          '' as gramWeight,
+          '01000229' as supplierNumber,
+          '' as supplierId,
+          '' as supplierTenantId,
+          '打卷' as packingMethod,
+          '染色' as treatmentMethod,
+          '1' as manualYarnFlag,
+          '0' as manualYarnUnitPrice,
+          '0' as manualYarnProportion,
+          '无' as remark,
+          '111' as cabinetNum
           from sy_shipping_details_item
           where del_flag = 0 and shipping_details_id = #{shippingDetailsId}
     </select>

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

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.documents.orderData.entity.SyOrderData;
+import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
+import org.jeecg.modules.documents.orderData.service.impl.SyOrderDataItemServiceImpl;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
 import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
@@ -20,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -38,6 +42,8 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
     private SyShippingDetailsMapper syShippingDetailsMapper;
     @Autowired
     private SyShippingDetailsItemServiceImpl syShippingDetailsItemService;
+    @Autowired
+    private SyOrderDataItemServiceImpl syOrderDataItemService;
 
 
     /**
@@ -89,6 +95,14 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
                  li.setShippingDetailsId(id);
                  li.setId(oConvertUtils.id());
                  syShippingDetailsItemList.add(li);
+
+                 //回写销售订单剩余数量
+                 SyOrderDataItem orderDataItem = syOrderDataItemService.getById(li.getSyOrderDataItemId());
+                 if(oConvertUtils.isNotEmpty(orderDataItem)){
+                     int suerBox = orderDataItem.getSurplusNum() - li.getShipmentQuantity().intValue();
+                     orderDataItem.setSurplusNum(suerBox);
+                     syOrderDataItemService.updateById(orderDataItem);
+                 }
              }
              if(syShippingDetailsItemList.size()!=0){
                  syShippingDetailsItemService.saveBatch(syShippingDetailsItemList);
@@ -118,13 +132,24 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
 
         SyShippingDetails entity = syShippingDetails;
         String id = syShippingDetails.getId();
-        //先删除子表
-        syShippingDetailsMapper.syshippingDetailsItemUpdate(id);
-        //删除主表
         SyShippingDetails syShippingDetailsEntity = getById(id);
         if(syShippingDetailsEntity.getState().equals("1")){
             throw new JeecgBootException("提交单据不能修改!");
         }
+
+        //回写销售订单剩余数量
+        List<SyShippingDetailsItem> list = entity.getSyShippingDetailsItemList();
+        for (SyShippingDetailsItem li:list) {
+            SyOrderDataItem orderDataItem = syOrderDataItemService.getById(li.getSyOrderDataItemId());
+            if (oConvertUtils.isNotEmpty(orderDataItem)) {
+                int suerBox = orderDataItem.getSurplusNum() + li.getShipmentQuantity().intValue();
+                orderDataItem.setSurplusNum(suerBox);
+                syOrderDataItemService.updateById(orderDataItem);
+            }
+        }
+        //删除子表
+        syShippingDetailsMapper.syshippingDetailsItemUpdate(id);
+        //删除主表
         syShippingDetailsEntity.setDelFlag("1");
         updateById(syShippingDetailsEntity);
         //新增
@@ -144,6 +169,18 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         int i = 0;
         SyShippingDetails syShippingDetails = getById(id);
         if(oConvertUtils.isNotEmpty(syShippingDetails)){
+            //回写销售订单剩余数量
+            QueryWrapper<SyShippingDetailsItem> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("shipping_details_id",id).eq("del_flag",0);
+            List<SyShippingDetailsItem> list = syShippingDetailsItemService.list(queryWrapper);
+            for (SyShippingDetailsItem li:list) {
+                SyOrderDataItem orderDataItem = syOrderDataItemService.getById(li.getSyOrderDataItemId());
+                if (oConvertUtils.isNotEmpty(orderDataItem)) {
+                    int suerBox = orderDataItem.getSurplusNum() + li.getShipmentQuantity().intValue();
+                    orderDataItem.setSurplusNum(suerBox);
+                    syOrderDataItemService.updateById(orderDataItem);
+                }
+            }
             //删除子表
             syShippingDetailsMapper.syshippingDetailsItemUpdate(id);
             //删除主表