ソースを参照

国贸模板修改

tntdc 2 年 前
コミット
52cc391933

+ 34 - 8
adm/src/main/java/com/minpay/guomao/templateexport/action/TemplateExportAction.java

@@ -16,7 +16,6 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.poi.xwpf.usermodel.XWPFTable;
 import org.apache.poi.xwpf.usermodel.XWPFTableCell;
-import org.apache.poi.xwpf.usermodel.XWPFTableRow;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge;
 
 import com.deepoove.poi.NiceXWPFDocument;
@@ -24,9 +23,6 @@ import com.deepoove.poi.XWPFTemplate;
 import com.deepoove.poi.data.MiniTableRenderData;
 import com.deepoove.poi.data.RowRenderData;
 import com.deepoove.poi.data.TextRenderData;
-import com.deepoove.poi.data.style.TableStyle;
-import com.deepoove.poi.policy.DynamicTableRenderPolicy;
-import com.deepoove.poi.policy.MiniTableRenderPolicy;
 import com.minpay.common.bean.User;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.IDownloadService;
@@ -34,8 +30,35 @@ import com.minpay.common.util.ChineseNumber;
 import com.minpay.common.util.CommonUtil;
 import com.minpay.common.util.DateUtil;
 import com.minpay.common.util.ListUtil;
-import com.minpay.db.table.mapper.*;
-import com.minpay.db.table.model.*;
+import com.minpay.db.table.mapper.ApBrandInfMapper;
+import com.minpay.db.table.mapper.ApCompanyAccountMapper;
+import com.minpay.db.table.mapper.ApCompanyContactMapper;
+import com.minpay.db.table.mapper.ApCompanySiteMapper;
+import com.minpay.db.table.mapper.ApContractDetailMapper;
+import com.minpay.db.table.mapper.ApContractInfMapper;
+import com.minpay.db.table.mapper.ApMoreInfMapper;
+import com.minpay.db.table.mapper.ApProductInfMapper;
+import com.minpay.db.table.mapper.ApProductSpecRelMapper;
+import com.minpay.db.table.mapper.ApWarehouseInfMapper;
+import com.minpay.db.table.model.ApBrandInf;
+import com.minpay.db.table.model.ApBrandInfExample;
+import com.minpay.db.table.model.ApCompanyAccount;
+import com.minpay.db.table.model.ApCompanyAccountExample;
+import com.minpay.db.table.model.ApCompanyContact;
+import com.minpay.db.table.model.ApCompanyContactExample;
+import com.minpay.db.table.model.ApCompanySite;
+import com.minpay.db.table.model.ApCompanySiteExample;
+import com.minpay.db.table.model.ApContractDetail;
+import com.minpay.db.table.model.ApContractDetailExample;
+import com.minpay.db.table.model.ApContractInf;
+import com.minpay.db.table.model.ApContractInfExample;
+import com.minpay.db.table.model.ApMoreInf;
+import com.minpay.db.table.model.ApProductInf;
+import com.minpay.db.table.model.ApProductInfExample;
+import com.minpay.db.table.model.ApProductSpecRel;
+import com.minpay.db.table.model.ApProductSpecRelExample;
+import com.minpay.db.table.model.ApWarehouseInf;
+import com.minpay.db.table.model.OwnApWarehouseInfExample;
 import com.minpay.db.table.own.mapper.LongContractMapper;
 import com.minpay.db.table.own.mapper.OrderManageMapper;
 import com.minpay.db.table.own.mapper.WarehouseInventoryMapper;
@@ -436,6 +459,8 @@ public class TemplateExportAction implements IMINAction {
 		        if(!CommonUtil.isYHL(branchId)){
 		        	RowRenderData lastRenderData = RowRenderData.build("合计", "", "", weightAll, CommonUtil.divide(amtAll, weightAll, 2), amtAll);
 			        datas.add(lastRenderData);
+			        RowRenderData lastRenderData2 = RowRenderData.build("合计人民币金额(大写):"+chineseNb+" ,税率 13%,不含税总金额:"+CommonUtil.divide(amtAll, "1.13", 2)+"元。", "", "", "", "", "");
+			        datas.add(lastRenderData2);
 		        }
 		        MiniTableRenderData table = new MiniTableRenderData(header, datas);
 		        put("table", table);// 产品表格信息
@@ -470,8 +495,9 @@ public class TemplateExportAction implements IMINAction {
 		// 合并合计单元格
 		if(!CommonUtil.isYHL(branchId)) {
 			NiceXWPFDocument xwpfDocument = template.getXWPFDocument();
-			XWPFTable table = xwpfDocument.getTableArray(0);
-			mergeCellsHorizontal(table, table.getRows().size() - 1, 0, 2);
+			XWPFTable table = xwpfDocument.getTableArray(1);
+			mergeCellsHorizontal(table, table.getRows().size() - 2, 0, 2);
+			mergeCellsHorizontal(table, table.getRows().size() - 1, 0, 5);
 		}
 		
 		response.setContentType("multipart/form-data");