hongchuangyanfa 2 lat temu
rodzic
commit
11928d7f2f

+ 1 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ExctabCell.java

@@ -72,6 +72,7 @@ public class ExctabCell extends BaseEntity {
     /**
      * 元素类型
      */
+    @ApiModelProperty(name = "text_element_type", value = "text_element_type")
     private Integer textElementType;
 
     /**

+ 0 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/ManagerApplication.java

@@ -14,5 +14,4 @@ public class ManagerApplication {
 	public static void main(String[] args) {
 		BladeApplication.run(LauncherConstant.APPLICATION_MANAGER_NAME, ManagerApplication.class, args);
 	}
-
 }

+ 92 - 43
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -18,6 +18,7 @@ import com.spire.xls.core.spreadsheet.HTMLOptions;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
 import lombok.SneakyThrows;
+import org.apache.commons.codec.Charsets;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
@@ -32,6 +33,7 @@ import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.MathUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.BladeUser;
@@ -41,6 +43,7 @@ import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.entity.*;
+import org.springblade.manager.excel.WbsFormElementBatchExcel;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
 import org.springblade.manager.service.*;
 import org.springblade.manager.utils.FileUtils;
@@ -60,10 +63,12 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.*;
+import java.net.URLEncoder;
 import java.util.*;
 import java.util.List;
 import java.util.regex.Matcher;
@@ -124,6 +129,9 @@ public class ExcelTabController extends BladeController {
 
     private final InformationQueryClient informationQueryClient;
 
+    // 项目信息
+    private final IProjectInfoService projectInfoService;
+
     /**
      * 详情
      */
@@ -442,13 +450,16 @@ public class ExcelTabController extends BladeController {
         WbsTreePrivate aPrivate = wbsTreePrivateService.getOne(Condition.getQueryWrapper(wbsTree));
         aPrivate.setExcelId(exceTabId);
 
+        // 获取excel 基本信息
+        ExcelTab excelTab = excelTabService.getById(exceTabId);
+
         UpdateWrapper<WbsTreePrivate> updateWrapper = new UpdateWrapper<>();
         updateWrapper.in("p_key_id", tabId);
         updateWrapper.set("is_link_table", 2);
+        updateWrapper.set("node_name", excelTab.getName()); //关联清表后 表单名和清表一样
         updateWrapper.set("excel_id", exceTabId);
 
-        // 获取excel 基本信息
-        ExcelTab excelTab = excelTabService.getById(exceTabId);
+
 
         // 复制模版htmlURL
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
@@ -475,7 +486,7 @@ public class ExcelTabController extends BladeController {
             Elements tds = tr.select("td");
             for (int j = 0; j < tds.size(); j++) {
                 Element element = tds.get(j);
-                if (element.html().indexOf("el-input") >= 0) {
+                if (element.html().indexOf("el-input") >= 0 || element.html().indexOf("el-date-picker") >= 0) {
 
                     boolean is_true = false;
                     String titleName = element.attr("title");
@@ -513,16 +524,16 @@ public class ExcelTabController extends BladeController {
                     String regularExpression = "$event" + "," + "'" + RegularExpressionUtil.getRegularExpression(filedType) + "','" + (StringUtils.isNotEmpty(filedType) ? WbsElementUtil.getTypeTips(filedType) : null) + "'," + i + "," + j;
 
                     if (is_true) {
-                        element.children().get(0).attr("placeholder", lastName).attr("@focus", "getInformation(" + oncklickText + ")")
+                        element.children().get(0).attr("placeholder", lastName)
                                 .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo)
                                 .attr("@blur", "getRegularExpression(" + regularExpression + ")")
                                 .attr("v-model", "formData." + attrInfo);
                     } else {
-                        element.children().get(0).attr("placeholder", lastName).attr("@focus", "getInformation(" + oncklickText + ")")
+                        element.children().get(0).attr("placeholder", lastName)
                                 .attr("weighing", maxScore + "").attr("id", attrInfo).attr("keyName", attrInfo)
                                 .attr("@blur", "getRegularExpression(" + regularExpression + ")");
                     }
-
+                    element.attr("@click", "getInformation(" + oncklickText + ")");
                 }
             }
         }
@@ -576,10 +587,37 @@ public class ExcelTabController extends BladeController {
 
         String htmlString = IoUtil.readToString(fileInputStream);
         htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
-        //   htmlString = htmlString.replaceAll("@focu","@focu212");
+        htmlString = htmlString.replaceAll("title", "titlexx");
+
+
+
         // 解析 style
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();
+        Elements hc = doc.select("hc-form-select-search");
+        if(hc.size()>=1){
+           for(int i =0;i<hc.size();i++){
+               Element datax = hc.get(i);
+               datax.removeAttr("pkeyId");
+               datax.removeAttr("contractId");
+               datax.attr("pkeyId",pkeyId+"");
+               datax.attr("contractId",wbsTreeContract.getContractId());
+           }
+        }
+
+         ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+        // 添加标题显示
+        Elements dwtitle = doc.getElementsByAttributeValueMatching("style","18.0pt");
+        if(dwtitle.size()==1){
+
+        }else if(dwtitle.size()>=2){
+            for (int i = 0;i<dwtitle.size();i++){
+                Element dw = dwtitle.get(i);
+                if(StringUtils.isEmpty(dw.text())){
+                    dw.text(projectInfo.getProjectName());
+                };
+            }
+        }
         doc.select("Col").remove();
         fileInputStream.close();
         return R.data(table + "");
@@ -669,43 +707,7 @@ public class ExcelTabController extends BladeController {
         // expailHtmlInfo(thmlUrl,1L);
     }
 
-    /**
-     * 首件表单获取 html页面
-     */
-    @GetMapping("/getDataInfoinfoxxxxx")
-    @ApiOperationSupport(order = 33)
-    @ApiOperation(value = "初始化实际", notes = "初始化实际")
-
-    public R getFirstExcelHtml() throws Exception {
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        List<Map<String, Object>> dataInof = jdbcTemplate.queryForList("SELECT * from m_excel_tab where parent_id ='1542056853226622977' and is_deleted=0");
-        System.out.println(dataInof.size());
-        for (int i = 0; i < dataInof.size(); i++) {
-
-            String html = dataInof.get(i).get("html_url") + "";
-            String fileUrl = dataInof.get(i).get("file_url") + "";
-            Long id = Long.parseLong(dataInof.get(i).get("id") + "");
-
-            String thmlUrl = file_path + id + ".html";
-            ExcelTab detail = excelTabService.getById(id);
-            Workbook wb = new Workbook();
-            InputStream da = CommonUtil.getOSSInputStream(fileUrl);
-            wb.loadFromMHtml(da);
-            //获取工作表
-            Worksheet sheet = wb.getWorksheets().get(0);
-            sheet.saveToHtml(thmlUrl);
-
-            detail.setHtmlUrl(thmlUrl);
-            excelTabService.saveOrUpdate(detail);
-            System.out.println(i);
-            if (thmlUrl != null) {
-                this.expailHtmlInfo(thmlUrl, id);
-            }
-            da.close();
-        }
 
-        return R.data("");
-    }
 
 
     // 上传解析 html
@@ -2260,4 +2262,51 @@ public class ExcelTabController extends BladeController {
         }
     }
 
+
+    /**
+     * excel 模版下载
+     */
+    @GetMapping("/down-Excel-file")
+    @ApiOperationSupport(order = 31)
+    @ApiOperation(value = "下载excel数据")
+    @ApiImplicitParam(name = "fileId", value = "fileId")
+    public void downExcelFile(HttpServletResponse response,String fileId) throws Exception {
+        ExcelTab excelTab = excelTabService.getById(fileId);
+
+        String fileName = URLEncoder.encode(excelTab.getName(), Charsets.UTF_8.name());
+
+        InputStream redio = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
+        byte[] buffer = IoUtil.readToByteArray(redio);
+
+        OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
+        response.setContentType("application/vnd.ms-excel");
+        response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
+        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+        toClient.write(buffer);
+        toClient.flush();
+        toClient.close();
+
+    }
+
+    /**
+     * 首件表单获取 html页面
+     */
+    @GetMapping("/getDataInfoinfoxxxxx")
+    @ApiOperationSupport(order = 100)
+    @ApiOperation(value = "初始化实际", notes = "初始化实际")
+
+    public R getFirstExcelHtml() throws Exception {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sql ="SELECT n.p_key_id,excelId from (SELECT p_key_id,(SELECT id from m_excel_tab x where x.alias like '%1542045893564796930%' and x.name =m.full_name) as excelId  from m_wbs_tree_private m where m.project_id = '1578599210897772545' and m.type='2'  and m.p_key_id!='1578599432939634723' ) n where excelId is not null ";
+        List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
+        System.out.println(dataInof.size());
+        for (int i = 0; i < dataInof.size(); i++) {
+            String p_key_id = dataInof.get(i).get("p_key_id") + "";
+            Long excelId = Long.parseLong(dataInof.get(i).get("excelId") + "");
+            this.saveLinkeTab(excelId, Long.valueOf(p_key_id));
+            System.out.println(i);
+        }
+
+        return R.data("");
+    }
 }

+ 52 - 16
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExpaileHtml.java

@@ -1,30 +1,19 @@
 package org.springblade.manager.controller;
 
-import com.alibaba.fastjson.JSON;
-import com.spire.pdf.graphics.PdfMargins;
-import com.spire.pdf.htmlconverter.LoadHtmlType;
-import com.spire.pdf.htmlconverter.qt.HtmlConverter;
-import com.spire.pdf.htmlconverter.qt.Size;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.spire.xls.CellRange;
-import com.spire.xls.ExcelVersion;
 import com.spire.xls.Workbook;
 import com.spire.xls.Worksheet;
-import com.spire.xls.core.spreadsheet.HTMLOptions;
-import io.swagger.models.auth.In;
-import org.apache.commons.lang.ArrayUtils;
-import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.springblade.core.tool.utils.*;
-import org.springblade.manager.service.IExctabCellService;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.time.LocalDateTime;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -33,9 +22,56 @@ public class ExpaileHtml {
 
     // private final IExctabCellService exctabCellService;
 
-    public static void main11(String[] args) throws IOException {
+    public static void main11(String[] args) throws Exception {
 
-        List<String> data = new ArrayList<>();
+ /*       Workbook wb = new Workbook();
+        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/C14.4.xlsx");
+        wb.loadFromMHtml(new FileInputStream(file1));
+        //获取工作表
+        Worksheet sheet = wb.getWorksheets().get(0);
+
+         CellRange[] columns = sheet.getMergedCells();
+         for (int i = 0; i< columns.length; i++){
+             if(columns[i].getStyle().getFont().getSize()>=17){
+                 System.out.println("哈哈");
+                 break;
+             }
+
+         }*/
+
+        String data = "__";
+        System.out.println(data.length());
+/*
+        System.out.println("xcc");
+        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Desktop/privateUrl/1572868137710256128.html");
+        String htmlString = IoUtil.readToString(new FileInputStream(file1));
+        Document doc = Jsoup.parse(htmlString);
+
+        //解析
+        Element table = doc.select("table").first();
+        Elements trs = table.select("tr");
+        Element element = trs.get(4).select("td").get(1);
+        JSONArray objs = new JSONArray();
+        Integer [] data= new Integer[2];
+        data[0]=1;
+        data[1]=2;
+
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("key",1);
+        jsonObject.put("name","小明");
+        objs.add(jsonObject);
+        String checkbox = "<hc-form-checkbox-group :datas='"+Arrays.asList(data)+"' :objs="+objs+" > </hc-form-checkbox-group>";
+       // element.empty().append(checkbox);
+
+        System.out.println(Arrays.asList(data));
+        System.out.println(objs);
+        System.out.println(checkbox);
+        element.empty().append(checkbox);
+        File writefile = new File("/Users/hongchuangyanfa/Desktop/123654.html");
+        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+*/
+
+/*        List<String> data = new ArrayList<>();
         List<String> data2 = new ArrayList<>();
         data.add("1:2");
 
@@ -64,7 +100,7 @@ public class ExpaileHtml {
         System.out.println("开始");
         for (String s : data2) {
             System.out.println(s);
-        }
+        }*/
 
 
        /* String  thmlUrl = "/Users/hongchuangyanfa/Desktop/C10.1.xlsx" ;

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/LinkdataInfoController.java

@@ -189,11 +189,11 @@ public class LinkdataInfoController extends BladeController {
 			// 获取元素基本信息
 			WbsFormElement wbsFormElement = wbsFormElementService.getById(linkdataInfo.getHtmlType());
 			String enName = wbsFormElement.getEName();
+			element.removeAttr("title");
+			element.attr("title",enName);
 			String dataInfo2 =wbsFormElement.getEKey()+"__"+linkdataInfo.getTrIndex()+"_"+linkdataInfo.getTdIndex() ;
 			Element element1=element1 = element.children().get(0);
 
-
-
 			if(element.html().indexOf("el-tooltip")>=0){
 				element1.removeAttr("placeholder");
 				element1.removeAttr("keyName");

+ 14 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -58,6 +58,14 @@
         <result column="isExistForm" property="isExistForm"/>
         <result column="majorDataType" property="majorDataType"/>
     </resultMap>
+
+    <resultMap id="treeNodeResultMap2" type="org.springblade.manager.vo.TreeNodeVO">
+        <id column="id" property="id"/>
+        <result column="parent_id" property="parentId"/>
+        <result column="title" property="title"/>
+        <result column="has_children" property="hasChildren"/>
+        <result column="primaryKeyId" property="primaryKeyId"/>
+    </resultMap>
     <insert id="insertCombination1">
         INSERT INTO m_wbs_tree_private(p_key_id, id, wbs_id, wbs_type, project_id, tenant_id, parent_id, ancestors,
                                        node_type, node_name, full_name, sort, remark, `type`,
@@ -514,8 +522,8 @@
     </select>
 
     <!-- 项目级 表单类型分类 wbs树 -->
-    <select id="tabTypeLazyTree" resultMap="treeNodeResultMap">
-        SELECT *,
+    <select id="tabTypeLazyTree" resultMap="treeNodeResultMap2">
+        SELECT p_key_id as id,p_key_id as primaryKeyId,title,parent_id,
                (
                    SELECT
                        CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
@@ -528,15 +536,15 @@
                            SELECT p_key_id,node_name,table_type as  parent_id from m_wbs_tree_private WHERE project_id=#{projectId} and is_deleted=0 and type=2 and table_type is not NULL GROUP BY node_name
                        ) b
                    WHERE
-                       b.parent_id = a.id
+                       b.parent_id = a.p_key_id
                ) AS "has_children"
 
                from (
-            SELECT  '12345678910' as p_key_id , '表单类型' as node_name, 0 as parent_id
+            SELECT  '12345678910' as p_key_id , '表单类型' as title, 0 as parent_id
                  union all
-            SELECT dict_key as p_key_id ,dict_value as node_name,'12345678910' as parent_id from blade_dict where code='table_type' and dict_key not in(-1,0)
+            SELECT dict_key as p_key_id ,dict_value as title,'12345678910' as parent_id from blade_dict where code='table_type' and dict_key not in(-1,0)
                  union all
-            SELECT p_key_id,node_name,table_type as  parent_id from m_wbs_tree_private WHERE project_id=#{projectId} and is_deleted=0 and type=2 and table_type is not NULL GROUP BY node_name
+            SELECT p_key_id,node_name as title,table_type as  parent_id from m_wbs_tree_private WHERE project_id=#{projectId} and is_deleted=0 and type=2 and table_type is not NULL GROUP BY node_name
            ) a where a.parent_id = #{parentId}
     </select>
 

+ 95 - 25
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -88,7 +88,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     private final InformationQueryClient informationQueryClient;
     // 元素信息表-
     private final IWbsTreeContractService wbsTreeContractService;
-    private final IWbsTreeService wbsTreeService;
+
     private final IFormulaService formulaService;
     private final JdbcTemplate jdbcTemplate;
 
@@ -109,6 +109,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     // 合同端信息
     private final IContractInfoService contractInfoService;
 
+    private final IProjectInfoService projectInfoService;
+
+
     @Override
     public IPage<ExcelTabVO> selectExcelTabPage(IPage<ExcelTabVO> page, ExcelTabVO excelTab) {
         return page.setRecords(baseMapper.selectExcelTabPage(page, excelTab));
@@ -668,7 +671,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         wb.loadFromMHtml(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
         //获取工作表
         Worksheet sheet = wb.getWorksheets().get(0);
-
+        // 标题添加
+        ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
+        CellRange[] columns = sheet.getMergedCells();
+        for (int i = 0; i< columns.length; i++){
+            CellRange cellRange = columns[i];
+            if(cellRange.getStyle().getFont().getSize()>=17){
+                cellRange.setText(projectInfo.getProjectName());
+                cellRange.getStyle().getFont().setSize(20);
+                break;
+            }
+        }
 
         // 数据不为空 &&
         if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
@@ -685,6 +698,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         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) {
@@ -702,9 +716,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     x1 = 1;
                                 }
                                 String myData = DataInfo.get(val) + "";
+
+                                if(myData.equals("30.72")){
+                                    System.out.println("");
+                                }
+
                                 if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
                                     if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
-                                        myData = myData.replace("[", "").replace("]", "");
+                                        myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
                                         String[] dataVal = myData.split(",");
                                         String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
                                         String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
@@ -727,18 +746,34 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                                     BufferedImage image = ImageIO.read(CommonUtil.getOSSInputStream(myData));
 
-                                    int colspan = Integer.parseInt(data.attr("colspan"));
-                                    int rowspan = Integer.parseInt(data.attr("rowspan"));
+                                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                                    int rowspan = data.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(data.attr("ROWSPAN"));
                                     int picHeight = 0;
                                     int picWidth = 0;
-                                    for (int i = y1; i <= (y1 + rowspan); i++) { // 跨列处理
-                                        String dataInfo = trs.get(i).attr("height");
-                                        if (StringUtils.isNotEmpty(dataInfo)) {
-                                            picHeight += Integer.parseInt(dataInfo);
+
+                                    if(rowspan==0){
+                                        String dataInfo = trs.get(y1).attr("height");
+                                        if(StringUtils.isEmpty(dataInfo)){
+                                             Element firstTd = trs.get(y1).children().get(0);
+                                            String heg[] =firstTd.attr("style").split(";");
+                                            for (String str:heg){
+                                                if(str.indexOf("height:")>=0){
+                                                    picHeight = Integer.parseInt(str.split(":")[1].replaceAll("px",""));
+                                                }
+                                            }
+                                        }else{
+                                            picHeight = Integer.parseInt(dataInfo);
+                                        }
+                                    }else{
+                                        for (int i = y1; i <= (y1 + rowspan); i++) { // 跨列处理
+                                            String dataInfo = trs.get(i).attr("height");
+                                            if (StringUtils.isNotEmpty(dataInfo)) {
+                                                picHeight += Integer.parseInt(dataInfo);
+                                            }
                                         }
                                     }
 
-                                    if (colspan >= 1) { //框行处理
+                                    if (colspan >=1) {
                                         for (int i = x1 - 1; i < x1 + colspan - 1; i++) {
                                             String dataInfo = cols.get(i).attr("width").replaceAll("px", "");
                                             if (StringUtils.isNotEmpty(dataInfo)) {
@@ -752,7 +787,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     pic.setHeight(picHeight);
                                     pic.setLeft(5);
                                 } else {
-                                    final CellRange cellRange = sheet.getCellRange(y1, x1);
+                                    CellRange cellRange = sheet.getCellRange(y1, x1);
+                                    System.out.println(cellRange.getText());
                                     cellRange.setText(myData);
                                 }
                             }
@@ -765,9 +801,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 queryWrapper.eq("type", 2);
                 queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
 
-                final List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
+                List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
                 if (textdictInfos != null && !textdictInfos.isEmpty()) {
-                    textdictInfos.forEach(e -> {
+                    for(TextdictInfo e : textdictInfos){
                         String key = e.getColKey();
                         String keys[] = key.split("__");
                         String[] trtd = keys[1].split("_");
@@ -782,12 +818,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         cellRange.setText(e.getId() + "");
                         cellRange.getCellStyle().getFont().setColor(Color.white);
 
-                    });
+                    };
                 }
             }
         }
 
 
+
         sheet.saveToPdf(pdfPath);
 
         BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
@@ -843,7 +880,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
             for (WbsTreeContract wbsInfo : wbsTreeContractList) {
                 // 隐藏的不生成pdf
-                if (wbsInfo.getIsBussShow() != 2) { //
+                if ( wbsInfo.getIsBussShow()==null || wbsInfo.getIsBussShow() != 2  ) { //
                     if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
                         data.add(wbsInfo.getPdfUrl());
                     } else {
@@ -907,16 +944,40 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             Document doc = Jsoup.parse(htmlString);
             //解析
             Elements dwtitle = doc.select("el-input[placeholder~=^承包单位]");
+            Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
             Elements htdtitle = doc.select("el-input[placeholder~=^合同段]");
             Elements jltitle = doc.select("el-input[placeholder~=^监理单位]");
             Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
+
+            Elements title = doc.select("el-input[placeholder~=^编号]");
+
+            /**
+             * 承包单位、施工单位:引用施工单位名称
+             * 监理单位:引用监理单位名称
+             * 合同段、所属建设项目(合同段):引用合同段编号
+             */
+
             ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
-            //
-            reData.put(dwtitle.attr("keyName"),contractInfo.getConstructionUnitName());
-            reData.put(htdtitle.attr("keyName"),contractInfo.getContractName());
-            reData.put(jltitle.attr("keyName"),contractInfo.getSupervisionUnitName());
-            reData.put(bhtitle.attr("keyName"),contractInfo.getContractNumber());
+            // 施工单位名称
+            if(dwtitle.size()>=1 ){
+                reData.put(dwtitle.attr("keyName"),contractInfo.getConstructionUnitName());
+            }
+            if(sgtitle.size()>=1){
+                reData.put(sgtitle.attr("keyName"),contractInfo.getConstructionUnitName());
+            }
 
+            // 合同段编号
+            if(htdtitle.size()>=1){
+                reData.put(htdtitle.attr("keyName"),contractInfo.getContractNumber());
+            }
+            // 监理单位名称
+            if(jltitle.size()>=1) {
+                reData.put(jltitle.attr("keyName"), contractInfo.getSupervisionUnitName());
+            }
+            // 编号
+            if(bhtitle.size()>=1 && contractInfo.getIsReferenceNumber()==1) {
+                reData.put(bhtitle.attr("keyName"), contractInfo.getConstructionUnitName());
+            }
 
         } catch (FileNotFoundException e) {
             e.printStackTrace();
@@ -944,22 +1005,31 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         sql = sql.replaceAll("]", "\']");
                         sql = sql.replaceAll("000Z,", "000Z\',");
                         sql = sql.replaceAll(", 20", ", \'20");
-                        sql = sql.replaceAll("'", "");
-                        reData.put(key + "__" + tabData[1], sql);
+                     //   sql = sql.replaceAll("'", "");
+                        if(StringUtils.isNotEmpty(tabData[0])) {
+                            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]);
+                        if(StringUtils.isNotEmpty(tabData[0])) {
+                            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]);
+                            if(StringUtils.isNotEmpty(tabData[0])){
+                                reData.put(key + "__" + tabData[1], tabData[0]);
+                            }
                         }
                     } else if (tabVal.indexOf("_^_") >= 0) {
                         String tabData[] = tabVal.split("_\\^_");
-                        reData.put(key + "__" + tabData[1], tabData[0]);
+                        if(StringUtils.isNotEmpty(tabData[0])){
+                            reData.put(key + "__" + tabData[1], tabData[0]);
+                        }
+
                     } else {
                         reData.put(key, tabVal);
                     }

+ 0 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExctabCellServiceImpl.java

@@ -53,13 +53,6 @@ public class ExctabCellServiceImpl extends BaseServiceImpl<ExctabCellMapper, Exc
     @Override
     public List<ExctabCellVO> getColSelect(String tabId) {
         List<ExctabCellVO> colSelect = baseMapper.getColSelect(tabId);
-        for (ExctabCellVO exctabCellVO : colSelect) {
-            Integer elementType = this.getElementType(exctabCellVO.getTextInfo());
-            if (elementType == -1) {
-                continue;
-            }
-            exctabCellVO.setTextElementType(elementType);
-        }
         return colSelect;
     }
 

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -222,6 +222,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         wbsTreeContract.setPKeyId(SnowFlakeUtil.getId());
                         wbsTreeContract.setWbsId(pawDTO.getWbsId());
                         wbsTreeContract.setWbsType(Integer.valueOf(wbsTreePrivate.getWbsType()));
+                        wbsTreeContract.setIsBussShow(1);
                         wbsTreeContract.setProjectId(pawDTO.getProjectId());
                         wbsTreeContract.setContractId(pawDTO.getContractId());
                         if (wbsTreePrivate.getType() == 2) {