|
...
|
...
|
@@ -65,27 +65,7 @@ public class LedgerReportExportHandler implements ExportHandler { |
|
65
|
65
|
int startMergeIndex = rowIndex;
|
|
66
|
66
|
// 合并结束行
|
|
67
|
67
|
int endMergeIndex = rowIndex + detailList.size();
|
|
68
|
|
- for (ReceiptLedgerReportDetail detail : detailList) {
|
|
69
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 6, detail.getCustomerName()
|
|
70
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
71
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 7, detail.getDebtTotal()
|
|
72
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
73
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 8, detail.getAgreement()
|
|
74
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
75
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 9, detail.getFirstCoordinate()
|
|
76
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
77
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 10, detail.getSecondCoordinate()
|
|
78
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
79
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 11, detail.getClearDebt()
|
|
80
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
81
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 12, detail.getCreditStatus()
|
|
82
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
83
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 13, detail.getTimingStatus()
|
|
84
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
85
|
|
- ExcelUtil.setCellValue(sheet, rowIndex, 14, detail.getWaitDeliveredOrder()
|
|
86
|
|
- , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
87
|
|
- rowIndex++;
|
|
88
|
|
- }
|
|
|
68
|
+ rowIndex = setCellValue(workbook, sheet, rowIndex, detailList);
|
|
89
|
69
|
if (detailList.size() > 1) {
|
|
90
|
70
|
setSubtotalCell(workbook, sheet, rowIndex, model);
|
|
91
|
71
|
// 合并单位格
|
|
...
|
...
|
@@ -109,7 +89,11 @@ public class LedgerReportExportHandler implements ExportHandler { |
|
109
|
89
|
sheet.addMergedRegion(cellRangeAddress6);
|
|
110
|
90
|
}
|
|
111
|
91
|
} else if ("RECEIVABLE_LEDGER_REPORT_MERGE".equals(exportType)) {
|
|
112
|
|
- setSubtotalCell(workbook, sheet, rowIndex, model);
|
|
|
92
|
+ if (detailList.size() > 1) {
|
|
|
93
|
+ setSubtotalCell(workbook, sheet, rowIndex, model);
|
|
|
94
|
+ } else {
|
|
|
95
|
+ rowIndex = setCellValue(workbook, sheet, rowIndex, detailList);
|
|
|
96
|
+ }
|
|
113
|
97
|
}
|
|
114
|
98
|
rowIndex++;
|
|
115
|
99
|
}
|
|
...
|
...
|
@@ -150,6 +134,34 @@ public class LedgerReportExportHandler implements ExportHandler { |
|
150
|
134
|
}
|
|
151
|
135
|
}
|
|
152
|
136
|
|
|
|
137
|
+ private int setCellValue(Workbook workbook, Sheet sheet, int rowIndex, List<ReceiptLedgerReportDetail> detailList) {
|
|
|
138
|
+ if (CollectionUtils.isEmpty(detailList)) {
|
|
|
139
|
+ return rowIndex;
|
|
|
140
|
+ }
|
|
|
141
|
+ for (ReceiptLedgerReportDetail detail : detailList) {
|
|
|
142
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 6, detail.getCustomerName()
|
|
|
143
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
144
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 7, detail.getDebtTotal()
|
|
|
145
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
146
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 8, detail.getAgreement()
|
|
|
147
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
148
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 9, detail.getFirstCoordinate()
|
|
|
149
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
150
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 10, detail.getSecondCoordinate()
|
|
|
151
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
152
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 11, detail.getClearDebt()
|
|
|
153
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
154
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 12, detail.getCreditStatus()
|
|
|
155
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
156
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 13, detail.getTimingStatus()
|
|
|
157
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
158
|
+ ExcelUtil.setCellValue(sheet, rowIndex, 14, detail.getWaitDeliveredOrder()
|
|
|
159
|
+ , setCellStyle(workbook, VerticalAlignment.CENTER, false));
|
|
|
160
|
+ rowIndex++;
|
|
|
161
|
+ }
|
|
|
162
|
+ return rowIndex;
|
|
|
163
|
+ }
|
|
|
164
|
+
|
|
153
|
165
|
/**
|
|
154
|
166
|
* 设置“小计”单元格
|
|
155
|
167
|
*
|
...
|
...
|
|