瀏覽代碼

[合同][修改][开发结算单]

release_toaliyun_real
luozukai 6 年之前
父節點
當前提交
7a222038a7
共有 3 個文件被更改,包括 3 次插入6 次删除
  1. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  2. +2
    -5
      mallinkService/src/main/java/com/iformall/utils/WordUtil.java
  3. 二進制
      mallinkService/src/main/resources/contract-word-template/settle.docx

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java 查看文件

@@ -838,7 +838,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
String filepath = fmUploadDir; String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx"; String filename = UUID.randomUUID() + ".docx";
String exportFileName = "结算单.docx"; String exportFileName = "结算单.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,rowsParams);


} }




+ 2
- 5
mallinkService/src/main/java/com/iformall/utils/WordUtil.java 查看文件

@@ -59,7 +59,7 @@ public class WordUtil {


XWPFDocument doc = WordExportUtil.exportWord07(templatePath, params); XWPFDocument doc = WordExportUtil.exportWord07(templatePath, params);
if(!CollectionUtils.isEmpty(rowsParams)) if(!CollectionUtils.isEmpty(rowsParams))
insertValueToTable(doc,rowsParams,1);
insertValueToTable(doc,rowsParams,0);


String tmpPath = temDir + fileName; String tmpPath = temDir + fileName;
FileOutputStream fos = new FileOutputStream(tmpPath); FileOutputStream fos = new FileOutputStream(tmpPath);
@@ -100,16 +100,13 @@ public class WordUtil {
*/ */
public static void insertValueToTable(XWPFDocument xwpfDocument, List<Map<String,String>> params, int tableIndex) throws Exception { public static void insertValueToTable(XWPFDocument xwpfDocument, List<Map<String,String>> params, int tableIndex) throws Exception {
List<XWPFTable> tableList = xwpfDocument.getTables(); List<XWPFTable> tableList = xwpfDocument.getTables();
if(tableList.size()<=tableIndex){
throw new Exception("tableIndex对应的表格不存在");
}
XWPFTable table = tableList.get(tableIndex); XWPFTable table = tableList.get(tableIndex);
List<XWPFTableRow> rows = table.getRows(); List<XWPFTableRow> rows = table.getRows();
if(rows.size()<2){ if(rows.size()<2){
throw new Exception("tableIndex对应表格应该为2行"); throw new Exception("tableIndex对应表格应该为2行");
} }
//模板的那一行 //模板的那一行
XWPFTableRow tmpRow = rows.get(3);
XWPFTableRow tmpRow = rows.get(2);
List<XWPFTableCell> tmpCells = null; List<XWPFTableCell> tmpCells = null;
List<XWPFTableCell> cells = null; List<XWPFTableCell> cells = null;
XWPFTableCell tmpCell = null; XWPFTableCell tmpCell = null;


二進制
mallinkService/src/main/resources/contract-word-template/settle.docx 查看文件


Loading…
取消
儲存