浏览代码

后管-WBS管理-调整表单-默认值,改为在html上面操作数据

LHB 2 月之前
父节点
当前提交
a203d06d92

+ 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("删除成功");
         }

+ 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);
 

+ 6 - 8
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -46,10 +46,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 /**
  * 参数信息表 服务实现类
@@ -193,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;
@@ -215,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");
@@ -225,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);