Selaa lähdekoodia

Merge remote-tracking branch 'origin/master' into master

yangyj 2 vuotta sitten
vanhempi
commit
76d1687f53

+ 127 - 13
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -36,6 +36,7 @@ import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.node.ForestNodeMerger;
+import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.StringUtil;
@@ -1244,6 +1245,118 @@ public class InformationWriteQueryController extends BladeController {
         return R.status(wbsTreeContractClient.diySort(sortLists));
     }
 
+    /**
+     * 复制节点
+     */
+    @PostMapping("/copyContractTreeNode11")
+    @ApiOperationSupport(order = 15)
+    @ApiOperation(value = "复制节点")
+    public R<Boolean> copyContractTreeNode11(@RequestBody CopyContractTreeNodeVO vo) {
+        //首先查询需要复制的节点及其下级所有子节点的信息
+        WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
+        // 获取当前节点的所有子节点
+       String vocational = SnowFlakeUtil.getId()+"";
+        // 插入数据库
+        // informationQueryService.copeNodeData(needCopyNode.getId()+"",vocational);
+        // 修改
+        //
+        //
+        //新增施工台账
+        System.out.println("1="+DateUtil.formatDateTime(DateUtil.now()));
+        List<WbsTreeContract>   saveList = new ArrayList<>();
+        List<ConstructionLedger> saveLedger = new ArrayList<>();
+        System.out.println("2="+DateUtil.formatDateTime(DateUtil.now()));
+        List<WbsTreeContract> nodeChildAll = informationQueryService.getNodeChildAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId(),vo.getNeedCopyPrimaryKeyId());
+        System.out.println("3="+DateUtil.formatDateTime(DateUtil.now()));
+        if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
+            WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
+
+            //重塑关键信息
+            Map<Long, Long> oldToNewIdMap = new HashMap<>();
+            //节点信息
+            Map<String, WbsTreeContract> nodeMap = new HashMap<>();
+            nodeChildAll.forEach(node -> {
+                oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
+                nodeMap.put(node.getId().toString(), node);
+            });
+
+            System.out.println("4="+DateUtil.formatDateTime(DateUtil.now()));
+            //todo 单份复制
+            nodeChildAll.forEach(node -> {
+                WbsTreeContract newData = new WbsTreeContract();
+                BeanUtils.copyProperties(node, newData);
+
+                //重塑关键信息
+                //重塑primaryKeyId
+                newData.setPKeyId(SnowFlakeUtil.getId());
+                //设置旧ID
+                if (StringUtils.isNotEmpty(node.getOldId())) {
+                    newData.setOldId(node.getOldId());
+                } else {
+                    newData.setOldId(node.getId().toString());
+                }
+
+                //设置新ID
+                if (new Integer("1").equals(node.getType())) {
+                    //如果是节点类型才重塑ID
+                    newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
+
+                    //划分编号
+                    newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
+                }
+                //设置父节点ID
+                if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
+                    //找到复制的节点,将parentId更改为 parent.getId()
+                    newData.setParentId(parent.getId());
+                    //设置新名称
+                    newData.setNodeName(vo.getNeedCopyNodeName());
+                    newData.setFullName(vo.getNeedCopyNodeName());
+                } else {
+                    newData.setParentId(oldToNewIdMap.containsKey(node.getParentId()) ? oldToNewIdMap.get(node.getParentId()) : SnowFlakeUtil.getId());
+                }
+                newData.setCreateTime(new Date());
+                newData.setUpdateTime(new Date());
+                //初始化是否显示表格,默认显示
+                newData.setIsBussShow(1);
+                //初始化表格是否上传附件,默认未上传
+                newData.setTabFileType(1);
+                //初始化单表是否可以预览,默认不能
+                newData.setIsTabPdf(1);
+                //初始化PDF路径
+                newData.setPdfUrl(null);
+                newData.setCreateUser(AuthUtil.getUserId());
+
+                //获取当前所有复制的节点的最大sort
+              //  String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
+             //   List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+            //    List<Integer> collect = query.stream().filter(f -> ObjectUtils.isNotEmpty(f.getSort())).collect(Collectors.toList()).stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
+                Integer max = 1;
+             //   if (collect.size() > 0) {
+            //        max = collect.stream().reduce(collect.get(0), Integer::max);
+             //   } else {
+              //      max = 1;
+             //   }
+                //设置sort
+                newData.setSort(max);
+                //重塑父节点关联关系
+                this.restoreParent(newData, oldToNewIdMap);
+
+                //保存到集合中
+                saveList.add(newData);
+
+                if (new Integer("6").equals(node.getNodeType())) {
+                    //生成施工日志
+                    this.createLedger(newData, saveLedger, nodeMap, null);
+                }
+            });
+            System.out.println("7="+DateUtil.formatDateTime(DateUtil.now()));
+        }
+
+        return this.saveOrCopyNodeTree(saveList, saveLedger, 32, needCopyNode);
+    }
+
+
+
     /**
      * 复制节点
      */
@@ -1251,10 +1364,8 @@ public class InformationWriteQueryController extends BladeController {
     @ApiOperationSupport(order = 15)
     @ApiOperation(value = "复制节点")
     public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
-
         //首先查询需要复制的节点及其下级所有子节点的信息
         WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
-
         //获取当前合同段所有节点
         List<WbsTreeContract> allContractNodeList = this.wbsTreeContractClient.searchContractTree(needCopyNode.getContractId());
 
@@ -1277,17 +1388,20 @@ public class InformationWriteQueryController extends BladeController {
             });
         }
 
+        System.out.println("1="+DateUtil.formatDateTime(DateUtil.now()));
         List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();
         //新增施工台账
         List<ConstructionLedger> saveLedger = new ArrayList<>();
 
         parentList.add(needCopyNode);
-
-        //查询所有有效子节点
+        System.out.println("2="+DateUtil.formatDateTime(DateUtil.now()));
+        //查询所有有效子节点(慢 10分钟)
         this.foreachQueryChildContract(parentList, childList, contractAllNodeMap);
+
+        System.out.println("3="+DateUtil.formatDateTime(DateUtil.now()));
         allList.addAll(parentList);
         allList.addAll(childList);
-
+        System.out.println("4="+DateUtil.formatDateTime(DateUtil.now()));
         if ("1".equals(vo.getCopyType())) {
             if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
                 WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
@@ -1300,6 +1414,9 @@ public class InformationWriteQueryController extends BladeController {
                     oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
                     nodeMap.put(node.getId().toString(), node);
                 });
+
+
+                System.out.println("5="+DateUtil.formatDateTime(DateUtil.now()));
                 //todo 单份复制
                 allList.forEach(node -> {
                     WbsTreeContract newData = new WbsTreeContract();
@@ -1370,7 +1487,7 @@ public class InformationWriteQueryController extends BladeController {
                     }
                 });
             }
-
+            System.out.println("6="+DateUtil.formatDateTime(DateUtil.now()));
         } else {
             //todo 多份复制
             //获取需要复制到的位置集合
@@ -1816,7 +1933,6 @@ public class InformationWriteQueryController extends BladeController {
                 //处理完重复数据后,设置进集合中
                 selectedNodeList.addAll(childList);
             }
-
             //处理半选
             this.disposeHalfSelectList(treeContract, halfSelectedNodeList, selectedNodeList);
 
@@ -1838,7 +1954,6 @@ public class InformationWriteQueryController extends BladeController {
             }
             //处理半选
             this.disposeHalfSelectList(treeContract, halfSelectedNodeList, selectedNodeList);
-
         }
 
         //保存集合
@@ -1889,7 +2004,6 @@ public class InformationWriteQueryController extends BladeController {
                 }
                 //设置sort
                 newData.setSort(max);
-
                 //设置节点名称
                 for (AddContractTreeNodeVO.Node addVO : selectList) {
                     if (half.getPKeyId().toString().equals(addVO.getPrimaryKeyId())) {
@@ -1929,7 +2043,6 @@ public class InformationWriteQueryController extends BladeController {
                         break;
                     }
                 }
-
                 //设置到保存集合中
                 saveList.add(newData);
 
@@ -1937,7 +2050,6 @@ public class InformationWriteQueryController extends BladeController {
                     //生成施工日志
                     this.createLedger(newData, saveLedger, null, nodeMap);
                 }
-
             });
         }
 
@@ -1957,6 +2069,7 @@ public class InformationWriteQueryController extends BladeController {
 
     @NotNull
     private R<Boolean> saveOrCopyNodeTree(List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer operationType, WbsTreeContract currentNode) {
+
         if (saveList.size() > 0) {
             StringBuilder str = new StringBuilder();
             //保存施工日志
@@ -1990,8 +2103,9 @@ public class InformationWriteQueryController extends BladeController {
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            //保存节点
-            return R.data(this.wbsTreeContractClient.saveBatch(saveList));
+            //保存节点(10s)
+            Boolean aBoolean = this.wbsTreeContractClient.saveBatch(saveList);
+            return R.data(aBoolean);
         }
 
         return R.data(false);

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -101,4 +101,9 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 
     void updateBatchByPKeyId(@Param("list")List<WbsTreeContract> result);
 
+	// 节点复制数据
+	boolean copeNodeData(String nodeId, String vocationalId);
+
+
+	List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId);
 }

+ 13 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -595,4 +595,17 @@
           AND wtc.is_deleted = 0
     </select>
 
+    <insert id="copeNodeData" >
+
+    </insert>
+
+    <!--获取当前节点Ids-->
+    <select id="getNodeChildAllByNodeId" resultType="org.springblade.manager.entity.WbsTreeContract">
+        select * from m_wbs_tree_contract wtc where
+           wtc.ancestors like concat('%',#{nodeId},'%')
+            AND wtc.contract_id = #{contractId}
+            AND wtc.is_deleted = 0
+            or wtc.p_key_id=#{pKeyId}
+
+    </select>
 </mapper>

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -113,4 +113,9 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
     //获取当前合同所有填报表
 	public Map<String, Long> getTreeAllTable(String contractId);
 
+	// 复制节点数据
+	boolean copeNodeData(String nodeId,String vocationalId);
+
+	// 获取当前节点下所有子节点
+	List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId);
 }

+ 10 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -562,6 +562,12 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         list.stream().forEach(li->map.put(li.getId()+"",li.getSubmitCounts()));
         return map;
     }
+
+    @Override
+    public boolean copeNodeData(String nodeId, String vocationalId) {
+        return baseMapper.copeNodeData(nodeId,vocationalId);
+    }
+
     /**
      * 递归调用获取合同所有填报表
      */
@@ -620,4 +626,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         return rootTreeNode;
     }
 
+    @Override
+    public List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId) {
+        return baseMapper.getNodeChildAllByNodeId(nodeId,contractId,pKeyId);
+    }
 }

+ 56 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -1076,7 +1076,7 @@ public class ExcelTabController extends BladeController {
                         ExctabCell exctabCell = new ExctabCell();
                         if ((textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) || inputText.indexOf("日期") >= 0) {
                             if (inputText.indexOf("日期") >= 0) {
-                                data.empty().append("<el-date-picker type='date' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
+                                data.empty().append("<el-date-picker type='date' popper-class='hc-table-form-date-picker'  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='" + inputText + "'> </el-date-picker>");
                             } else if (textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) {
                                 if (inputText.indexOf("专业监理工程师") >= 0) {
                                     inputText = "专业监理工程师_年月日";
@@ -1086,7 +1086,7 @@ public class ExcelTabController extends BladeController {
                                     inputText = "年月日";
                                 }
                             }
-                            data.empty().append("<el-date-picker  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
+                            data.empty().append("<el-date-picker  popper-class='hc-table-form-date-picker'  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;' placeholder='年月日'> </el-date-picker>");
                             exctabCell.setTextInfo(inputText);
                             exctabCell.setExctabId(excelId);
                             exctabCell.setIsDeleted(0);
@@ -2739,7 +2739,6 @@ public class ExcelTabController extends BladeController {
         return R.data(bussDataInfoTrial);
     }
 
-
     /**
      * 在线excel 修改回调
      * @throws IOException
@@ -2752,4 +2751,58 @@ public class ExcelTabController extends BladeController {
         return excelTabService.callbackSave(callback);
     }
 
+    /**
+     * 质检 获取坐标位置
+     */
+    @GetMapping("/get-html-buss-cols")
+    @ApiOperationSupport(order = 36)
+    @ApiOperation(value = "获取坐标位置", notes = "获取坐标位置")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
+    })
+    public R getHtmlBussCols(Long pkeyId) throws FileNotFoundException {
+
+        WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                .eq(WbsTreeContract::getPKeyId, pkeyId));
+        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();
+        Elements trs = table.select("tr");
+
+        List<List<String>> redata = new ArrayList<>();
+        for (int i = 0; i < trs.size(); i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            List<String> tdList = new ArrayList<>();
+            for (int j = 0; j < tds.size(); j++) {
+                Element element = tds.get(j);
+                if (element.html().indexOf("el-tooltip") >= 0) {
+                    element = element.children().get(0);
+                }
+                if (element.children().size() >= 1) {
+                    String keyname = element.children().get(0).attr("keyname");
+                    if (StringUtils.isNotEmpty(keyname)) {
+                        tdList.add(keyname);
+                    }
+                }
+            }
+            redata.add(tdList) ;
+        }
+
+        String[][] res = new String[redata.size()][]; // 存放转换结果的 二维数组
+        for(int i=0; i<res.length; i++){ // 转换方法
+            res[i] = redata.get(i).toArray(new String[redata.get(i).size()]);
+        }
+        return R.data(res);
+    }
 }

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

@@ -294,22 +294,22 @@ public class TextdictInfoController extends BladeController {
                 element.empty().append(checkbox);
             }
         } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
-            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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 popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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 popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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>");
+            element.empty().append("<el-time-picker popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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 popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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>");
+            element.empty().append("<el-date-picker popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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>");
+            element.empty().append("<el-date-picker popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  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.empty().append("<el-date-picker popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' 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 + "')");
         } else if (textdictInfo.getTextId().equals("daterangeYMD")) { // 时间段 /
-            element.empty().append("<el-date-picker @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  v-model=" + vmode + " type='datetimerange' range-separator='/' 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.empty().append("<el-date-picker popper-class='hc-table-form-date-picker hc-form-id-"+keyname+"' @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " type='datetimerange' range-separator='/' 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 + "')");
 
         } else if (textdictInfo.getTextId().equals("img")) {

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

@@ -1053,7 +1053,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "/Users/hongchuangyanfa/Desktop/";
+       // String file_path = "/Users/hongchuangyanfa/Desktop/";
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1119,7 +1119,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
 
                     String title=projectInfo.getProjectName();
-                    if(title.length()>=44){
+                    if(title.length()>=30){
                         sheet.getRow(fisRow).setHeight((short)900);
                         newStyle.setWrapText(true);
                     }
@@ -1356,7 +1356,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-       // String file_path = "/Users/hongchuangyanfa/Desktop/";
+        //String file_path = "/Users/hongchuangyanfa/Desktop/";
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();

+ 51 - 30
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -16,6 +16,9 @@ import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Units;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.vo.DataVO;
@@ -300,42 +303,22 @@ public class FileUtils {
 
 
 
-    public static void main11(String[] args) throws Exception {
-            String data = "";
-        for(int i=1;i<=100;i++){
-            data +="name"+i+"  VARCHAR(500),";
-        }
-        System.out.println(data);
-  /*      String excelPath="/Users/hongchuangyanfa/Desktop/pdf/1625671101419880450.xlsx";
-        File file_out = ResourceUtil.getFile("/Users/hongchuangyanfa/Desktop/pdf/123.xlsx");
-        InputStream exceInp = new FileInputStream(file_out);//CommonUtil.getOSSInputStream("https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230130/2d98b5a4d6270d5d4f98847216c17888.xlsx");
+    public static void main123(String[] args) throws Exception {
+
+
+        String excelPath="/Users/hongchuangyanfa/Desktop/pdf/1625671101419880450.xlsx";
+        File file_out = ResourceUtil.getFile("/Users/hongchuangyanfa/Desktop/pdf/12345.xlsx");
+        InputStream exceInp = new FileInputStream(file_out);//CommonUtil.getOSSInputStream("https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230308/aede5ee70ecc095c8e1dd76aa2f49d1a.xlsx");
         final org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(exceInp);
         Sheet sheet = workbook.getSheetAt(0);
         sheet.setForceFormulaRecalculation(true);
         // fileName为图片完整路径,例:C:\images\EDG.jpg
-        InputStream ossInputStream = CommonUtil.getOSSInputStream("https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230215/78c0938ed110230f3907461228e6fb45.jpg");
-        byte[] bytes = IOUtils.toByteArray(ossInputStream);
-
-        // 这里根据实际需求选择图片类型
-        int pictureIdx = workbook.addPicture(bytes,6);
-
-        CreationHelper helper = workbook.getCreationHelper();
-        ClientAnchor anchor = helper.createClientAnchor();
-        anchor.setCol1(0); // param1是列号
-        anchor.setCol2(7);
-        anchor.setRow1(9); // param2是行号
-        anchor.setRow2(30); // param2是行号
-
-        Drawing drawing = sheet.createDrawingPatriarch();
-        anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
-        // 插入图片
-        Picture pict = drawing.createPicture(anchor, pictureIdx); // 调整图片占单元格百分比的大小,1.0就是100%
-        pict.resize(1,1);
-        FileUtils.imageOrientation(sheet, anchor, new DataVO(0, 9) );
+
+
         FileOutputStream outputStream = new FileOutputStream(excelPath);
         //生成一份新的excel
 
-        Cell cell = sheet.getRow(6).getCell(10);
+        Cell cell = sheet.getRow(10).getCell(10);
         cell.setCellValue("2023年02-08-2023年02-09");
 
 
@@ -349,7 +332,45 @@ public class FileUtils {
         }
         if (workbook != null) {
             IoUtil.closeQuietly(workbook);
-        }*/
+        }
+
+    }
+
+
+    public static void main23(String[] args) throws FileNotFoundException {
+        File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/fsdownload/1633774811681390592.html");
+        FileInputStream fileInputStream = new FileInputStream(file1);
+        String htmlString = IoUtil.readToString(fileInputStream);
+        // 解析 style
+        org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
+        Element table = doc.select("table").first();
+        Elements trs = table.select("tr");
+
+
+        List<List<String>> redata = new ArrayList<>();
+        for (int i = 0; i < trs.size(); i++) {
+            Element tr = trs.get(i);
+            Elements tds = tr.select("td");
+            List<String> tdList = new ArrayList<>();
+            for (int j = 0; j < tds.size(); j++) {
+                Element element = tds.get(j);
+                if (element.html().indexOf("el-tooltip") >= 0) {
+                    element = element.children().get(0);
+                }
+                if (element.children().size() >= 1) {
+                    String keyname = element.children().get(0).attr("keyname");
+                    if (StringUtils.isNotEmpty(keyname)) {
+                        tdList.add(keyname);
+                    }
+                }
+            }
+            redata.add(tdList) ;
+        }
+
+        String[][] res = new String[redata.size()][]; // 存放转换结果的 二维数组
+        for(int i=0; i<res.length; i++){ // 转换方法
+            res[i] = redata.get(i).toArray(new String[redata.get(i).size()]);
+        }
 
     }
 }