Commit adecd2bb3a5d1280fa1c7ef66ceb67588d975476

Authored by chenhang4442024
1 parent bbb3b9ce

feat:1.LOCAL对账单导出时,添加项目号表格

src/main/java/com/order/erp/common/utils/AccountStatementExcel.java
... ... @@ -46,10 +46,10 @@ public class AccountStatementExcel {
46 46 titleheaderCell.setCellStyle(titleStyle); // 将样式应用到单元格
47 47  
48 48 // 合并单元格(例如合并 A1 到 L1)
49   - sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 11));
  49 + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 12));
50 50  
51 51 // 设置标题栏的列宽
52   - for (int i = 0; i < 12; i++) {
  52 + for (int i = 0; i < 13; i++) {
53 53 sheet.setColumnWidth(i, 5000); // 根据需求调整宽度
54 54 }
55 55 titleRow.setHeightInPoints(30);
... ... @@ -57,7 +57,7 @@ public class AccountStatementExcel {
57 57 sheet.setRepeatingRows(new CellRangeAddress(0,1,-1,-1)); // 从第1行到第2行(即标题行和生产科,内部编号等等那一行)在每一页重复显示
58 58  
59 59 Row headerRow = sheet.createRow(1);
60   - String[] headers = {"生产科", "内部编号", "Client PC", "STYLE", "REFERENCE", "颜色中文", "PIC 图片", "数量", "拖货时间", "包装类型", "生产科单价", "生产科总价"};
  60 + String[] headers = {"生产科", "项目号","内部编号", "Client PC", "STYLE", "REFERENCE", "颜色中文", "PIC 图片", "数量", "拖货时间", "包装类型", "生产科单价", "生产科总价"};
61 61 for (int i = 0; i < headers.length; i++) {
62 62 Cell cell = headerRow.createCell(i);
63 63 cell.setCellValue(headers[i]);
... ... @@ -79,7 +79,7 @@ public class AccountStatementExcel {
79 79 CreationHelper helper = workbook.getCreationHelper();
80 80 Drawing<?> drawing = sheet.createDrawingPatriarch();
81 81 ClientAnchor anchor = helper.createClientAnchor();
82   - anchor.setCol1(6);
  82 + anchor.setCol1(7);
83 83 anchor.setRow1(i + 2);
84 84 anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
85 85  
... ... @@ -88,7 +88,7 @@ public class AccountStatementExcel {
88 88  
89 89 Row row = sheet.createRow(i + 2);
90 90 String[] rowData = {
91   - item.getProductionDepartment(), item.getInnerNo(), item.getCustomerPo(),
  91 + item.getProductionDepartment(),item.getProjectNo(), item.getInnerNo(), item.getCustomerPo(),
92 92 item.getCustomerStyle(), item.getModeleLo(), item.getCnColor(),
93 93 item.getSmallPicUrl(), String.valueOf(item.getOrderCount()),
94 94 item.getProductionDepartmentConsignTime().split(" ")[0], item.getPacketType(),
... ... @@ -109,22 +109,22 @@ public class AccountStatementExcel {
109 109  
110 110 int lastRowNum = accountStatementExcelVOList.size() + 2;
111 111 Row totalRow = sheet.createRow(lastRowNum);
112   - for (int j = 0; j < 12; j++) {
  112 + for (int j = 0; j < 13; j++) {
113 113 totalRow.createCell(j);
114 114 }
115 115  
116 116 totalRow.getCell(0).setCellValue("合计");
117   - totalRow.getCell(7).setCellValue(totalQuantity );
118   - totalRow.getCell(11).setCellValue(totalPrice > 0 ? "¥" + String.format("%.2f", totalPrice) : "无数据");
  117 + totalRow.getCell(8).setCellValue(totalQuantity );
  118 + totalRow.getCell(12).setCellValue(totalPrice > 0 ? "¥" + String.format("%.2f", totalPrice) : "无数据");
119 119  
120 120  
121 121  
122   - for (int j = 0; j < 12; j++) {
  122 + for (int j = 0; j < 13; j++) {
123 123 totalRow.getCell(j).setCellStyle(borderStyle);
124 124 }
125 125 totalRow.setHeightInPoints(50);
126 126  
127   - int[] columnWidths = {3000, 4000, 7000, 6000, 6000, 4000, 4400, 2500, 4000, 3000, 3100, 4000};
  127 + int[] columnWidths = {3000,4000, 4000, 7000, 6000, 6000, 4000, 4400, 2500, 4000, 3000, 3100, 4000};
128 128 for (int i = 0; i < columnWidths.length; i++) {
129 129 sheet.setColumnWidth(i, columnWidths[i]);
130 130 }
... ...
src/main/java/com/order/erp/domain/excel/AccountStatementExcelVO.java
... ... @@ -20,6 +20,11 @@ public class AccountStatementExcelVO {
20 20 private String productionDepartment;
21 21  
22 22 /**
  23 + * 项目号
  24 + * */
  25 + private String projectNo;
  26 +
  27 + /**
23 28 * 内部编号
24 29 */
25 30 private String innerNo;
... ...