Selaa lähdekoodia

成本分配,托书

zengtx 2 vuotta sitten
vanhempi
commit
d296f642c8

+ 80 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java

@@ -1,5 +1,9 @@
 package org.jeecg.modules.cost.controller;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.alibaba.excel.write.metadata.fill.FillConfig;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -8,7 +12,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.formula.functions.T;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -20,12 +27,15 @@ import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.cost.entity.*;
 import org.jeecg.modules.cost.service.*;
 import org.jeecg.modules.cost.vo.SyCostAllocationPage;
+import org.jeecg.modules.demo.test.entity.JoaDemo;
 import org.jeecg.modules.report.entity.FabricLoss;
 import org.jeecg.modules.report.entity.SyFabricLossReport;
 import org.jeecg.modules.report.mapper.FabricLossMapper;
 import org.jeecg.modules.report.service.IFabricLossService;
 import org.jeecg.modules.report.service.ISyFabricLossReportService;
+import org.jeecg.modules.scas.entity.SyCostAllocationSummary;
 import org.jeecg.modules.system.controller.CommonController;
+import org.jeecgframework.poi.excel.ExcelExportUtil;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -40,9 +50,10 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
 import springfox.documentation.spring.web.json.Json;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
+import java.io.*;
 import java.util.*;
 
 /**
@@ -374,8 +385,8 @@ public class SyCostAllocationController {
      * @param request
      * @param syCostAllocation
      */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, SyCostAllocation syCostAllocation) {
+    @RequestMapping(value = "/exportXls1")
+    public ModelAndView exportXls1(HttpServletRequest request, SyCostAllocation syCostAllocation) {
         // Step.1 组装查询条件
         QueryWrapper<SyCostAllocation> queryWrapper = QueryGenerator.initQueryWrapper(syCostAllocation, request.getParameterMap());
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -564,4 +575,70 @@ public class SyCostAllocationController {
         return result;
     }
 
+
+    /**
+     * 成本分配导出
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/exportXlsSyCostAllocation")
+    public void exportXlsSyCostAllocation(@RequestBody SyCostAllocation syCostAllocation,
+                                  HttpServletRequest request, HttpServletResponse response) throws IOException {
+
+        //获取模板输入流
+        InputStream inStream = new FileInputStream("D:\\单证模板\\成本分配-"+syCostAllocation.getSheetName()+".xlsx");
+        //通过poi创建表对象
+        XSSFWorkbook workbook = new XSSFWorkbook(inStream);
+        //遍历复制sheet
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        //写到流
+        workbook.write(bos);
+        ServletOutputStream outputStream = response.getOutputStream();
+        ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
+        ExcelWriter excelWriter = EasyExcel.write(outputStream).withTemplate(is).build();
+        //填充配置, 这里的意义是给模板中的集合数据添加新行, 保证导出不会错乱
+        FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
+
+        //多发少发
+        if(oConvertUtils.isNotEmpty(syCostAllocation.getSyPilosityFewer())&& syCostAllocation.getSyPilosityFewer().size()!=0 ){
+            List<SyPilosityFewer> syTransferList= syCostAllocation.getSyPilosityFewer();
+            WriteSheet writeSheet1 = EasyExcel.writerSheet("多发少发").build();
+            excelWriter.fill(syTransferList, fillConfig, writeSheet1);
+
+        }
+        //面料余下数量
+        if(oConvertUtils.isNotEmpty(syCostAllocation.getSyRemaining())&&syCostAllocation.getSyRemaining().size()!=0){
+            List<SyRemaining> syRemainingList= syCostAllocation.getSyRemaining();
+            WriteSheet writeSheet1 = EasyExcel.writerSheet("面料余下").build();
+            excelWriter.fill(syRemainingList, fillConfig, writeSheet1);
+
+        }
+        //辅料余下数量
+        if( oConvertUtils.isNotEmpty(syCostAllocation.getSyRemainingIngreDeent()) && syCostAllocation.getSyRemainingIngreDeent().size()!=0){
+            List<SyRemainingIngreDeent> syRemainingList= syCostAllocation.getSyRemainingIngreDeent();
+            WriteSheet writeSheet1 = EasyExcel.writerSheet("辅料余下").build();
+            excelWriter.fill(syRemainingList, fillConfig, writeSheet1);
+
+        }
+        //面料转入数量
+        if(oConvertUtils.isNotEmpty(syCostAllocation.getSyTransfer())&& syCostAllocation.getSyTransfer().size()!=0){
+            List<SyTransfer> syTransferList= syCostAllocation.getSyTransfer();
+            WriteSheet writeSheet1 = EasyExcel.writerSheet("面料转入").build();
+            excelWriter.fill(syTransferList, fillConfig, writeSheet1);
+
+        }
+        //辅料转入数量
+        if( oConvertUtils.isNotEmpty(syCostAllocation.getSytransferIngreDeent()) && syCostAllocation.getSytransferIngreDeent().size()!=0){
+            List<SytransferIngreDeent> syRemainingList= syCostAllocation.getSytransferIngreDeent();
+            WriteSheet writeSheet1 = EasyExcel.writerSheet("辅料转入").build();
+            excelWriter.fill(syRemainingList, fillConfig, writeSheet1);
+
+        }
+
+        //关流
+        excelWriter.finish();
+        inStream.close();
+    }
+
 }

+ 16 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyCostAllocation.java

@@ -219,4 +219,20 @@ public class SyCostAllocation implements Serializable {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date queryTime;
 
+
+
+    //转入,余下,多发少发导出集合
+//    syPilosityFewer 多发少发
+//    syRemaining 面料余下数量
+//    syRemainingIngreDeent 辅料余下数量
+//    syTransfer 面料转入数量
+//    sytransferIngreDeent 辅料转入数量
+    List<SyPilosityFewer> syPilosityFewer;
+    List<SyRemaining> syRemaining;
+    List<SyRemainingIngreDeent> syRemainingIngreDeent;
+    List<SyTransfer> syTransfer;
+    List<SytransferIngreDeent> sytransferIngreDeent;
+
+    private String sheetName;
+
 }

+ 33 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyPilosityFewer.java

@@ -0,0 +1,33 @@
+package org.jeecg.modules.cost.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+//多发少发导出实体类
+@Data
+public class SyPilosityFewer {
+
+    //颜色
+    @Excel(name = "颜色",width=20)
+    private String color;
+
+    //存货名称
+    @Excel(name = "存货名称",width=20)
+    private String goodsName;
+
+    //多发少发
+    @Excel(name = "多发少发",width=20)
+    private String pilosityFewer;
+
+    //计划数量
+    @Excel(name = "计划数量",width=20)
+    private String planQuantity;
+
+    //购入数量
+    @Excel(name = "购入数量",width=20)
+    private String purchaseQuantity;
+
+    //备注
+    @Excel(name = "备注",width=20)
+    private String remarks;
+}

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyRemaining.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.cost.entity;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
@@ -11,20 +12,26 @@ import java.math.BigDecimal;
 public class SyRemaining {
 
     //存货名称
+    @Excel(name = "存货名称",width=20)
     private String goodsName;
 
     //颜色
+    @Excel(name = "颜色",width=20)
     private String color;
 
     //计划单号
+    @Excel(name = "计划单号",width=20)
     private String planCode;
 
     //使用数量
+    @Excel(name = "使用数量",width=20)
     private String number;
 
     //单位成本
+    @Excel(name = "单位成本",width=20)
     private BigDecimal unitCost;
 
     //总成本
+    @Excel(name = "总成本",width=20)
     private BigDecimal cost;
 }

+ 31 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyRemainingIngreDeent.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.cost.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+//辅料余下数量导出实体类
+@Data
+public class SyRemainingIngreDeent {
+
+    //存货名称
+    @Excel(name = "存货名称",width=20)
+    private String goodsName;
+
+    //计划单号
+    @Excel(name = "计划单号",width=20)
+    private String planCode;
+
+    //使用数量
+    @Excel(name = "使用数量",width=20)
+    private String number;
+
+    //单位成本
+    @Excel(name = "单位成本",width=20)
+    private BigDecimal unitCost;
+
+    //总成本
+    @Excel(name = "总成本",width=20)
+    private BigDecimal cost;
+}

+ 11 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyTransfer.java

@@ -1,30 +1,40 @@
 package org.jeecg.modules.cost.entity;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.ExcelTarget;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 @Data
 @TableName("sy_transfer")
 @ApiModel(value="sy_transfer对象", description="转入数据")
-public class SyTransfer {
+@ExcelTarget("syTransfer")
+public class SyTransfer implements java.io.Serializable {
     //存货名称
+    @Excel(name = "存货名称", width=15)
     private String goodsName;
 
     //颜色
+    @Excel(name = "颜色", width=15)
     private String color;
 
     //计划单号
+    @Excel(name = "计划单号", width=15)
     private String planCode;
 
     //使用数量
+    @Excel(name = "使用数量", width=15)
     private String number;
 
     //单位成本
+   // @Excel(name = "单位成本", width=15)
     private BigDecimal unitCost;
 
     //总成本
+   // @Excel(name = "总成本", width=15)
     private BigDecimal cost;
 }

+ 31 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SytransferIngreDeent.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.cost.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+//辅料转入数量导出实体类
+@Data
+public class SytransferIngreDeent {
+
+    //存货名称
+    @Excel(name = "存货名称",width=20)
+    private String goodsName;
+
+    //计划单号
+    @Excel(name = "计划单号",width=20)
+    private String planCode;
+
+    //使用数量
+    @Excel(name = "使用数量",width=20)
+    private String number;
+
+    //单位成本
+    @Excel(name = "单位成本",width=20)
+    private BigDecimal unitCost;
+
+    //总成本
+    @Excel(name = "总成本",width=20)
+    private BigDecimal cost;
+}

+ 20 - 22
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java

@@ -133,33 +133,31 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
            sumList=null;
        }
 
-      // List<SyCostLossReview> syCostList = new ArrayList<>();
-       IPage<SyCostLossReview> pageList;
-       if(oConvertUtils.isNotEmpty(syCostLossReview.getIsPlanMan()) && syCostLossReview.getIsPlanMan().equals("否") ){
-           List<String> list1= syCostLossReviewService.queryCodeByPlanTable("","");
-
-           pageList = syCostLossReviewMapper.querylist(syCostLossReview,sumList,page,list1);
-           pageList.setTotal(syCostLossReviewMapper.querylistCount(syCostLossReview,sumList,list1));
-       }else{
-           pageList = syCostLossReviewService.querylist(syCostLossReview,sumList,page,new ArrayList<>());
-           pageList.setTotal(syCostLossReviewMapper.querylistCount(syCostLossReview,sumList,new ArrayList<>()));
-       }
+
+           IPage<SyCostLossReview> pageList;
+           pageList = syCostLossReviewMapper.querylist(syCostLossReview,sumList,page,new ArrayList<>());
+           if(sumList.size()!=0&& oConvertUtils.isNotEmpty(sumList)){
+               pageList.setTotal(sumList.size());
+           }else {
+               pageList.setTotal(syCostLossReviewMapper.querylistCount(syCostLossReview, sumList, new ArrayList<>()));
+           }
 
        for (SyCostLossReview sy:pageList.getRecords()) {
 
-           //赋值制单人
-           List<String> list=syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
-           if(list.size()==0){
-               sy.setMaker("");
-           }else {
-               for (int i=0;i<list.size();i++) {
-                   if(i==0){
-                       sy.setMaker(list.get(0));
-                   }else {
-                       sy.setMaker(sy.getMaker()+","+list.get(i));
+               //赋值制单人
+               List<String> list = syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
+               if (list.size() == 0) {
+                   sy.setMaker("");
+               } else {
+                   for (int i = 0; i < list.size(); i++) {
+                       if (i == 0) {
+                           sy.setMaker(list.get(0));
+                       } else {
+                           sy.setMaker(sy.getMaker() + "," + list.get(i));
+                       }
                    }
                }
-           }
+
            //赋值面损审批数据
            SyCostLossReview f = syCostLossReviewService.querySyFabricLossByCode(sy.getPlanNo());
            if(f!=null){

+ 9 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml

@@ -89,16 +89,16 @@
         ) t
         where PATINDEX('%[吖-咗]%', planNo)=0 and PATINDEX('%.%', planNo)=0 and PATINDEX('%/%', planNo)=0
         <if test="e.planNo !=null and e.planNo !=''">
-            and t.planNo like CONCAT(#{e.planNo},'%')
+            and t.planNo = #{e.planNo}
         </if>
         <if test="e.dverifyDateB !=null and e.dverifyDateB !='' and e.dverifyDateE !=null and e.dverifyDateE !=''">
             and t.dverifyDate between #{e.dverifyDateB} and #{e.dverifyDateE}
         </if>
         <if test="e.department !=null and e.department !=''">
-            and t.department like CONCAT(#{e.department},'%')
+            and t.department = #{e.department}
         </if>
         <if test="e.salesman !=null and e.salesman !=''">
-            and t.salesman like CONCAT(#{e.salesman},'%')
+            and t.salesman = #{e.salesman}
         </if>
         <if test="list != null">
             and t.planNo in
@@ -207,16 +207,16 @@
         ) t
         where PATINDEX('%[吖-咗]%', planNo)=0 and PATINDEX('%.%', planNo)=0 and PATINDEX('%/%', planNo)=0
         <if test="e.planNo !=null and e.planNo !=''">
-            and t.planNo like CONCAT(#{e.planNo},'%')
+            and t.planNo = #{e.planNo}
         </if>
         <if test="e.dverifyDateB !=null and e.dverifyDateB !='' and e.dverifyDateE !=null and e.dverifyDateE !=''">
             and t.dverifyDate between #{e.dverifyDateB} and #{e.dverifyDateE}
         </if>
         <if test="e.department !=null and e.department !=''">
-            and t.department like CONCAT(#{e.department},'%')
+            and t.department  = #{e.department}
         </if>
         <if test="e.salesman !=null and e.salesman !=''">
-            and t.salesman like CONCAT(#{e.salesman},'%')
+            and t.salesman  = #{e.salesman}
         </if>
         <if test="list != null">
             and t.planNo in
@@ -478,7 +478,7 @@
                     JOIN UFDATA_102_2021.dbo.Person  pe ON s.cMaker = pe.cPersonName
                     where cSOCode like 'sy%' and CHARINDEX('-',cSOCode)>0 and pe.cdepcode='TPD02'
         ) as views
-        where maker LIKE CONCAT('%',#{maker},'%')
+        where maker LIKE CONCAT('%',#{maker},'%') and  PATINDEX('%[吖-咗]%', planNo)=0 and PATINDEX('%.%', planNo)=0 and PATINDEX('%/%', planNo)=0
         group by planNo,maker
     </select>
     <select id="queryCodeByfstatus" resultType="String">
@@ -489,7 +489,7 @@
             and status=#{status}
         </if>
         <if test='ffirstApproveDateB !="" and ffirstApproveDateB != null'>
-            and first_approve_date between concat(#{ffirstApproveDateB},'%') and concat(#{ffirstApproveDateE},'%')
+            and first_approve_date between #{ffirstApproveDateB} and #{ffirstApproveDateE}
         </if>
 
     </select>
@@ -505,7 +505,7 @@
             and remarks LIKE CONCAT('%',#{remarks},'%')
         </if>
         <if test="planMan!=null and planMan!=''">
-            and plan_man LIKE CONCAT('%',#{planMan},'%')
+            and plan_man = #{planMan}
         </if>
     </select>
 

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

@@ -718,11 +718,23 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 
 
 			 if (testName.equals("-结汇发票")) {
-			 	StringBuffer sbu = new StringBuffer();
+				 //获取模板输入流
+				 InputStream inStream = new FileInputStream("D:\\单证模板\\报关信息-结汇发票.xlsx");
+				 //通过poi创建表对象
+				 XSSFWorkbook workbook = new XSSFWorkbook(inStream);
+				 //遍历复制sheet
+				 ByteArrayOutputStream bos = new ByteArrayOutputStream();
+				 //写到流
+				 workbook.write(bos);
+				 ServletOutputStream outputStream = response.getOutputStream();
+				 ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
+				 ExcelWriter excelWriter = EasyExcel.write(outputStream).withTemplate(is).build();
+
+				 //填充配置, 这里的意义是给模板中的集合数据添加新行, 保证导出不会错乱
+				 FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
+
+				 WriteSheet writeSheet1 = EasyExcel.writerSheet("结汇发票").build();
 
-				 List<Map<String, Object>> taitouList = new ArrayList<>();
-				 //获取对应模板
-				 TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\报关信息-结汇发票.xlsx");
 
 				 //查询数据字典-公司抬头
 				 List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
@@ -730,50 +742,24 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 					 for (DictModel te : test) {
 						 if (list.get(0).getPkOrg().equals(te.getText())) {
 							 String split[] = test.get(0).getValue().split("\\+");
-//							 for (int i = 1; i < 5 ; i++) {
-//								 Map<String, Object> maiTou = new HashMap<>();
-//								 maiTou.put("name", split[i]);
-//
-//								 //taitouList.add(maiTou);
-//							 }
 							 entity.setClientAbbreviation(split[1]);
 							 entity.setCorporationAddress(split[2]);
 							 entity.setCorporationTel(split[3]);
 							 entity.setFax(split[4]);
 						 }
 					 }
-
-				 }
-				 //转map
-				 Field[] fields = entity.getClass().getDeclaredFields();
-				 for (Field field : fields) {
-					 field.setAccessible(true);
-					 map.put(field.getName(), field.get(entity));
-				 }
-				 //集合转map
-				 for (SyShippingOrderItem li : list) {
-					 Field[] fieldsList = li.getClass().getDeclaredFields();
-					 Map<String, Object> mapList = new HashMap<String, Object>();
-					 for (Field field : fieldsList) {
-						 field.setAccessible(true);
-						 mapList.put(field.getName(), field.get(li));
-					 }
-					 listMap.add(mapList);
 				 }
-				 map.put("item", listMap);
-				 //map.put("list", taitouList);
+				 excelWriter.fill(entity, fillConfig, writeSheet1);
+				 excelWriter.fill(list, fillConfig, writeSheet1);
+				 //关流
+				 excelWriter.finish();
+				 inStream.close();
 
-				 Workbook workbook = ExcelExportUtil.exportExcel(params, map);
-				 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-				 response.setCharacterEncoding("utf-8");
-				 ServletOutputStream outputStream = response.getOutputStream();
-				 workbook.write(outputStream);
 
 			 }
 
 			 if (isAhaa.equals("国内")) {
 
-
 					 //获取公司抬头信息
 					 List<DictModel> companyTitle = sysDictService.queryDictItemsByCode("company_title");
 					 if (companyTitle.size()!=0) {
@@ -807,7 +793,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 
 //---------------------------申报要素------------------------------
 						 WriteSheet writeSheet1 = EasyExcel.writerSheet("申报要素").build();
-//
 
 						 int i = 1;
 						 for (SyShippingOrderItem li : itemList) {

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

@@ -115,13 +115,13 @@ 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 a.supplier,a.style_number,a.smail_po,a.english_name,a.unit_price
+            group by c.sy_packing_list_tailoring_id order by a.supplier,a.style_number,a.smail_po,a.english_name,a.unit_price
         </if>
         <if test='type == "面辅料"'>
             left join sy_packing_list_fabric_item c
             on a.tailoring_fabric_item_id = c.id
             where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
-            group by a.group_id order by style_number,smail_po desc
+            group by a.sy_packing_list_fabric_id order by style_number,smail_po desc
         </if>
 
     </select>
@@ -154,7 +154,7 @@ round(sum(t.totalPrice),2) as totalPrice,round(sum(t.grossWeight),2) as grossWei
 round(sum(t.volume),3) as volume,t.curr,t.dree,t.place,t.certificate,t.styleNumber,t.smailPo,t.orderNumber,t.ctns,t.kgs,t.cbm,pkOrg,t.factoryUnitPrice,
 t.outerBoxLength,t.outerBoxWidth,t.outerBoxHeight,t.hod,t.unIt,t.emp,t.purchaseOutsourcingOrderNo,t.packId,t.salesman,t.earliestDeliveryDate,t.declarationUnit,
 t.clientAbbreviation,t.pcGw,t.priceGw from (
-select a.supplier,GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName,sum(a.number) as number,a.unit_price as unitPrice,
+select a.garment_factory as garmentFactory,a.supplier,GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName,sum(a.number) as number,a.unit_price as unitPrice,
 sum(a.number*a.unit_price) as totalPrice,a.gross_weight as grossWeight,a.net_weight as netWeight,a.master_metering as pcs,a.volume as volume,a.elements_Id as elementsId,
 'USD' as curr,'CHINA' as dree,'宁波其他/宁波象山县' as place,'照章征税' as certificate,a.style_number as styleNumber,a.smail_po as smailPo,a.box_number as boxNumber,
 a.order_number as orderNumber,a.client_abbreviation as clientAbbreviation,'PCS' as pacs,'CTNS' as ctns,'KGS' as kgs,'CBM' as cbm,c.salesman as salesman,'PC' as pcGw,'/PC' as priceGw,
@@ -166,7 +166,7 @@ on a.elements_Id = b.id
 left join sy_packing_list_tailoring_item c
 on a.tailoring_fabric_item_id = c.id
 where a.sy_shipping_order_item_id =#{id}
-group by c.group_id) t group by t.elementsId,t.styleNumber,t.smailPo,t.unitPrice order by t.styleNumber,t.smailPo desc
+group by c.group_id) t group by t.elementsId,t.styleNumber,t.smailPo,t.unitPrice order by t.garmentFactory,t.salesman,t.styleNumber
 
     </select>
 
@@ -237,7 +237,7 @@ group by c.group_id) t group by t.elementsId,t.styleNumber,t.smailPo,t.unitPrice
     <select id="qeuryItemInfo" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select sum(t.grossWeight) as grossWeight,t.orderNumber,t.tailoringFabricItemId,t.pkOrg from (
-select a.purchase_outsourcing_order_no as orderNumber,a.gross_weight as grossWeight,
+select a.order_number as orderNumber,a.gross_weight as grossWeight,
 a.tailoring_fabric_item_id as tailoringFabricItemId,a.pk_org as pkOrg
 from sy_shipping_order_item a
 left join sy_packing_list_tailoring_item c
@@ -248,7 +248,7 @@ where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id}  group by c.group_i
     <select id="qeuryItemInfoTa" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select sum(t.grossWeight) as grossWeight,t.orderNumber,t.tailoringFabricItemId,t.pkOrg from (
-select a.purchase_outsourcing_order_no as orderNumber,sum(a.gross_weight) as grossWeight,
+select a.order_number as orderNumber,sum(a.gross_weight) as grossWeight,
 a.tailoring_fabric_item_id as tailoringFabricItemId,a.pk_org as pkOrg
 from sy_shipping_order_item a
 where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id}  group by a.group_id) t  group by t.orderNumber