Pārlūkot izejas kodu

预托书调整

zengtx 2 gadi atpakaļ
vecāks
revīzija
9daedf3a24

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

@@ -318,13 +318,15 @@ public class SyLetterDepositController extends JeecgController<SyLetterDeposit,
 									HttpServletRequest req) {
 
 		 Result<IPage<SyPreAssembledPackingListVo>> result = new Result<IPage<SyPreAssembledPackingListVo>>();
-		 QueryWrapper<SyPreAssembledPackingListVo> queryWrapper = new QueryWrapper<SyPreAssembledPackingListVo>();
+		// QueryWrapper<SyPreAssembledPackingListVo> queryWrapper = new QueryWrapper<SyPreAssembledPackingListVo>();
+		 QueryWrapper<SyPreAssembledPackingListVo> queryWrapper = QueryGenerator.initQueryWrapper(syPreAssembledPackingListVo, req.getParameterMap());
 
 		 if(oConvertUtils.isNotEmpty(syPreAssembledPackingListVo.getItemNumber())){
 			 queryWrapper.eq("a.item_number",syPreAssembledPackingListVo.getItemNumber());
 		 }
 		 queryWrapper.eq("a.del_flag",0);
 		 queryWrapper.eq("b.del_flag",0);
+		 queryWrapper.groupBy("b.group_id");
 		 queryWrapper.orderByDesc("a.create_time");
 		 Page<SyPreAssembledPackingListVo> page = new Page<SyPreAssembledPackingListVo>(pageNo, pageSize);
 		 IPage<SyPreAssembledPackingListVo> pageList = syLetterDepositService.querySyPreAssembledPackingList(page, queryWrapper);
@@ -393,30 +395,30 @@ public class SyLetterDepositController extends JeecgController<SyLetterDeposit,
 	 }
 
 
-	 @ApiOperation(value="预装箱单数据合并", notes="预装箱单数据合并")
-	 @GetMapping(value = "/mergeSyPreAssembledPackingList")
-	 public Result<List<SyPreAssembledPackingListVo>> mergeSyPreAssembledPackingList(String itemId){
-
-		 Result<List<SyPreAssembledPackingListVo>> result = new Result<>();
-		 List<String> stringList = new ArrayList<>();
-		 QueryWrapper<SyPreAssembledPackingListVo> queryWrapper = new QueryWrapper<>();
-
-		 Page<SyPreAssembledPackingListVo> page = new Page<SyPreAssembledPackingListVo>(1, -1);
-
-		 String itemIdSplit[] = itemId.split(",");
-		 for (String li:itemIdSplit){
-			 stringList.add(li);
-		 }
-		 queryWrapper.in("b.id",stringList).eq("a.del_flag",0);
-		 queryWrapper.groupBy("a.item_number,a.memo,a.pre_delivery_date,a.order_type,a.depositary_receipt_no,b.inventory_name,b.po_no,b.distribution_point," +
-				 "b.colour");
-
-		 IPage<SyPreAssembledPackingListVo> pageList = syLetterDepositService.mergeSyPreAssembledPackingList(page, queryWrapper);
-
-		 result.setSuccess(true);
-		 result.setMessage("查询成功!");
-		 result.setResult(pageList.getRecords());
-
-		 return result;
-	 }
-}
+//	 @ApiOperation(value="预装箱单数据合并", notes="预装箱单数据合并")
+//	 @GetMapping(value = "/mergeSyPreAssembledPackingList")
+//	 public Result<List<SyPreAssembledPackingListVo>> mergeSyPreAssembledPackingList(String itemId){
+//
+//		 Result<List<SyPreAssembledPackingListVo>> result = new Result<>();
+//		 List<String> stringList = new ArrayList<>();
+//		 QueryWrapper<SyPreAssembledPackingListVo> queryWrapper = new QueryWrapper<>();
+//
+//		 Page<SyPreAssembledPackingListVo> page = new Page<SyPreAssembledPackingListVo>(1, -1);
+//
+//		 String itemIdSplit[] = itemId.split(",");
+//		 for (String li:itemIdSplit){
+//			 stringList.add(li);
+//		 }
+//		 queryWrapper.in("b.id",stringList).eq("a.del_flag",0);
+//		 queryWrapper.groupBy("a.item_number,a.memo,a.pre_delivery_date,a.order_type,a.depositary_receipt_no,b.inventory_name,b.po_no,b.distribution_point," +
+//				 "b.colour");
+//
+//		 IPage<SyPreAssembledPackingListVo> pageList = syLetterDepositService.mergeSyPreAssembledPackingList(page, queryWrapper);
+//
+//		 result.setSuccess(true);
+//		 result.setMessage("查询成功!");
+//		 result.setResult(pageList.getRecords());
+//
+//		 return result;
+//	 }
+  }

+ 38 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/entity/VO/SyPreAssembledPackingListVo.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @Data
@@ -122,4 +123,41 @@ public class SyPreAssembledPackingListVo {
     /**尺码*/
     @ApiModelProperty(value = "尺码")
     private String size;
+    /**件数*/
+    @ApiModelProperty(value = "件数")
+    private BigDecimal total;
+
+    /**外箱长度*/
+    //@Excel(name = "外箱长度", width = 15)
+    @ApiModelProperty(value = "外箱长度")
+    private java.math.BigDecimal outerBoxLength;
+    /**外箱宽度*/
+    //  @Excel(name = "外箱宽度", width = 15)
+    @ApiModelProperty(value = "外箱宽度")
+    private java.math.BigDecimal outerBoxWidth;
+    /**外箱高度*/
+    //  @Excel(name = "外箱高度", width = 15)
+    @ApiModelProperty(value = "外箱高度")
+    private java.math.BigDecimal outerBoxHeight;
+
+    /**起始箱号*/
+    // @Excel(name = "起始箱号", width = 15)
+    @ApiModelProperty(value = "起始箱号")
+    private String startingBoxNumber;
+    /**结束箱号*/
+    //  @Excel(name = "结束箱号", width = 15)
+    @ApiModelProperty(value = "结束箱号")
+    private String endCaseNumber;
+    @ApiModelProperty(value = "成衣工厂")
+    private String garmentFactory;
+    @ApiModelProperty(value = "hod")
+    private String hod;
+    @ApiModelProperty(value = "styleNo")
+    private String styleNo;
+    @ApiModelProperty(value = "prepackSku")
+    private String prepackSku;
+    @ApiModelProperty(value = "业务员")
+    private String salesman;
+    @ApiModelProperty(value = "业务部门(销售部门)")
+    private String salesDepartment;
 }

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

@@ -5,16 +5,17 @@
 
     <select id="querySyPreAssembledPackingList" resultType="org.jeecg.modules.documents.letterDeposit.entity.VO.SyPreAssembledPackingListVo">
 
-select a.id as id,b.id as itemId,a.item_number as itemNumber,a.pre_delivery_date as preDeliveryDate ,b.inventory_name as inventoryName,b.po_no as poNo,b.distribution_point as distributionPoint,
-a.memo,a.customer,b.colour,b.box_number as  boxNumber,b.ac_set_no as acSetNo,
-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,
-b.total_gross_weight as totalGrossWeight,b.total_volume as totalVolume,b.total_price as totalPrice,b.factory_unit_price as factoryUnitPrice,
-a.depositary_receipt_no as depositaryReceiptNo,b.spur_or_sub_order as spurOrSubOrder,b.pieces_box as piecesBox,b.size,b.colour
+select a.id as id,GROUP_CONCAT(b.id) as itemId,a.item_number as itemNumber,a.pre_delivery_date 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.smail_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,b.spur_or_sub_order as spurOrSubOrder,sum(b.pieces_box) as piecesBox,b.size,
+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,
+b.garment_factory as garmentFactory,b.hod as hod,b.style_no as styleNo,b.prepack_sku as prepackSku,a.salesman as salesman,a.sales_department
 from sy_pre_assembled_packing_list_item b
 left join sy_pre_assembled_packing_list a
 on a.id = b.sy_pre_assembled_packing_list_id
   ${ew.customSqlSegment}
-
     </select>
 
     <update id="syLetterDepositItemDelete">
@@ -63,18 +64,18 @@ on a.id = b.sy_pre_assembled_packing_list_id
     </update>
 
 
-    <select id="mergeSyPreAssembledPackingList" resultType="org.jeecg.modules.documents.letterDeposit.entity.VO.SyPreAssembledPackingListVo">
+<!--    <select id="mergeSyPreAssembledPackingList" resultType="org.jeecg.modules.documents.letterDeposit.entity.VO.SyPreAssembledPackingListVo">-->
 
-select a.id as id,GROUP_CONCAT(b.id) as itemId,a.item_number as itemNumber,a.pre_delivery_date 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.spur_Or_Sub_Order as spurOrSubOrder,
-sum(a.total_net_weight) as totalNetWeight,a.order_type as orderType,sum(b.total_quantity) as totalQuantity,
-sum(a.total_gross_weight) as totalGrossWeight,sum(a.total_volume) as totalVolume,a.total_price as totalPrice,b.factory_unit_price as factoryUnitPrice,
-a.depositary_receipt_no as depositaryReceiptNo from sy_pre_assembled_packing_list a
-left join sy_pre_assembled_packing_list_item b
-on a.id = b.sy_pre_assembled_packing_list_id and b.del_flag = 0
-  ${ew.customSqlSegment}
+<!--select a.id as id,GROUP_CONCAT(b.id) as itemId,a.item_number as itemNumber,a.pre_delivery_date 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.spur_Or_Sub_Order as spurOrSubOrder,-->
+<!--sum(a.total_net_weight) as totalNetWeight,a.order_type as orderType,sum(b.total_quantity) as totalQuantity,-->
+<!--sum(a.total_gross_weight) as totalGrossWeight,sum(a.total_volume) as totalVolume,a.total_price as totalPrice,b.factory_unit_price as factoryUnitPrice,-->
+<!--a.depositary_receipt_no as depositaryReceiptNo from sy_pre_assembled_packing_list a-->
+<!--left join sy_pre_assembled_packing_list_item b-->
+<!--on a.id = b.sy_pre_assembled_packing_list_id and b.del_flag = 0-->
+<!--  ${ew.customSqlSegment}-->
 
-    </select>
+<!--    </select>-->
 
     <select id="querySyLetterDeposit" resultType="org.jeecg.modules.documents.letterDeposit.entity.SyLetterDeposit">
 select a.depositary_receipt_no as depositaryReceiptNo,a.order_number as orderNumber,a.export_invoice_no as exportInvoiceNo,

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

@@ -12,8 +12,10 @@ import org.jeecg.modules.documents.letterDeposit.entity.VO.SyPreAssembledPacking
 import org.jeecg.modules.documents.letterDeposit.mapper.SyLetterDepositMapper;
 import org.jeecg.modules.documents.letterDeposit.service.ISyLetterDepositService;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
 import org.jeecg.modules.spapl.entity.SyPreAssembledPackingList;
 import org.jeecg.modules.spapl.entity.SyPreAssembledPackingListItem;
+import org.jeecg.modules.spapl.service.impl.SyPreAssembledPackingListItemServiceImpl;
 import org.jeecg.modules.spapl.service.impl.SyPreAssembledPackingListServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -43,6 +45,8 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
     private SyLetterDepositItemServiceImpl syLetterDepositItemService;
     @Autowired
     private SyPreAssembledPackingListServiceImpl syPreAssembledPackingListService;
+    @Autowired
+    private SyPreAssembledPackingListItemServiceImpl syPreAssembledPackingListItemService;
 
 
     /**
@@ -99,7 +103,6 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
               syPreAssembledPackingListService.updateById(preEntity);
 
             }
-
         }
         //新增子表
         List<SyLetterDepositItem> list = syLetterDeposit.getSyLetterDepositItemList();
@@ -113,6 +116,7 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
                 syLetterDepositItemList.add(li);
 
                 //回写集装箱单号与集装箱代号
+                //预装箱单主表ID
                 String perid = li.getSyPreAssembledPackingListId();
                 String itemIdSplit[] = perid.split(",");
                 for (String item:itemIdSplit) {
@@ -123,6 +127,17 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
                     //集装箱号
                     preEntity.setContainerNumber(li.getContainerNumber());
                     syPreAssembledPackingListService.updateById(preEntity);
+
+                    //回写发运明细是否被参照
+                    SyPreAssembledPackingListItem preItem = syPreAssembledPackingListItemService.getById(li.getSyPreAssembledPackingListItemId());
+                    if(oConvertUtils.isNotEmpty(preItem)){
+                        //发运明细子表ID
+                        String shippingIds = preItem.getSyDeclarationElementsItemId();
+                        SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
+                        syshippingItem.setId(shippingIds);
+                        syshippingItem.setIsReference(1);
+                    }
+
                 }
             }
             if(syLetterDepositItemList.size()!=0){
@@ -130,20 +145,20 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
             }
         }
 
-        //新增人民币
-        List<SyRmb> rmbList = syLetterDeposit.getSyRmbList();
-        for(SyRmb rmb:rmbList){
-            rmb.setId(oConvertUtils.id());
-            rmb.setSyLetterDepositId(syLetterDeposit.getId());
-        }
-        syLetterDepositMapper.syRmbAdd(rmbList);
-        //新增美元
-        List<SyUsd> usdList = syLetterDeposit.getSyUsdList();
-        for(SyUsd rmb:usdList){
-            rmb.setId(oConvertUtils.id());
-            rmb.setSyLetterDepositId(syLetterDeposit.getId());
-        }
-        syLetterDepositMapper.syUsdAdd(usdList);
+//        //新增人民币
+//        List<SyRmb> rmbList = syLetterDeposit.getSyRmbList();
+//        for(SyRmb rmb:rmbList){
+//            rmb.setId(oConvertUtils.id());
+//            rmb.setSyLetterDepositId(syLetterDeposit.getId());
+//        }
+//        syLetterDepositMapper.syRmbAdd(rmbList);
+//        //新增美元
+//        List<SyUsd> usdList = syLetterDeposit.getSyUsdList();
+//        for(SyUsd rmb:usdList){
+//            rmb.setId(oConvertUtils.id());
+//            rmb.setSyLetterDepositId(syLetterDeposit.getId());
+//        }
+//        syLetterDepositMapper.syUsdAdd(usdList);
 
         //新增主表
        boolean boo =  save(syLetterDeposit);
@@ -166,15 +181,16 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
         //删除子表
         String id = syLetterDeposit.getId();
         if(oConvertUtils.isNotEmpty(id)){
+            //删除子表
             syLetterDepositMapper.syLetterDepositItemDelete(id);
             //删除主表
             syLetterDeposit.setDelFlag("1");
             updateById(syLetterDeposit);
 
-            //删除人民币
-            syLetterDepositMapper.syRmbDelete(id);
-            //删除美元
-            syLetterDepositMapper.syUsdDelete(id);
+//            //删除人民币
+//            syLetterDepositMapper.syRmbDelete(id);
+//            //删除美元
+//            syLetterDepositMapper.syUsdDelete(id);
             //新增
             syLetterDepositAdd(syLetterDeposit);
         }

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

@@ -325,4 +325,13 @@ public class SyShippingDetailsItem {
 	@Excel(name = "光坯毛门幅CM", width = 15)
 	@ApiModelProperty(value = "光坯毛门幅CM")
 	private java.math.BigDecimal guangpeiGateWidth;
+
+	/**超发数量*/
+	@Excel(name = "超发数量", width = 15)
+	@ApiModelProperty(value = "超发数量")
+	private BigDecimal excessQuantity;
+	/**是否被参照*/
+	@Excel(name = "是否被参照", width = 15)
+	@ApiModelProperty(value = "是否被参照")
+	private Integer isReference;
 }

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

@@ -8,6 +8,8 @@ import lombok.Data;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.math.BigDecimal;
+
 @Data
 public class OrderDataVo {
 
@@ -212,5 +214,15 @@ public class OrderDataVo {
     @ApiModelProperty(value = "箱数")
     private String boxNumber;
 
+    @Excel(name = "委外采购单价", width = 15)
+    @ApiModelProperty(value = "委外采购单价")
+    private BigDecimal iTaxPrice;
+
+    @Excel(name = "委外采购佣金", width = 15)
+    @ApiModelProperty(value = "委外采购佣金")
+    private BigDecimal ymoney;
 
+    @Excel(name = "委外采购订单号", width = 15)
+    @ApiModelProperty(value = "委外采购订单号")
+    private String OMPOId;
 }

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

@@ -6,13 +6,14 @@
 
         select b.sy_order_data_id as syOrderDataId,GROUP_CONCAT(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,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.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,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
-           a.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,
+           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,
-             a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription
+             a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription,b.supplier as supplier,b.iTaxPrice as iTaxPrice,
+             case when b.ymoney is null then '0' else b.ymoney end as ymoney,b.OMPO_id as OMPOId
              from sy_order_data_item b
         left join sy_order_data a
         on a.id = b.sy_order_data_id
@@ -27,21 +28,24 @@
 
     <select id="queryOrderDataGarment" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
 
+
         select b.sy_order_data_id as syOrderDataId,GROUP_CONCAT(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,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,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
-        a.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,
-        a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription
+         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,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
+           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,
+             a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription,b.supplier as supplier,b.iTaxPrice as iTaxPrice,
+             case when b.ymoney is null then '0' else b.ymoney end as ymoney,b.OMPO_id as OMPOId
         from sy_order_data_item b
         left join sy_order_data a
         on a.id = b.sy_order_data_id
         ${ew.customSqlSegment}
-
             AND (b.inventory_code not like '19%' and b.inventory_code not like 'N19%')
+         group by concat(a.order_number,a.customer_abbreviation,a.sales_department,a.salesman,a.account,b.pre_delivery_date,a.order_remarks,
+        b.item_number,b.small_po,b.inventory_name,b.colour,b.distribution_point,b.pack_id,b.coding_rules)
 
     </select>
 
@@ -149,10 +153,10 @@ ${ew.customSqlSegment}
     <select id="displayDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
           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_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,b.surplus_num as surplusNum,DATE_FORMAT(b.pre_completion_date,'%y-%m-%d') as preCompletionDate,
+           a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,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,a.supplier as supplier,b.unit_price_including_tax as unitPriceIncludingTax,
-           a.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.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,
              a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription