From c11e6f07b031eea6c7de4c5508b8dbf0ee01d2c7 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 01 四月 2026 10:08:08 +0800
Subject: [PATCH] 去除不同报价方案,不能添加相同【客户-路线-车型】数据
---
tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java | 564 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 558 insertions(+), 6 deletions(-)
diff --git a/tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java b/tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java
index 42dc6df..637ef81 100644
--- a/tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java
+++ b/tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java
@@ -4,13 +4,24 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.system.service.ISysConfigService;
+import com.ruoyi.tms.domain.*;
+import com.ruoyi.tms.mapper.*;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
-import com.ruoyi.tms.domain.TmsArBillItem;
-import com.ruoyi.tms.domain.TmsReceivableFee;
-import com.ruoyi.tms.mapper.TmsArBillItemMapper;
-import com.ruoyi.tms.mapper.TmsReceivableFeeMapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
@@ -22,8 +33,6 @@
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
-import com.ruoyi.tms.mapper.TmsArBillMapper;
-import com.ruoyi.tms.domain.TmsArBill;
import com.ruoyi.tms.service.ITmsArBillService;
import com.ruoyi.common.core.text.Convert;
@@ -45,6 +54,19 @@
private TmsArBillItemMapper tmsArBillItemMapper;
@Resource
private TmsReceivableFeeMapper tmsReceivableFeeMapper;
+ @Resource
+ private TmsReceivableFeeItemMapper tmsReceivableFeeItemMapper;
+ @Resource
+ private TmsTripMapper tmsTripMapper;
+
+ @Autowired
+ private ISysConfigService sysConfigService;
+
+ @Autowired
+ private RedisCache redisCache;
+
+ @Resource
+ private TmsDispatchOrderMapper tmsDispatchOrderMapper;
/**
* 鏌ヨ搴旀敹璐﹀崟
@@ -217,4 +239,534 @@
{
return tmsArBillMapper.deleteTmsArBillById(id);
}
+
+ /**
+ * 瀵煎嚭瀵硅处鍗曚竴寮忓鑱旀牸寮�
+ *
+ * @param tmsArBill 搴旀敹璐﹀崟
+ * @param exportKey 瀵煎嚭鍔熻兘鐨勫敮涓�鏍囪瘑
+ */
+ @DataSource(DataSourceType.SLAVE)
+ @Async
+ @Override
+ public void exportArBillFormat(TmsArBill tmsArBill, String exportKey) {
+ // 璁剧疆褰撳墠浠诲姟涓衡�滀笅杞戒腑鈥濈姸鎬�
+ com.ruoyi.common.utils.file.DownloadExportUtil.deleteDownloadFile(redisCache, exportKey, "0");
+
+ try {
+ // 鐢熸垚鏂囦欢鍚�
+ String fileName = com.ruoyi.common.utils.poi.ExcelUtil.encodeFileName("arBillFormatData");
+ // 鎵ц瀵煎嚭
+ fileName = exportArBillFormatData(fileName, tmsArBill);
+ // 璁剧疆涓嬭浇瀹屾垚鐘舵��
+ com.ruoyi.common.utils.file.DownloadExportUtil.setDownloadFile(redisCache, exportKey, fileName);
+ logger.info("Export completed for key: {}, file: {}", exportKey, fileName);
+ } catch (Exception e) {
+ logger.error("Export failed for key: {}, error: {}", exportKey, e.getMessage(), e);
+ com.ruoyi.common.utils.file.DownloadExportUtil.deleteDownloadFile(redisCache, exportKey, "1"); // 璁剧疆澶辫触鐘舵��
+ throw e;
+ }
+ }
+
+ /**
+ * 瀵煎嚭瀵硅处鍗曚竴寮忓鑱旀暟鎹�
+ *
+ * @param fileName 鏂囦欢鍚�
+ * @param tmsArBill 搴旀敹璐﹀崟
+ * @return 瀵煎嚭鍚庣殑鏂囦欢鍚�
+ */
+ protected String exportArBillFormatData(String fileName, TmsArBill tmsArBill) {
+ try (SXSSFWorkbook workbook = new SXSSFWorkbook(1000)) {
+ // 鍒涘缓宸ヤ綔琛�
+ SXSSFSheet sheet = workbook.createSheet("瀵硅处鍗�");
+
+ // 鍒涘缓鏍峰紡
+ Map<String, CellStyle> styles = createArBillStyles(workbook);
+
+ // 鏌ヨ鏁版嵁
+ TmsArBill bill = selectTmsArBillById(tmsArBill.getId());
+
+
+ // 鑾峰彇娓竵鍏戜汉姘戝竵姹囩巼
+ String rateStr = sysConfigService.selectConfigByKey("sys.hk.rmb.rate");
+ BigDecimal exchangeRate = new BigDecimal(rateStr);
+
+ // 鏀堕泦鎵�鏈夎垂鐢ㄥ悕绉帮紝鐢ㄤ簬鍔ㄦ�佺敓鎴愬垪
+ Set<String> feeNames = new HashSet<>();
+
+ for (TmsArBillItem item : bill.getItems()) {
+ // 搴旀敹璐圭敤ID
+ Integer arFeeId = item.getArFeeId();
+ // 搴旀敹璐圭敤鏄庣粏
+ List<TmsReceivableFeeItem> tmsReceivableFeeItems = tmsReceivableFeeItemMapper.selectTmsReceivableFeeItemList(new TmsReceivableFeeItem() {{
+ setHeadId(arFeeId);
+ }});
+ // 浠庡簲鏀惰垂鐢ㄦ槑缁嗕腑鏀堕泦璐圭敤鍚嶇О
+ for (TmsReceivableFeeItem feeItem : tmsReceivableFeeItems) {
+ feeNames.add(feeItem.getFeeName());
+ }
+ }
+
+
+ // 灏嗚垂鐢ㄥ悕绉拌浆鎹负鍒楄〃锛屼繚鎸侀『搴�
+ List<String> feeNameList = new ArrayList<>(feeNames);
+
+ // 鍩虹鍒楁暟锛堝簭鍙枫�佽璐ф棩鏈熴�佽璐х偣銆佸嵏璐х偣銆佽溅鐗屻�佸瀷鍙凤級
+ int baseColumns = 6;
+ // 澶囨敞鍒椾綅缃�
+ int remarkColumn = baseColumns + feeNameList.size();
+
+ // 璁剧疆鍒楀
+ sheet.setColumnWidth(0, 5000); // 搴忓彿
+ sheet.setColumnWidth(1, 5000); // 瑁呰揣鏃ユ湡
+ sheet.setColumnWidth(2, 8000); // 瑁呰揣鐐�
+ sheet.setColumnWidth(3, 8000); // 鍗歌揣鐐�
+ sheet.setColumnWidth(4, 5000); // 杞︾墝
+ sheet.setColumnWidth(5, 5000); // 鍨嬪彿
+
+ // 璁剧疆璐圭敤鍒楀
+ for (int i = 0; i < feeNameList.size(); i++) {
+ sheet.setColumnWidth(baseColumns + i, 6000);
+ }
+
+ sheet.setColumnWidth(remarkColumn, 10000); // 澶囨敞
+
+ // 鏍囬鍖哄煙
+ createTitleArea(sheet, styles,bill);
+
+ // 琛ㄥご
+ createDynamicTableHeader(sheet, styles, feeNameList, baseColumns, remarkColumn);
+
+ // 鏁版嵁鍖哄煙
+ int startRow = 4;
+ // 璐圭敤鍚堣鏄犲皠
+ Map<String, BigDecimal> feeTotals = new HashMap<>();
+ for (String feeName : feeNameList) {
+ feeTotals.put(feeName, BigDecimal.ZERO);
+ }
+
+ int rowIndex = 0;
+
+ for (TmsArBillItem item : bill.getItems()) {
+ // 鏌ヨ瀵瑰簲鐨勫簲鏀惰垂鐢�
+ TmsReceivableFee fee = tmsReceivableFeeMapper.selectTmsReceivableFeeById(item.getArFeeId());
+ if (fee != null) {
+ Row row = sheet.createRow(startRow + rowIndex);
+
+ // 搴忓彿
+ Cell cell0 = row.createCell(0);
+ cell0.setCellValue(rowIndex + 1);
+ cell0.setCellStyle(styles.get("data"));
+ // 鏌ヨ璋冨害鍗曚俊鎭�
+ TmsDispatchOrder dispatchOrder = null;
+ if (fee.getDispatchId() != null) {
+ dispatchOrder = tmsDispatchOrderMapper.selectTmsDispatchOrderById(fee.getDispatchId());
+ }
+ // 瑁呰揣鏃ユ湡
+ Cell cell1 = row.createCell(1);
+ if (dispatchOrder != null) {
+ TmsTrip tmsTrip = tmsTripMapper.selectTmsTripByTripType(3,dispatchOrder.getId() );
+ if (tmsTrip!=null) {
+ cell1.setCellValue(DateUtils.parseDateToStr("yyyy-MM-dd", tmsTrip.getTripTime()));
+ cell1.setCellStyle(styles.get("data"));
+ }
+ }
+
+
+
+ // 瑁呰揣鐐�
+ Cell cell2 = row.createCell(2);
+ if (dispatchOrder != null && dispatchOrder.getShipperRegionLabel() != null) {
+ cell2.setCellValue(dispatchOrder.getShipperRegionLabel());
+ cell2.setCellStyle(styles.get("data"));
+ }
+
+ // 鍗歌揣鐐�
+ Cell cell3 = row.createCell(3);
+ if (dispatchOrder != null && dispatchOrder.getReceiverRegionLabel() != null) {
+ cell3.setCellValue(dispatchOrder.getReceiverRegionLabel());
+ cell3.setCellStyle(styles.get("data"));
+ }
+
+ // 杞︾墝
+ Cell cell4 = row.createCell(4);
+ if (dispatchOrder != null && dispatchOrder.getLicensePlate() != null) {
+ cell4.setCellValue(dispatchOrder.getLicensePlate());
+ cell4.setCellStyle(styles.get("data"));
+ }
+
+ // 鍨嬪彿
+ Cell cell5 = row.createCell(5);
+ if (dispatchOrder != null && dispatchOrder.getActualVehicleType() != null) {
+ cell5.setCellValue(dispatchOrder.getActualVehicleType());
+ cell5.setCellStyle(styles.get("data"));
+ }
+
+ // 鏋勫缓璐圭敤鍚嶇О鍒伴噾棰濈殑鏄犲皠锛堟腐甯佽浆浜烘皯甯侊級
+ Map<String, BigDecimal> feeMap = new HashMap<>();
+ // 鏌ヨ搴旀敹璐圭敤鏄庣粏
+ List<TmsReceivableFeeItem> tmsReceivableFeeItems = tmsReceivableFeeItemMapper.selectTmsReceivableFeeItemList(new TmsReceivableFeeItem() {{
+ setHeadId(fee.getId());
+ }});
+ // 澶勭悊搴旀敹璐圭敤鏄庣粏
+ for (TmsReceivableFeeItem feeItem : tmsReceivableFeeItems) {
+ BigDecimal amount = feeItem.getRegisterAmount();
+ // 濡傛灉鏄腐甯侊紝杞崲涓轰汉姘戝竵
+ if ("HKD".equals(feeItem.getCurrency()) || "娓竵".equals(feeItem.getCurrency())) {
+ amount = amount.multiply(exchangeRate).setScale(2, RoundingMode.HALF_UP);
+ }
+ feeMap.put(feeItem.getFeeName(), amount);
+ }
+
+ // 濉厖璐圭敤鍒�
+ for (int j = 0; j < feeNameList.size(); j++) {
+ String feeName = feeNameList.get(j);
+ Cell cell = row.createCell(baseColumns + j);
+ BigDecimal feeAmount = feeMap.getOrDefault(feeName, BigDecimal.ZERO);
+ cell.setCellValue(feeAmount.doubleValue());
+ cell.setCellStyle(styles.get("data"));
+
+ // 绱鍚堣
+ feeTotals.put(feeName, feeTotals.get(feeName).add(feeAmount));
+ }
+
+ // 澶囨敞
+ Cell remarkCell = row.createCell(remarkColumn);
+ remarkCell.setCellValue("" + (fee.getDispatchNo() != null ? fee.getDispatchNo() : ""));
+ remarkCell.setCellStyle(styles.get("data"));
+
+ rowIndex++;
+ }
+ }
+
+
+ // 灏忚琛�
+ int subTotalRow = startRow + rowIndex;
+ Row subTotal = sheet.createRow(subTotalRow);
+ Cell subTotalCell = subTotal.createCell(2);
+ subTotalCell.setCellValue("灏忚");
+ subTotalCell.setCellStyle(styles.get("total"));
+ sheet.addMergedRegion(new CellRangeAddress(subTotalRow, subTotalRow, 2, 5));
+
+ // 濉厖璐圭敤灏忚
+ for (int j = 0; j < feeNameList.size(); j++) {
+ String feeName = feeNameList.get(j);
+ Cell cell = subTotal.createCell(baseColumns + j);
+ cell.setCellValue(feeTotals.get(feeName).doubleValue());
+ cell.setCellStyle(styles.get("total"));
+ }
+
+ // 鍚堣琛�
+ int totalRow = subTotalRow + 1;
+ Row total = sheet.createRow(totalRow);
+ Cell totalCell = total.createCell(2);
+ totalCell.setCellValue("鍚堣(CNB)");
+ totalCell.setCellStyle(styles.get("total"));
+ sheet.addMergedRegion(new CellRangeAddress(totalRow, totalRow, 2, 5));
+
+ // 濉厖璐圭敤鍚堣
+ for (int j = 0; j < feeNameList.size(); j++) {
+ String feeName = feeNameList.get(j);
+ Cell cell = total.createCell(baseColumns + j);
+ cell.setCellValue(feeTotals.get(feeName).doubleValue());
+ cell.setCellStyle(styles.get("total"));
+ }
+
+ // 澶囨敞璇存槑鍖哄煙
+ createNotesArea(sheet, styles, totalRow + 1);
+
+ // 璐︽埛淇℃伅鍖哄煙
+ createAccountInfo(sheet, styles, totalRow + 4);
+
+ // 绛惧瓧鐩栫珷鍖哄煙
+ createSignatureArea(sheet, styles, totalRow + 8,bill);
+
+ // 淇濆瓨鏂囦欢
+ String path = RuoYiConfig.getDownloadPath() + fileName;
+ File file = new File(path);
+ File parentFile = file.getParentFile();
+ if (!parentFile.exists()) {
+ parentFile.mkdirs();
+ }
+
+ try (FileOutputStream fos = new FileOutputStream(file)) {
+ workbook.write(fos);
+ }
+
+ return fileName;
+ } catch (Exception e) {
+ logger.error("瀵煎嚭瀵硅处鍗曚竴寮忓鑱旀牸寮忓け璐�", e);
+ throw new RuntimeException("瀵煎嚭澶辫触锛岃妫�鏌ユ暟鎹�", e);
+ }
+
+ }
+
+ /**
+ * 鍒涘缓瀵硅处鍗曚竴寮忓鑱旀牱寮�
+ *
+ * @param workbook 宸ヤ綔绨�
+ * @return 鏍峰紡鏄犲皠
+ */
+ private Map<String, CellStyle> createArBillStyles(SXSSFWorkbook workbook) {
+ Map<String, CellStyle> styles = new HashMap<>();
+
+ // 鏍囬鏍峰紡
+ CellStyle titleStyle = workbook.createCellStyle();
+ titleStyle.setAlignment(HorizontalAlignment.CENTER);
+ titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+ Font titleFont = workbook.createFont();
+ titleFont.setFontName("寰蒋闆呴粦");
+ titleFont.setFontHeightInPoints((short) 16);
+ titleFont.setBold(true);
+ titleStyle.setFont(titleFont);
+ styles.put("title", titleStyle);
+
+ // 琛ㄥご鏍峰紡
+ CellStyle headerStyle = workbook.createCellStyle();
+ headerStyle.setAlignment(HorizontalAlignment.CENTER);
+ headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+ headerStyle.setBorderTop(BorderStyle.THIN);
+ headerStyle.setBorderBottom(BorderStyle.THIN);
+ headerStyle.setBorderLeft(BorderStyle.THIN);
+ headerStyle.setBorderRight(BorderStyle.THIN);
+ headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+ headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+ Font headerFont = workbook.createFont();
+ headerFont.setFontName("寰蒋闆呴粦");
+ headerFont.setFontHeightInPoints((short) 11);
+ headerFont.setBold(true);
+ headerStyle.setFont(headerFont);
+ styles.put("header", headerStyle);
+
+ // 鏁版嵁鏍峰紡
+ CellStyle dataStyle = workbook.createCellStyle();
+ dataStyle.setAlignment(HorizontalAlignment.CENTER);
+ dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+ dataStyle.setBorderTop(BorderStyle.THIN);
+ dataStyle.setBorderBottom(BorderStyle.THIN);
+ dataStyle.setBorderLeft(BorderStyle.THIN);
+ dataStyle.setBorderRight(BorderStyle.THIN);
+ Font dataFont = workbook.createFont();
+ dataFont.setFontName("寰蒋闆呴粦");
+ dataFont.setFontHeightInPoints((short) 11);
+ dataStyle.setFont(dataFont);
+ styles.put("data", dataStyle);
+
+ // 鍚堣鏍峰紡
+ CellStyle totalStyle = workbook.createCellStyle();
+ totalStyle.setAlignment(HorizontalAlignment.CENTER);
+ totalStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+ totalStyle.setBorderTop(BorderStyle.THIN);
+ totalStyle.setBorderBottom(BorderStyle.THIN);
+ totalStyle.setBorderLeft(BorderStyle.THIN);
+ totalStyle.setBorderRight(BorderStyle.THIN);
+ totalStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+ totalStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+ Font totalFont = workbook.createFont();
+ totalFont.setFontName("寰蒋闆呴粦");
+ totalFont.setFontHeightInPoints((short) 11);
+ totalFont.setBold(true);
+ totalStyle.setFont(totalFont);
+ styles.put("total", totalStyle);
+
+ // 鏂囨湰鏍峰紡
+ CellStyle textStyle = workbook.createCellStyle();
+ textStyle.setAlignment(HorizontalAlignment.LEFT);
+ textStyle.setVerticalAlignment(VerticalAlignment.TOP);
+ Font textFont = workbook.createFont();
+ textFont.setFontName("寰蒋闆呴粦");
+ textFont.setFontHeightInPoints((short) 11);
+ textStyle.setFont(textFont);
+ styles.put("text", textStyle);
+
+ return styles;
+ }
+
+ /**
+ * 鍒涘缓鏍囬鍖哄煙
+ *
+ * @param sheet 宸ヤ綔琛�
+ * @param styles 鏍峰紡鏄犲皠
+ * @param tmsReceivableFee 搴旀敹璐圭敤鏌ヨ鏉′欢
+ */
+ private void createTitleArea(SXSSFSheet sheet, Map<String, CellStyle> styles, TmsArBill tmsArBill) {
+ // 鏍囬琛�
+ Row titleRow = sheet.createRow(0);
+ titleRow.setHeightInPoints(30);
+ Cell titleCell = titleRow.createCell(0);
+ titleCell.setCellValue(tmsArBill.getCustomerName());
+ titleCell.setCellStyle(styles.get("title"));
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 9));
+
+ // 瀵硅处鍗曡
+ Row billRow = sheet.createRow(1);
+ billRow.setHeightInPoints(20);
+ Cell toCell = billRow.createCell(0);
+ toCell.setCellValue("TO: "+tmsArBill.getCustomerName());
+ toCell.setCellStyle(styles.get("text"));
+
+ Cell billTitleCell = billRow.createCell(3);
+ billTitleCell.setCellValue(tmsArBill.getBillName());
+ billTitleCell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(1, 1, 3, 6));
+
+ // 鍏徃淇℃伅琛�
+ Row companyRow = sheet.createRow(2);
+ companyRow.setHeightInPoints(20);
+ Cell fromCell = companyRow.createCell(0);
+ fromCell.setCellValue("FROM:鐝犳捣甯傛眹鐣呬氦閫氭姇璧勬湁闄愬叕鍙�");
+ fromCell.setCellStyle(styles.get("text"));
+ }
+
+ /**
+ * 鍒涘缓鍔ㄦ�佽〃鏍艰〃澶�
+ *
+ * @param sheet 宸ヤ綔琛�
+ * @param styles 鏍峰紡鏄犲皠
+ * @param feeNameList 璐圭敤鍚嶇О鍒楄〃
+ * @param baseColumns 鍩虹鍒楁暟
+ * @param remarkColumn 澶囨敞鍒椾綅缃�
+ */
+ private void createDynamicTableHeader(SXSSFSheet sheet, Map<String, CellStyle> styles, List<String> feeNameList, int baseColumns, int remarkColumn) {
+ Row headerRow = sheet.createRow(3);
+ headerRow.setHeightInPoints(25);
+
+ // 鍩虹鍒�
+ String[] baseHeaders = {"搴忓彿", "瑁呰揣鏃ユ湡", "瑁呰揣鐐�", "鍗歌揣鐐�", "杞︾墝", "鍨嬪彿"};
+ for (int i = 0; i < baseHeaders.length; i++) {
+ Cell cell = headerRow.createCell(i);
+ cell.setCellValue(baseHeaders[i]);
+ cell.setCellStyle(styles.get("header"));
+ }
+
+ // 璐圭敤鍒�
+ for (int i = 0; i < feeNameList.size(); i++) {
+ Cell cell = headerRow.createCell(baseColumns + i);
+ cell.setCellValue(feeNameList.get(i) + "(浜烘皯甯�)");
+ cell.setCellStyle(styles.get("header"));
+ }
+
+ // 澶囨敞鍒�
+ Cell remarkCell = headerRow.createCell(remarkColumn);
+ remarkCell.setCellValue("澶囨敞");
+ remarkCell.setCellStyle(styles.get("header"));
+ }
+
+ /**
+ * 鍒涘缓澶囨敞璇存槑鍖哄煙
+ *
+ * @param sheet 宸ヤ綔琛�
+ * @param styles 鏍峰紡鏄犲皠
+ * @param startRow 璧峰琛�
+ */
+ private void createNotesArea(SXSSFSheet sheet, Map<String, CellStyle> styles, int startRow) {
+ Row note1Row = sheet.createRow(startRow);
+ Cell note1Cell = note1Row.createCell(0);
+ note1Cell.setCellValue("1.渚濇嵁鍚堝悓鐩稿叧瑙勫畾锛岃吹鍙搁渶鍚戞垜鍙告敮浠橈骏锛堝ぇ鍐欓噾棰濓細锛夌殑璐圭敤锛岃璐靛徃鍙婃椂瀹夋帓鏀粯銆�");
+ note1Cell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow, startRow, 0, 9));
+
+ Row note2Row = sheet.createRow(startRow + 1);
+ Cell note2Cell = note2Row.createCell(0);
+ note2Cell.setCellValue("2.浼犵湡浠朵笌鍘熶欢璧峰悓绛夋硶寰嬫晥鍔涖��");
+ note2Cell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow + 1, startRow + 1, 0, 9));
+ }
+
+ /**
+ * 鍒涘缓璐︽埛淇℃伅鍖哄煙
+ *
+ * @param sheet 宸ヤ綔琛�
+ * @param styles 鏍峰紡鏄犲皠
+ * @param startRow 璧峰琛�
+ */
+ private void createAccountInfo(SXSSFSheet sheet, Map<String, CellStyle> styles, int startRow) {
+ Row accountTitleRow = sheet.createRow(startRow);
+ Cell accountTitleCell = accountTitleRow.createCell(0);
+ accountTitleCell.setCellValue("鐑﹁鏍稿纭骞惰浆鑷虫垜鍙稿涓嬪笎鍙凤細");
+ accountTitleCell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow, startRow, 0, 9));
+
+ Row bankRow = sheet.createRow(startRow + 1);
+ Cell bankCell = bankRow.createCell(0);
+ bankCell.setCellValue("寮�鎴烽摱琛�:涓浗鍐滀笟鍙戝睍閾惰鐝犳捣甯傚垎琛�");
+ bankCell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow + 1, startRow + 1, 0, 9));
+
+ Row accountRow = sheet.createRow(startRow + 2);
+ Cell accountCell = accountRow.createCell(0);
+ accountCell.setCellValue("璐﹀彿:20344990100000422001");
+ accountCell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow + 2, startRow + 2, 0, 9));
+
+ Row nameRow = sheet.createRow(startRow + 3);
+ Cell nameCell = nameRow.createCell(0);
+ nameCell.setCellValue("鎴峰悕:鐝犳捣甯傛眹鐣呬氦閫氭姇璧勬湁闄愬叕鍙�");
+ nameCell.setCellStyle(styles.get("text"));
+ sheet.addMergedRegion(new CellRangeAddress(startRow + 3, startRow + 3, 0, 9));
+ }
+
+ /**
+ * 鍒涘缓绛惧瓧鐩栫珷鍖哄煙
+ *
+ * @param sheet 宸ヤ綔琛�
+ * @param styles 鏍峰紡鏄犲皠
+ * @param startRow 璧峰琛�
+ * @param bill
+ */
+ private void createSignatureArea(SXSSFSheet sheet, Map<String, CellStyle> styles, int startRow, TmsArBill bill) {
+ Row payerRow = sheet.createRow(startRow);
+ Cell payerCell = payerRow.createCell(0);
+ payerCell.setCellValue("浠樻鍗曚綅锛堢敳鏂癸級锛�"+bill.getCustomerName());
+ payerCell.setCellStyle(styles.get("text"));
+
+ Cell payeeCell = payerRow.createCell(6);
+ payeeCell.setCellValue("鏀舵鍗曚綅锛堜箼鏂癸級锛氱彔娴峰競姹囩晠浜ら�氭姇璧勬湁闄愬叕鍙�");
+ payeeCell.setCellStyle(styles.get("text"));
+
+ Row creatorRow = sheet.createRow(startRow + 1);
+ Cell creatorCell = creatorRow.createCell(0);
+ creatorCell.setCellValue("鍒惰〃浜哄憳锛�");
+ creatorCell.setCellStyle(styles.get("text"));
+
+ Cell creatorCell2 = creatorRow.createCell(6);
+ creatorCell2.setCellValue("鍒惰〃浜哄憳锛�");
+ creatorCell2.setCellStyle(styles.get("text"));
+
+ Row checkerRow = sheet.createRow(startRow + 2);
+ Cell checkerCell = checkerRow.createCell(0);
+ checkerCell.setCellValue("瀹℃牳浜哄憳锛�");
+ checkerCell.setCellStyle(styles.get("text"));
+
+ Cell checkerCell2 = checkerRow.createCell(6);
+ checkerCell2.setCellValue("瀹℃牳浜哄憳锛�");
+ checkerCell2.setCellStyle(styles.get("text"));
+
+ Row reviewerRow = sheet.createRow(startRow + 3);
+ Cell reviewerCell = reviewerRow.createCell(0);
+ reviewerCell.setCellValue("澶嶆牳浜哄憳锛�");
+ reviewerCell.setCellStyle(styles.get("text"));
+
+ Cell reviewerCell2 = reviewerRow.createCell(6);
+ reviewerCell2.setCellValue("澶嶆牳浜哄憳锛�");
+ reviewerCell2.setCellStyle(styles.get("text"));
+
+ Row stampRow = sheet.createRow(startRow + 4);
+ Cell stampCell = stampRow.createCell(0);
+ stampCell.setCellValue("鐩栫珷锛�");
+ stampCell.setCellStyle(styles.get("text"));
+
+ Cell stampCell2 = stampRow.createCell(6);
+ stampCell2.setCellValue("鐩栫珷锛�");
+ stampCell2.setCellStyle(styles.get("text"));
+
+ Row dateRow = sheet.createRow(startRow + 5);
+ Cell dateCell = dateRow.createCell(0);
+ dateCell.setCellValue("鏃ユ湡锛�2026骞� 鏈� 鏃�");
+ dateCell.setCellStyle(styles.get("text"));
+
+ Cell dateCell2 = dateRow.createCell(6);
+ dateCell2.setCellValue("鏃ユ湡锛�2026骞� 鏈� 鏃�");
+ dateCell2.setCellStyle(styles.get("text"));
+ }
}
--
Gitblit v1.8.0