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

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

release_toaliyun_real
luozukai пре 6 година
родитељ
комит
8315f9f712
4 измењених фајлова са 18 додато и 11 уклоњено
  1. +4
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java
  2. +5
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  4. +8
    -4
      mallinkService/src/main/java/com/iformall/utils/WordUtil.java

+ 4
- 1
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java Прегледај датотеку

@@ -8,6 +8,7 @@ import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.BaseEntity; import com.iformall.domain.po.BaseEntity;
import com.iformall.domain.po.WxBillSettle; import com.iformall.domain.po.WxBillSettle;
import com.iformall.domain.po.WxBillSettleRecord; import com.iformall.domain.po.WxBillSettleRecord;
import com.iformall.service.WxBillAllService;
import com.iformall.service.WxBillSettleRecordService; import com.iformall.service.WxBillSettleRecordService;
import com.iformall.service.WxBillSettleService; import com.iformall.service.WxBillSettleService;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -32,6 +33,8 @@ public class WxBillSettleController extends BaseController {
private WxBillSettleService wxBillSettleService; private WxBillSettleService wxBillSettleService;
@Autowired @Autowired
private WxBillSettleRecordService wxBillSettleRecordService; private WxBillSettleRecordService wxBillSettleRecordService;
@Autowired
private WxBillAllService wxBillAllService;


@GetMapping("list") @GetMapping("list")
@ApiOperation("账单管理-结算对冲列表") @ApiOperation("账单管理-结算对冲列表")
@@ -88,6 +91,6 @@ public class WxBillSettleController extends BaseController {
@SystemControllerLog(description = "账单管理-结算单-下载") @SystemControllerLog(description = "账单管理-结算单-下载")
public void downloadSettle(@ModelAttribute WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { public void downloadSettle(@ModelAttribute WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) {
wxBillSettle.setTenantId(getTenantId()); wxBillSettle.setTenantId(getTenantId());
wxBillSettleService.exportBill(request, response, wxBillSettle);
wxBillAllService.exportSettleBill(wxBillSettle,request,response);
} }
} }

+ 5
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Прегледај датотеку

@@ -786,7 +786,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);
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
} }


@Override @Override
@@ -818,14 +818,14 @@ public class WxBillAllServiceImpl implements WxBillAllService {
int size = wxBillSettle.getReceiveBillIds().size() > wxBillSettle.getPayBillIds().size()?wxBillSettle.getReceiveBillIds().size():wxBillSettle.getPayBillIds().size(); int size = wxBillSettle.getReceiveBillIds().size() > wxBillSettle.getPayBillIds().size()?wxBillSettle.getReceiveBillIds().size():wxBillSettle.getPayBillIds().size();
int count = 1; int count = 1;
for (int i = 0; i < size ; i++) { for (int i = 0; i < size ; i++) {
WxBillSettleBill bill = wxBillSettle.getReceiveBillIds().get(i);
WxBillSettleBill bill = i>wxBillSettle.getReceiveBillIds().size()-1?null:wxBillSettle.getReceiveBillIds().get(i);
Map<String,String> map = new HashedMap(); Map<String,String> map = new HashedMap();
if(bill != null){ if(bill != null){
map.put("s1",count+""); map.put("s1",count+"");
map.put("bn1",bill.getBillName()); map.put("bn1",bill.getBillName());
map.put("money1",bill.getReceivePay()); map.put("money1",bill.getReceivePay());
} }
WxBillSettleBill payBill = wxBillSettle.getPayBillIds().get(i);
WxBillSettleBill payBill = i>wxBillSettle.getPayBillIds().size()-1?null:wxBillSettle.getPayBillIds().get(i);
if(payBill != null){ if(payBill != null){
map.put("bn2",payBill.getBillName()); map.put("bn2",payBill.getBillName());
map.put("money2",payBill.getReceivePay()); map.put("money2",payBill.getReceivePay());
@@ -837,8 +837,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
String templatePath = "contract-word-template/settle.docx"; String templatePath = "contract-word-template/settle.docx";
String filepath = fmUploadDir; String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx"; String filename = UUID.randomUUID() + ".docx";
String exportFileName = "催缴单.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response);
String exportFileName = "结算单.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);


} }




+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Прегледај датотеку

@@ -1612,7 +1612,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
String filepath = fmUploadDir; String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx"; String filename = UUID.randomUUID() + ".docx";
String exportFileName = result.get("merchantName").toString() + "合同.docx"; String exportFileName = result.get("merchantName").toString() + "合同.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response);
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
} }


@Override @Override


+ 8
- 4
mallinkService/src/main/java/com/iformall/utils/WordUtil.java Прегледај датотеку

@@ -8,6 +8,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -35,7 +36,7 @@ public class WordUtil {
* @param request HttpServletRequest * @param request HttpServletRequest
* @param response HttpServletResponse * @param response HttpServletResponse
*/ */
public static void exportWord(String templatePath, String temDir, String fileName, String exportFileName, Map<String, Object> params, HttpServletRequest request, HttpServletResponse response) {
public static void exportWord(String templatePath, String temDir, String fileName, String exportFileName, Map<String, Object> params, HttpServletRequest request, HttpServletResponse response,List<Map<String,String>> rowsParams) {
Assert.notNull(templatePath, "模板路径不能为空"); Assert.notNull(templatePath, "模板路径不能为空");
Assert.notNull(temDir, "临时文件路径不能为空"); Assert.notNull(temDir, "临时文件路径不能为空");
Assert.notNull(exportFileName, "导出文件名不能为空"); Assert.notNull(exportFileName, "导出文件名不能为空");
@@ -57,6 +58,9 @@ public class WordUtil {




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

String tmpPath = temDir + fileName; String tmpPath = temDir + fileName;
FileOutputStream fos = new FileOutputStream(tmpPath); FileOutputStream fos = new FileOutputStream(tmpPath);
doc.write(fos); doc.write(fos);
@@ -94,7 +98,7 @@ public class WordUtil {
* @param tableIndex * @param tableIndex
* @throws Exception * @throws Exception
*/ */
private 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){ if(tableList.size()<=tableIndex){
throw new Exception("tableIndex对应的表格不存在"); throw new Exception("tableIndex对应的表格不存在");
@@ -105,7 +109,7 @@ public class WordUtil {
throw new Exception("tableIndex对应表格应该为2行"); throw new Exception("tableIndex对应表格应该为2行");
} }
//模板的那一行 //模板的那一行
XWPFTableRow tmpRow = rows.get(1);
XWPFTableRow tmpRow = rows.get(3);
List<XWPFTableCell> tmpCells = null; List<XWPFTableCell> tmpCells = null;
List<XWPFTableCell> cells = null; List<XWPFTableCell> cells = null;
XWPFTableCell tmpCell = null; XWPFTableCell tmpCell = null;
@@ -147,7 +151,7 @@ public class WordUtil {
* @param text * @param text
* @throws Exception * @throws Exception
*/ */
private void setCellText(XWPFTableCell tmpCell, XWPFTableCell cell,String text) throws Exception {
public static void setCellText(XWPFTableCell tmpCell, XWPFTableCell cell,String text) throws Exception {
CTTc cttc2 = tmpCell.getCTTc(); CTTc cttc2 = tmpCell.getCTTc();
CTTcPr ctPr2 = cttc2.getTcPr(); CTTcPr ctPr2 = cttc2.getTcPr();
CTTc cttc = cell.getCTTc(); CTTc cttc = cell.getCTTc();


Loading…
Откажи
Сачувај