hongchuangyanfa 2 лет назад
Родитель
Сommit
db80ca1cf4

+ 148 - 101
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -14,13 +14,11 @@ import com.itextpdf.io.font.FontProgram;
 import com.itextpdf.io.font.FontProgramFactory;
 import com.itextpdf.layout.font.FontProvider;
 import com.spire.xls.*;
-import com.spire.xls.core.IStyle;
 import com.spire.xls.core.spreadsheet.HTMLOptions;
-import com.spire.xls.core.spreadsheet.pivottables.PivotStyle;
-import com.spire.xls.core.spreadsheet.shapes.XlsTextBoxShape;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
 import lombok.SneakyThrows;
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -279,7 +277,7 @@ public class ExcelTabController extends BladeController {
         options.setImageEmbedded(true);
         //获取工作表
         Worksheet sheet = wb.getWorksheets().get(0);
-        sheet.saveToHtml(thmlUrl,options);
+        sheet.saveToHtml(thmlUrl, options);
 
         detail.setExtension(bladeFile1.getOriginalName());
         detail.setFileUrl(bladeFile1.getLink());
@@ -343,7 +341,7 @@ public class ExcelTabController extends BladeController {
                                                      @ApiParam(value = "liunxId", required = true) @RequestParam String liunxId,
                                                      @ApiParam(value = "项目Id", required = true) @RequestParam String projectid) {
         if (wbsType == 1) {
-            List<WbsNodeTableVO> rs = wbsTreeService.selectByNodeTableByExcel(id, projectid,liunxId);
+            List<WbsNodeTableVO> rs = wbsTreeService.selectByNodeTableByExcel(id, projectid, liunxId);
             if (!("").equals(rs) && rs.size() > 0) {
                 return R.data(rs);
             }
@@ -636,8 +634,24 @@ public class ExcelTabController extends BladeController {
     }
 
 
+/*    public static void main(String[] args) throws FileNotFoundException {
+
+        String thmlUrl = "/Users/hongchuangyanfa/Desktop/1234567890.html";
+
+        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/D9.11表-顶进施工的涵洞质量检验单.xlsx");
+
+        Workbook wb = new Workbook();
+        wb.loadFromMHtml(new FileInputStream(file1));
+        //获取工作表
+        Worksheet sheet = wb.getWorksheets().get(0);
+
+        sheet.saveToHtml(thmlUrl);
+        expailHtmlInfo(thmlUrl,1L);
+    }*/
+
+
     // 上传解析 html
-    public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
+    public static void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
 
         // 读取
         File file1 = ResourceUtil.getFile(thmlUrl);
@@ -685,7 +699,7 @@ public class ExcelTabController extends BladeController {
             Element tr = trs.get(i);
             Elements tds = tr.select("td");
 
-            String xyInof = getTrInfo(tds, styleMap, index_state, xy_type, maxCol);
+            String xyInof = getTrInfo(tds, styleMap, index_state, xy_type, maxCol, i, zikey);
 
             xy_type = Integer.parseInt(xyInof.split(",")[0]);
             tr.attr("xy_type", xyInof);
@@ -707,10 +721,8 @@ public class ExcelTabController extends BladeController {
                     if (StringUtils.isNotEmpty(keyId)) {
                         String classInfo = styleMap.get(keyId);
                         data.removeAttr("class");
-                        //data.attr("style",styleMap.get(keyId).replaceAll("break-word","inherit"));
                     }
 
-
                     Map<String, String> textObject = new HashMap<>();
                     // 计算
                     int x1 = 0;
@@ -719,12 +731,14 @@ public class ExcelTabController extends BladeController {
                     int y2 = 0;
 
                     String textInfo = data.text().trim().replaceAll(" ", "");
-
+                    System.out.println(textInfo);
                     y1 = i + 1;
                     //x 移位 算法
                     String getRowInfo = rowData[y1];
                     if (getRowInfo != null) {
                         String[] dataInfo2 = getRowInfo.split(",");
+                        // 先逻辑处理 连续时,归一
+
                         if (getRowInfo.indexOf("1") >= 0 && j == 0) {
                             x = Integer.parseInt(dataInfo2[0].split(":")[1]);
                         } else {
@@ -739,14 +753,19 @@ public class ExcelTabController extends BladeController {
                     }
 
                     // X 坐标
-                    if (colspan == 0) {
-                        x1 = x + 1;
-                        x2 = x + 1;
-                        x = x + 1;
+                    if (tds.size() == 1) {
+                        x1 = 1;
+                        x2 = colspan;
                     } else {
-                        x1 = x + 1;
-                        x2 = x + colspan;
-                        x = x + colspan;
+                        if (colspan == 0) {
+                            x1 = x + 1;
+                            x2 = x + 1;
+                            x = x2;
+                        } else {
+                            x1 = x + 1;
+                            x2 = x + colspan;
+                            x = x2;
+                        }
                     }
 
                     //x y 坐标
@@ -764,7 +783,13 @@ public class ExcelTabController extends BladeController {
                                 int mx1 = Integer.parseInt(dataInfo3.split(":")[0]);
                                 int mx2 = Integer.parseInt(dataInfo3.split(":")[1]);
                                 if (mx2 + 1 == x1) {
-                                    dataInfo = dataInfo + "," + mx1 + ":" + x2;
+                                    dataInfo = StringUtils.join(ArrayUtils.remove(dataInfo2, dataInfo2.length - 1)); //removing element at index 2
+                                    if (dataInfo2.length == 1) {
+                                        dataInfo = mx1 + ":" + x2;
+                                    } else {
+                                        dataInfo = dataInfo + "," + mx1 + ":" + x2;
+                                    }
+
                                 } else {
                                     dataInfo = dataInfo + "," + x1 + ":" + x2;
                                 }
@@ -783,6 +808,7 @@ public class ExcelTabController extends BladeController {
                         dataInfo.put("y2", y2 + "");
                         dataInfo.put("xytype", xy_type + "");
                         zikey.add(dataInfo);
+
                     } else { //空行
                         List<Map<String, String>> left = new ArrayList<>();
                         List<Map<String, String>> top = new ArrayList<>();
@@ -806,16 +832,17 @@ public class ExcelTabController extends BladeController {
                                 }
                             }
                         }
+
                         String inputText = "";
                         // 特征值赛选 规则
                         for (int k = 0; k < left.size(); k++) { // 左计算
-                            String name = left.get(k).get("name");//.replaceAll("[^\u4E00-\u9FA5]", "");
+                            String name = left.get(k).get("name");
                             int xx1 = Integer.parseInt(left.get(k).get("x1"));
                             int xx2 = Integer.parseInt(left.get(k).get("x2"));
                             int yy1 = Integer.parseInt(left.get(k).get("y1"));
                             int yy2 = Integer.parseInt(left.get(k).get("y2"));
 
-                            if (index_state) { // 正向规则匹配
+                            if (index_state && !StringUtil.isNumeric(name) && name.length() <= 20) { // 正向规则匹配
                                 if (istrue) {
                                     if (x1 - xx2 <= 1 && y1 == yy2) {
                                         inputText = name;
@@ -835,12 +862,14 @@ public class ExcelTabController extends BladeController {
                         // 特征值赛选 规则
                         if (top != null && top.size() >= 1) {
                             for (int k = 0; k < top.size(); k++) { // 向上计算
-                                String name = top.get(k).get("name");//.replaceAll("[^\u4E00-\u9FA5]", "");
+                                String name = top.get(k).get("name");
                                 int xx1 = Integer.parseInt(top.get(k).get("x1"));
                                 int xx2 = Integer.parseInt(top.get(k).get("x2"));
                                 int yy1 = Integer.parseInt(top.get(k).get("y1"));
                                 int yy2 = Integer.parseInt(top.get(k).get("y2"));
-                                inputText += name + "_";
+                                if (!StringUtil.isNumeric(name) && name.length() <= 20) {
+                                    inputText += name + "_";
+                                }
                             }
                         }
 
@@ -851,23 +880,17 @@ public class ExcelTabController extends BladeController {
                         String parm = i + "," + j + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
                         // 设置文本信息
                         ExctabCell exctabCell = new ExctabCell();
-                        System.out.println("111__"+trHtml);
-                        System.out.println(trHtml.indexOf("Important")>=0);
                         if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
-                            // data.empty().append("<el-date-picker  style='width:100%;height:100%'  trIndex="+i+" tdIndex="+j+"  x1="+x1+" x2="+x2+" y1="+y1+" y2="+y2+"  type='date' format='YYYY年MM月DD日' placeholder='请选择时间'> </el-date-picker>");
+
                             data.empty().append("<el-input type='text'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-input>");
                             exctabCell.setExctabId(excelId);
-                            exctabCell.setTextInfo("签字时间");
+                            exctabCell.setTextInfo(inputText);
                             exctabCell.setIsDeleted(0);
                             exctabCell.setXys(i + "_" + j);
                             colTitle.add(exctabCell);
-                            data.attr("title", "签字时间");
+                            data.attr("title", inputText);
 
-                        }//else if(trHtml.indexOf("Important")>=0){ // 图片处理方式
-                           // data.empty().append(imgs.get(imgIndex)+"");
-                          //  imgIndex = imgIndex+1;
-                       // }
-                        else {
+                        } else {
                             if (index_state) {
                                 if (rowspan >= 1) {
                                     data.empty().append("<el-input type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
@@ -876,7 +899,7 @@ public class ExcelTabController extends BladeController {
                                 }
                             } else {
                                 if (j == 0) {
-                                    if (colspan == maxCol && i >= 1 && i <= 2) {
+                                    if (colspan == maxCol && i >= 1) {
                                         if (rowspan >= 1) {
                                             data.empty().append("<el-input type='textarea'  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                         } else {
@@ -897,21 +920,21 @@ public class ExcelTabController extends BladeController {
 
                             if (!inputText.equals("")) {
                                 exctabCell.setExctabId(excelId);
-                                exctabCell.setTextInfo(inputText.replaceAll("[^(\u4E00-\u9FA5_)]", ""));
+                                exctabCell.setTextInfo(inputText);
                                 exctabCell.setIsDeleted(0);
                                 exctabCell.setXys(i + "_" + j);
                                 colTitle.add(exctabCell);
                             }
-                            data.attr("title", inputText.replaceAll("[^(\u4E00-\u9FA5_)]", ""));
+                            data.attr("title", inputText);
                         }
                     }
                 }
             }
         }
-
+        System.out.println(zikey);
         // 去掉重复的数据
 
-        Map<String, String> groupMap2 = colTitle.stream()
+/*        Map<String, String> groupMap2 = colTitle.stream()
                 .collect(Collectors.groupingBy(ExctabCell::getTextInfo, Collectors.mapping(ExctabCell::getXys, Collectors.joining(","))));
 
         exctabCellService.DeletExcelByTableId(excelId + "");
@@ -925,7 +948,7 @@ public class ExcelTabController extends BladeController {
             exctabCell.setXys(groupMap2.get(title));
             colTitle2.add(exctabCell);
         }
-        exctabCellService.saveBatch(colTitle2);
+        exctabCellService.saveBatch(colTitle2);*/
 
         // 保存
         File writefile = new File(thmlUrl);
@@ -933,7 +956,7 @@ public class ExcelTabController extends BladeController {
     }
 
     //计算区域坐标
-    public static String getTrInfo(Elements tds, Map<String, String> styleMap, boolean index_state, Integer xy_type, int maxCol) {
+    public static String getTrInfo(Elements tds, Map<String, String> styleMap, boolean index_state, Integer xy_type, int maxCol, int y, List<Map<String, String>> zikey) {
 
         int x_width = 0;
         int y_width = 0;
@@ -946,6 +969,16 @@ public class ExcelTabController extends BladeController {
 
         boolean istrue = true;
 
+        // 上 tr 长度
+
+        List<Map<String, String>> maxList = zikey.stream().filter(map -> Integer.parseInt(map.get("y1")) <= y && y <= Integer.parseInt(map.get("y2"))).collect(Collectors.toList());
+
+        int top1_max = 0;
+        if (maxList != null && maxList.size() >= 1) {
+            top1_max = maxList.stream().mapToInt(m -> Integer.parseInt(m.get("x2"))).max().getAsInt();
+        }
+
+
         //区域计算
         for (int j = 0; j < tds.size(); j++) {
             Element data = tds.get(j);
@@ -989,10 +1022,15 @@ public class ExcelTabController extends BladeController {
             //是否需要改变
             if (maxCol == y_width) {
                 index_state = false;
-                xy_type += 1;
+                if (maxCol != top1_max) {
+                    xy_type += 1;
+                }
+
             }
             if (maxCol == text_width) {
-                xy_type += 1;
+                if (maxCol != top1_max) {
+                    xy_type += 1;
+                }
             }
         } else { // 区域外
             if (maxCol == x_width) {
@@ -1064,15 +1102,9 @@ public class ExcelTabController extends BladeController {
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
-        if(wbsTreeContract==null){
+        if (wbsTreeContract == null) {
             return R.data(reData);
         }
-        QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("type", 4);
-        queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
-
-        // 获取默认值
-        final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
 
 
         if (wbsTreeContract == null) {
@@ -1093,48 +1125,61 @@ public class ExcelTabController extends BladeController {
         String querySql = "select * from " + wbsTreeContract.getInitTableName() + " where p_key_id=" + pkeyId;
         List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
 
-        if (dataIn == null || dataIn.size() <= 0) {
-            return R.data(reData);
-        }
-        Map<String, Object> mysqlData = dataIn.get(0);
+        if (dataIn != null && dataIn.size() >= 1) {
+            Map<String, Object> mysqlData = dataIn.get(0);
+            for (String key : mysqlData.keySet()) {
+                String tabVal = mysqlData.get(key) + "";
+                // 时间段处理
+                if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
+                    if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
+                        String tabData[] = tabVal.split("_\\^_");
+
+                        if (reData.containsKey("pickerKey")) {
+                            String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
+                            reData.put("pickerKey", pickerKey);
+                        } else {
+                            reData.put("pickerKey", key + "__" + tabData[1]);
+                        }
 
-        //
-        for (String key : mysqlData.keySet()) {
-            String tabVal = mysqlData.get(key) + "";
-            // 时间段处理
-            if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
-                if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
-                    String tabData[] = tabVal.split("__");
-                    if (reData.containsKey("pickerKey")) {
-                        String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
-                        reData.put("pickerKey", pickerKey);
-                    } else {
-                        reData.put("pickerKey", key + "__" + tabData[1]);
-                    }
+                        String sql = tabData[0];
+                        sql = sql.replaceAll("\\[", "['");
+                        sql = sql.replaceAll("]", "\']");
+                        sql = sql.replaceAll("000Z,", "000Z\',");
+                        sql = sql.replaceAll(", 20", ", \'20");
+                        sql = sql.replaceAll("'", "");
+                        reData.put(key + "__" + tabData[1], sql);
+                    } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
 
-                    String sql = tabData[0];
-                    sql = sql.replaceAll("\\[", "['");
-                    sql = sql.replaceAll("]", "\']");
-                    sql = sql.replaceAll("000Z,", "000Z\',");
-                    sql = sql.replaceAll(", 20", ", \'20");
-                    sql = sql.replaceAll("'", "");
-                    reData.put(key + "__" + tabData[1], sql);
-                } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
-
-                    String tabData[] = tabVal.split("__");
-                    reData.put(key + "__" + tabData[1], tabData[0]);
-
-                } else if (tabVal.indexOf(",") >= 0) {
-                    String mysql[] = tabVal.split(",");
-                    for (String data : mysql) {
-                        String tabData[] = data.split("__");
+                        String tabData[] = tabVal.split("_\\^_");
                         reData.put(key + "__" + tabData[1], tabData[0]);
+
+                    } else if (tabVal.indexOf("☆") >= 0) {
+                        String mysql[] = tabVal.split("☆");
+                        for (String data : mysql) {
+                            String tabData[] = data.split("_\\^_");
+                            reData.put(key + "__" + tabData[1], tabData[0]);
+                        }
+                    } else if (tabVal.indexOf("_^_") >= 0) {
+                        String tabData[] = tabVal.split("_\\^_");
+                        reData.put(key + "__" + tabData[1], tabData[0]);
+                    } else {
+                        reData.put(key, tabVal);
                     }
-                } else if (tabVal.indexOf("__") >= 0) {
-                    String tabData[] = tabVal.split("__");
-                    reData.put(key + "__" + tabData[1], tabData[0]);
+                }
+            }
+        }
+        // 获取默认值
+        QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("type", 4);
+        queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
+        final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
+        if (!textdictInfos.isEmpty()) {
+            for (TextdictInfo textdictInfo : textdictInfos) {
+                if (reData.containsKey(textdictInfo.getColKey())) {
+                    String keyVal = reData.get(textdictInfo.getColKey()) + "";
+
                 } else {
-                    reData.put(key, tabVal);
+                    reData.put(textdictInfo.getColKey() + "", textdictInfo.getSigRoleName());
                 }
             }
         }
@@ -1163,8 +1208,6 @@ public class ExcelTabController extends BladeController {
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
 
-
-
         if (wbsTreeContract == null) {
             return R.fail("该数据下无此节点!");
         }
@@ -1203,18 +1246,27 @@ public class ExcelTabController extends BladeController {
                 Element table = doc.select("table").first();
                 Elements trs = table.select("tr");
 
-                if(ObjectUtil.isNotEmpty(DataInfo)) {
+                if (ObjectUtil.isNotEmpty(DataInfo)) {
                     for (String val : DataInfo.keySet()) {
                         if (val.indexOf("__") >= 0) {
                             String DataVal[] = val.split("__");
                             String[] xy = DataVal[1].split("_");
                             Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
+
                             if (data.html().indexOf("x1") >= 0 && data.html().indexOf("y1") >= 0) {
-                                int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                int x1 = 0;
+                                int y1 = 0;
+
+                                if (data.html().indexOf("el-tooltip") >= 0) {
+                                    x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
+                                    y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
+                                } else {
+                                    x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                    y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+                                }
                                 if (x1 == 0) {
                                     x1 = 1;
                                 }
-                                int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
                                 String myData = DataInfo.get(val) + "";
                                 if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
                                     if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
@@ -1255,7 +1307,6 @@ public class ExcelTabController extends BladeController {
                                 } else {
                                     final CellRange cellRange = sheet.getCellRange(y1, x1);
                                     cellRange.setText(myData);
-                                    cellRange.getCellStyle().setHorizontalAlignment(HorizontalAlignType.Left);
                                 }
                             }
                         }
@@ -1268,8 +1319,8 @@ public class ExcelTabController extends BladeController {
                 queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
 
                 final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
-                if(textdictInfos!=null && !textdictInfos.isEmpty()){
-                    textdictInfos.forEach(e->{
+                if (textdictInfos != null && !textdictInfos.isEmpty()) {
+                    textdictInfos.forEach(e -> {
                         String key = e.getColKey();
                         String keys[] = key.split("__");
                         String[] trtd = keys[1].split("_");
@@ -1281,7 +1332,7 @@ public class ExcelTabController extends BladeController {
                         int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
 
                         final CellRange cellRange = sheet.getCellRange(y1, x1);
-                        cellRange.setText(e.getId()+"");
+                        cellRange.setText(e.getId() + "");
                         cellRange.getCellStyle().getFont().setColor(Color.white);
 
                     });
@@ -1290,8 +1341,6 @@ public class ExcelTabController extends BladeController {
         }
 
 
-
-
         sheet.saveToPdf(pdfPath);
 
         BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
@@ -1622,7 +1671,7 @@ public class ExcelTabController extends BladeController {
 
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
-       /* ExcelTab detail = excelTabService.getById(nodeId);
+        ExcelTab detail = excelTabService.getById(nodeId);
         // 上传excel文件
         R<BladeFile> bladeFile = iossClient.addFileInfo(file);
         BladeFile bladeFile1 = bladeFile.getData();
@@ -1639,12 +1688,10 @@ public class ExcelTabController extends BladeController {
         detail.setFileUrl(bladeFile1.getLink());
         detail.setFileType(3); // 表示为清表信息  1 表示祖节点  2 表示为节点信息 3 表示清表
         detail.setHtmlUrl(thmlUrl);
-        excelTabService.saveOrUpdate(detail);*/
+        excelTabService.saveOrUpdate(detail);
         // 解析html
-       // expailHtmlInfo(thmlUrl, detail.getId());
+        expailHtmlInfo(thmlUrl, detail.getId());
         return R.success("上传成功");
     }
 
-
-
 }

+ 7 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExpaileHtml.java

@@ -30,8 +30,12 @@ public  class ExpaileHtml {
 
    // private final IExctabCellService exctabCellService;
 
-    public static void main12313(String[] args) throws IOException {
-        String  thmlUrl = "/Users/hongchuangyanfa/Desktop/C10.1.xlsx" ;
+    public static void main11(String[] args) throws IOException {
+        String dataInfo ="-";
+
+
+
+       /* String  thmlUrl = "/Users/hongchuangyanfa/Desktop/C10.1.xlsx" ;
         String  thmlUrl2 = "/Users/hongchuangyanfa/Desktop/C10.2.pdf" ;
         File file1 = ResourceUtil.getFile(thmlUrl);
 
@@ -42,7 +46,7 @@ public  class ExpaileHtml {
     //    System.out.println(sheet.getLastColumn());
         sheet.getCellRange(20,1).setText("1111");
         System.out.println(sheet.getCellRange(20,1).getText());
-        sheet.saveToPdf(thmlUrl2);
+        sheet.saveToPdf(thmlUrl2);*/
 
         //指定URL路径
         // String url = "/Users/hongchuangyanfa/Desktop/privateUrl/1560160597855698944.html";

+ 19 - 8
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -227,19 +227,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 							}
 						}
 
-						String lastStr = dataInfo2.getString(ziduan[0])+"__"+ziduan[0].split("__")[1];
+						String lastStr = dataInfo2.getString(ziduan[0])+"_^_"+ziduan[0].split("__")[1];
 						for (int i=1 ;i<ziduan.length;i++){
 							String keyData = dataInfo2.getString(ziduan[i]);
 							if(!keyData.equals("")){
-								lastStr+=","+dataInfo2.getString(ziduan[i])+"__"+ziduan[i].split("__")[1];
+								lastStr+="☆"+dataInfo2.getString(ziduan[i])+"_^_"+ziduan[i].split("__")[1];
 							}
 
 						}
 						dataMap2.put(k,lastStr);
 					}else{
 						String dataVal = dataInfo2.getString(dataMap.get(k).get(0));
-						System.out.println(k+"__"+dataMap.get(k).get(0));
-						dataMap2.put(k, dataVal+"__"+dataMap.get(k).get(0).split("__")[1]);
+						dataMap2.put(k, dataVal+"_^_"+dataMap.get(k).get(0).split("__")[1]);
 					}
 				}
 				dataMap2.put("p_key_id",tableInfo.getPkeyId());
@@ -372,10 +371,22 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 					valStr=valStr.substring(0,valStr.lastIndexOf(","));
 					sqlInfo = sqlInfo + keyStr+") VALUES (" +valStr +")";
 
-					UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
-					updateWrapper.in("p_key_id",tableInfo.getPkeyId());
-					updateWrapper.set("is_tab_pdf",2);
-					wbsTreeContractService.update(updateWrapper);
+				WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+							.eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId,tableInfo.getContractId()));
+
+				if (wbsTreeContractByP!=null){
+					//处理文件提名
+					String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId())? Long.valueOf(wbsTreeContractByP.getOldId()) :wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()));
+					fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
+
+					//huangjn 保存成功后调用生成资料查询列表数据
+					this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2,"是否是首件(临时,暂时没用到)");
+				}
+
+				UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
+				updateWrapper.in("p_key_id",tableInfo.getPkeyId());
+				updateWrapper.set("is_tab_pdf",2);
+				wbsTreeContractService.update(updateWrapper);
 
 					jdbcTemplate.execute(sqlInfo);
 					// pdf 预览添加