Pārlūkot izejas kodu

托书回写以及查询详情调整

zengtx 1 gadu atpakaļ
vecāks
revīzija
e0abbbe30e

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java

@@ -1480,7 +1480,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 					 //获取业务员编码、销售部门编码、客户简称
 					 li.put("orderId", fabricEntity.getSyOrderDataId());// = syShippingOrderMapper.querySOMain();
 				 } else if (oConvertUtils.isNotEmpty(tailoringEntity)) {
-					 li.put("orderId", fabricEntity.getSyOrderDataId());//  = syShippingOrderMapper.querySOMain(tailoringEntity.getSyOrderDataId());
+					 li.put("orderId", tailoringEntity.getSyOrderDataId());//  = syShippingOrderMapper.querySOMain(tailoringEntity.getSyOrderDataId());
 				 } else {
 					 result.setResult(0);
 					 result.setMessage("推送失败!未找到订单相关信息!");
@@ -1493,7 +1493,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 			 if (itemList.get(0).getPkOrg().equals("901")) {
 				 i = syShippingOrderService.saveSalePayVouchOne(map, listmap, rmbmap, usdmap);
 			 } else if (itemList.get(0).getPkOrg().equals("902")) {
-				 i = syShippingOrderService.saveSalePayVouchThree(map, listmap, rmbmap, usdmap);
+				 i = syShippingOrderService.saveSalePayVouchTwo(map, listmap, rmbmap, usdmap);
 			 } else if (itemList.get(0).getPkOrg().equals("903")) {
 				 i = syShippingOrderService.saveSalePayVouchThree(map, listmap, rmbmap, usdmap);
 			 }

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

@@ -81,6 +81,8 @@ d.terms_of_deliveryvalue as termsOfDeliveryvalue
          amount,item_column as itemColumn  from sy_usd where del_flag = 0 and sy_letter_deposit_id = #{syLetterDepositId}
     </select>
 
+
+<!--    成衣详情-->
     <select id="queryItem" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 SELECT GROUP_CONCAT(a.id) as id, a.sy_shipping_order_item_id as syShippingOrderItemId, a.english_name as englishName, a.style_number as styleNumber, a.smail_po as smailPo,a.create_by as createBy,
 sum(a.number) as number,
@@ -95,12 +97,12 @@ a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcin
   left join sy_packing_list_tailoring_item c
 on a.tailoring_fabric_item_id = c.id
   where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
-group by c.group_id order by style_number,smail_po desc
+group by a.group_id order by style_number,smail_po desc
     </select>
 
 
 
-<!--    面料托书-->
+<!--    面料托书发票-->
     <select id="queryEelementMerge" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName,case when ready_fabric != '辅料' then sum(c.meter) else sum(c.actual_declared_quantity) end as meter,sum(a.number) as number,a.unit_price as unitPrice,
@@ -118,6 +120,7 @@ where a.sy_shipping_order_item_id =#{id}
     </select>
 
 
+    <!--    成衣托书发票-->
     <select id="queryEelement" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select t.id, t.hsCode,sum(t.boxNumber) as boxNumber, t.declarationName,t.englishProductName,sum(t.number) as number,round(t.unitPrice,2) as unitPrice,
@@ -145,7 +148,7 @@ group by c.group_id) t group by t.elementsId,t.styleNumber,t.smailPo,t.unitPrice
 
     <select id="syShippingOrderMerge" resultType="org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList">
 
-  select c.hs_code as hsCode,c.declaration_name as declarationName,a.id as tailoringFabricId ,GROUP_CONCAT(b.id) as tailoringFabricItemId,a.document_No as documentNo,a.create_by as createBy,
+  select c.hs_code as hsCode,c.declaration_name as declarationName,GROUP_CONCAT(DISTINCT a.id) as tailoringFabricId ,GROUP_CONCAT(DISTINCT b.id) as tailoringFabricItemId,a.document_No as documentNo,a.create_by as createBy,
   a.export_invoice_no as exportInvoiceNo,a.container_number as containerNumber,a.garment_Factory as garmentFactory,
   b.supplier as supplier,a.plumbum_No as plumbumNo,a.customer_abbreviation as clientAbbreviation,
         round(sum(b.net_weight),2) as number,

+ 15 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java

@@ -219,19 +219,21 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                          itemList.add(syShippingOrderItem);
                     }
                     //查询预装箱但面料数据
-                    SyPackingListFabric syPackingListFabric = syPackingListFabricService.getById(li.getTailoringFabricId());
-                    if(oConvertUtils.isEmpty(syPackingListFabric)){
-                        throw new JeecgBootException("没有查询到装箱单面料数据!");
+                    String tailoringFabricId[] = li.getTailoringFabricId().split(",");
+                    for(int f = 0;f<tailoringFabricId.length;f++){
+                        SyPackingListFabric syPackingListFabric = syPackingListFabricService.getById(tailoringFabricId[f]);
+                        if(oConvertUtils.isEmpty(syPackingListFabric)){
+                            throw new JeecgBootException("没有查询到装箱单面料数据!");
+                        }
+                        //回写预装箱面料外销发票号、是否被参照、托书号,集装箱号,集装箱代号
+                        syPackingListFabric.setExportInvoiceNo(syShippingOrder.getShippingOrderNumber());
+                        syPackingListFabric.setIsReference(1);
+                        syPackingListFabric.setShippingOrderNumber(syShippingOrder.getShippingOrderNumber());
+                        //syPackingListFabric.setContainerCode(li.getContainerCode());
+                        syPackingListFabric.setContainerNumber(li.getContainerNumber());
+
+                        syPackingListFabricService.updateById(syPackingListFabric);
                     }
-                    //回写预装箱面料外销发票号、是否被参照、托书号,集装箱号,集装箱代号
-                    syPackingListFabric.setExportInvoiceNo(syShippingOrder.getShippingOrderNumber());
-                    syPackingListFabric.setIsReference(1);
-                    syPackingListFabric.setShippingOrderNumber(syShippingOrder.getShippingOrderNumber());
-                    //syPackingListFabric.setContainerCode(li.getContainerCode());
-                    syPackingListFabric.setContainerNumber(li.getContainerNumber());
-
-                    syPackingListFabricService.updateById(syPackingListFabric);
-
                 }else{ //成衣
                     //查询装箱单成衣子表数据
                     QueryWrapper<SyPackingListTailoringItem> queryWrapper = new QueryWrapper<SyPackingListTailoringItem>();
@@ -288,7 +290,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
 
                     }
 
-                    //回写装箱成衣外销发票号、是否被参照、托书号,集装箱号,集装箱代号
+                    //回写装箱成衣外销发票号、是否被参照、托书号,集装箱号,集装箱代号
                     SyPackingListTailoring syPackingListTailoring = syPackingListTailoringService.getById(li.getTailoringFabricId());
                     if(oConvertUtils.isEmpty(syPackingListTailoring)){
                         throw new JeecgBootException("没有查询到装箱单数据!");