Bläddra i källkod

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

yangyj 1 år sedan
förälder
incheckning
641e69b90e

+ 1 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TextdictInfoVO.java

@@ -31,4 +31,5 @@ import lombok.EqualsAndHashCode;
 public class TextdictInfoVO extends TextdictInfo {
     private static final long serialVersionUID = 1L;
 
+    private String parentRoleId;
 }

+ 5 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveProjectConfigServiceImpl.java

@@ -22,7 +22,11 @@ public class ArchiveProjectConfigServiceImpl extends BaseServiceImpl<ArchiveProj
      */
     @Override
     public ArchiveProjectConfig getByProjectIdOrNew(Long projectId) {
-        List<ArchiveProjectConfig> configs = baseMapper.selectList(new LambdaQueryWrapper<ArchiveProjectConfig>().eq(ArchiveProjectConfig::getTenantId, SecureUtil.getTenantId()).eq(ArchiveProjectConfig::getProjectId, projectId));
+        List<ArchiveProjectConfig> configs = baseMapper.selectList(new LambdaQueryWrapper<ArchiveProjectConfig>()
+                .eq(ArchiveProjectConfig::getTenantId, SecureUtil.getTenantId())
+                .eq(ArchiveProjectConfig::getProjectId, projectId)
+                .last("LIMIT 1")
+        );
         if (configs == null || configs.size() == 0) {
             // 创建新对象
             ArchiveProjectConfig config = new ArchiveProjectConfig();

+ 34 - 12
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1410,10 +1410,6 @@ public class InformationWriteQueryController extends BladeController {
             //获取数据源表(附件复制使用)
             Set<WbsTreeContract> oldTabs = nodeChildAll.stream().filter(f -> (new Integer(2).equals(f.getType()))).collect(Collectors.toSet());
 
-            //获取实体表列对象
-            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));
             StringBuilder copySql = new StringBuilder();
             /*重置内容*/
             Map<String, Map<String, String>> ekvMap = new HashMap<>();
@@ -1483,10 +1479,20 @@ public class InformationWriteQueryController extends BladeController {
                     //表单所属方,只有勾选了对应的所属方权限才复制数据;勾选了复制数据才能复制,否则只是创建节点、表
                     if (nodeOld.getType() == 2 && StringUtils.isNotEmpty(newData.getInitTableName()) && tabOwner.contains(nodeOld.getTableOwner()) && vo.getIsCopyData() == 1) {
                         String tableName = newData.getInitTableName();
+                        if (StringUtils.isEmpty(tableName)) { //没有实体表名,跳过
+                            continue;
+                        }
+
+                        //获取实体表对应字段
+                        List<QueryProcessDataVO> nodeTabCols = informationQueryService.getNodeChildTabColsAllByTabName(tableName);
+                        //转化为map
+                        Map<String, String> nodeTabColsMap = nodeTabCols.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
+
                         String col = nodeTabColsMap.get(tableName);
                         if (ObjectUtil.isEmpty(col)) { //如果没获取到字段,那么跳过
                             continue;
                         }
+
                         List<String> filteredList = Arrays.stream(col.split(","))
                                 .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
                                 .collect(Collectors.toList());
@@ -2298,9 +2304,9 @@ public class InformationWriteQueryController extends BladeController {
                                         StringBuilder copyDataSql = new StringBuilder();
                                         String col = queryProcessDataVO.getAncestors();
                                         String colVal = queryProcessDataVO.getAncestors();
-                                        colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + needTab.getPKeyId() + "' as p_key_id,");
+                                        colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + objTab.getPKeyId() + "' as p_key_id,");
                                         //delete SQL (先删除旧数据,再新增)
-                                        String delSql = "delete from " + tableName + " where p_key_id = " + needTab.getPKeyId() + " ; ";
+                                        String delSql = "delete from " + tableName + " where p_key_id = " + objTab.getPKeyId() + " ; ";
                                         //insert into SQL
                                         String testColVal = reviseCols(eMap, colVal, oldPKeyId, tableName);
                                         StaticLog.info("KT3356:" + testColVal);
@@ -2807,6 +2813,21 @@ public class InformationWriteQueryController extends BladeController {
         }
     }
 
+    /**
+     * 获取所有子节点
+     */
+    private void currentNodeAllChild(List<WbsTreeContract> resultChildNodes, List<WbsTreeContract> childNodes, String contractId) {
+        if (childNodes.size() > 0) {
+            //如果存在子级,那么递归获取子级的子级
+            List<Long> ids = childNodes.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
+            List<WbsTreeContract> childNodeList = jdbcTemplate.query("select p_key_id,id,parent_id,type from m_wbs_tree_contract where is_deleted = 0 and contract_id = " + contractId + " and parent_id in(" + StringUtils.join(ids, ",") + ")", new BeanPropertyRowMapper<>(WbsTreeContract.class));
+            if (childNodeList.size() > 0) {
+                resultChildNodes.addAll(childNodeList);
+                this.currentNodeAllChild(resultChildNodes, childNodeList, contractId);
+            }
+        }
+    }
+
     /**
      * 删除节点
      *
@@ -2836,15 +2857,18 @@ public class InformationWriteQueryController extends BladeController {
             return R.data(300, false, "存在已经上报或审批的节点,不允许删除");
         }
 
-        //查询所有子节点
-        List<WbsTreeContract> removeNodeList = jdbcTemplate.query("select p_key_id,type from m_wbs_tree_contract where is_deleted = 0 and contract_id = " + removeNode.getContractId() + " and ancestors like '%" + removeNode.getId() + "%'", new BeanPropertyRowMapper<>(WbsTreeContract.class));
+        //查询所有子节点 TODO(不能用ancestors字段获取,ancestors字段有问题,目前用递归获取)2023年9月19日
+        //List<WbsTreeContract> removeNodeList = jdbcTemplate.query("select p_key_id,type from m_wbs_tree_contract where is_deleted = 0 and contract_id = " + removeNode.getContractId() + " and ancestors like '%" + removeNode.getId() + "%'", new BeanPropertyRowMapper<>(WbsTreeContract.class));
+        List<WbsTreeContract> removeNodeList = new ArrayList<>();
+        this.currentNodeAllChild(removeNodeList, Collections.singletonList(removeNode), removeNode.getContractId());
 
         //获取pKeyId
         List<Long> removeList = removeNodeList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList());
         //拼接
         ids = ids + "," + String.join(",", JSONArray.parseArray(JSONObject.toJSONString(removeList), String.class));
-        //删除掉表格
+        //删除掉表格 TODO(不清楚为什么要剔除表格,按理说删除节点后,节点下的表也应该一起删除的,猜测或许是为了方便恢复节点的时候表数据还存在)2023年9月19日
         removeNodeList.removeIf(tree -> tree.getType() != null && new Integer("2").equals(tree.getType()));
+
         //获取被删除节点名称
         //String nodeName = StringUtils.isNotEmpty(removeNode.getFullName()) ? removeNode.getFullName() : removeNode.getNodeName() + "," + removeNodeList.stream().map(wbs -> StringUtils.isNotEmpty(wbs.getFullName()) ? wbs.getFullName() : wbs.getNodeName()).collect(Collectors.joining());
 
@@ -2888,13 +2912,11 @@ public class InformationWriteQueryController extends BladeController {
         this.recycleBinClient.saveDelBusinessData(idArray, StringUtils.isNotEmpty(removeNode.getFullName()) ? removeNode.getFullName() : removeNode.getNodeName(), 2, parentNodeName.toString(), removeNode.getProjectId(), removeNode.getContractId());
 
         //改为物理删除 (8.28改为逻辑删除,方便恢复)
-        Boolean aBoolean = this.wbsTreeContractClient.removeContractTreeNode(idArray);
+        this.wbsTreeContractClient.removeContractTreeNode(idArray);
 
         //更新redis
-        //this.informationQueryService.AsyncWbsTree(removeNode.getParentId() + "", removeNode.getParentId() + "", removeNode.getContractId(), "", "1");
         this.informationQueryService.delAsyncWbsTree(removeNode.getContractId());
 
-//        return R.data(aBoolean);
         return R.data(true);
     }
 

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

@@ -3768,11 +3768,11 @@ public class ExcelTabController extends BladeController {
     }
 
 
-    @PostMapping("/save_sigInfo12313213")
+    @PostMapping("/save_sigpdfInfo12313213")
     @ApiOperationSupport(order = 72)
     @ApiOperation(value = "pdf", notes = "pdf")
-    public void synPDFInfo() throws Exception {
-        String sqlInfo = "SELECT DISTINCT wbs_id,classify,contract_id,project_id,type from u_information_query where contract_id='1681864110494851073' and is_deleted=0 and type=1 ";
+    public void synPDFInfo(@RequestParam String contractid) throws Exception {
+        String sqlInfo = "SELECT DISTINCT wbs_id,classify,contract_id,project_id,type from u_information_query where contract_id='"+contractid+"' and is_deleted=0 and type=1 and wbs_id in(SELECT p_key_id from m_wbs_tree_contract where is_deleted=0 and contract_id='"+contractid+"')";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlInfo);
         System.out.println(maps.size());
         int i=0;

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

@@ -52,6 +52,8 @@ import org.springblade.manager.service.impl.WbsTreePrivateServiceImpl;
 import org.springblade.manager.utils.ExcelInfoUtils;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.*;
+import org.springblade.manager.wrapper.ExcelTabWrapper;
+import org.springblade.manager.wrapper.TextdictWrapper;
 import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -94,7 +96,7 @@ public class TextdictInfoController extends BladeController {
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "详情", notes = "传入textdictInfo")
     public R<TextdictInfo> detail(TextdictInfo textdictInfo) {
-        TextdictInfo detail = textdictInfoService.getOne(Condition.getQueryWrapper(textdictInfo));
+        TextdictInfoVO detail = textdictInfoService.selectTextdictInfoById(textdictInfo.getId()+"");
         return R.data(detail);
     }
 
@@ -227,148 +229,6 @@ public class TextdictInfoController extends BladeController {
     }
 
 
-//    /**
-//     * 保存字段信息
-//     */
-//    @PostMapping("/saveTextInfo")
-//    @ApiOperationSupport(order = 9)
-//    @ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
-//    public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
-//
-//        // 获取 节点信息
-//        WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
-//
-//        // 读取html页面信息
-//        String path = "";
-//        String fileUrl = wbsTreePrivate.getHtmlUrl();
-//
-//        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
-//
-//        String htmlString = IoUtil.readToString(fileInputStream);
-//        // 样式集合
-//        Document doc = Jsoup.parse(htmlString);
-//
-//        //解析
-//        Element table = doc.select("table").first();
-//        Elements trs = table.select("tr");
-//        Element element = trs.get(textdictInfo.getTrIndex()).select("td").get(textdictInfo.getTdIndex());
-//        if (element.html().indexOf("el-tooltip") >= 0) {
-//            element = element.children().get(0);
-//        }
-//        String trindex = element.children().get(0).attr("trindex");
-//        String tdindex = element.children().get(0).attr("tdindex");
-//        String x1 = element.children().get(0).attr("x1");
-//        String x2 = element.children().get(0).attr("x2");
-//        String y1 = element.children().get(0).attr("y1");
-//        String y2 = element.children().get(0).attr("y2");
-//        String placeholder = element.children().get(0).attr("placeholder").replaceAll("[^(\u4E00-\u9FA5_)]", "");
-//        String keyname = element.children().get(0).attr("keyname");
-//        String weighing = element.children().get(0).attr("weighing");
-//        String parm = trindex + "," + tdindex + "," + x1 + "," + x2 + "," + y1 + "," + y2 + ",$event";
-//        String oncklickText = "'" + placeholder + "'," + trindex + "," + tdindex;
-//
-//        String vmode = "formData." + keyname;
-//        String leftCli = "inputLeftClick($event,'" + keyname + "')";
-//        if (textdictInfo.getTextId().equals("input")) { // 文本框
-//            element.empty().append("<el-input  @mouseup.left=" + leftCli + " type='text' id=" + keyname + " @keydown.shift.up='keyupShiftUp'  @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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 + "  id=" + keyname + "  @mouseup.left=" + leftCli + "  @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  type='textarea' placeholder=" + placeholder + " v-model=" + vmode + "    keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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("select")) { // 下拉框
-//            String selectText = " <el-select id=" + keyname + " v-model=" + vmode + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">"; //v-model="+keyname+"
-//            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
-//            if (optionList != null && optionList.size() >= 1) {
-//                for (int i = 0; i < optionList.size(); i++)
-//                    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);
-//
-//        } else if (textdictInfo.getTextId().equals("radio")) { // 单选按钮
-//
-//            String radioText = "<el-radio-group id=" + keyname + " @keyDowns='dateKeydown()' v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">";
-//            List<TextdictInfo_vo> optionList = textdictInfo.getTextInfo();
-//            if (optionList != null && optionList.size() >= 1) {
-//                for (int i = 0; i < optionList.size(); i++)
-//                    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) {
-//                JSONArray objs = new JSONArray();
-//                for (int i = 0; i < optionList.size(); i++) {
-//                    JSONObject jsonObject = new JSONObject();
-//                    jsonObject.put("key", i + 1);
-//                    jsonObject.put("name", optionList.get(i).getDictValue());
-//                    objs.add(jsonObject);
-//                }
-//                String checkbox = "<hc-form-checkbox-group   @keyDowns='dateKeydown()' :objs='" + objs + "'  @change='checkboxGroupChange' :val=" + vmode + " v-model=" + vmode + " keyname=" + keyname + " weighing=" + weighing + " placeholder=" + placeholder + " trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "> </hc-form-checkbox-group>";
-//                element.empty().append(checkbox);
-//            }
-//        } else if (textdictInfo.getTextId().equals("date")) { // 日期--年月日时分秒
-//
-//            element.empty().append("<el-date-picker @keyDowns='dateKeydown()' 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='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='YYYY年MM月DD日' value-format='YYYY年MM月DD日' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm:ss' value-format='HH:mm:ss' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' v-model=" + vmode + " type='date' format='HH:mm' value-format='HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' 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='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetime' format='DD日 HH:mm' value-format='DD日 HH:mm' placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='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 @keyDowns='dateKeydown()' 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 @keyDowns='dateKeydown()' 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")) { //图片
-//            element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
-//            element.removeAttr("style");
-//        } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
-//            element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
-//        } else if (textdictInfo.getTextId().equals("strengthSearch")){ //强度搜索框
-//            element.empty().append("<hc-form-select-search2 id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='strength_search' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search2>");
-//        }
-//        element.attr("@click", "getInformation(" + oncklickText + ")");
-//
-//        File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
-//        if (!writeFile.exists()) {
-//            if (StringUtils.isNotEmpty(path)) {
-//                File file = new File(path);
-//                if (!file.exists()) {
-//                    file.mkdirs();
-//                }
-//                FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
-//            }
-//        } else {
-//            FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
-//        }
-//        Thread.sleep(300);
-//        // 清空相关的保存数据
-//        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 != null && tablist.size() > 0 && wbsTreePrivate.getType() != 10) {
-//            String clarSql = "update  " + tabName + " set " + keyname.split("__")[0] + "=null where p_key_id in(SELECT p_key_id FROM m_wbs_tree_contract WHERE id ='" + wbsTreePrivate.getId() + "' and project_id='" + wbsTreePrivate.getProjectId() + "' )";
-//            jdbcTemplate.execute(clarSql);
-//        }
-//        fileInputStream.close();
-//        return R.success("操作成功");
-//    }
-
     /**
      * 保存字段信息
      */
@@ -614,7 +474,7 @@ public class TextdictInfoController extends BladeController {
         String replace = str1.replace("\\", "\\\\");
 
         //修改同几点的数据
-        String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in ("+ids+")";
+        String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in ("+ids+") and project_id="+wbsTreePrivate.getProjectId()+"";
         jdbcTemplate.execute(updateSqlP);
 
 
@@ -629,7 +489,7 @@ public class TextdictInfoController extends BladeController {
         String cPkeyIdsStr = StringUtils.join(cPkeyIds, ",");
 
         if (StringUtils.isNotEmpty(cPkeyIdsStr)) {
-            String updateSqlC = "update m_wbs_tree_contract set html_url = '" + replace + "' where p_key_id in (" + cPkeyIdsStr + ")";
+            String updateSqlC = "update m_wbs_tree_contract set html_url = '" + replace + "' where p_key_id in (" + cPkeyIdsStr + ") and project_id="+wbsTreePrivate.getProjectId()+"";
             jdbcTemplate.execute(updateSqlC);
         }
 
@@ -743,7 +603,7 @@ public class TextdictInfoController extends BladeController {
         String replace = str1.replace("\\", "\\\\");
         if (StringUtils.isNotEmpty(ids)) {
             //修改所有节点的htmlUrl
-            String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in (" + ids + ")";
+            String updateSqlP = "update m_wbs_tree_private set html_url = '" + replace + "' where p_key_id in (" + ids + ") and project_id="+wbsTreePrivate.getProjectId()+"";
             jdbcTemplate.execute(updateSqlP);
         }
 
@@ -760,7 +620,7 @@ public class TextdictInfoController extends BladeController {
 
             String cPkeyIdsStr = StringUtils.join(cPkeyIds, ",");
             if (StringUtils.isNotEmpty(cPkeyIdsStr)) {
-                String updateSqlC = "update m_wbs_tree_contract set html_url = '" + replace + "' where p_key_id in (" + cPkeyIdsStr + ")";
+                String updateSqlC = "update m_wbs_tree_contract set html_url = '" + replace + "' where p_key_id in (" + cPkeyIdsStr + ") and project_id="+wbsTreePrivate.getProjectId()+"";
                 jdbcTemplate.execute(updateSqlC);
             }
         }

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.java

@@ -21,6 +21,7 @@ import org.springblade.manager.injector.EasyBaseMapper;
 import org.springblade.manager.vo.TextdictInfoVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.data.repository.query.Param;
 
 import java.util.List;
 
@@ -41,4 +42,6 @@ public interface TextdictInfoMapper extends EasyBaseMapper<TextdictInfo> {
      */
     List<TextdictInfoVO> selectTextdictInfoPage(IPage page, TextdictInfoVO textdictInfo);
 
+    TextdictInfoVO selectTextdictInfoById(@Param("id") String id);
+
 }

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -30,4 +30,8 @@
         </if>
     </select>
 
+    <select id="selectTextdictInfoById" resultType="org.springblade.manager.vo.TextdictInfoVO">
+        select  *,(SELECT parent_id from blade_role c where c.id=b.sig_role_id) as parentRoleId from m_textdict_info b where is_deleted = 0 and id=#{id}
+    </select>
+
 </mapper>

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

@@ -42,5 +42,7 @@ public interface ITextdictInfoService extends IService<TextdictInfo> {
      */
     IPage<TextdictInfoVO> selectTextdictInfoPage(IPage<TextdictInfoVO> page, TextdictInfoVO textdictInfo);
 
+    TextdictInfoVO selectTextdictInfoById(String id);
+
     void deleDataInfoById(String id);
 }

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

@@ -19,7 +19,6 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
-import org.apache.poi.hssf.usermodel.HSSFRichTextString;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.usermodel.Font;
@@ -46,7 +45,6 @@ import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.common.vo.DataVO;
 import org.springblade.core.log.exception.ServiceException;
-import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -1619,6 +1617,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                 if (row != null) {
                                     Cell cell = row.getCell(x1 - 1);
                                     if (cell != null || ObjectUtils.isNotEmpty(cell)) {
+                                        short fontIndex = cell.getCellStyle().getFontIndex();
+                                        Font fontAt = workbook.getFontAt(fontIndex);
+                                        fontAt.setFontName("EUDC");
                                         cell.setCellValue(myData);
                                     }
                                     boolean wrap = Optional.ofNullable(cell).map(Cell::getCellStyle).map(CellStyle::getWrapText).orElse(true);
@@ -1638,7 +1639,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
             for (Element element : dqids){
                 String dqid = element.attr("dqid");
-               // if(element.hasAttr("x1") && element.hasAttr("y1")){
                     Elements x11 = element.getElementsByAttribute("x1");
                     if(x11!=null && x11.size()>=1){
                         Element element1 = x11.get(x11.size()-1);
@@ -1669,67 +1669,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                     newStyle.setShrinkToFit(true);
                                     cell.setCellStyle(newStyle);
                                     cell.setCellValue(dqid);
-                              //  }
                             }
                         }
                     }
-               // }
             }
-
-          /*  QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
-            queryWrapper.in("type", 2, 6);
-            queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
-            List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
-
-            // table.getElementsByAttribute("dq")
-
-            if (textdictInfos != null && !textdictInfos.isEmpty()) {
-                for (TextdictInfo e : textdictInfos) {
-                    String key = e.getColKey();
-                    String[] keys = key.split("__");
-                    String[] trtd = keys[1].split("_");
-                    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()) {
-                                Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
-
-                                if (data.html().indexOf("el-tooltip") >= 0) {
-                                    data = data.children().get(0);
-                                }
-
-                                int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
-                                if (x1 == 0) {
-                                    x1 = 1;
-                                }
-                                int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
-
-                                Row row = sheet.getRow(y1 - 1);
-                                if (row != null) {
-
-                                    Cell cell = row.getCell(x1 - 1);
-                                    if (cell != null || ObjectUtils.isNotEmpty(cell)) {
-                                        short fontIndex = cell.getCellStyle().getFontIndex();
-                                        Font oldfontAt = workbook.getFontAt(fontIndex);
-                                        Font redFont = workbook.createFont();
-                                        redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
-                                        redFont.setFontHeightInPoints(Short.valueOf("1"));//设置字体大小
-                                        redFont.setFontName(oldfontAt.getFontName());//设置字体
-
-                                        CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
-                                        newStyle.cloneStyleFrom(cell.getCellStyle());
-                                        newStyle.setFont(redFont);
-                                        newStyle.setShrinkToFit(true);
-                                        cell.setCellStyle(newStyle);
-                                        cell.setCellValue(e.getId() + "");
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }*/
         }
 
         //输出流
@@ -1771,7 +1714,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         } else {
             dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && tableFile.getType() == 2).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
         }
-        //List<String> dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && (tableFile.getType() == 1 || tableFile.getType() == 2)).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
 
         String pdfPath2 = file_path + "/pdf//" + pkeyId + "_2.pdf";
 

+ 5 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -48,6 +48,11 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
         return page.setRecords(baseMapper.selectTextdictInfoPage(page, textdictInfo));
     }
 
+    @Override
+    public TextdictInfoVO selectTextdictInfoById(String id) {
+        return baseMapper.selectTextdictInfoById(id);
+    }
+
     @Override
     public void deleDataInfoById(String id) {
         baseMapper.deleteById(id);

+ 13 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -952,6 +952,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                     //构造入参集合
                     List<WbsTreePrivate> insertData1 = new ArrayList<>();
                     List<WbsTreePrivate> insertData2 = new ArrayList<>();
+                    //映射新老pKeyId,用于保存表单配置
+                    Map<Long,Long> map = new HashMap<>();
+                    //是否存在独立库表,true为不存在,不存在才同步
+                    Boolean isExist = true;
 
                     if (pawDTO.getReferenceType().equals("public")) {
                         //获取当前树下所有节点、表信息
@@ -985,6 +989,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
 
                         //获取当前项目下的所有独立表
                         List<WbsTreePrivate> wbsTreePrivatesTableDL = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery().select(WbsTreePrivate::getId).eq(WbsTreePrivate::getProjectId, pawDTO.getProjectId()).eq(WbsTreePrivate::getType, 10).eq(WbsTreePrivate::getParentId, -10).eq(WbsTreePrivate::getStatus, 1));
+                        //存在数据则不再同步独立库表单配置
+                        if (wbsTreePrivatesTableDL != null && wbsTreePrivatesTableDL.size() > 0){
+                            isExist = false;
+                        }
                         Set<Long> saveIdsSet = saveIds.stream().map(Long::parseLong).collect(Collectors.toSet());
                         wbsTreePrivatesNodeAndTab.forEach(wbsTreePrivate -> {
                             boolean isType1Or2 = wbsTreePrivate.getType() == 1 || wbsTreePrivate.getType() == 2;
@@ -1020,6 +1028,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
                                 if (tree.getType() == 10) {
                                     wbsTreePrivate.setWbsId(null);
                                     wbsTreePrivate.setWbsType(null);
+                                    map.put(tree.getPKeyId(),wbsTreePrivate.getPKeyId());
                                 } else {
                                     wbsTreePrivate.setWbsId(pawDTO.getPrimaryKeyId());
                                     wbsTreePrivate.setWbsType(String.valueOf(pawDTO.getWbsType()));
@@ -1051,6 +1060,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
 
                         //异步修改htmlUrl
                         wbsTreePrivateService.batchResetHtmlUrl(insertData2);
+                        //异步同步独立库表单配置
+                        if (isExist && map.size() > 0) {
+                            wbsTreePrivateService.batchSynTableConfig(map);
+                        }
 
                         if (pawDTO.getWbsType() == 1) {
                             projectInfoMapper.updateTemplateInfoQuality(pawDTO.getProjectId(), pawDTO.getPrimaryKeyId(), "private");

+ 57 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/wrapper/TextdictWrapper.java

@@ -0,0 +1,57 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.manager.entity.ExcelTab;
+import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.vo.ExcelTabVO;
+import org.springblade.manager.vo.TextdictInfoVO;
+import org.springblade.system.cache.SysCache;
+import org.springblade.system.entity.Role;
+import org.springblade.system.user.cache.UserCache;
+
+import java.util.Objects;
+
+/**
+ * 清表基础数据表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2022-05-18
+ */
+public class TextdictWrapper extends BaseEntityWrapper<TextdictInfo, TextdictInfoVO> {
+
+    public static TextdictWrapper build() {
+        return new TextdictWrapper();
+    }
+
+    @Override
+    public TextdictInfoVO entityVO(TextdictInfo textdictInfo) {
+        TextdictInfoVO excelTabVO = Objects.requireNonNull(BeanUtil.copy(textdictInfo, TextdictInfoVO.class));
+
+        //User createUser = UserCache.getUser(excelTab.getCreateUser());
+        if(textdictInfo.getType()==2){
+            Role role = SysCache.getRole(Long.valueOf(textdictInfo.getSigRoleId()));
+            excelTabVO.setParentRoleId(role.getParentId()+"");
+        }
+
+
+        return excelTabVO;
+    }
+
+}