Przeglądaj źródła

销售发票/采购询价单/发货通知单导出调整

fenghaifu 1 miesiąc temu
rodzic
commit
76900c0b81

+ 7 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -847,6 +847,13 @@ public class DateUtils extends PropertyEditorSupport {
         return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR);
     }
 
+    public static Date dateAdd(Date srcDate, int part, int diff){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(srcDate);
+        calendar.add(part, diff);
+        return calendar.getTime();
+    }
+
 
     public static void main(String[] args) {
         System.out.println(nowYear());

+ 2 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurInquiryFormController.java

@@ -764,6 +764,7 @@ public class PurInquiryFormController {
                         purInquiryForm.setInquirySuppiler(classEnt.getName());
                         purInquiryForm.setContacts(classEnt.getContacts());
                         purInquiryForm.setPhone(classEnt.getPhone());
+                        purInquiryForm.setAddress(classEnt.getAddress());
                         purInquiryForm.setEmail(classEnt.getEmail());
                     }
                 }
@@ -818,7 +819,7 @@ public class PurInquiryFormController {
                 productList.forEach(p->noteList.add(p.getNotes()));
 
                 ExcelExportUtils.excelInsertRowNotes(getOutputStream(purInquiryForm.getBillCode()+".xlsx", response),
-                        tempFilePath, 14, noteList, 1, 3);
+                        tempFilePath, 16, noteList, 2, 4);
 
 
             } catch (Exception ex) {

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryForm.java

@@ -194,4 +194,6 @@ public class PurInquiryForm implements Serializable {
     private String unit;
     @TableField(exist = false)
     private String contactsNo;
+    @TableField(exist = false)
+    private String address;
 }

+ 186 - 9
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleDeliveryController.java

@@ -7,12 +7,8 @@ import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -29,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.aspect.annotation.PermissionData;
 import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.DateUtils;
+import org.jeecg.common.util.UUIDGenerator;
 import org.jeecg.modules.baseCode.entity.*;
 import org.jeecg.modules.baseCode.service.*;
 import org.jeecg.modules.cuspCode.entity.CuspCustomerProfile;
@@ -41,6 +38,7 @@ import org.jeecg.modules.storeCode.service.IStoreSaleOutService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysDictService;
 import org.jeecg.modules.system.service.ISysUserService;
+import org.jeecg.modules.utils.ExcelExportUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -632,16 +630,25 @@ public class SaleDeliveryController {
         exportByDeliver("随货发票", saleDelivery.getId(), response);
     }
 
+    /**
+     * 导出签单
+     *
+     */
+    @RequestMapping(value = "/exportSignBillXls")
+    public void exportSignBillXls(HttpServletResponse response, SaleDelivery saleDelivery) throws Exception {
+        exportByDeliver("签单", saleDelivery.getId(), response);
+    }
+
     /**
      * 导出唛头
      *
      */
     @RequestMapping(value = "/exportShippingBillXls")
-    public void exportShippingBillXls(HttpServletResponse response, SaleDelivery saleDelivery) throws Exception {
-        exportByDeliver("唛头", saleDelivery.getId(), response);
-    }
+    public void exportShippingBillXls(HttpServletResponse response, SaleDelivery saleDelivery1) throws Exception {
+
+        String templateName = "唛头";
+        String id=saleDelivery1.getId();
 
-    private void exportByDeliver(String templateName, String id, HttpServletResponse response){
         BaseTemplates templates = baseTemplatesService.getByTemplateType(templateName);
         SaleDelivery saleDelivery = saleDeliveryService.getById(id);
         List<SaleDeliveryDetails> deliveryDetailsList = saleDeliveryDetailsService.selectByMainId(id);
@@ -696,6 +703,8 @@ public class SaleDeliveryController {
                     SaleOrder saleOrder = saleOrderService.getOne(orderLambdaQueryWrapper);
                     if (saleOrder != null){
                         saleDelivery.setPaymentTerms(saleOrder.getPaymentTerms());
+                        saleDelivery.setOrderNumber(saleOrder.getCustomerOrder());
+                        saleDelivery.setAgreementTerms(saleOrder.getAgreementTerms());
                     }
                 }
                 // 查询数据字典
@@ -787,6 +796,174 @@ public class SaleDeliveryController {
         }
     }
 
+    private void exportByDeliver(String templateName, String id, HttpServletResponse response){
+        BaseTemplates templates = baseTemplatesService.getByTemplateType(templateName);
+        SaleDelivery saleDelivery = saleDeliveryService.getById(id);
+        List<SaleDeliveryDetails> deliveryDetailsList = saleDeliveryDetailsService.selectByMainId(id);
+        List<SaleDeliveryShip> deliveryShipList = saleDeliveryShipService.selectByMainId(id);
+
+
+        if (templates != null) {
+            try {
+
+                String productionClass = saleDelivery.getProductionClass();
+                if (StringUtils.isNotBlank(productionClass)) {
+
+                    BaseProductClass classEnt = baseProductClassService.getById(productionClass);
+                    if (classEnt != null) {
+                        saleDelivery.setProductionClass(classEnt.getName());
+                    }
+                }
+                String getQuotationCustomer = saleDelivery.getCustomer();
+                if (StringUtils.isNotBlank(getQuotationCustomer)) {
+
+                    CuspCustomerProfile classEnt = cuspCustomerProfileService.getById(getQuotationCustomer);
+                    if (classEnt != null) {
+                        saleDelivery.setCustomerAddress(classEnt.getRegisterAddress());
+                        saleDelivery.setContacts(classEnt.getContacts());
+                        saleDelivery.setPhone(classEnt.getPhone());
+                        saleDelivery.setEmail(classEnt.getEmail());
+                    }
+                }
+                // 获取计产品档案
+                List<BaseProductArchive> productArchiveList = new ArrayList<>();
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                    LambdaQueryWrapper<BaseProductArchive> productWrapper = new LambdaQueryWrapper<>();
+                    productWrapper.in(BaseProductArchive::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getProductId).collect(Collectors.toList()));
+                    productArchiveList = baseProductArchiveService.list(productWrapper);
+                }
+                // 获取销售订单行
+                List<SaleOrderProduct> saleOrderProductList = new ArrayList<>();
+                if (oConvertUtils.listIsNotEmpty(deliveryDetailsList)){
+                    LambdaQueryWrapper<SaleOrderProduct> productWrapper = new LambdaQueryWrapper<>();
+                    productWrapper.in(SaleOrderProduct::getId, deliveryDetailsList.stream().map(SaleDeliveryDetails::getSourceId).collect(Collectors.toList()));
+                    saleOrderProductList = saleOrderProductService.list(productWrapper);
+                }
+                // 获取销售订单
+                if (oConvertUtils.isNotEmpty(saleDelivery.getSourceCode())){
+                    LambdaQueryWrapper<SaleOrder> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    orderLambdaQueryWrapper.eq(SaleOrder::getBillCode, saleDelivery.getSourceCode());
+                    SaleOrder saleOrder = saleOrderService.getOne(orderLambdaQueryWrapper);
+                    if (saleOrder != null){
+                        saleDelivery.setPaymentTerms(saleOrder.getPaymentTerms());
+                        saleDelivery.setOrderNumber(saleOrder.getCustomerOrder());
+                        saleDelivery.setAgreementTerms(saleOrder.getAgreementTerms());
+                    }
+                }
+                // 查询数据字典
+                String currencyText = sysDictService.queryDictTextByKey("currency", saleDelivery.getCurrency());
+                saleDelivery.setCurrencyText(currencyText);
+                String paymentTermsText = sysDictService.queryDictTextByKey("customer_payment_terms", saleDelivery.getPaymentTerms());
+                saleDelivery.setPaymentTermsText(paymentTermsText);
+                List<DictModel> unitDictList = sysDictService.queryDictItemsByCode("measurement_unit");
+
+                // 产品设置
+                int rowNum = 1;
+                BigDecimal deliverMoney = BigDecimal.ZERO;
+                for(SaleDeliveryDetails o:deliveryDetailsList){
+                    BigDecimal amount = o.getMoney() == null ? BigDecimal.ZERO: o.getMoney();
+                    deliverMoney = deliverMoney.add(amount);
+                    o.setRowNumber(rowNum++);
+                    if (o.getDeliveryTime() != null){
+                        o.setDeliverDateText(DateUtils.date2Str(o.getDeliveryTime(), DateUtils.date_sdf.get()));
+                    }
+
+                    BaseProductArchive findProduct = productArchiveList.stream().filter(e->e.getId().equals(o.getProductId())).findFirst().orElse(null);
+                    if (findProduct != null){
+                        o.setUnit(findProduct.getMeasurementUnit());
+                        if (findProduct.getMeasurementUnit() != null){
+                            DictModel findDict = unitDictList.stream().filter(d->d.getValue().equals(findProduct.getMeasurementUnit())).findFirst().orElse(null);
+                            if (findDict != null){
+                                o.setUnit(findDict.getText());
+                            }
+                        }
+                    }
+                    SaleOrderProduct saleOrderProduct = saleOrderProductList.stream().filter(e->e.getId().equals(o.getSourceId())).findFirst().orElse(null);
+                    if (saleOrderProduct != null){
+                        if (oConvertUtils.isNotEmpty(saleOrderProduct.getDiscount()) && saleOrderProduct.getDiscount().intValue() != 0){
+                            o.setDiscountText(saleOrderProduct.getDiscount().intValue()+"%");
+                        }
+                    }
+                }
+                deliverMoney = deliverMoney.setScale(2);
+                saleDelivery.setDeliveryMoney(deliverMoney);
+
+                String shipname = "";
+                String imo = "";
+
+                if(oConvertUtils.listIsNotEmpty(deliveryShipList)){
+
+                    shipname = deliveryShipList.stream().map(SaleDeliveryShip::getShipName).distinct().collect(Collectors.joining());
+
+                    LambdaQueryWrapper<BaseShipArchive> shipArchiveLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    shipArchiveLambdaQueryWrapper.in(BaseShipArchive::getId,deliveryShipList.stream().map(SaleDeliveryShip::getShipId).collect(Collectors.joining()));
+                    List<BaseShipArchive> baseShipArchiveList = baseShipArchiveService.list(shipArchiveLambdaQueryWrapper);
+
+                    if(oConvertUtils.listIsNotEmpty(baseShipArchiveList)){
+                        imo = baseShipArchiveList.stream().map(BaseShipArchive::getImo).distinct().collect(Collectors.joining());
+                    }
+                }
+                saleDelivery.setShipName(shipname);
+                saleDelivery.setImo(imo);
+                // 项目名称
+                if (saleDelivery.getProject() != null){
+                    BaseProjectArchive projectArchive = baseProjectArchiveService.getById(saleDelivery.getProject());
+                    if (projectArchive != null){
+                        saleDelivery.setContactsNo(projectArchive.getName());
+                    }
+
+                }
+
+                if(deliveryDetailsList.size() > 0){
+
+                    saleDelivery.setQualityGrade(deliveryDetailsList.get(0).getQualityGrade());
+                }
+                //
+                saleDelivery.setBillDateText(DateUtils.date2Str(saleDelivery.getDeliveryDate(), DateUtils.date_sdf.get()));
+
+                // 账期
+                saleDelivery.setDueDateText(saleDelivery.getBillDateText());
+                if (oConvertUtils.isNotEmpty(paymentTermsText)){
+                    if (paymentTermsText.indexOf(" ")>-1){
+                        String[] split = paymentTermsText.split(" ");
+                        if (oConvertUtils.getInt(split[0], 0)>0) {
+                            saleDelivery.setDueDateText(DateUtils.date2Str(DateUtils.dateAdd(saleDelivery.getDeliveryDate(), Calendar.DATE, Integer.parseInt(split[0])), DateUtils.date_sdf.get()));
+                        }
+                    }
+                }
+                // 制单人信息
+                SysUser sysUser = sysUserService.getUserByName(saleDelivery.getCreateBy());
+                saleDelivery.setSalesPhone(sysUser.getPhone());
+                saleDelivery.setSalesEmail(sysUser.getEmail());
+
+                String templateFilePath = uploadpath + templates.getTemplateFile();
+                String tempFilePath = uploadpath + "/"+ UUIDGenerator.generate()+".xlsx";
+
+                try (ExcelWriter excelWriter = EasyExcel.write(tempFilePath).withTemplate(templateFilePath).build()) {
+                    WriteSheet writeSheet = EasyExcel.writerSheet().build();
+                    FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).forceNewRow(Boolean.TRUE).build();
+                    excelWriter.fill(new FillWrapper(deliveryDetailsList), fillConfig, writeSheet);
+                    excelWriter.fill(saleDelivery, writeSheet);
+                }
+                List<String> noteList = new ArrayList<>();
+                deliveryDetailsList.forEach(p->noteList.add(p.getNotes()));
+
+                int startIndex = 18;
+                if ("随货发票".equals(templateName)){
+                    startIndex = 19;
+                }
+                ExcelExportUtils.excelInsertRowNotes(getOutputStream(saleDelivery.getBillCode()+".xlsx", response),
+                        tempFilePath, startIndex, noteList, 2, 4);
+
+
+
+            } catch (Exception ex) {
+                ex.printStackTrace();
+            }
+
+        }
+    }
+
     /**
      * 这是ExcelUtil.getOutputStream
      * 这里就是将文件下载交给了浏览器

+ 47 - 43
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInvoiceController.java

@@ -9,12 +9,8 @@ import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.time.LocalDate;
 import java.time.temporal.ChronoUnit;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -682,23 +678,24 @@ public class SaleInvoiceController {
     @RequestMapping(value = "/exportBillXls")
     public void exportBillXls(HttpServletResponse response, SaleInvoice saleInvoice1) throws Exception {
         String id = saleInvoice1.getId();
-        BaseTemplates templates = baseTemplatesService.getByTemplateType("销售发票");
+        BaseTemplates templates = null;
+        BaseTemplates templatesN = baseTemplatesService.getByTemplateType("销售发票无折上折");
+        BaseTemplates templatesZ = baseTemplatesService.getByTemplateType("销售发票有折上折");
+
         SaleInvoice saleInvoice = saleInvoiceService.getById(id);
+        SaleDelivery saleDelivery = saleDeliveryService.getByBillCode(saleInvoice.getSourceCode());
+        SaleOrder saleOrder = saleOrderService.getByBillCode(saleDelivery.getSourceCode());
+        if (saleOrder.getDoubleDiscount() == null) {
+            templates = templatesN;
+        } else {
+            templates = templatesZ;
+        }
+        List<SaleOrderProduct> orderProductList = saleOrderProductService.selectByMainId(saleOrder.getId());
         List<SaleInvoiceProduct> productList = saleInvoiceProductService.selectByMainId(id);
         List<SaleInvoiceShip> invoiceShipList = saleInvoiceShipService.selectByMainId(id);
-        String productClass = "";
-        String orderCode = "";
-        String currency = "";
-        if (oConvertUtils.isNotEmpty(saleInvoice.getSourceCode())) {
-            LambdaQueryWrapper<SaleDelivery> deliveryLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            deliveryLambdaQueryWrapper.eq(SaleDelivery::getBillCode, saleInvoice.getSourceCode());
-            SaleDelivery delivery = saleDeliveryService.getOne(deliveryLambdaQueryWrapper);
-            if (delivery != null){
-                productClass = delivery.getProductionClass();
-                orderCode = delivery.getSourceCode();
-                currency = delivery.getCurrency();
-            }
-        }
+        String productClass = saleDelivery.getProductionClass();
+        String orderCode = saleDelivery.getSourceCode();
+        String currency = saleDelivery.getCurrency();
         saleInvoice.setProductionClass(productClass);
         saleInvoice.setCurrency(currency);
 
@@ -714,6 +711,8 @@ public class SaleInvoiceController {
                         saleInvoice.setProductionClass(classEnt.getName());
                     }
                 }
+                saleInvoice.setContacts(saleOrder.getLiaisonInfo());
+                /*
                 String customerId = saleInvoice.getCustomer();
                 if (StringUtils.isNotBlank(customerId)) {
 
@@ -724,7 +723,7 @@ public class SaleInvoiceController {
                         saleInvoice.setPhone(classEnt.getPhone());
                         saleInvoice.setEmail(classEnt.getEmail());
                     }
-                }
+                }*/
                 // 获取计产品档案
                 List<BaseProductArchive> productArchiveList = new ArrayList<>();
                 if (oConvertUtils.listIsNotEmpty(productList)){
@@ -747,16 +746,9 @@ public class SaleInvoiceController {
                     saleOrderProductList = saleOrderProductService.list(productWrapper);
                 }
                 // 获取销售订单
-                if (oConvertUtils.isNotEmpty(orderCode)){
-                    LambdaQueryWrapper<SaleOrder> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                    orderLambdaQueryWrapper.eq(SaleOrder::getBillCode, orderCode);
-                    SaleOrder saleOrder = saleOrderService.getOne(orderLambdaQueryWrapper);
-                    if (saleOrder != null){
-                        saleInvoice.setPaymentTerms(saleOrder.getPaymentTerms());
-                        // 客户订单号
-                        saleInvoice.setContactsNo(saleOrder.getCustomerOrder());
-                    }
-                }
+                saleInvoice.setPaymentTerms(saleOrder.getPaymentTerms());
+                // 客户订单号
+                saleInvoice.setContactsNo(saleOrder.getCustomerOrder());
                 // 查询数据字典
                 String currencyText = sysDictService.queryDictTextByKey("currency", saleInvoice.getCurrency());
                 saleInvoice.setCurrencyText(currencyText);
@@ -795,6 +787,11 @@ public class SaleInvoiceController {
                 }
                 saleInvoice.setInvoiceMoney(invoiceMoney.setScale(2));
 
+                if (oConvertUtils.isNotEmpty(saleOrder.getDoubleDiscount())) {
+                    saleInvoice.setDiscountText(saleOrder.getDoubleDiscount().intValue() + "%");
+                }
+
+
                 String shipname = "";
                 String imo = "";
 
@@ -812,28 +809,35 @@ public class SaleInvoiceController {
                 }
                 saleInvoice.setShipName(shipname);
                 saleInvoice.setImo(imo);
-                // 项目名称
-                /*
-                if (saleInvoice.getProject() != null){
-                    BaseProjectArchive projectArchive = baseProjectArchiveService.getById(saleInvoice.getProject());
-                    if (projectArchive != null){
-                        saleInvoice.setContactsNo(projectArchive.getName());
-                    }
-
-                }*/
 
                 if(productList.size() > 0){
 
                     saleInvoice.setQualityGrade(productList.get(0).getQualityGrade());
                 }
-                //
+                // 账期
                 saleInvoice.setBillDateText(DateUtils.date2Str(saleInvoice.getBillDate(), DateUtils.date_sdf.get()));
-
-
+                saleInvoice.setDueDateText(saleInvoice.getBillDateText());
+                if (oConvertUtils.isNotEmpty(paymentTermsText)){
+                    if (paymentTermsText.indexOf(" ")>-1){
+                        String[] split = paymentTermsText.split(" ");
+                        if (oConvertUtils.getInt(split[0], 0)>0) {
+                            saleInvoice.setDueDateText(DateUtils.date2Str(DateUtils.dateAdd(saleInvoice.getBillDate(), Calendar.DATE, Integer.parseInt(split[0])), DateUtils.date_sdf.get()));
+                        }
+                    }
+                }
+                // 订单金额
+                BigDecimal orderMoney = BigDecimal.ZERO;
+                for (SaleOrderProduct o : orderProductList) {
+                    BigDecimal amount = o.getTaxAmount() == null ? BigDecimal.ZERO : o.getTaxAmount();
+                    orderMoney = orderMoney.add(amount);
+                }
+                saleInvoice.setOrderMoney(orderMoney.setScale(2));
+                saleInvoice.setAgreementTerms(saleOrder.getAgreementTerms());
                 // 制单人信息
                 SysUser sysUser = sysUserService.getUserByName(saleInvoice.getCreateBy());
                 saleInvoice.setSalesPhone(sysUser.getPhone());
                 saleInvoice.setSalesEmail(sysUser.getEmail());
+                saleInvoice.setSalesmanName(sysUser.getRealname());
 
                 String templateFilePath = uploadpath + templates.getTemplateFile();
                 String tempFilePath = uploadpath + "/"+ UUIDGenerator.generate()+".xlsx";
@@ -848,7 +852,7 @@ public class SaleInvoiceController {
                 productList.forEach(p->noteList.add(p.getNotes()));
 
                 ExcelExportUtils.excelInsertRowNotes(getOutputStream(saleInvoice.getInvoiceCode()+".xlsx", response),
-                        tempFilePath, 17, noteList, 1, 3);
+                        tempFilePath, 20, noteList, 2, 4);
 
 
 

+ 8 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleDelivery.java

@@ -234,4 +234,12 @@ public class SaleDelivery implements Serializable {
     private String currencyText;
     @TableField(exist = false)
     private String paymentTermsText;
+    @TableField(exist = false)
+    private String orderNumber;
+    @TableField(exist = false)
+    private String agreementTerms;
+    @TableField(exist = false)
+    private String dueDateText;
+    @TableField(exist = false)
+    private String customerAddress;
 }

+ 10 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInvoice.java

@@ -215,4 +215,14 @@ public class SaleInvoice implements Serializable {
     private String productionClass;
     @TableField(exist = false)
     private String currency;
+    @TableField(exist = false)
+    private String dueDateText;
+    @TableField(exist = false)
+    private String discountText;
+    @TableField(exist = false)
+    private BigDecimal orderMoney;
+    @TableField(exist = false)
+    private String salesmanName;
+    @TableField(exist = false)
+    private String agreementTerms;
 }

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/utils/ExcelExportUtils.java

@@ -45,7 +45,7 @@ public class ExcelExportUtils {
                     insertedRow++;
                     sheet.shiftRows(rowIndex, sheet.getLastRowNum(), 1, true, true);
                     Row newRow = sheet.createRow(rowIndex); // 备注行
-                    Cell remarkCell = newRow.createCell(1); // 备注从第一列开始
+                    Cell remarkCell = newRow.createCell(mergeStartColumn); // 备注从第一列开始
                     remarkCell.setCellValue(notes);
                     CellRangeAddress mergedRegion = new CellRangeAddress(rowIndex, rowIndex, mergeStartColumn, mergeEndColumn); // 合并从第一行第一列到第一行第三列的单元格