瀏覽代碼

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 年之前
父節點
當前提交
f32bf89bfe

+ 6 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/DefaultConfig.java

@@ -77,4 +77,10 @@ public class DefaultConfig extends BaseEntity {
 	 * 所属 模式
 	 */
 	private int indexModel;
+
+	/**
+	 * app 是否跳过引导页
+	 */
+	private int appCheck;
+
 }

+ 9 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/DefaultConfigController.java

@@ -62,10 +62,11 @@ public class DefaultConfigController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入defaultConfig")
 	public R<DefaultConfig> detail(DefaultConfig defaultConfig, BladeUser user) {
-		defaultConfig.setCreateUser(user.getUserId());
-		defaultConfig.setClientId(user.getClientId());
-		DefaultConfig detail = defaultConfigService.getOne(Condition.getQueryWrapper(defaultConfig));
-		return R.data(detail);
+		DefaultConfig oldConfig = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery()
+				.eq(DefaultConfig::getCreateUser, user.getUserId())
+				.eq(DefaultConfig::getClientId, user.getClientId()));
+
+		return R.data(oldConfig);
 	}
 
 	/**
@@ -144,6 +145,7 @@ public class DefaultConfigController extends BladeController {
         DefaultConfig oldConfig = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery()
 				.eq(DefaultConfig::getCreateUser, bladeUser.getUserId())
 				.eq(DefaultConfig::getClientId, bladeUser.getClientId()));
+
         if (oldConfig != null) {
             //修改
             if (StringUtils.isNotEmpty(newConfig.getColor())) {
@@ -161,6 +163,9 @@ public class DefaultConfigController extends BladeController {
             if (StringUtils.isNotEmpty(newConfig.getFullScreen())) {
                 oldConfig.setFullScreen(newConfig.getFullScreen());
             }
+			if (StringUtils.isNotEmpty(newConfig.getAppCheck()+"")) {
+				oldConfig.setAppCheck(newConfig.getAppCheck());
+			}
             oldConfig.setOpinionView(newConfig.getOpinionView());
             return R.data(this.defaultConfigService.updateById(oldConfig));
         }
@@ -169,7 +174,6 @@ public class DefaultConfigController extends BladeController {
         newConfig.setCreateUser(AuthUtil.getUserId());
         newConfig.setCreateTime(new Date());
         newConfig.setClientId(bladeUser.getClientId());
-
         return R.status(defaultConfigService.save(newConfig));
     }
 }

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -180,7 +180,8 @@ public class TaskController extends BladeController {
         R<SmsResponse> result = this.newSmsClient.sendMessage("test_code", JsonUtil.toJson(params), phone);
         if (result.getData().isSuccess()) {
             //记录当前验证码
-            DefaultConfig config = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery().eq(DefaultConfig::getCreateUser, AuthUtil.getUserId()));
+            DefaultConfig config = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery().eq(DefaultConfig::getCreateUser, AuthUtil.getUserId())
+                    .isNotNull(DefaultConfig::getSmsCode));
             if (config != null) {
                 //修改
                 config.setSmsCode(code);

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/DefaultConfigMapper.xml

@@ -22,6 +22,7 @@
         <result column="full_screen" property="fullScreen"/>
         <result column="client_id" property="clientId"/>
         <result column="index_model" property="indexModel"/>
+        <result column="app_check" property="appCheck"/>
     </resultMap>
 
 

+ 13 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -999,7 +999,19 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     String querySql = "select "+tabBusstimeInfo.getColKey()+" from "+tabBusstimeInfo.getTabEnName()+" where p_key_id="+idMap.get(tabBusstimeInfo.getTabEnName());
                     Map<String, Object> maps = jdbcTemplate.queryForMap(querySql);
                     if(maps!=null){
-                        dateInfo = maps.get(tabBusstimeInfo.getColKey())+"";
+                      String  keyData = maps.get(tabBusstimeInfo.getColKey())+"";
+                        if(StringUtils.isNotEmpty(keyData)){
+                            dateInfo = keyData.split("_\\^_")[0];
+                            if(dateInfo.indexOf("年")>=0){
+                                dateInfo = dateInfo.replace("年","-");
+                            }
+                            if(dateInfo.indexOf("月")>=0){
+                                dateInfo = dateInfo.replace("月","-");
+                            }
+                            if(dateInfo.indexOf("日")>=0){
+                                dateInfo = dateInfo.replace("日","");
+                            }
+                        }
                     }
                 }
                 System.out.println("----- 电签成功--------==修改---="+dateInfo);

+ 4 - 106
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -293,112 +293,17 @@ public class ExcelTabController extends BladeController {
 
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + filecode + ".html";
-        String thmlUrl2 = file_path + filecode + "123.html";
         String exceUrl = file_path + filecode + "123.xlsx";
-
-        // 解析原始excel
-        Workbook wb = new Workbook();
-        wb.loadFromMHtml(file.getInputStream());
-
-        // 操作
-        Workbook wb2 = new Workbook();
-        wb2.loadFromMHtml(file.getInputStream());
-        Worksheet sheet2 = wb2.getWorksheets().get(0);
-
-        HTMLOptions options = new HTMLOptions();
-        options.setImageEmbedded(true);
-        //获取工作表
-        Worksheet sheet = wb.getWorksheets().get(0);
-        sheet.saveToHtml(thmlUrl, options);
-
-        CellRange[] mergedCells = sheet.getMergedCells();
-        CellRange[] mergedCells3 = sheet2.getMergedCells();
-        Map<String, Map<String, Integer>> xyList = new HashMap<>();
-        int j = 0;
-        for (int i = 0; i < mergedCells.length; i++) {
-            Map<String, Integer> dataMap = new HashMap<>();
-            CellRange mergedCell = mergedCells[i];
-            j = j + 1;
-            mergedCells3[i].getComment().getRichText().setText(j + "");
-            mergedCell.setValue(j + "");
-            dataMap.put("x1", mergedCell.getRow());
-            dataMap.put("x2", mergedCell.getLastRow());
-            dataMap.put("y1", mergedCell.getColumn());
-            dataMap.put("y2", mergedCell.getLastColumn());
-            xyList.put(j + "", dataMap);
-        }
-
-        CellRange[] mergedCells2 = sheet.getCells();
-        CellRange[] mergedCells4 = sheet2.getCells();
-        for (int i = 0; i < mergedCells2.length; i++) {
-            CellRange mergedCell = mergedCells2[i];
-            String data = mergedCell.getComment().getRichText().getText();
-            if (StringUtils.isEmpty(data)) {
-                j = j + 1;
-                mergedCells4[i].getComment().getRichText().setText(j + "");
-                mergedCell.setValue(j + "");
-                Map<String, Integer> dataMap = new HashMap<>();
-                dataMap.put("x1", mergedCell.getRow());
-                dataMap.put("x2", mergedCell.getLastRow());
-                dataMap.put("y1", mergedCell.getColumn());
-                dataMap.put("y2", mergedCell.getLastColumn());
-                xyList.put(j + "", dataMap);
-            }
-        }
-        sheet.saveToHtml(thmlUrl2, options);
-
-        // 组装坐标
-        File html1 = new File(thmlUrl);  // 原始html
-        File html2 = new File(thmlUrl2); // 坐标html
-        InputStream inputStream1 = new FileInputStream(html1);
-        InputStream inputStream2 = new FileInputStream(html2);
-        String htmlString1 = IoUtil.readToString(inputStream1);
-        String htmlString2 = IoUtil.readToString(inputStream2);
-
-        Document doc1 = Jsoup.parse(htmlString1);
-        Element table1 = doc1.select("table").first();
-        Elements trs1 = table1.select("tr");
-        Document doc2 = Jsoup.parse(htmlString2);
-        Element table2 = doc2.select("table").first();
-        Elements trs2 = table2.select("tr");
-
-        for (int i = 0; i < trs1.size(); i++) {
-            Elements td1 = trs1.get(i).select("td");
-            Elements td2 = trs2.get(i).select("td");
-            for (int x = 0; x < td1.size(); x++) {
-                Element cell1 = td1.get(x);
-                Element cell2 = td2.get(x);
-                String html = cell2.html();
-                if (html.indexOf("div") >= 0) {
-                    html = cell2.children().get(0).html();
-                }
-                Map<String, Integer> xyMap = xyList.get(html);
-                if (xyMap != null) {
-                    cell1.attr("x1", xyMap.get("x1") + "");
-                    cell1.attr("x2", xyMap.get("x2") + "");
-                    cell1.attr("y1", xyMap.get("y1") + "");
-                    cell1.attr("y2", xyMap.get("y2") + "");
-                }
-            }
-        }
-
+        FileUtils.excelInfo(file.getInputStream(),exceUrl,thmlUrl,"1");
         // 上传excel文件
-        wb2.saveToFile(exceUrl,FileFormat.Version2013);
-
         BladeFile bladeFile = newIOSSClient.uploadFile(file.getOriginalFilename(),exceUrl);
-
-        File writeFile = new File(thmlUrl);
-        FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
-
+      //  R<BladeFile> bladeFile = iossClient.addFileInfo(file);
+      //  BladeFile bladeFile1 = bladeFile.getData();
         detail.setExtension(file.getOriginalFilename());
         detail.setFileUrl(bladeFile.getLink());
         detail.setFileType(3); // 表示为清表信息  1 表示祖节点  2 表示为节点信息 3 表示清表
         detail.setHtmlUrl(thmlUrl);
         excelTabService.saveOrUpdate(detail);
-
-        if (html2.exists()) {
-            html2.delete();
-        }
         // 解析html
         expailHtmlInfo(thmlUrl, detail.getId());
         return R.success("上传成功");
@@ -563,11 +468,9 @@ public class ExcelTabController extends BladeController {
         // 复制模版htmlURL
 
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
-//        File file_in = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1605183410156863488.html");
 
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + "/privateUrl/" + filecode + ".html";
-//        String thmlUrl = "C:\\Users\\泓创研发01\\Desktop\\privateUrl\\out\\acc.html";
         File file_out = ResourceUtil.getFile(thmlUrl);
         FileUtil.copy(file_in, file_out);
         updateWrapper.set("html_url", thmlUrl);
@@ -657,9 +560,7 @@ public class ExcelTabController extends BladeController {
                         element.children().get(0).attr("placeholder", lastName)
                                 .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo)
                                 .attr("@blur", "getRegularExpression(" + regularExpression + ",'" + filedLength + "')")
-                                .attr("maxlength", filedLength)
-                                .attr("class", "warnstyle");
-
+                                .attr("maxlength", filedLength);
                     }
                     element.attr("@click", "getInformation(" + oncklickText + ")");
                 }
@@ -2181,10 +2082,8 @@ public class ExcelTabController extends BladeController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-
         //更新缓存
         informationQueryClient.delAsyncWbsTree(contractId);
-
         return R.data("操作成功");
     }
 
@@ -3516,7 +3415,6 @@ public class ExcelTabController extends BladeController {
         InputStream fileInputStream = null;
         if (file1.exists()) {
             fileInputStream = new FileInputStream(file1);
-            ;
         } else {
             String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
             fileInputStream = CommonUtil.getOSSInputStream(path);

+ 13 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -14,6 +14,7 @@ import com.mixsmart.utils.FormulaUtils;
 import com.mixsmart.utils.ListUtils;
 import com.mixsmart.utils.RegexUtils;
 import com.spire.xls.FileFormat;
+import com.spire.xls.Worksheet;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
@@ -614,24 +615,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 }
                 //获取数据库信息
                 ExcelTab excelTab = baseMapper.selectById(Long.parseLong(tabId));
-                //上传新文件到文件服务器
-                byte[] officeByte = IoUtil.readToByteArray(inputStream);
 
-                FileOutputStream fs = new FileOutputStream(dataUrl);
-                fs.write(officeByte);
-                fs.flush();
+                //上传新文件到文件服务器
+                //excel修改 同步修改html 对象
+                String thmlUrl = file_path + filecode + ".html";
+                FileUtils.excelInfo(inputStream,dataUrl,thmlUrl,"2");
                 BladeFile bladeFile = newIOSSClient.uploadFile(excelTab.getExtension(), dataUrl);
                 //获取文件大小
-                int size = connection.getContentLength() / 1024 / 1024; //单位M
+               int size = connection.getContentLength() / 1024 / 1024; //单位M
                 excelTab.setAttachSize(Long.parseLong(size + ""));
                 excelTab.setStatus(3);
                 excelTab.setFileUrl(bladeFile.getLink());
+                excelTab.setHtmlUrl(thmlUrl);
                 baseMapper.updateById(excelTab);
-                File file = new File(dataUrl);
-               /* if (file.exists()) {
-                    file.delete();
-                }*/
-                System.out.println("123456");
+
+                File file2 = new File(dataUrl);
+                if (file2.exists()) {
+                    file2.delete();
+                }
+                inputStream.close();
             } catch (Exception e) {
                 editCallback.setError(1);
                 e.printStackTrace();

+ 9 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FTPUtils.java

@@ -2,6 +2,8 @@ package org.springblade.manager.utils;
 
 import org.apache.commons.net.ftp.FTPClient;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -35,20 +37,22 @@ public class FTPUtils {
     }
 
     //文件覆盖上传
-/*    public static void main(String[] args) throws Exception {
+    public static void main1(String[] args) throws Exception {
 
-        InputStream input = FileUtils.getInputStreamByUrl("http://192.168.0.109:6371/1534807810770993152.html");
+       // InputStream input = FileUtils.getInputStreamByUrl("http://192.168.0.109:6371/1534807810770993152.html");
+        String dataUrl = "/Users/hongchuangyanfa/Desktop/预览图_千图网_编号357539942.jpg";
+        InputStream input = new FileInputStream(new File(dataUrl));
 
         FTPUtils ftpUtils = new FTPUtils();
         try {
             FTPClient ftp = ftpUtils.getFTPClinet();
             // 获取本地文件并上传
 
-            ftp.changeWorkingDirectory("/Desktop/");//跳转目录
+            ftp.changeWorkingDirectory("/localArchive/");//跳转目录
             ftp.setFileType(FTPClient.BINARY_FILE_TYPE);//必须要设置以二进制的方式传输文件
             ftp.enterLocalPassiveMode();//被动模式
 
-            if (!ftp.storeFile("1534807810770993152.html", input)) {
+            if (!ftp.storeFile("1534807810770993152.jpg", input)) {
                 System.out.println("失败,服务器返回:" + ftp.getReplyString());//获取上传失败的原因
             } else {
                 System.out.println("文件:1534807810770993152.html 上传成功");
@@ -58,6 +62,6 @@ public class FTPUtils {
         } catch (IOException e) {
             System.out.println("ftp连接失败");
         }
-    }*/
+    }
 
 }

+ 197 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -1,11 +1,16 @@
 package org.springblade.manager.utils;
 
+import com.aliyun.oss.common.utils.DateUtil;
 import com.aspose.cells.SaveFormat;
 import com.aspose.cells.Workbook;
 import com.itextpdf.text.Document;
 import com.itextpdf.text.pdf.PdfCopy;
 import com.itextpdf.text.pdf.PdfReader;
 import com.spire.xls.*;
+import com.spire.xls.CellRange;
+import com.spire.xls.collections.CommentsCollection;
+import com.spire.xls.core.INamedRange;
+import com.spire.xls.core.spreadsheet.HTMLOptions;
 import com.sun.image.codec.jpeg.JPEGCodec;
 import com.sun.image.codec.jpeg.JPEGImageEncoder;
 import org.apache.commons.lang.StringUtils;
@@ -29,9 +34,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.utils.SystemUtils;
 import org.springblade.common.vo.DataVO;
 import org.springblade.core.tool.api.ResultCode;
-import org.springblade.core.tool.utils.FileUtil;
-import org.springblade.core.tool.utils.IoUtil;
-import org.springblade.core.tool.utils.ResourceUtil;
+import org.springblade.core.tool.utils.*;
 import org.springblade.system.cache.ParamCache;
 
 import javax.imageio.ImageIO;
@@ -40,6 +43,8 @@ import java.awt.image.BufferedImage;
 import java.io.*;
 import java.net.URL;
 import java.net.URLEncoder;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.zip.ZipEntry;
@@ -305,12 +310,6 @@ public class FileUtils {
         }
     }
 
-    public static void main11(String[] args) {
-        String excelPath="/Users/hongchuangyanfa/Downloads/A11 施工放样报验单 (1).xlsx";
-        String pdfPath="/Users/hongchuangyanfa/Downloads/A11 施工放样报验单 (1).pdf";
-
-        FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
-    }
 
     /**
      * excel设置 打印缩放比例
@@ -347,7 +346,7 @@ public class FileUtils {
                 sheet.setHorizontallyCenter(true);//设置打印页面为水平居中
                 sheet.setVerticallyCenter(true);
                 sheet.setAutobreaks(true);
-               // printSetup.setLandscape(false);
+                // printSetup.setLandscape(false);
                 sheet.setMargin(XSSFSheet.BottomMargin, (double) 0.1);// 页边距(下)
                 sheet.setMargin(XSSFSheet.LeftMargin, (double) 0.7);// 页边距(左)
                 sheet.setMargin(XSSFSheet.RightMargin, (double) 0.7);// 页边距(右)
@@ -355,9 +354,9 @@ public class FileUtils {
                 printSetup.setScale((short) 100);//自定义缩放①,此处100为无缩放
                 System.out.print(sheet.getAutobreaks());
                 printSetup.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
-              //  printSetup.setFitHeight((short) 1);//设置高度为自动分页
-               // printSetup.setFitWidth((short) 1);//设置宽度为一页
-               // sheet.setFitToPage(true);
+                //  printSetup.setFitHeight((short) 1);//设置高度为自动分页
+                // printSetup.setFitWidth((short) 1);//设置宽度为一页
+                // sheet.setFitToPage(true);
             }
             // Excel文件生成后存储的位置。
             outReport = new ByteArrayOutputStream();
@@ -415,4 +414,189 @@ public class FileUtils {
         return file_path;
     }
 
+
+    public static void main123(String[] args) throws Exception {
+       String excelUrl = "/Users/hongchuangyanfa/Downloads/C4.13路基压实度汇总表.xlsx";
+        String old_html = "/Users/hongchuangyanfa/Desktop/pdf/old_html.html";
+        String old_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/old_html.xlsx";
+
+      //  File data = new File(excelUrl);
+      //  InputStream inputStream = new FileInputStream(data);
+      //  excelInfo(inputStream,old_xlsx,old_html,"1");
+
+        String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
+        String new_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/new_html.xlsx";
+
+        File data = new File(old_xlsx);
+        InputStream inputStream = new FileInputStream(data);
+        excelInfo(inputStream,new_xlsx,new_html,"2");
+    }
+
+
+    /**
+     * 在线编辑excel 操作
+     *
+     * @param fileInputStream
+     * @param excelURL
+     * @param htmlUrl
+     * @throws Exception
+     */
+    public static void excelInfo(InputStream fileInputStream, String excelURL, String htmlUrl, String type) {
+        try {
+            String file_path = FileUtils.getSysLocalFileUrl() + "/pdf/";
+            String filecode = SnowFlakeUtil.getId() + "";
+            String thmlUrl2 = file_path + filecode + "123.html";
+
+            // 解析原始excel
+            com.spire.xls.Workbook wb = new com.spire.xls.Workbook();
+            wb.loadFromMHtml(fileInputStream);
+
+            wb.saveToFile(excelURL, FileFormat.Version2013);
+            // 操作
+            com.spire.xls.Workbook wb2 = new com.spire.xls.Workbook();
+            wb2.loadFromMHtml(excelURL);
+            Worksheet sheet2 = wb2.getWorksheets().get(0);
+
+            HTMLOptions options = new HTMLOptions();
+            options.setImageEmbedded(true);
+            //获取工作表
+            Worksheet sheet = wb.getWorksheets().get(0);
+            sheet.saveToHtml(htmlUrl, options);
+
+            CellRange[] mergedCells = sheet.getMergedCells();
+            Map<String, Map<String, Integer>> xyList = new HashMap<>();
+
+            CellRange[] cellRanges = sheet.getCells();
+
+            int j = 0;
+            int maxVal = 0;
+
+            for (int i = 0; i < cellRanges.length; i++) {
+                CellRange oldcell = cellRanges[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                int k = 0;
+                if(Func.isNumeric(data)){
+                    k = Func.toInt(data);
+                }
+                if (maxVal < k) {
+                        maxVal = k;
+                }
+            }
+
+            for (int i = 0; i < mergedCells.length; i++) {
+                Map<String, Integer> dataMap = new HashMap<>();
+                CellRange oldcell = mergedCells[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                System.out.println(mergedCell.getValue()+"---"+data);
+                if (StringUtils.isEmpty(data)) {
+                    if(maxVal<=0){
+                        j = j + 1;
+                    }else{
+                        maxVal = maxVal+1;
+                        j=maxVal;
+                    }
+                } else {
+                    if(Func.isNumeric(data)){
+                        j = Func.toInt(data);
+                    }else {
+                        j = Func.toInt((data.trim().replaceAll("\r|\n", "")).split(":")[1] + "");
+                    }
+                }
+                // 目标表添加备注信息
+                sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
+                mergedCell.getDataValidation().setErrorMessage(j+"");
+                mergedCell.setValue(j + "");
+                dataMap.put("x1", mergedCell.getRow());
+                dataMap.put("x2", mergedCell.getLastRow());
+                dataMap.put("y1", mergedCell.getColumn());
+                dataMap.put("y2", mergedCell.getLastColumn());
+                xyList.put(j + "", dataMap);
+            }
+
+            // 单个cell
+            for (int i = 0; i < cellRanges.length; i++) {
+                CellRange oldcell = cellRanges[i];
+                CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+                String data = mergedCell.getDataValidation().getErrorMessage();
+                Map<String, Integer> dataMap = new HashMap<>();
+                if (StringUtils.isEmpty(data)) {
+                    if(maxVal<=0){
+                        j = j + 1;
+                    }else{
+                        maxVal = maxVal+1;
+                        j=maxVal;
+                    }
+                } else {
+                    if(Func.isNumeric(data)){
+                        j = Func.toInt(data);
+                    }else {
+                        j = Func.toInt((data.trim().replaceAll("\r|\n", "")).split(":")[1] + "");
+                    }
+                }
+                sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
+                oldcell.getComment().getRichText().setText(j + "");
+                mergedCell.setValue(j + "");
+                dataMap.put("x1", mergedCell.getRow());
+                dataMap.put("x2", mergedCell.getLastRow());
+                dataMap.put("y1", mergedCell.getColumn());
+                dataMap.put("y2", mergedCell.getLastColumn());
+                xyList.put(j + "", dataMap);
+            }
+            sheet.saveToHtml(thmlUrl2, options);
+
+            // 上传excel文件
+            wb2.saveToFile(excelURL, FileFormat.Version2013);
+
+            // 组装坐标
+            File html1 = new File(htmlUrl);  // 原始html
+            File html2 = new File(thmlUrl2); // 坐标html
+            InputStream inputStream1 = new FileInputStream(html1);
+            InputStream inputStream2 = new FileInputStream(html2);
+            String htmlString1 = IoUtil.readToString(inputStream1);
+            String htmlString2 = IoUtil.readToString(inputStream2);
+
+            org.jsoup.nodes.Document doc1 = Jsoup.parse(htmlString1);
+            Element table1 = doc1.select("table").first();
+            Elements trs1 = table1.select("tr");
+            org.jsoup.nodes.Document doc2 = Jsoup.parse(htmlString2);
+            Element table2 = doc2.select("table").first();
+            Elements trs2 = table2.select("tr");
+
+            for (int i = 0; i < trs1.size(); i++) {
+                Elements td1 = trs1.get(i).select("td");
+                Elements td2 = trs2.get(i).select("td");
+                for (int x = 0; x < td1.size(); x++) {
+                    Element cell1 = td1.get(x);
+                    if (cell1.children().size() >= 1) {
+                        cell1.empty();
+                    }
+                    Element cell2 = td2.get(x);
+                    String html = cell2.text();
+                    Map<String, Integer> xyMap = xyList.get(html);
+                    if (xyMap != null) {
+                        cell1.attr("x1", xyMap.get("x1") + "");
+                        cell1.attr("x2", xyMap.get("x2") + "");
+                        cell1.attr("y1", xyMap.get("y1") + "");
+                        cell1.attr("y2", xyMap.get("y2") + "");
+                        cell1.attr("exceVal",html);
+                    }
+                }
+            }
+
+            File writeFile = new File(htmlUrl);
+            FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
+            if (html2.exists()) {
+                html2.delete();
+            }
+            fileInputStream.close();
+            wb2.dispose();
+            wb.dispose();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
 }