Преглед изворни кода

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-service

zengtx пре 1 година
родитељ
комит
c8652b08fc

+ 136 - 31
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/controller/SyPreAssembledPackingListController.java

@@ -24,6 +24,7 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.hibernate.engine.jdbc.Size;
 import org.jeecg.common.exception.JeecgBootException;
@@ -1284,7 +1285,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
         CellStyle cellStyle2 = workbook.createCellStyle();//设置单元格样式
         cellStyle2.setAlignment(HorizontalAlignment.CENTER);//左右居中
         cellStyle2.setWrapText(true);//自动换行
-        cellStyle2.setFillForegroundColor(IndexedColors.WHITE.getIndex());//设置前景色 现在是浅绿色
+        cellStyle2.setFillForegroundColor(IndexedColors.WHITE.getIndex());//设置前景色 现在是
         cellStyle2.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());//设置背景色 现在是浅绿色
         cellStyle2.setBorderBottom(BorderStyle.THIN);//边框
         cellStyle2.setBorderTop(BorderStyle.THIN);//边框
@@ -1293,6 +1294,28 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
         cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//上下居中
         cellStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);//必须设置 否则无效
 
+        CellStyle cellStyle3 = workbook.createCellStyle();//设置单元格样式
+        cellStyle3.setAlignment(HorizontalAlignment.CENTER);//左右居中
+        cellStyle3.setWrapText(true);//自动换行
+        cellStyle3.setVerticalAlignment(VerticalAlignment.CENTER);//上下居中
+        cellStyle3.setFillForegroundColor(IndexedColors.WHITE.getIndex());//设置前景色 现在是浅绿色
+        cellStyle3.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());//设置背景色 现在是浅绿色
+        cellStyle3.setBorderBottom(BorderStyle.THIN);//边框
+        cellStyle3.setBorderTop(BorderStyle.THIN);//边框
+        cellStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);//必须设置 否则无效
+
+
+        CellStyle cellStyle4 = workbook.createCellStyle();//设置单元格样式
+        cellStyle4.setAlignment(HorizontalAlignment.CENTER);//左右居中
+        cellStyle4.setWrapText(true);//自动换行
+        cellStyle4.setVerticalAlignment(VerticalAlignment.CENTER);//上下居中
+        cellStyle4.setFillForegroundColor(IndexedColors.WHITE.getIndex());//设置前景色 现在是浅绿色
+        cellStyle4.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());//设置背景色 现在是浅绿色
+        cellStyle4.setBorderBottom(BorderStyle.THIN);//边框
+        cellStyle4.setBorderTop(BorderStyle.THIN);//边框
+        cellStyle4.setBorderRight(BorderStyle.THIN);//边框
+        cellStyle4.setFillPattern(FillPatternType.SOLID_FOREGROUND);//必须设置 否则无效
+
         Font headerFont = workbook.createFont();
         headerFont.setFontHeightInPoints((short) 12);
         headerFont.setFontName("黑体");
@@ -1307,14 +1330,9 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
             Sheet sheet=(Sheet) sheets.next();
             //箱数、件数、总净重、总体积、总毛重 不需要合计只需要获取主表数据
             for (SyPreAssembledPackingList list : items){
-                Row row = sheet.createRow(num1+1);
+                int mainLength=num1+1;
+                num1++;
                 num1++;
-                String [] args=list.toString1().split(",");
-                for (int i=0;i<args.length;i++){
-                    Cell cell = row.createCell(i);//横向
-                    cell.setCellValue(args[i]);
-                    cell.setCellStyle(cellStyle);
-                }
                 int num2=0;
                 for (SyPreAssembledPackingListItem item : list.getSyPreAssembledPackingListItemList()){
                     if(num2==0){
@@ -1355,34 +1373,121 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
                         cell.setCellStyle(cellStyle);
                     }
                 }
+                //起始行,结束行,起始列,结束列
+              /*  String [] args=list.toString1().split(",");
+                Row row = sheet.createRow(mainLength);
+                for (int i=0;i<x;i++){
+                    //sheet.createFreezePane();
+                    Cell cell = row.createCell(i);//横向
+                    if(i<args.length){
+                        cell.setCellValue(args[i]);
+                        cell.setCellStyle(cellStyle);
+                    }else{
+                        cell.setCellStyle(cellStyle3);
+                    }
+                    if(i==x-1){
+                        cell.setCellStyle(cellStyle4);
+                    }
+                }*/
+               // CellRangeAddress region = new CellRangeAddress( 10, 12,10, 12);
+                //sheet.addMergedRegion(region);
+               // Row row = sheet.createRow(mainLength);
+                //Row row3 = sheet.createRow(10);
+                /*Cell cellx = row3.createCell(10);//横向
+                cellx.setCellValue("测试数据");
+                cellx.setCellStyle(cellStyle);*/
+
+                String [] args=list.toString1().split("_____");
+                String [] args1=args[0].split(",");
+                String [] args2=args[1].split(",");
+
+                CellRangeAddress region = new CellRangeAddress( mainLength, mainLength,5, 5+list.getSizeTables().size());
+                sheet.addMergedRegion(region);
+                Row row = sheet.createRow(mainLength);
+                for (int i=0;i<x;i++){
+                    //sheet.createFreezePane();
+                    Cell cell = row.createCell(i);//横向
+                    cell.setCellStyle(cellStyle2);
+                    if(i>5&&i<5+list.getSizeTables().size()+1){
+                        Cell cell2= row.createCell(5);
+                        cell2.setCellStyle(cellStyle);
+                        cell2.setCellValue(args1[5]);
+                        continue;
+                    }else if(i<5){
+                        cell.setCellValue(args1[i]);
+                        cell.setCellStyle(cellStyle);
+                    }
+                    else if(i>5+list.getSizeTables().size()&&i<10+list.getSizeTables().size()){
+                        cell.setCellValue(args1[i-list.getSizeTables().size()]);
+                        cell.setCellStyle(cellStyle);
+                    }
+                    else{
+                        cell.setCellStyle(cellStyle3);
+                    }
+                    if(i==x-1){
+                        cell.setCellStyle(cellStyle4);
+                    }
+                }
+                CellRangeAddress region2 = new CellRangeAddress( mainLength+1, mainLength+1,6, 5+list.getSizeTables().size());
+                sheet.addMergedRegion(region2);
+                row = sheet.createRow(mainLength+1);
+                for (int i=0;i<x;i++){
+                    Cell cell = row.createCell(i);//横向
+                    cell.setCellStyle(cellStyle);
+                    if(i>6&&i<5+list.getSizeTables().size()){
+                        //row.createCell(6).setCellValue("size");
+                        Cell cell2= row.createCell(6);
+                        cell2.setCellStyle(cellStyle2);
+                        cell2.setCellValue("size");
+                        continue;
+                    }else if(i<6){
+                        cell.setCellValue(args2[i]);
+                        cell.setCellStyle(cellStyle);
+                    }
+                    else if(i>5+list.getSizeTables().size()&&i<10+list.getSizeTables().size()){
+                        cell.setCellValue(args2[i-list.getSizeTables().size()]);
+                        cell.setCellStyle(cellStyle);
+                    }
+                    else{
+                        cell.setCellStyle(cellStyle3);
+                    }
+                    if(i==x-1){
+                        cell.setCellStyle(cellStyle4);
+                    }
+                }
                 Row row2 = sheet.createRow(num1+1);
+                for (int i=0;i<x;i++){
+                    Cell cell = row2.createCell(i);//横向
+                    cell.setCellStyle(cellStyle);
+                    if(i==0){
+                        cell.setCellValue("合计");
+                    }else if(i==x-10){
+                        cell.setCellValue(list.getTotalBoxes().doubleValue());//箱数
+                        sheet.setColumnWidth(x-10,list.getTotalVolume().toString().length()*500);
+                    }else if(i==x-9){
+                        cell.setCellValue(list.getTotal().doubleValue());//总件数
+                        sheet.setColumnWidth(x-9,list.getTotal().toString().length()*500);
+                    }else if(i==x-5){
+                        cell.setCellValue(list.getTotalVolume().doubleValue());//总体积
+                        sheet.setColumnWidth(x-9,list.getTotalVolume().toString().length()*500);
+                    }else if(i==x-3){
+                        cell.setCellValue(list.getTotalNetWeight().doubleValue());//总净重
+                        sheet.setColumnWidth(x-9,list.getTotalNetWeight().toString().length()*500);
+                    }else if(i==x-1){
+                        cell.setCellValue(list.getTotalGrossWeight().doubleValue());//总毛重
+                        sheet.setColumnWidth(x-9,list.getTotalGrossWeight().toString().length()*500);
+                    }else{
+                        cell.setCellStyle(cellStyle3);
+                        //cell.setCellValue();//
+                    }
+                    //sheet.setColumnWidth(x,1000);
+                }
 
-                Cell cell = row2.createCell(0);//横向
-                cell.setCellValue("合计");
-                cell.setCellStyle(cellStyle);
-                Cell cell2 = row2.createCell(x-10);//横向
-                cell2.setCellValue(list.getTotalBoxes().doubleValue());//箱数
-                sheet.setColumnWidth(x-10,list.getTotalVolume().toString().length()*500);
-                cell2.setCellStyle(cellStyle);
-                Cell cell3 = row2.createCell(x-9);//横向
-                cell3.setCellValue(list.getTotal().doubleValue());//总件数
-                sheet.setColumnWidth(x-9,list.getTotalVolume().toString().length()*500);
-                cell3.setCellStyle(cellStyle);
-                Cell cell4 = row2.createCell(x-5);//横向
-                cell4.setCellValue(list.getTotalVolume().doubleValue());//总体积
-                sheet.setColumnWidth(x-5,list.getTotalVolume().toString().length()*500);
-                cell4.setCellStyle(cellStyle);
-                Cell cell5 = row2.createCell(x-3);//横向
-                cell5.setCellValue(list.getTotalNetWeight().doubleValue());//总净重
-                sheet.setColumnWidth(x-3,list.getTotalNetWeight().toString().length()*500);
-                cell5.setCellStyle(cellStyle);
-                Cell cell6 = row2.createCell(x-1);//横向
-                cell6.setCellValue(list.getTotalGrossWeight().doubleValue());//总毛重
-                sheet.setColumnWidth(x-1,list.getTotalGrossWeight().toString().length()*500);
-                cell6.setCellStyle(cellStyle);
+                //cell6.setCellStyle(cellStyle);
                 num1++;
                 num1++;
             }
+
         }
     }
 

+ 29 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingList.java

@@ -219,6 +219,10 @@ public class SyPreAssembledPackingList implements Serializable {
 	@TableField(exist = false)
 	private java.lang.String groupName;
 
+	@ApiModelProperty(value = "类型")
+	@TableField(exist = false)
+	private java.lang.String inventoryCurrencyName;
+
 	/**二维表格*/
 	@TableField(exist = false)
 	@ApiModelProperty(value = "二维表格")
@@ -252,6 +256,30 @@ public class SyPreAssembledPackingList implements Serializable {
 	}
 
 	public String toString1(){
+		return  "PO:"+ ","+
+				orderNumber+ ","+
+				"STYLE:"+ ","+
+				itemNumber+ ","+
+				"DESCRIPTION:"+ ","+
+				productName+ ","+
+				"UNIT PRICE:"+ ","+
+				price+ ","+
+				"MERCHANDISER:"+ ","+
+				salesman+ ",_____"+
+
+				"HOD:"+ ","+
+				hod+ ","+
+				"SUPPLIER:"+ ","+
+				supplier+ ","+
+				"COMPOSITE:"+ ","+
+				materialComposition+ ","+
+				"PORT:"+ ","+
+				distributionPoint+ ","+
+				"CLASSES:"+ ","+
+				inventoryCurrencyName;
+	}
+
+	/*public String toString1(){
 		//订单号:	A11293629	款号:	18010	品名:	7B印花网眼T恤
 		return  "订单号:"+ ","+
 				orderNumber+ ","+
@@ -269,5 +297,5 @@ public class SyPreAssembledPackingList implements Serializable {
 				price+ ","+
 				"分销点:"+ ","+
 				distributionPoint;
-	}
+	}*/
 }

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingListItem.java

@@ -286,7 +286,7 @@ public class SyPreAssembledPackingListItem implements Serializable {
 	@ApiModelProperty(value = "超发数量")
 	private BigDecimal excessQuantity;//超发数量
 	/**业务员*/
-	//@Excel(name = "业务员", width = 15)
+	@Excel(name = "业务员", width = 15)
 	@ApiModelProperty(value = "业务员")
 	private String salesman;
 	/**业务部门(销售部门)*/
@@ -347,6 +347,7 @@ public class SyPreAssembledPackingListItem implements Serializable {
 			colour=parsms[9];
 			unitPrice=new BigDecimal("0");//初始化
 			totalPrice=new BigDecimal("0");//初始化
+			System.out.println("parsms[10]\t"+parsms[10]);
 			planQuantity=new BigDecimal(parsms[10]);
 			boxNumber=new BigDecimal(Integer.parseInt(endCaseNumber)-Integer.parseInt(startingBoxNumber)+1);//箱数
 			netWeight=new BigDecimal(parsms[11]);

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/mapper/xml/SyPreAssembledPackingListMapper.xml

@@ -358,7 +358,9 @@
     <select id="queryById2" resultType="org.jeecg.modules.spapl.entity.SyPreAssembledPackingList" parameterType="java.lang.String">
         SELECT
         a.item_Number item_Number,
+        a.salesman salesman,
         b.small_Po order_Number,
+        d.inventory_Currency_Name inventory_Currency_Name,
         b.distribution_Point,
         SUBSTRING(b.hod,1,10)  hod,
         b.supplier,

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -147,7 +147,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 		for (SyPreAssembledPackingListItem item2 : items){
 			System.out.println("item2.getgroupid\t"+item2.getGroupId());
 			 if(maps.containsKey(item2.getGroupId())){//有这个分组id
-				 SyPreAssembledPackingListItem item=maps.get(item2.getGroupId());
+				 SyPreAssembledPackingListItem item=item2;
 				 List<SizeTable> sizes=item.getSizeTables();//获取尺码表信息
 				 BigDecimal boxNumber1=item.getBoxNumber();//获取箱数
 				 item.setActualPackingQty(item.getTotal());//计划装箱数量
@@ -1105,6 +1105,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 			}
 		}
 		for (SyPreAssembledPackingList entity : lists){//主表获取子表数据
+			System.out.println("entity.name\t"+entity.getInventoryCurrencyName());
 			SyPreAssembledPackingList list=bigDecimalMaps.get(entity.getGroupName());
 			entity.setTotal(list.getTotal());
 			//entity.setPrice(list.getPrice());

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabricItem.java

@@ -266,6 +266,14 @@ public class SyPackingListFabricItem implements Serializable {
 	@Excel(name = "集装箱号")
 	@TableField(exist = false)
 	private String containerNumber1;
+	/**推送状态*/
+	@ApiModelProperty(value = "推送状态")
+	@TableField(exist = false)
+	private String pushState;
+
+	@ApiModelProperty(value = "制单人")
+	@TableField(exist = false)
+	private String preparedBy;
 	//体积,总价
 	/**预发货日期*/
 	@Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/xml/SyPackingListFabricItemMapper.xml

@@ -164,10 +164,10 @@
 			(select declaration_Name from sy_declaration_elements
 			where id=t.elements_Id) declaration_Name,
 			(select declaration_unit from sy_declaration_elements
-			where id=t.elements_Id) declaration_unit, t.*
+			where id=t.elements_Id) declaration_unit, t.push_State, t.*
 			from ( 	SELECT
-			a.container_Number as containerNumber1, a.export_invoice_no,
-			a.garment_Factory, a.prepared_by,  b.*
+			a.container_Number as containerNumber1, a.export_invoice_no,a.push_State,
+			a.garment_Factory, a.create_By as prepared_by,  b.*
 			FROM  sy_packing_list_fabric a
 			left join sy_packing_list_fabric_item b
 			on a.id=b.sy_packing_list_fabric_id and a.del_flag=0
@@ -176,7 +176,7 @@
 			<foreach collection="ids" item="value" index="index" open="(" separator="," close=")">
 				#{value}
 			</foreach>
-			ORDER BY  declaration_Name,plan_Lot_Number
+			ORDER BY  export_Invoice_No,dyelot_Number /*declaration_Name,plan_Lot_Number*/
 		) t
 	</select>