Browse Source

预托书、托书调整

zengtx 2 years ago
parent
commit
aeec14a02b

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/controller/SyLetterDepositController.java

@@ -98,7 +98,7 @@ public class SyLetterDepositController extends JeecgController<SyLetterDeposit,
 			}
 			//预托书号
 			if(oConvertUtils.isNotEmpty(syLetterDeposit.getDepositaryReceiptNo().trim())){
-				queryWrapper.eq("b.depositary_receipt_no",syLetterDeposit.getDepositaryReceiptNo());
+				queryWrapper.eq("a.depositary_receipt_no",syLetterDeposit.getDepositaryReceiptNo());
 			}
 			//托书日期
 			if(oConvertUtils.isNotEmpty(syLetterDeposit.getShippingOrderDate())){

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/mapper/xml/SyLetterDepositMapper.xml

@@ -96,7 +96,7 @@ on a.id = b.sy_letter_deposit_id
         select item_number as itemNumber,small_po as smallPo,total,box_number as boxNumber,pre_ids as preIds,sy_pre_assembled_packing_list_id as syPreAssembledPackingListId,
 total_gross_weight as totalGrossWeight,total_net_weight as totalNetWeight,total_volume as totalVolume,distribution_point as distributionPoint,
 container_code as containerCode,container_number as containerNumber,unit_price as unitPrice,total_price as totalPrice,
-hod,salesman,sales_Department as salesDepartment,spur_or_subOrder as spurOrSubOrder
+hod,salesman,sales_Department as salesDepartment,spur_or_sub_order as spurOrSubOrder
          from sy_letter_deposit_item
          where del_flag = 0 and sy_letter_deposit_id = #{syId} group by letter_groupid
 

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/service/impl/SyLetterDepositServiceImpl.java

@@ -322,6 +322,15 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
             entit.setId(li.getSyPreAssembledPackingListId());
             entit.setIsReference(0);
             syPreAssembledPackingListService.updateById(entit);
+
+            //查询预装箱单子表
+            SyPreAssembledPackingListItem entity = syPreAssembledPackingListItemService.getById(li.getSyPreAssembledPackingListItemId());
+            //回写发运明细是否被参照
+            String shippingIds = entity.getSyDeclarationElementsItemId();
+            SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
+            syshippingItem.setId(shippingIds);
+            syshippingItem.setIsReference(0);
+            syShippingDetailsItemService.updateById(syshippingItem);
         }
         //删除子表
         syLetterDepositMapper.syLetterDepositItemDelete(id);

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

@@ -39,6 +39,8 @@ import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsSer
 
 import java.util.logging.SimpleFormatter;
 
+import org.jeecg.modules.spapl.entity.SyPreAssembledPackingListItem;
+import org.jeecg.modules.spapl.service.impl.SyPreAssembledPackingListItemServiceImpl;
 import org.jeecg.modules.spapl.vo.SyPreAssembledPackingListPage;
 import org.jeecg.modules.system.util.oConvertUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -92,6 +94,8 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	 private SyShippingDetailsMapper syShippingDetailsMapper;
 	 @Autowired
 	 private SyGetOrderServiceImpl syGetOrderService;
+	 @Autowired
+	 private SyPreAssembledPackingListItemServiceImpl syPreAssembledPackingListItemService;
 	
 	/**
 	 * 分页列表查询
@@ -504,6 +508,15 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 						  result.setMessage("部分单据已取消提交,请勿重复取消提交!");
 						  return result;
 					  }
+					  //判断下游是否有单据 sy_pre_assembled_packing_list_item
+					  QueryWrapper<SyPreAssembledPackingListItem> queryWrapper = new QueryWrapper<SyPreAssembledPackingListItem>();
+					  queryWrapper.eq("sy_declaration_elements_item_id",li.getId()).eq("del_flag",0);
+                      List<SyPreAssembledPackingListItem> packingListItems = syPreAssembledPackingListItemService.list(queryWrapper);
+                      if(packingListItems.size()!=0){
+						  result.setSuccess(false);
+						  result.setMessage("该单据被下游参照,不允许取消提交!");
+						  return result;
+					  }
 				  }
 			  }
 		  }

+ 24 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/entity/VO/SyPackingList.java

@@ -53,19 +53,37 @@ public class SyPackingList {
     private String colour;
     /**采购/委外订单号*/
     @ApiModelProperty(value = "采购/委外订单号")
-    private String purchase;
+    private String purOrSubOrder;
     /**订单类型*/
     @ApiModelProperty(value = "订单类型")
     private String orderType;
-    /**工厂单价*/
-    @ApiModelProperty(value = "工厂单价")
-    private String theFactoryPrice;
 
     /**成衣或者面料*/
     @Excel(name = "成衣或者面料", width = 15)
     @ApiModelProperty(value = "成衣或者面料")
     private String readyFabric;
 
-    //入库数量
-    private BigDecimal inventoryQuantity;
+    @ApiModelProperty(value = "预发货日期")
+    private String hod;
+    @ApiModelProperty(value = "工厂单价")
+    private BigDecimal factoryUnitPrice;
+
+    @ApiModelProperty(value = "数量")
+    private BigDecimal planQuantity;
+    @ApiModelProperty(value = "箱数")
+    private BigDecimal actualPackingQty;
+    @ApiModelProperty(value = "集装箱代号")
+    private String containerCode;
+    @ApiModelProperty(value = "集装箱号")
+    private String containerNumber;
+    @ApiModelProperty(value = "预托书号")
+    private String depositaryReceiptNo;
+    @ApiModelProperty(value = "毛重")
+    private BigDecimal totalGrossWeight;
+    @ApiModelProperty(value = "净重")
+    private BigDecimal totalNetWeight;
+    @ApiModelProperty(value = "体积")
+    private BigDecimal totalVolume;
+
+
 }

+ 12 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -20,11 +20,12 @@
   <select id="queryTailoring" resultType="org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList">
 
     select a.id as id ,GROUP_CONCAT(b.id) as itemId, a.document_No as documentNo,a.order_number as orderNumber,a.depositary_receipt_no as depositaryReceiptNo,
-     a.item_number as itemNumber,b.inventory_name as productName,b.distribution_point as distributionPoint,
-     b.item_code as itemCode,b.starting_box_number as startingBoxNumber,b.end_case_number as endCaseNumber,
-     b.colour as colour,b.pieces_box as piecesBox,b.box_number as boxNumber,b.total as total,b.outer_box_length as outerBoxLength,
-     b.outer_box_width as outerBoxWidth,b.outer_box_height as outerBoxHeight,b.total_volume as totalVolume,b.total_net_weight as totalNetWeight,
-     b.total_gross_weight as totalGrossWeight,'成衣' as readyFabric
+     a.item_number as itemNumber,b.inventory_name as inventoryName,b.distribution_point as distributionPoint,a.customer_abbreviation as customerAbbreviation,
+     b.item_code as itemCode,b.starting_box_number as startingBoxNumber,b.end_case_number as endCaseNumber,b.hod as preDeliveryDate,b.small_Po as smallPo,
+     b.colour as colour,b.pieces_box as piecesBox,b.box_number as boxNumber,b.total as total,b.outer_box_length as outerBoxLength,a.customer as customer,
+     b.outer_box_width as outerBoxWidth,b.outer_box_height as outerBoxHeight,sum(b.total_volume) as totalVolume,sum(b.total_net_weight) as totalNetWeight,b.spur_Or_Sub_Order as purOrSubOrder,
+     sum(b.total_gross_weight) as totalGrossWeight,'成衣' as readyFabric,a.memo as memo,b.salesman as salesman,b.factory_Unit_Price as factoryUnitPrice,sum(b.total_price) as totalPrice,
+     sum(b.plan_Quantity) as planQuantity,sum(b.actual_Packing_Qty) as actualPackingQty,a.container_code as containerCode,b.container_number as containerNumber
        from sy_packing_list_tailoring a
     left join sy_packing_list_tailoring_item b
     on a.id = b.sy_packing_list_tailoring_id
@@ -35,9 +36,12 @@
     <!--    查询装箱单-面料-->
     <select id="queryFabric" resultType="org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList">
 
-    select a.id as id ,GROUP_CONCAT(b.id) as itemId, a.document_No as documentNo,a.order_number as orderNumber,a.depositary_receipt_no as depositaryReceiptNo,
-     b.inventory_name as productName,sum(b.Remaining_Quantity) as inventoryQuantity,
-     b.inventory_Code as itemCode,
+    select a.id as id ,GROUP_CONCAT(b.id) as itemId, a.document_No as documentNo,a.order_number as orderNumber,
+    b.item_Number as itemNumber,a.customer_Abbreviation as customerAbbreviation,a.customer,b.small_Po as smallPo,b.distribution_Point as distributionPoint,
+    b.salesman as salesman,b.pur_Or_Sub_Order as purOrSubOrder,b.factory_Unit_Price as factoryUnitPrice,'0' as totalVolume,'0' as actualPackingQty,
+    a.depositary_receipt_no as depositaryReceiptNo,b.order_Type as orderType,sum(b.gross_weight) as totalGrossWeight,sum(b.total_Price) as totalPrice,
+     b.inventory_name as inventoryName,sum(b.inventory_quantity) as planQuantity,sum(b.net_weight) as totalNetWeight,a.container_Code as containerCode,
+     b.inventory_Code as itemCode,a.memo as memo,a.container_number as containerNumber,
      b.colour as colour,
      '面料' as readyFabric
        from sy_packing_list_fabric a