Просмотр исходного кода

Merge branch 'lihb' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

# Conflicts:
#	blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/ITextdictInfoService.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java
LHB 2 месяцев назад
Родитель
Сommit
bcad672d8a

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

@@ -102,11 +102,6 @@ public class TextdictInfoController extends BladeController {
     @ApiOperationSupport(order = 2)
     @ApiOperation(value = "分页", notes = "传入textdictInfo")
     public R<IPage<TextdictInfo>> list(TextdictInfo textdictInfo, Query query) {
-        if(textdictInfo.getType() == 4){
-            return R.data(textdictInfoService.analysisHtmlDefault(textdictInfo.getTabId()));
-        }
-
-
         IPage<TextdictInfo> pages = textdictInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(textdictInfo));
         return R.data(pages);
     }
@@ -118,7 +113,9 @@ public class TextdictInfoController extends BladeController {
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "分页", notes = "传入textdictInfo")
     public R<IPage<TextdictInfoVO>> page(TextdictInfoVO textdictInfo, Query query) {
-
+        if(textdictInfo.getType() == 4){
+            return R.data(textdictInfoService.analysisHtmlDefault(textdictInfo.getTabId()));
+        }
         IPage<TextdictInfoVO> pages = textdictInfoService.selectTextdictInfoPage(Condition.getPage(query), textdictInfo);
         return R.data(pages);
     }
@@ -162,9 +159,9 @@ public class TextdictInfoController extends BladeController {
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids,
                     @ApiParam(value = "wbs p_key_id", required = true) @RequestParam String tabId,
-                    @ApiParam(value = "colKey", required = false) @RequestParam String colKey,
-                    @ApiParam(value = "type", required = false) @RequestParam Integer type) throws FileNotFoundException {
-        if(type == 4){
+                    String colKey,
+                    Integer type) throws FileNotFoundException {
+        if(type != null && type == 4){
             textdictInfoService.removeHtmlDefault(tabId,colKey);
             return R.success("删除成功");
         }

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

@@ -93,6 +93,14 @@ public class WbsTreeSynchronousRecordController {
      */
     @PostMapping("add")
     public R<WbsTreeSynchronousRecord> insert(@RequestBody WbsTreeSynchronousRecord mWbsTreeSynchronousRecord) {
+        if (StringUtil.isBlank(mWbsTreeSynchronousRecord.getNodeId())) {
+            return R.fail("节点不能为空");
+        }else{
+            String[] split = mWbsTreeSynchronousRecord.getNodeId().split(",");
+            if(split.length > 100){
+                return R.fail("节点过多,如果勾选了父节点,请勿带子节点!");
+            }
+        }
         if (StringUtil.isBlank(mWbsTreeSynchronousRecord.getType())) {
             return R.fail("请选择同步类型");
         }

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

@@ -49,7 +49,7 @@ public interface ITextdictInfoService extends IService<TextdictInfo> {
 
     TextdictInfo selectTextdictInfoOne(String id,String sigRoleId,String projectId);
 
-    IPage<TextdictInfo> analysisHtmlDefault(String tabId);
+    IPage<TextdictInfoVO> analysisHtmlDefault(String tabId);
 
     void removeHtmlDefault(String tabId, String colKey);
 

+ 16 - 47
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -33,7 +33,6 @@ import org.springblade.manager.entity.TextdictInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.mapper.TextdictInfoMapper;
 import org.springblade.manager.mapper.WbsTreePrivateMapper;
-import org.springblade.manager.service.ISignConfigService;
 import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.TextdictBy345VO;
@@ -48,7 +47,6 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 参数信息表 服务实现类
@@ -60,9 +58,6 @@ import java.util.stream.Collectors;
 public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, TextdictInfo> implements ITextdictInfoService {
     @Resource
     private WbsTreePrivateMapper wbsTreePrivateMapper;
-
-    @Resource
-    private ISignConfigService iSignConfigService;
     @Override
     public IPage<TextdictInfoVO> selectTextdictInfoPage(IPage<TextdictInfoVO> page, TextdictInfoVO textdictInfo) {
         List<TextdictInfoVO> textdict = new ArrayList<>();
@@ -74,47 +69,20 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 String htmlString = IoUtil.readToString(fileInputStream);
                 Document doc = Jsoup.parse(htmlString);
                 Elements table = doc.getElementsByAttribute("dqid");
-                List<String> dqid = new ArrayList<>();
-                List<String> keys = new ArrayList<>();
-                for(Element ek:table){
-                    dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
-                    Elements keyNames = ek.getElementsByAttribute("keyname");
-                    if(Func.isNotEmpty(keyNames)){
-                        for(Element keyName:keyNames){
-                            keys.addAll(Func.toStrList("\\|\\|",keyName.attr("keyname")));
-                        }
-                    }
-                }
-                if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
-                    if(Func.isNotEmpty(dqid) && dqid.size() > 0){
-                        textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
-                    }else {
-                        textdict = new ArrayList<>();
-                    }
-                }else{
-                    textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
-                }
-                if (textdict != null && !keys.isEmpty()) {
-                    for (TextdictInfoVO vo : textdict) {
-                        if (!(privateInfo.getPKeyId() + "").equals(vo.getTabId())) {
-                            vo.setIsSystem(1);
-                        }
-                        keys.remove(vo.getColKey());
+
+                    List<String> dqid = new ArrayList<>();
+                    for(Element ek:table){
+                        dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
                     }
-                    if (Func.isNotEmpty(keys)) {
-                        // 查询系统级电签配置
-                        TextdictInfoVO temp = textdict.stream().findFirst().orElse(null);
-                        if (temp == null) {
-                            temp = new TextdictInfoVO();
-                            temp.setProjectId(privateInfo.getProjectId());
-                            temp.setExcelId(privateInfo.getExcelId() + "");
-                            temp.setTabId(privateInfo.getPKeyId() + "");
-                            temp.setType(2);
+                    if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
+                        if(Func.isNotEmpty(dqid) && dqid.size() > 0){
+                            textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
+                        }else {
+                            textdict = new ArrayList<>();
                         }
-                        List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
-                        textdict.addAll(textdictList);
+                    }else{
+                        textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
                     }
-                }
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
@@ -222,12 +190,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
     }
 
     @Override
-    public IPage<TextdictInfo> analysisHtmlDefault(String tabId) {
+    public IPage<TextdictInfoVO> analysisHtmlDefault(String tabId) {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
 
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(tabId));
-        IPage<TextdictInfo> textdictInfoPage = new Page<TextdictInfo>();
+        IPage<TextdictInfoVO> textdictInfoPage = new Page<TextdictInfoVO>();
         try {
             File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
             InputStream fileInputStream;
@@ -244,9 +212,9 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
             Element table = doc.select("table").first();
             Elements elements = table.select("[defText]");
 
-            ArrayList<TextdictInfo> textdictInfos = new ArrayList<>();
+            ArrayList<TextdictInfoVO> textdictInfos = new ArrayList<>();
             for (Element element : elements) {
-                TextdictInfo textdictInfo = new TextdictInfo();
+                TextdictInfoVO textdictInfo = new TextdictInfoVO();
                 String keyname = element.attr("keyname");
                 String placeholder = element.attr("placeholder");
                 String defText = element.attr("defText");
@@ -254,6 +222,7 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 textdictInfo.setColName(placeholder);
                 textdictInfo.setSigRoleName(defText);
                 textdictInfo.setType(4);
+                textdictInfo.setId(-1L);
                 textdictInfos.add(textdictInfo);
             }
             textdictInfoPage.setRecords(textdictInfos);

+ 2 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsSynchronousServiceImpl.java

@@ -438,12 +438,9 @@ public class WbsSynchronousServiceImpl {
                                 editPrivateNode.setIsLinkTable(2);
                             }
 
-                            //元素 是与表绑定
-                            if (collect.contains(3)) {
+                            //元素、公式 是根据init_table_id去查询
+                            if (collect.contains(3) || collect.contains(5)) {
                                 editPrivateNode.setInitTableName(templateNode.getInitTableName());
-                            }
-                            //公式 根据init_table_id去查询的
-                            if (collect.contains(5)) {
                                 editPrivateNode.setInitTableId(templateNode.getInitTableId());
                             }