Browse Source

发运明细跟托书调整

zengtx 2 years ago
parent
commit
2b89619f9c

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/entity/SyLetterDepositItem.java

@@ -217,4 +217,9 @@ public class SyLetterDepositItem {
 	@Excel(name = "预装箱单单据号", width = 15)
 	@ApiModelProperty(value = "预装箱单单据号")
 	private String preAssembledPackingNo;
+
+	/**客户简称*/
+	@Excel(name = "客户简称", width = 15)
+	@ApiModelProperty(value = "客户简称")
+	private java.lang.String clientAbbreviation;
 }

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

@@ -7,7 +7,7 @@
 
 select a.document_No as documentNo,a.id as id,GROUP_CONCAT(b.id) as itemId,a.item_number as itemNumber,b.hod as preDeliveryDate ,b.inventory_name as inventoryName,b.po_no as poNo,b.distribution_point as distributionPoint,
 a.memo,a.customer,b.colour,sum(b.box_number) as  boxNumber,b.ac_set_no as acSetNo,sum(b.total) as total,a.customer_abbreviation as customerAbbreviation,
-sum(b.total_net_weight) as totalNetWeight,a.order_type as orderType,b.total_quantity as totalQuantity,b.small_Po as smallPo,b.unit_price as unitPrice,
+sum(b.total_net_weight) as totalNetWeight,a.order_type as orderType,b.plan_Quantity as totalQuantity,b.small_Po as smallPo,b.unit_price as unitPrice,
 sum(b.total_gross_weight) as totalGrossWeight,sum(b.total_volume) as totalVolume,sum(b.total_price) as totalPrice,b.factory_unit_price as factoryUnitPrice,
 a.depositary_receipt_no as depositaryReceiptNo,a.spur_Or_Sub_Order as spurOrSubOrder,sum(b.pieces_box) as piecesBox,b.size,a.order_number as orderNumber,
 b.starting_box_number as startingBoxNumber,b.end_case_number as endCaseNumber,b.outer_box_length as outerBoxLength,b.outer_box_width as outerBoxWidth,b.outer_box_height as outerBoxHeight,
@@ -79,8 +79,8 @@ on a.id = b.sy_pre_assembled_packing_list_id
 
     <select id="querySyLetterDeposit" resultType="org.jeecg.modules.documents.letterDeposit.entity.SyLetterDeposit">
 select a.id as id,a.depositary_receipt_no as depositaryReceiptNo,b.order_number as orderNumber,a.export_invoice_no as exportInvoiceNo,
-a.client_abbreviation as clientAbbreviation,a.exchange_earnings_value as exchangeEarningsValue,b.sy_pre_assembled_packing_list_id as syPreAssembledPackingListId,
-a.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,sum(b.box_number) as boxNumber,sum(b.total_gross_weight) as totalGrossWeight,sum(b.total_volume) as totalVolume,
+b.client_abbreviation as clientAbbreviation,a.exchange_earnings_value as exchangeEarningsValue,b.sy_pre_assembled_packing_list_id as syPreAssembledPackingListId,
+b.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,sum(b.box_number) as boxNumber,sum(b.total_gross_weight) as totalGrossWeight,sum(b.total_volume) as totalVolume,
 sum(a.money) as money,a.the_actual_shipping_date as theActualShippingDate,a.exchange_earnings_text as exchangeEarningsText,a.consignee as consignee,a.bill_of_lading_or_carriage_receipt as billOfLadingOrCarriageReceipt,
 a.addressee as addressee,a.trade_country as tradeCountry,a.arrive_in_country as arriveInCountry,a.export_port as exportPort,a.notifier as notifier,a.nottfy as nottfy,a.destination_port as destinationPort,
 a.the_documents_state as theDocumentsState from sy_letter_deposit a

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

@@ -97,6 +97,7 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
             //syLetterDeposit.setTheDocumentsState("0");//状态
         }
         syLetterDeposit.setDelFlag("0");
+        //syLetterDeposit.setClientAbbreviation(syLetterDeposit.getSyLetterDepositItemList().get(0).get)
         //新增子表
         List<SyLetterDepositItem> list = syLetterDeposit.getSyLetterDepositItemList();
         if(list.size()!=0){
@@ -153,10 +154,12 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
                     itenPojo.setNetWeight(syper.getNetWeight());
                     itenPojo.setTotalNetWeight(syper.getTotalNetWeight());
                     itenPojo.setGrossWeight(syper.getGrossWeight());
+                    itenPojo.setTotalGrossWeight(syper.getTotalGrossWeight());
                     itenPojo.setTotalNetWeight(syper.getTotalNetWeight());
                     itenPojo.setOuterBoxHeight(syper.getOuterBoxHeight());
                     itenPojo.setOuterBoxLength(syper.getOuterBoxLength());
                     itenPojo.setTotalNetWeight(syper.getTotalNetWeight());
+                    itenPojo.setTotalPrice(syper.getTotalPrice());
                     itenPojo.setTotalVolume(syper.getTotalVolume());
                     itenPojo.setNetWeightToo(syper.getNetWeightToo());
                     itenPojo.setUnitPrice(syper.getUnitPrice());
@@ -170,6 +173,7 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
                     itenPojo.setItemNumber(li.getItemNumber());
                     itenPojo.setSmallPo(syper.getSmallPo());
                     itenPojo.setPreAssembledPackingNo(li.getPreAssembledPackingNo());
+                    itenPojo.setClientAbbreviation(li.getClientAbbreviation());
 
                     syLetterDepositItemList.add(itenPojo);
 

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

@@ -632,13 +632,20 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		  List<DxpDataPlan> tokenList = tokenpage.getRecords();
 		  String tokenUrl = tokenList.get(0).getItemIp()+tokenList.get(0).getItemUrl();
 
-		  //查询主表
-		  PushShippingVO pushShippingVO =  syShippingDetailsService.pushSyShipping(id);
-		  //查询子表
+		  //查询明细
 		  List<PushShippingDeialVo> pushShippingDeialVoList =  syShippingDetailsService.pushSyShippingDeial(id);
-		  pushShippingVO.setLines(pushShippingDeialVoList);
+		  for(PushShippingDeialVo li:pushShippingDeialVoList){
+			   if(li.getSubmitStatus().equals("0")){
+				   result.put("success","false");
+				   result.put("message","该单据部分未提交,请全部提交再推送!");
+				   return result;
+			   }
+			  //查询主表
+			  PushShippingVO pushShippingVO =  syShippingDetailsService.pushSyShipping(id);
+			  pushShippingVO.setLines(li);
+			  list.add(pushShippingVO);
+		  }
 
-		  list.add(pushShippingVO);
 	      //转JSON
 		  Gson userGson = new GsonBuilder().create();
 		  result.put("payload", userGson.toJson(JSONObject.toJSON(list)));
@@ -863,6 +870,11 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 					 li.setOmpoAccount(entity.getOmpoAccount());//供应商账套
 					 li.setPurOrSubOrder(entity.getOmpoCode());//委外采购订单号
 					 li.setYmoney(entity.getYmoney());//佣金
+//					 String mengfu = li.getGuangpeiGateWidth();
+//					 if(mengfu.substring(0,1).indexOf("/") != 1){
+//						 li.setGuangpeiGateWidth(entity.getGuangpeiGateWidth().toString());
+//					 }
+
 				 }
 			 }
 			 m++;

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

@@ -362,6 +362,6 @@ public class SyShippingDetailsItem {
 	private java.math.BigDecimal ymoney;
 
 	@Excel(name = "提交1,取消提交0", width = 15)
-	@ApiModelProperty(value = "最底层供应商名称")
+	@ApiModelProperty(value = "提交1,取消提交0")
 	private Integer submitStatus;
 }

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

@@ -238,4 +238,7 @@ public class OrderDataVo {
     //委外采购Id 子
     private java.lang.String ompoIdItem;
 
+    @Excel(name = "门幅", width = 15)
+    @ApiModelProperty(value = "门幅")
+    private String guangpeiGateWidth;
 }

+ 8 - 47
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/PushShippingDeialVo.java

@@ -5,35 +5,18 @@ import lombok.Data;
 @Data
 public class PushShippingDeialVo {
 
-    //租户ID
-    private String tenantId;
-    //装箱单行id,全局唯一
-    private String accessoriesLineId;
-    //装箱单头 ID
-    private String accessoriesHeaderId;
+
     //行号(序号)
     private String packingLineNum;
-    //业务员
-    private String merchandiser;
-    //计划单号
-    private String poNo;
-    //计划单号行ID
+    //计划单号行ID(订单号行ID(母件))
     private String moDetailId;
-    //计划单号ID
-    private String poId;
     //款号
     private String styleNo;
-    //缸号
-    private String batchNo;
     //颜色
     private String color;
-    //颜色特性
-    private String itemAttrId;
     //物料编码
     private String itemCode;
-    //物料ID
-    private String itemId;
-    //项目(辅料品名)
+    //项目(辅料品名)(存货名称)
     private String itemDesc;
     //报关品名
     private String declarationName;
@@ -43,32 +26,8 @@ public class PushShippingDeialVo {
     private String width;
     //匹数
     private String rolls;
-    //计划装箱数量
+    //发货数量
     private String planPackingQty;
-    //实际装箱数量
-    private String actualPackingQty;
-    //毛重
-    private String grossWeight;
-    //净重
-    private String netWeight;
-    //米数
-    private String length;
-    //拷布重
-    private String clothWeight;
-    //箱数
-    private String cartons;
-    //价格
-    private String unitPrice;
-    //总价合计
-    private String totalPrice;
-    //克重
-    private String gramWeight;
-    //供应商编码
-    private String supplierNumber;
-    //供应商ID
-    private String supplierId;
-    //供应商租户ID
-    private String supplierTenantId;
     //包装方式
     private String packingMethod;
     //处理方式
@@ -81,6 +40,8 @@ public class PushShippingDeialVo {
     private String manualYarnProportion;
     //备注
     private String remark;
-    //柜号
-    private String cabinetNum;
+
+    //提交状态
+    private String submitStatus;
+
 }

+ 11 - 18
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/PushShippingVO.java

@@ -7,34 +7,27 @@ import java.util.List;
 @Data
 public class PushShippingVO {
 
-    //租户ID
-    private String tenantId;
-    //装箱单头ID
-    private String accessoriesHeaderId;
-    //装箱单编号
+    //装箱单编号(用发运明细单号+行号做拼接,传过来,类似xxxx-1)
     private String packingHeaderNum;
+    //发运明细单号
+    private String attributeString1;
     //装箱单类型
     private String packingType;
     //装箱单状态
     private String packingStatus;
-    //PO
+    //订单
     private String poNo;
-    //集装箱号
-    private String containerNum;
-    //装柜日期
-    private String loadingDate;
-    //供应商编码(收货)
+    //订单号ID
+    private String attributeBigint1;
+    //供应商编码
     private String supplierNumber;
-    //供应商ID
-    private String supplierId;
-    //供应商租户ID
-    private String supplierTenantId;
-    //发票号
-    private String invoiceNum;
+    //成衣供应商编码
+    private String factory;
     //制单人
     private String preparer;
     //制单时间
     private String preparationTime;
 
-    private  List<PushShippingDeialVo> lines;
+    //明细对象
+    private  PushShippingDeialVo lines;
 }

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

@@ -8,7 +8,7 @@
          b.colour as colour,b.size as size,b.coding_rules as codingRules,sum(b.quantity) as quantity,a.business_type_value as businessTypeText,a.customer_order_number as customerOrderNumber,
            a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,sum(b.surplus_num) as surplusNum,DATE_FORMAT(b.pre_completion_date,'%Y-%m-%d') as preCompletionDate,
            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,
+           b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,guangpei_gate_width as guangpeiGateWidth,
            b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,a.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,
@@ -33,7 +33,7 @@
          b.colour as colour,b.size as size,b.coding_rules as codingRules,sum(b.quantity) as quantity,a.business_type_value as businessTypeText,a.customer_order_number as customerOrderNumber,
            a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,sum(b.surplus_num) as surplusNum,DATE_FORMAT(b.pre_completion_date,'%Y-%m-%d') as preCompletionDate,
            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,
+           b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,guangpei_gate_width as guangpeiGateWidth,
            b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,a.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,
@@ -106,45 +106,30 @@ ${ew.customSqlSegment}
     </update>
 
 
-    <select id="pushSyShipping" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingVO">
-
-        select
-        document_no as packingHeaderNum,--装箱单编号-(发运明细单号)
-        'ACCESSORIES' as packingType,--装箱单类型-(发运明细类型,默认ACCESSORIES)
-        'NEW' as packingStatus,--装箱单状态-(发运明细状态,默认NEW)
-         '01000229' as supplierNumber,--供应商编码(收货)(收货方供应商编码)
-          create_by as preparer,--制单人
-          create_time as preparationTime--制单时间
-          from sy_shipping_details
-          where del_flag = 0 and id = #{id}
+    <select id="pushSyShipping" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo">
+      select
+       concat(a.document_no,'-',b.sort) as packingHeaderNum,a.document_no as attributeString1,
+          'ACCESSORIES' as packingType,'NEW' as packingStatus,b.order_number as poNo,
+          b.sy_order_data_id as attributeBigint1,b.supplier_code as supplierNumber,'成衣工厂' as factory,
+           a.create_by as preparer,a.create_time as preparationTime
+          from sy_shipping_details a
+          where a.del_flag = 0 and a.id = #{id}
 
     </select>
 
     <select id="pushSyShippingDeial" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo">
 
-        select
-          a.sort as packingLineNum, -- 行号-(发运明细行号)
-          a.order_number as poNo,--计划单号-(订单号)
-          a.sy_order_data_id as moDetailId,--计划单号行ID-(订单号行ID(母件))
-          a.item_number as styleNo, --款号
-           b.colour as color,--颜色
-           a.inventory_code as itemCode,--物料编码-(存货编码)
-          a.inventory_name as itemDesc,--项目(辅料品名)-(存货名称)
-          '' as declarationName,--报关品名
-          a.material_composition as composition,--成分-(物料成分)
-          b.guangpei_gate_width as width,--门幅
-          '' as rolls,--匹数
-          a.shipment_quantity as planPackingQty,--计划装箱数量-(发货数量)
-          a.treatment_method as treatmentMethod,--处理方式
-          a.manual_yarn_flag as manualYarnFlag,--是否手册纱
-          a.manual_yarn_unit_price as manualYarnUnitPrice,--手册纱单价
-          a.manual_yarn_proportion as manualYarnProportion,--手册纱占比
-          a.memo as remark,--备注
-          '111' as cabinetNum
-          from sy_shipping_details_item a
-          left join sy_order_data_item b
-          on a.sy_order_data_item_id = b.id
-          where a.del_flag = 0 and a.shipping_details_id = #{shippingDetailsId}
+      select b.sort as packingLineNum,
+           b.sy_order_data_item_id as moDetailId,b.item_number as styleNo,b.colour as color,
+           b.inventory_code as itemCode,b.inventory_name as itemDesc,c.declaration_name as declarationName,
+           b.material_composition as composition,'0' as width,'0' as rolls,b.shipment_quantity as planPackingQty,
+           b.treatment_method as treatmentMethod,b.manual_yarn_flag as manualYarnFlag,
+           manual_yarn_unit_price as manualYarnUnitPrice,b.manual_yarn_proportion as manualYarnProportion,
+           '' as remark,b.submit_status as submitStatus
+        from sy_shipping_details_item b
+        left join sy_declaration_elements c
+        on b.elements_id = c.id
+        where b.del_flag = 0 and b.shipping_details_id = #{shippingDetailsId}
     </select>
 
 

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

@@ -71,6 +71,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
     @Override
     public SyShippingDetails syShippingDetailsAdd(SyShippingDetails syShippingDetails) {
 
+        int sort = 1;
         List<SyShippingDetailsItem> syShippingDetailsItemList = new ArrayList<>();
          String syId = syShippingDetails.getId();
          String id = oConvertUtils.id();
@@ -89,12 +90,14 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
 
          if(list.size()!=0){
              for (SyShippingDetailsItem li:list){
+
+                 li.setSort(sort);
                  //设置主表自建
                  li.setShippingDetailsId(id);
                  li.setId(oConvertUtils.id());
                  li.setSurplusQuantity(li.getShipmentQuantity());//剩余数量
                  syShippingDetailsItemList.add(li);
-
+                 sort++;
                  //回写销售订单剩余数量
                  SyOrderDataItem orderDataItem = syOrderDataItemService.getById(li.getSyOrderDataItemId());
                  if(oConvertUtils.isNotEmpty(orderDataItem)){