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

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

@@ -248,6 +248,6 @@ public class WbsTreeContract extends BaseEntity {
     /**
      * 配合试验比ids
      */
-    private String mixRatioTestIds;
+  //  private String mixRatioTestIds;
 
 }

+ 134 - 144
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -383,16 +383,14 @@ public class ExcelTabController extends BladeController {
             String ancestors = parent.getAlias() + StringPool.COMMA + excelTab.getParentId();
             excelTab.setAlias(ancestors);
         }
-        excelTabService.saveOrUpdate(excelTab);
         // 关联清表信息计算
-
         List<ExcelTabWbsTypeVO> linkDataInfo = wbsExclTabParmVO.getLinkDataInfo();
-
         if (linkDataInfo != null && linkDataInfo.size() >= 1) {
             // 判断是否上传excle
             if ((excelTab.getFileUrl() != null || excelTab.getFileUrl() != "") && excelTab.getFileType() != 3) {
                 return R.fail("请上传清表!");
             }
+            excelTabService.saveOrUpdate(excelTab);
             for (ExcelTabWbsTypeVO info : linkDataInfo) {
                 String[] pk_id = info.getLinkIds().split(",");
                 for (String pkInfo : pk_id) {
@@ -407,10 +405,11 @@ public class ExcelTabController extends BladeController {
 
                     updateWrapper.set("is_link_table", Integer.parseInt(pk_type[1]));
                     updateWrapper.set("excel_id", excelTab.getId());
-
                     wbsTreePrivateService.update(updateWrapper);
                 }
             }
+        }else{
+            excelTabService.saveOrUpdate(excelTab);
         }
 
         return R.success("添加成功!");
@@ -456,7 +455,6 @@ public class ExcelTabController extends BladeController {
         updateWrapper.set("excel_id", exceTabId);
 
 
-
         // 复制模版htmlURL
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
         String filecode = SnowFlakeUtil.getId() + "";
@@ -585,33 +583,59 @@ public class ExcelTabController extends BladeController {
         htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
         htmlString = htmlString.replaceAll("title", "titlexx");
 
-
-
-        // 解析 style
+        // 远程搜索配置
         Document doc = Jsoup.parse(htmlString);
+        int maxCol = doc.select("Col").size();
         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());
-           }
+        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());
+        // 标题解决
+        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());
-                };
+       // Elements dwtitle = doc.getElementsByAttributeValueMatching("style", "18.0pt");
+        Elements trs = table.select("tr");
+        for (int i = 0; i < 6; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            for (int j = 0; j < tds.size(); j++) {
+                Element data = tds.get(j);
+                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                String style = data.attr("style");
+                if(style.indexOf("font-size")>=0){
+                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:")+10,style.indexOf(".0pt")));
+                    if (StringUtils.isNotEmpty(data.text())  && fontsize>=12) {
+                        trs.get(i-1).select("td").get(0).text(projectInfo.getProjectName());
+                    }
+                }
+            }
+
+
+        }
+
+        // 获取公式颜色
+
+        String tabName = wbsTreeContract.getInitTableName();
+        // 字段查询 获取公式字段
+        String colkeys = "SELECT e_key from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_formula c where c.is_deleted=0) ";
+        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colkeys);
+
+        if (maps != null) {
+            for (Map<String, Object> keys : maps) {
+                String key = keys.get("e_key") + "__";
+                Elements gscolor = doc.select("el-input[keyname~=^" + key + "]");
+                for (Element element : gscolor) {
+                    System.out.println(element.parent());
+                    element.parent().attr("gscolor", "11");
+                }
             }
         }
         doc.select("Col").remove();
@@ -652,46 +676,6 @@ public class ExcelTabController extends BladeController {
     }
 
 
-    /**
-     * 首件表单获取 html页面
-     */
-    @GetMapping("/get-first-excel-html")
-    @ApiOperationSupport(order = 15)
-    @ApiOperation(value = "首件表单获取html页面", notes = "首件表单获取html页面")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
-    })
-    public R getFirstExcelHtml(Long projectId) throws IOException, InterruptedException {
-
-        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                .eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getTableType, "111"));
-        if (wbsTreeContract == null) {
-            return R.fail("该数据下无此节点!");
-        }
-        if (wbsTreeContract.getHtmlUrl() == null) {
-            return R.fail("请上传清表!");
-        }
-
-        File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
-        FileInputStream fileInputStream = new FileInputStream(file1);
-        String htmlString = IoUtil.readToString(fileInputStream);
-        // 解析 style
-        Document doc = Jsoup.parse(htmlString);
-        Element table = doc.select("table").first();
-        doc.select("Col").remove();
-        fileInputStream.close();
-        JSONObject reData = new JSONObject();
-        reData.put("id", wbsTreeContract.getPKeyId());
-        reData.put("data", table);
-        return R.data(table + "");
-    }
-
-
-
-
-
-
-
     // 上传解析 html
     public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
 
@@ -1255,7 +1239,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R copeBussTab(Long pkeyId) throws FileNotFoundException {
+    public R copeBussTab(Long pkeyId){
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
 
@@ -1290,37 +1274,40 @@ public class ExcelTabController extends BladeController {
 
         // 字段查询 并去掉公式字段
 
-        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '"+tabName+"' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
+        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
-        colkeys = stringObjectMap.get("colkeys")+"";
+        colkeys = stringObjectMap.get("colkeys") + "";
         // 复制表数据
-        String querySql = "select "+colkeys+" from " + tabName + " where p_key_id=" + pkeyId;
-        Map<String, Object> dataMap2 = jdbcTemplate.queryForMap(querySql);
+        String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
+        List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
+        if (dataList != null && dataList.size()>=1) {
+            Map<String, Object> dataMap2 = dataList.get(0);
 
-        dataMap2.remove("p_key_id");
-        dataMap2.remove("id");
+            dataMap2.remove("p_key_id");
+            dataMap2.remove("id");
 
-        // sql 组装
-        String sqlInfo = "";
+            // sql 组装
+            String sqlInfo = "";
 
-        sqlInfo = "INSERT INTO " + tabName + " ( ";
+            sqlInfo = "INSERT INTO " + tabName + " ( ";
 
-        String keyStr = "id,p_key_id,";
-        String valStr = SnowFlakeUtil.getId() + "," + wbsTreeContract.getPKeyId() + ",";
+            String keyStr = "id,p_key_id,";
+            String valStr = SnowFlakeUtil.getId() + "," + wbsTreeContract.getPKeyId() + ",";
 
-        for (String keys : dataMap2.keySet()) {
-            if (!(dataMap2.get(keys) + "").equals("null")) {
-                keyStr += keys + ",";
-                valStr += "'" + dataMap2.get(keys) + "',";
+            for (String keys : dataMap2.keySet()) {
+                if (!(dataMap2.get(keys) + "").equals("null")) {
+                    keyStr += keys + ",";
+                    valStr += "'" + dataMap2.get(keys) + "',";
+                }
             }
-        }
-        keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
-        valStr = valStr.substring(0, valStr.lastIndexOf(","));
+            keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
+            valStr = valStr.substring(0, valStr.lastIndexOf(","));
 
-        sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
+            sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
 
-        //huangjn 保存成功后调用生成资料查询列表数据
-        jdbcTemplate.execute(sqlInfo);
+            //huangjn 保存成功后调用生成资料查询列表数据
+            jdbcTemplate.execute(sqlInfo);
+        }
         wbsTreeContractService.save(wbsTreeContract);
         return R.data("成功");
     }
@@ -1344,7 +1331,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "classify", value = "classify", required = true),
             @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
     })
-    public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId,String nodeId, String contractId,String projectId,String classify) {
+    public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
 
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
@@ -1390,7 +1377,7 @@ public class ExcelTabController extends BladeController {
         wbsTreeContractService.update(updateWrapper);
         // 合并后
 
-        excelTabService.getBussPdfs(nodeId,classify,contractId,projectId);
+        excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
 
         return R.data(tableFile.getId());
     }
@@ -1425,7 +1412,7 @@ public class ExcelTabController extends BladeController {
         String sql = "select pdf_url, e_visa_pdf_url from u_information_query  where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
         Object pdfUrl = stringObjectMap.get("pdf_url");
-        if(stringObjectMap.get("e_visa_pdf_url") != null){
+        if (stringObjectMap.get("e_visa_pdf_url") != null) {
             //优先使用电签的PDF
             pdfUrl = stringObjectMap.get("e_visa_pdf_url");
         }
@@ -1465,7 +1452,7 @@ public class ExcelTabController extends BladeController {
         String classify = tableInfo1.getString("classify");
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
         try {
-            this.excelTabService.formulaFillData(tableInfoList,Long.parseLong(nodeid));
+            this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeid));
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -1767,6 +1754,13 @@ public class ExcelTabController extends BladeController {
                     //数据结果
                     Map<String, Object> reData = new HashMap<>();
 
+                    String id = mysqlData.get("id")+"" ;
+                    String querySqlx = "SELECT tree_primary_key_id as primaryKeyId,title as path from u_contract_log_wbs where  business_id ='"+id+"'";
+                    List<Map<String, Object>> businessDat = this.jdbcTemplate.queryForList(querySqlx);
+                    if(businessDat!=null){
+                        reData.put("linkTabIds",businessDat);
+                    }
+
                     for (String key : mysqlData.keySet()) {
                         String tabVal = mysqlData.get(key) + "";
                         // 时间段处理
@@ -1809,13 +1803,11 @@ public class ExcelTabController extends BladeController {
                     }
 
                     // 移除Id 和 p_key_id
-//                    reData.remove("id");
                     reData.remove("p_key_id");
                     reData.remove("classify");
                     reData.remove("contractId");
                     reData.remove("pkeyId");
                     reData.remove("projectId");
-
                     resultMapList.add(reData);
                 }
             }
@@ -1861,7 +1853,7 @@ public class ExcelTabController extends BladeController {
                 return R.fail("目标日期下未找到当前用户填报的数据,请重新选择");
             }
 
-            for(JSONObject targetJson : targetJsonList){
+            for (JSONObject targetJson : targetJsonList) {
 
                 //获取目标数据所在数据表
                 WbsTreePrivate table = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, targetJson.getString("tableId")));
@@ -1883,14 +1875,14 @@ public class ExcelTabController extends BladeController {
                             List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
                             //重置业务ID
                             value = SnowFlakeUtil.getId();
-                            if(wbsJsonList != null && wbsJsonList.size() > 0){
-                                if(oneGroupLogWbsList.size() == 0){
+                            if (wbsJsonList != null && wbsJsonList.size() > 0) {
+                                if (oneGroupLogWbsList.size() == 0) {
                                     oneGroupLogWbsList.addAll(wbsJsonList);
                                 }
                             } else {
                                 wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
                             }
-                            for(JSONObject json : wbsJsonList){
+                            for (JSONObject json : wbsJsonList) {
                                 json.put("businessId", value);
                             }
 
@@ -2234,14 +2226,14 @@ public class ExcelTabController extends BladeController {
         }
         List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
         try {
-            this.excelTabService.formulaFillData(tableInfoList,null);
+            this.excelTabService.formulaFillData(tableInfoList, null);
         } catch (Exception e) {
             e.printStackTrace();
         }
 
         // 保存数据到数据库
         String isFirst = tableInfoList.get(0).getIsFirst();
-        if(StringUtils.isNotEmpty(isFirst)){
+        if (StringUtils.isNotEmpty(isFirst)) {
             //保存首件
             return R.data(this.excelTabService.saveOrUpdateFirst(tableInfoList));
         } else {
@@ -2258,7 +2250,7 @@ public class ExcelTabController extends BladeController {
     @ApiOperationSupport(order = 31)
     @ApiOperation(value = "下载excel数据")
     @ApiImplicitParam(name = "fileId", value = "fileId")
-    public void downExcelFile(HttpServletResponse response,String fileId) throws Exception {
+    public void downExcelFile(HttpServletResponse response, String fileId) throws Exception {
         ExcelTab excelTab = excelTabService.getById(fileId);
 
         String fileName = URLEncoder.encode(excelTab.getName(), Charsets.UTF_8.name());
@@ -2285,13 +2277,13 @@ public class ExcelTabController extends BladeController {
 
     public R getFirstExcelHtml() throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String sql ="SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201')  and is_deleted=0 and file_type=3 ";
+        String sql = "SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201')  and is_deleted=0 and file_type=3 ";
         List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
         System.out.println(dataInof.size());
         for (int i = 0; i < dataInof.size(); i++) {
             String file_url = dataInof.get(i).get("file_url") + "";
             Long p_key_id = Long.parseLong(dataInof.get(i).get("id") + "");
-            String  html_url = dataInof.get(i).get("html_url")+"";
+            String html_url = dataInof.get(i).get("html_url") + "";
 
             ExcelTab detail = excelTabService.getById(p_key_id);
             // 解析excel
@@ -2305,9 +2297,9 @@ public class ExcelTabController extends BladeController {
             Thread.sleep(100);
             sheet.saveToHtml(html_url, options);
             Thread.sleep(100);
-            this.expailHtmlInfo(html_url,p_key_id);
+            this.expailHtmlInfo(html_url, p_key_id);
             Thread.sleep(100);
-            EexpaileInfo(html_url,p_key_id);
+            EexpaileInfo(html_url, p_key_id);
             System.out.println(i);
         }
 
@@ -2315,7 +2307,7 @@ public class ExcelTabController extends BladeController {
     }
 
     // 水利水电
-    public void EexpaileInfo(String htmlUrl,long pk_id) throws FileNotFoundException {
+    public void EexpaileInfo(String htmlUrl, long pk_id) throws FileNotFoundException {
         //   String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
         String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
         // 样式集合
@@ -2352,7 +2344,7 @@ public class ExcelTabController extends BladeController {
                         String trTitleName = "";
                         Element element = tds.get(j);
 
-                        first +=element.text();
+                        first += element.text();
 
                         // 中间计算方式
                         if (element.html().indexOf("el-input") >= 0) {
@@ -2364,28 +2356,28 @@ public class ExcelTabController extends BladeController {
                             exctabCell.setCreateTime(new Date());
                             exctabCell.setTextElementType(99);
 
-                            for(int k=i ;k<sgY ; k++){
+                            for (int k = i; k < sgY; k++) {
                                 Element atr = trs.get(k);
                                 Elements atds = atr.select("td");
                                 int m = 0;
-                                if(k==i){
-                                    m=j+1;
-                                }else{
+                                if (k == i) {
+                                    m = j + 1;
+                                } else {
                                     m = 0;
                                 }
-                                for(int l=m;l<atds.size();l++){
+                                for (int l = m; l < atds.size(); l++) {
                                     Element element1 = atds.get(l);
-                                    if(element1.html().indexOf("el-input")>=0){
+                                    if (element1.html().indexOf("el-input") >= 0) {
                                         break;
-                                    }else{
-                                        end = end+element1.text();
+                                    } else {
+                                        end = end + element1.text();
                                     }
                                 }
                             }
 
-                            tdStr = first+end;
+                            tdStr = first + end;
 
-                            if ( first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
+                            if (first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
                                 trTitleName = titt + "_合格率";
                             }
 
@@ -2394,35 +2386,35 @@ public class ExcelTabController extends BladeController {
                             }
 
                             if (first.indexOf("各项报验资料") >= 0 && end.indexOf("的要求") >= 0 && end.indexOf("SL") >= 0) {
-                                if(end.indexOf("。")>=0){
-                                    end= end.substring(0,end.indexOf("。"));
+                                if (end.indexOf("。") >= 0) {
+                                    end = end.substring(0, end.indexOf("。"));
                                 }
                                 trTitleName = titt + "_报验资料是否满足" + end;
                             }
 
                             if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
-                                if(first.indexOf("。")>=0){
-                                    first= first.substring(first.indexOf("。")+1,first.length());
+                                if (first.indexOf("。") >= 0) {
+                                    first = first.substring(first.indexOf("。") + 1, first.length());
                                 }
                                 trTitleName = titt + "_" + first.substring(0, first.length() - 2);
                             }
                             // 2
-                            if (first.indexOf("合格")>=0 &&first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
-                                trTitleName = titt + "_"+first.substring(first.indexOf("其中优良")+2,first.indexOf("占")+1)+"比";
+                            if (first.indexOf("合格") >= 0 && first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
+                                trTitleName = titt + "_" + first.substring(first.indexOf("其中优良") + 2, first.indexOf("占") + 1) + "比";
                             }
                             if (first.indexOf("主要工序达到") >= 0 && end.indexOf("等级") >= 0) {
                                 trTitleName = titt + "工序等级";
                             }
                             // 3
-                            if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 &&  first.indexOf("符合") >= 0) {
+                            if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 && first.indexOf("符合") >= 0) {
                                 trTitleName = titt + "_设计要求";
                             }
-                            if (end.indexOf("100%合格") >= 0 ) {
+                            if (end.indexOf("100%合格") >= 0) {
                                 trTitleName = titt + "_合格数量";
                             }
 
-                            System.out.println(i+","+j+"="+trTitleName);
-                            first="";
+                            System.out.println(i + "," + j + "=" + trTitleName);
+                            first = "";
                             end = "";
                             exctabCell.setTextInfo(trTitleName);
                             exctabCell.setXys(i + "_" + j);
@@ -2445,11 +2437,11 @@ public class ExcelTabController extends BladeController {
                         exctabCell.setCreateTime(new Date());
                         exctabCell.setTextElementType(99);
                         tds.get(0).removeAttr("title");
-                        if(titt.indexOf("施工")>=0){
+                        if (titt.indexOf("施工") >= 0) {
                             exctabCell.setTextInfo("施工单位合同章");
                             tds.get(0).attr("title", "施工单位合同章");
                         }
-                        if(titt.indexOf("监理")>=0){
+                        if (titt.indexOf("监理") >= 0) {
                             exctabCell.setTextInfo("监理单位合同章");
                             tds.get(0).attr("title", "监理单位合同章");
                         }
@@ -2465,11 +2457,11 @@ public class ExcelTabController extends BladeController {
                         exctabCell.setTextElementType(99);
                         tds.get(1).removeAttr("title");
 
-                        if(titt.indexOf("施工")>=0){
+                        if (titt.indexOf("施工") >= 0) {
                             tds.get(1).attr("title", "施工单位个人签字");
                             exctabCell.setTextInfo("施工单位个人签字");
                         }
-                        if(titt.indexOf("监理")>=0){
+                        if (titt.indexOf("监理") >= 0) {
                             tds.get(1).attr("title", "监理单位个人签字");
                             exctabCell.setTextInfo("监理单位个人签字");
                         }
@@ -2484,11 +2476,11 @@ public class ExcelTabController extends BladeController {
                         exctabCell.setCreateTime(new Date());
                         exctabCell.setTextElementType(99);
                         tds.get(2).removeAttr("title");
-                        if(titt.indexOf("施工")>=0){
+                        if (titt.indexOf("施工") >= 0) {
                             tds.get(2).attr("title", "日期施工单位");
                             exctabCell.setTextInfo("日期施工单位");
                         }
-                        if(titt.indexOf("监理")>=0){
+                        if (titt.indexOf("监理") >= 0) {
                             tds.get(2).attr("title", "日期监理单位");
                             exctabCell.setTextInfo("日期监理单位");
                         }
@@ -2501,17 +2493,15 @@ public class ExcelTabController extends BladeController {
             }
         }
 
-         File writefile = new File(htmlUrl);
-          FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+        File writefile = new File(htmlUrl);
+        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
         System.out.println("完成");
     }
 
 
-
-
-
     /**
      * 表单填写 图片添加 并压缩
+     *
      * @param file
      * @return
      */
@@ -2521,15 +2511,15 @@ public class ExcelTabController extends BladeController {
     @ApiOperation(value = "表单填写图片上传", notes = "表单填写图片上传")
     public R addBussFile(@RequestParam MultipartFile file) {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        BladeFile bladeFile=new BladeFile();
-        if(file.getSize()>=1024){
+        BladeFile bladeFile = new BladeFile();
+        if (file.getSize() >= 1024) {
             String filecode = SnowFlakeUtil.getId() + "";
-            String imgUrl = file_path+"/pdf/"+  filecode+".jpg";
-            FileUtils.CompressImage(imgUrl,file.getInputStream());
-            bladeFile= this.newIOSSClient.uploadFile(file.getOriginalFilename(),imgUrl);
+            String imgUrl = file_path + "/pdf/" + filecode + ".jpg";
+            FileUtils.CompressImage(imgUrl, file.getInputStream());
+            bladeFile = this.newIOSSClient.uploadFile(file.getOriginalFilename(), imgUrl);
             File imgFile = ResourceUtil.getFile(imgUrl);
             imgFile.delete();
-        }else{
+        } else {
             bladeFile = this.newIOSSClient.uploadFileByInputStream(file);
         }
         return R.data(bladeFile);

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

@@ -1,6 +1,7 @@
 package org.springblade.manager.controller;
 
 
+import org.apache.commons.lang.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
@@ -16,6 +17,12 @@ import java.util.List;
 public class ExpaileHtml {
 
     public static void main11(String[] args) throws FileNotFoundException {
+
+
+        String sdata ="2022年11月10日";
+        String edata ="2022年11月10日";
+      //  System.out.println(sdata.equals());
+/*
         List<File> list = FileUtil.list("/Users/hongchuangyanfa/Desktop/123456/");
          int i = 0;
          for(File file:list){
@@ -25,12 +32,52 @@ public class ExpaileHtml {
                  System.out.println(file.getPath()+"__"+(i++));
                  EexpaileInfo(file.getPath());
              }
-         }
+         }*/
 
-    /*    String html_url = "/Users/hongchuangyanfa/Desktop/123456/1582973763253698560.html";
-        EexpaileInfo(html_url);*/
+        String html_url = "/Users/hongchuangyanfa/Desktop/privateUrl/1582298975938019328.html";
+        testinfo22(html_url);
     }
 
+
+
+    public static void testinfo22(String htmlUrl) throws FileNotFoundException {
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
+        // 样式集合
+        Document doc = Jsoup.parse(htmlString);
+         Elements select = doc.select("el-input[placeholder~=.*合同段.*]");
+         int trindex = Integer.parseInt(select.attr("tdindex"));
+
+        System.out.println(trindex);
+        System.out.println(select.size());
+    }
+
+    public static void testinfo(String htmlUrl) throws FileNotFoundException {
+        String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
+        // 样式集合
+        Document doc = Jsoup.parse(htmlString);
+        //解析
+        Element table = doc.select("table").first();
+        int maxCol = doc.select("Col").size();
+        Elements trs = table.select("tr");
+        for (int i = 0; i <= 6; i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+
+            for (int j = 0; j < tds.size(); j++) {
+                Element data = tds.get(j);
+                int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
+                String style = data.attr("style");
+                if(style.indexOf("font-size")>=0){
+                    int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:")+10,style.indexOf(".0pt")));
+                    if (StringUtils.isNotEmpty(data.text()) && colspan >= maxCol - 1 && fontsize>=12) {
+
+                        System.out.println(data.text());
+                    }
+                }
+
+            }
+        }
+    }
     public static void EexpaileInfo(String htmlUrl) throws FileNotFoundException {
      //   String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
         String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));

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

@@ -103,6 +103,8 @@ public class FirstController extends BladeController {
         File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
         FileInputStream fileInputStream = new FileInputStream(file1);
         String htmlString =   IoUtil.readToString(fileInputStream);
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        htmlString = htmlString.replaceAll("title", "titlexx");
         // 解析 style
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();

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

@@ -202,6 +202,7 @@ public class LinkdataInfoController extends BladeController {
 				element1.removeAttr("@focus");
 				element1 = element.children().get(0).children().get(0);
 			}
+
 			element1.removeAttr("placeholder");
 			element1.removeAttr("keyName");
 			element1.removeAttr("weighing");

+ 15 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -215,7 +215,7 @@ public class TextdictInfoController extends BladeController {
         String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
 
         String vmode = "formData." + keyname;
-        if (textdictInfo.getTextId().equals("input")) { // 单选
+        if (textdictInfo.getTextId().equals("input")) { // 文本
             element.empty().append("<el-input type='text' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </el-input>");
         } else if (textdictInfo.getTextId().equals("textarea")) { // 文本域
             int rowspan = element.attr("ROWSPAN").equals("") ? 0 : Integer.parseInt(element.attr("ROWSPAN"));
@@ -225,7 +225,7 @@ public class TextdictInfoController extends BladeController {
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
-                    selectText += "<el-option  key='" + i + "' label='" + optionList.get(i).getDictValue() + "'   value='" + i + "' > </el-option>";
+                    selectText += "<el-option  key='" + optionList.get(i).getDictValue() + "' label='" + optionList.get(i).getDictValue() + "'   value='" + optionList.get(i).getDictValue() + "' > </el-option>";
             }
             selectText += "</el-select>";
             element.empty().append(selectText);
@@ -235,20 +235,17 @@ public class TextdictInfoController extends BladeController {
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
                 for (int i = 0; i < optionList.size(); i++)
-                    radioText += " <el-radio label=" + i + ">" + optionList.get(i).getDictValue() + "</el-radio>";
+                    radioText += " <el-radio label=" + optionList.get(i).getDictValue() + ">" + optionList.get(i).getDictValue() + "</el-radio>";
             }
             radioText += "</el-radio-group >";
             element.empty().append(radioText);
         } else if (textdictInfo.getTextId().equals("checkbox")) { // 多选框
             List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
             if (optionList != null && optionList.size() >= 1) {
-                Integer[] data = new Integer[optionList.size()];
                 JSONArray objs = new JSONArray();
-
                 for (int i = 0; i < optionList.size(); i++){
-                    data[i]=i+1;
                     JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("key",i+1);
+                    jsonObject.put("key",optionList.get(i).getDictValue());
                     jsonObject.put("name",optionList.get(i).getDictValue());
                     objs.add(jsonObject);
                 }
@@ -256,14 +253,19 @@ public class TextdictInfoController extends BladeController {
                 element.empty().append(checkbox);
             }
         } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='yyyy年MM月dd日 hh:mm:ss' value-format='yyyy-MM-dd hh:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='YYYY年MM月DD日 HH:mm:ss' value-format='YYYY-MM-DD HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
         } else if (textdictInfo.getTextId().equals("dateYMD")) { // 日期--年月日
-            element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='yyyy年MM月dd日' value-format='yyyy-MM-dd' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY-MM-DD' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-date-picker>");
         } else if (textdictInfo.getTextId().equals("dateHMS")) { // 日期--时分秒
-            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='hh:mm:ss' value-format='hh:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
-        } else if (textdictInfo.getTextId().equals("dataSM")) { // 日期--时分
-            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='hh:mm' value-format='hh:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        } else if (textdictInfo.getTextId().equals("dateSM")) { // 日期--时分
+            element.empty().append("<el-time-picker v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        }else if (textdictInfo.getTextId().equals("dateMDHM")) { // 日期--月日时分
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='MM月DD日 HH:mm' value-format='MM-DD HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
+        }else if (textdictInfo.getTextId().equals("dateDHM")) { // 日期--日时分
+            element.empty().append("<el-date-picker v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%'   placeholder='" + placeholder + "'> </el-time-picker>");
         }
+
         else if (textdictInfo.getTextId().equals("daterange")) { // 时间段
             element.empty().append("<el-date-picker  v-model=" + vmode + " type='datetimerange' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
             element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
@@ -356,7 +358,7 @@ public class TextdictInfoController extends BladeController {
             textdictInfoService.saveOrUpdate(textdictInfo);
             element.removeAttr("dqId");
             element.attr("dqId", textdictInfo.getId() + "");
-            element.children().get(0).attr("readonly","true");
+            element.children().get(0).attr(":readonly","true");
         }
 
         // 写入 excel

+ 26 - 21
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -363,7 +363,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             //为空,默认今天
             recordTime = DateUtil.format(new Date(), "yyyy-MM-dd");
         }
-
+        // 为数据集
         String businessId = tableInfoList.get(0).getTheLogId();
         if (StringUtils.isEmpty(businessId)) {
 
@@ -714,18 +714,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     x1 = 1;
                                 }
                                 String myData = DataInfo.get(val) + "";
-
-
                                 if (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) {
                                     if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
                                         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});
+                                        String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1}).trim();
 
                                         String end_dataStr[] = dataVal[1].split("T")[0].split("-");
-                                        String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
-
+                                        String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1}).trim();
                                         if (StartDate.equals(endDate)) {
                                             myData = StartDate;
                                         } else {
@@ -943,13 +940,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             String htmlString = IoUtil.readToString(new FileInputStream(file1));
             Document doc = Jsoup.parse(htmlString);
             //解析
-            Elements dwtitle = doc.select("el-input[placeholder~=^承包单位]");
+            Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
             Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
-            Elements htdtitle = 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~=^编号]");
+           // Elements title = doc.select("el-input[placeholder~=^编号]");
 
             /**
              * 承包单位、施工单位:引用施工单位名称
@@ -968,7 +965,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
             // 合同段编号
             if(htdtitle.size()>=1){
-                reData.put(htdtitle.attr("keyName"),contractInfo.getContractNumber());
+                for (Element element:htdtitle){
+                    int trindex = Integer.parseInt(element.attr("tdindex"));
+                    if(trindex<=8){
+                        reData.put(htdtitle.attr("keyName"),contractInfo.getContractNumber());
+                    }
+                }
             }
             // 监理单位名称
             if(jltitle.size()>=1) {
@@ -1010,12 +1012,21 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             reData.put(key + "__" + tabData[1], sql);
                         }
                     } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
-
-                        String tabData[] = tabVal.split("_\\^_");
-                        if(StringUtils.isNotEmpty(tabData[0])) {
-                            reData.put(key + "__" + tabData[1], tabData[0]);
+                        // 时间和字符串合作
+                        if(tabVal.indexOf("☆")>=0){
+                            String mysql[] = tabVal.split("☆");
+                            for (String data : mysql) {
+                                String tabData[] = data.split("_\\^_");
+                                if(StringUtils.isNotEmpty(tabData[0])){
+                                    reData.put(key + "__" + tabData[1], tabData[0]);
+                                }
+                            }
+                        }else{
+                            String tabData[] = tabVal.split("_\\^_");
+                            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) {
@@ -1029,7 +1040,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         if(StringUtils.isNotEmpty(tabData[0])){
                             reData.put(key + "__" + tabData[1], tabData[0]);
                         }
-
                     } else {
                         reData.put(key, tabVal);
                     }
@@ -1051,8 +1061,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
         }
 
-        // 添加4个长量值
-
 
         // 移除Id 和 p_key_id
         reData.remove("id");
@@ -1061,9 +1069,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         reData.remove("contractId");
         reData.remove("pkeyId");
         reData.remove("projectId");
-
-
-
         return R.data(reData);
     }