hongchuangyanfa 2 years ago
parent
commit
b8b1eb87e0

+ 17 - 31
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1247,10 +1247,10 @@ public class InformationWriteQueryController extends BladeController {
     /**
      * 复制节点
      */
-    @PostMapping("/copyContractTreeNode11")
+    @PostMapping("/copyContractTreeNode")
     @ApiOperationSupport(order = 15)
-    @ApiOperation(value = "复制节点")
-    public R<Boolean> copyContractTreeNode11(@RequestBody CopyContractTreeNodeVO vo) {
+    @ApiOperation(value = "复制节点(新)")
+    public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
         //首先查询需要复制的节点及其下级所有子节点的信息
         WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
         // 获取当前节点的所有子节点
@@ -1258,18 +1258,18 @@ public class InformationWriteQueryController extends BladeController {
         // 插入数据库
         // 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()));
+       // 获取实体表列对象
+        List<QueryProcessDataVO> nodeTabCols = informationQueryService.getNodeChildTabColsAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId());
+        // 转化为map
+        Map<String, String> nodeTabColsMap = nodeTabCols.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
+
         if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
             WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
-
             //重塑关键信息
             Map<Long, Long> oldToNewIdMap = new HashMap<>();
             //节点信息
@@ -1284,7 +1284,6 @@ public class InformationWriteQueryController extends BladeController {
             nodeChildAll.forEach(node -> {
                 WbsTreeContract newData = new WbsTreeContract();
                 BeanUtils.copyProperties(node, newData);
-
                 //重塑关键信息
                 //重塑primaryKeyId
                 newData.setPKeyId(SnowFlakeUtil.getId());
@@ -1299,7 +1298,6 @@ public class InformationWriteQueryController extends BladeController {
                 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);
                 }
@@ -1324,34 +1322,19 @@ public class InformationWriteQueryController extends BladeController {
                 //初始化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);
+         R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 32, needCopyNode);
+         jdbcTemplate.batchUpdate();
+        return booleanR;
     }
 
 
@@ -1359,10 +1342,10 @@ public class InformationWriteQueryController extends BladeController {
     /**
      * 复制节点
      */
-    @PostMapping("/copyContractTreeNode")
+    @PostMapping("/copyContractTreeNode12313212")
     @ApiOperationSupport(order = 15)
     @ApiOperation(value = "复制节点")
-    public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
+    public R<Boolean> copyContractTreeNode123131231(@RequestBody CopyContractTreeNodeVO vo) {
         //首先查询需要复制的节点及其下级所有子节点的信息
         WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
         //获取当前合同段所有节点
@@ -1386,6 +1369,9 @@ public class InformationWriteQueryController extends BladeController {
                 }
             });
         }
+        //复制结构信息
+      //   R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 32, needCopyNode);
+        // 复制表数据
 
         System.out.println("1="+DateUtil.formatDateTime(DateUtil.now()));
         List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();

+ 6 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -21,6 +21,8 @@ import org.springblade.business.vo.InformationQueryVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
+import java.util.Map;
+
 import org.apache.ibatis.annotations.Param;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.manager.entity.WbsTreeContract;
@@ -104,6 +106,9 @@ public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 	// 节点复制数据
 	boolean copeNodeData(String nodeId, String vocationalId);
 
-
+	// 获取当前节点的子节点及自己
 	List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId);
+
+	// 获取当前节点下,所有表单的字段数据
+	List<QueryProcessDataVO> getNodeChildTabColsAllByNodeId(String nodeId, String contractId);
 }

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

@@ -608,4 +608,11 @@
             or wtc.p_key_id=#{pKeyId}
 
     </select>
+
+    <!--获取当前节点下,所有表单的字段数据-->
+    <select id="getNodeChildTabColsAllByNodeId" resultMap="queryProcessDataMap">
+        SELECT table_name as queryType,GROUP_CONCAT(COLUMN_name) as ancestors from information_schema.COLUMNS where table_name
+            in(SELECT init_table_name from m_wbs_tree_contract a WHERE a.ancestors like concat('%',#{nodeId},'%') and contract_id=#{contractId} and type=2 and is_deleted=0)
+        GROUP BY table_name
+    </select>
 </mapper>

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

@@ -118,4 +118,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
 
 	// 获取当前节点下所有子节点
 	List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId);
+
+	// 获取当前节点所有的表的字段信息
+	List<QueryProcessDataVO> getNodeChildTabColsAllByNodeId(String nodeId,String contractId);
 }

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

@@ -630,4 +630,9 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
     public List<WbsTreeContract> getNodeChildAllByNodeId(String nodeId,String contractId,String pKeyId) {
         return baseMapper.getNodeChildAllByNodeId(nodeId,contractId,pKeyId);
     }
+
+    @Override
+    public List<QueryProcessDataVO> getNodeChildTabColsAllByNodeId(String nodeId, String contractId) {
+        return baseMapper.getNodeChildTabColsAllByNodeId(nodeId,contractId);
+    }
 }

+ 76 - 35
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -445,7 +445,7 @@ public class ExcelTabController extends BladeController {
 
 
     /**
-     * 关联清表-保存1
+     * 关联清表-保存
      */
     @GetMapping("/save-linkTab")
     @ApiOperationSupport(order = 14)
@@ -455,7 +455,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "tabId", value = "表Id", required = true),
     })
     public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws IOException {
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //String file_path = "C:\\Users\\泓创开发\\Desktop";
 
         // 关联 私有项目 wbs 数据信息
@@ -492,11 +492,11 @@ public class ExcelTabController extends BladeController {
         //解析
         Element table = doc.select("table").first();
         Elements trs = table.select("tr");
-        if (aPrivate.getInitTableId() == null) {
+        if (aPrivate.getInitTableId() == null){
             org.springblade.manager.entity.TableInfo tableInfo = tableInfoService.getOne(new LambdaQueryWrapper<org.springblade.manager.entity.TableInfo>()
                     .eq(org.springblade.manager.entity.TableInfo::getTabEnName, aPrivate.getInitTableName()));
-            aPrivate.setInitTableId(tableInfo.getId() + "");
-            updateWrapper.set("init_table_id", tableInfo.getId() + "");
+            aPrivate.setInitTableId(tableInfo.getId()+"");
+            updateWrapper.set("init_table_id", tableInfo.getId()+"");
         }
 
         List<WbsFormElement> elementList = wbsFormElementService.selectElementListByFid(aPrivate.getInitTableId() + "");
@@ -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);
@@ -1144,7 +1144,7 @@ public class ExcelTabController extends BladeController {
                                     }
                                 } else {
                                     Element bforData = tds.get(j - 1);
-                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group") >= 0) {
+                                    if (!bforData.text().isEmpty() || bforData.html().indexOf("hc-form-checkbox-group")>=0) {
                                         if (rowspan >= 1) {
                                             data.empty().append("<el-input @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' type='textarea' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%;'   :rows=" + rowspan * 2 + " placeholder=''> </el-input>");
                                         } else {
@@ -1408,13 +1408,13 @@ public class ExcelTabController extends BladeController {
         String tabName = wbsTreeContract.getInitTableName();
         // 字段查询 并去掉公式字段
 
-        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id ";
+        String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '"+tabName+"' and a.id=b.f_id ";
         Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
         colkeys = stringObjectMap.get("colkeys") + "";
 
         // 复制表数据
 
-        String querySql = "insert into " + tabName + " (id,p_key_id," + colkeys + ") select '" + newPkId + "','" + newPkId + "'," + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
+        String querySql = "insert into "+tabName+" (id,p_key_id,"+colkeys+") select '"+newPkId+"','"+newPkId+"'," + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
         jdbcTemplate.execute(querySql);
 
         wbsTreeContractService.save(wbsTreeContract);
@@ -1528,9 +1528,9 @@ public class ExcelTabController extends BladeController {
                 //优先使用电签的PDF
                 pdfUrl = stringObjectMap.get("e_visa_pdf_url");
             }
-            if (StringUtils.isEmpty(pdfUrl + "")) {
-                return R.fail(300, "无数据");
-            } else {
+            if(StringUtils.isEmpty(pdfUrl+"")){
+                return R.fail(300,"无数据");
+            }else{
                 return R.data(pdfUrl);
             }
 
@@ -1645,7 +1645,7 @@ public class ExcelTabController extends BladeController {
     })
     public R<String> getTheLogPdInfo(String theLogId, String nodePrimaryKeyId, String recordTime, String contractId) throws Exception {
         //获取配置的路径
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
         //获取对应的日志
         JSONObject theLogJson;
@@ -1797,7 +1797,7 @@ public class ExcelTabController extends BladeController {
                                 String key = e.getColKey();
                                 String[] keys = key.split("__");
                                 String[] trtd = keys[1].split("_");
-                                if (trs.size() > (Integer.parseInt(trtd[0]))) {
+                                if ( trs.size() > (Integer.parseInt(trtd[0]))) {
                                     Element trData = trs.get(Integer.parseInt(trtd[0]));
                                     Elements tdDatas = trData.select("td");
                                     if (tdDatas.size() > Integer.parseInt(trtd[1])) {
@@ -1816,8 +1816,7 @@ public class ExcelTabController extends BladeController {
                                         cellRange.getCellStyle().getFont().setColor(Color.white);
                                     }
 
-                                }
-                            });
+                            }});
                         }
                     }
                 }
@@ -1977,10 +1976,10 @@ public class ExcelTabController extends BladeController {
                     resultMapList.add(reData);
                 }
             }
-        } else {
+        }else {
             WbsTreePrivate node = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, nodePrimaryKeyId));
             WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery()
-                    .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId, node.getProjectId()));
+                    .eq(WbsTreePrivate::getParentId, node.getId()).eq(WbsTreePrivate::getProjectId,node.getProjectId()));
             Map<String, Object> reData = new HashMap<>();
             // 获取默认值
             QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
@@ -1996,6 +1995,7 @@ public class ExcelTabController extends BladeController {
         }
 
 
+
         return R.data(resultMapList);
     }
 
@@ -2735,27 +2735,12 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true)
     })
     public R<List<Map<String, Object>>> getBussDataInfoTrial(Long id, Long pkeyId) {
-        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId);
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId );
         return R.data(bussDataInfoTrial);
     }
 
-    @GetMapping("/get-buss-dataInfo-list-trial")
-    @ApiOperationSupport(order = 34)
-    @ApiOperation(value = "获取试验用户保存数据-质检关联", notes = "获取试验用户保存数据")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "pkeyId", value = "表id", required = true),
-            @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true)
-    })
-    public R<Map<String, Object>> getBussDataInfoListTrial(Long id, Long pkeyId) {
-        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId);
-        bussDataInfoTrial.get(0).remove("group_id");
-        return R.data(bussDataInfoTrial.get(0));
-    }
-
-
     /**
      * 在线excel 修改回调
-     *
      * @throws IOException
      */
     @PostMapping(value = "/callbackSave")
@@ -2766,4 +2751,60 @@ 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);
+                    }
+                }
+            }
+            if(tdList!=null && tdList.size()>=1){
+                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);
+    }
 }

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

@@ -257,7 +257,7 @@ public class TextdictInfoController extends BladeController {
 
         String vmode = "formData." + keyname;
         if (textdictInfo.getTextId().equals("input")) { // 文本框
-            element.empty().append("<el-input type='text' @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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>");
+            element.empty().append("<el-input type='text'  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight' 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"));
             element.empty().append("<el-input :rows=" + rowspan * 2 + "  @keyup.shift.up='keyupShiftUp' @keyup.shift.down='keyupShiftDown' @keyup.shift.left='keyupShiftLeft' @keyup.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    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>");
@@ -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 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>");
+            element.empty().append("<el-date-picker id='"+keyname+"' 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 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>");
+            element.empty().append("<el-date-picker id='"+keyname+"' 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 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>");
+            element.empty().append("<el-time-picker id='"+keyname+"' 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 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>");
+            element.empty().append("<el-time-picker id='"+keyname+"' 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 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>");
+            element.empty().append("<el-date-picker id='"+keyname+"' 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 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>");
+            element.empty().append("<el-date-picker id='"+keyname+"' 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 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.empty().append("<el-date-picker id='"+keyname+"' 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 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.empty().append("<el-date-picker id='"+keyname+"' 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")) {

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

@@ -42,7 +42,6 @@ import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.springblade.business.entity.InformationQuery;
-import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.OperationLogClient;
@@ -946,7 +945,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 for (Element element : bhtitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     if (trindex <= 10) {
-                        reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
+                        reData.put(element.attr("keyName"), node.getPartitionCode()==null?"":node.getPartitionCode());
                     }
                 }
             }
@@ -1115,12 +1114,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 newStyle.cloneStyleFrom(cell.getCellStyle());
 
 
+
                 short fontHeightInPoints = redFont.getFontHeightInPoints();
-                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow <= 8) {
+                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
 
-                    String title = projectInfo.getProjectName();
-                    if (title.length() >= 44) {
-                        sheet.getRow(fisRow).setHeight((short) 900);
+                    String title=projectInfo.getProjectName();
+                    if(title.length()>=30){
+                        sheet.getRow(fisRow).setHeight((short)900);
                         newStyle.setWrapText(true);
                     }
                     redFont.setBold(true);
@@ -1147,7 +1147,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         if (val.indexOf("__") >= 0) {
                             String[] DataVal = val.split("__");
                             String[] xy = DataVal[1].split("_");
-                            if (Integer.parseInt(xy[0]) < trs.size()) {
+                            if (Integer.parseInt(xy[0])<trs.size()) {
                                 Element ytzData = trs.get(Integer.parseInt(xy[0]));
                                 if (ytzData != null) {
                                     Elements tdsx = ytzData.select("td");
@@ -1258,11 +1258,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         String key = e.getColKey();
                         String[] keys = key.split("__");
                         String[] trtd = keys[1].split("_");
-                        if (Integer.parseInt(trtd[0]) < trs.size()) {
+                        if (Integer.parseInt(trtd[0])<trs.size()) {
                             Element ytzData = trs.get(Integer.parseInt(trtd[0]));
                             if (ytzData != null) {
                                 Elements tdsx = ytzData.select("td");
-                                if (Integer.parseInt(trtd[1]) < tdsx.size()) {
+                                if (Integer.parseInt(trtd[1])<tdsx.size()) {
                                     Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
                                     int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
                                     if (x1 == 0) {
@@ -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<>();
@@ -1381,24 +1381,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (tabpdf2.exists()) {
             tabpdf2.delete();
         }
-
-        //TODO ------ 试验pdf关联部位工程及信息 liuYC 2023-03-13 ------
-        //获取试验记录id
-        List<String> recordIds = baseMapper.queryTrialRecordId(nodeId).stream().distinct().collect(Collectors.toList());
-        if (recordIds.size() > 0) {
-            String recordInfoSql = "select detection_category,detection_result,task_status,pdf_url from u_trial_self_inspection_record where id in(" + StringUtils.join(recordIds, ",") + ")";
-            List<TrialSelfInspectionRecord> query = jdbcTemplate.query(recordInfoSql, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
-            if (query.size() > 0) {
-                //只获取已审批合格自检记录,追加试验pdf到质检后面
-                List<String> pdfUrlsTrail = query.stream().filter(f -> ("已审批").equals(f.getTaskStatus())
-                        && (new Integer(1).equals(f.getDetectionResult()))
-                        && (new Integer(1).equals(f.getDetectionCategory()))).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
-                if (pdfUrlsTrail.size() > 0) {
-                    data.addAll(pdfUrlsTrail);
-                }
-            }
-        }
-
         FileUtils.mergePdfPublicMethods(data, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
 
@@ -1406,13 +1388,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
 
         // 获取顺序
-        int sort = 0;
-        if (ObjectUtil.isNotEmpty(wbsTreeContract)) {
-            if (wbsTreeContract.getSort() != null) {
+        int sort =0;
+        if(ObjectUtil.isNotEmpty(wbsTreeContract)){
+            if(wbsTreeContract.getSort()!=null){
                 sort = wbsTreeContract.getSort();
             }
         }
-        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + sort + " where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
+        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = "+ sort +" where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         jdbcTemplate.execute(sql);
     }
 
@@ -1437,9 +1419,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         String tabName = wbsTreePrivate.getInitTableName();
         String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
         List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
-        if (tabList.size() <= 0) {
-            //不存在返回null
-            return list;
+        if (tabList == null || tabList.size() <= 0) {
+            throw new ServiceException("无实体表对应");
         }
 
         String querySql = "select * from " + wbsTreePrivate.getInitTableName() + " where p_key_id=" + pkeyId + " and group_id = " + groupId;