Procházet zdrojové kódy

Merge branch 'master' into auth

# Conflicts:
#	boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/array/ArrayUtils.java
#	boman-web-core/src/main/java/com/boman/web/core/controller/CommonController.java
#	boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java
#	boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java
#	boman-web-core/src/main/java/com/boman/web/core/service/common/ICommonService.java
#	boman-web-core/src/main/java/com/boman/web/core/service/select/BaseSelectServiceImpl.java
#	boman-web-core/src/main/java/com/boman/web/core/service/select/IBaseSelectService.java
shiqian před 4 roky
rodič
revize
5d0abf65e3
64 změnil soubory, kde provedl 1639 přidání a 1066 odebrání
  1. 1 1
      boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteFileService.java
  2. 25 3
      boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteSysMenuService.java
  3. 1 1
      boman-api/boman-api-system/src/main/java/com/boman/system/api/factory/RemoteFileFallbackFactory.java
  4. 15 3
      boman-api/boman-domain/src/main/java/com.boman.domain/GenTable.java
  5. 22 0
      boman-api/boman-domain/src/main/java/com.boman.domain/GenTableColumn.java
  6. 1 13
      boman-api/boman-domain/src/main/java/com.boman.domain/SysFile.java
  7. 10 0
      boman-api/boman-domain/src/main/java/com.boman.domain/constant/SubmitConstant.java
  8. 8 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/constant/UserConstants.java
  9. 4 12
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/array/ArrayUtils.java
  10. 5 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/collection/CollectionUtils.java
  11. 2 2
      boman-common/boman-common-redis/src/main/java/com/boman/common/redis/service/RedisService.java
  12. 1 1
      boman-modules/boman-file/src/main/java/com/boman/file/controller/SysFileController.java
  13. 23 15
      boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenController.java
  14. 7 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableColumnMapper.java
  15. 4 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableMapper.java
  16. 88 60
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java
  17. 136 56
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableServiceImpl.java
  18. 7 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableColumnService.java
  19. 5 0
      boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml
  20. 6 2
      boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableMapper.xml
  21. 28 0
      boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java
  22. 1 1
      boman-modules/boman-system/src/main/java/com/boman/system/controller/SysProfileController.java
  23. 7 0
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysMenuMapper.java
  24. 4 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java
  25. 91 126
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java
  26. 7 0
      boman-modules/boman-system/src/main/resources/mapper/system/SysMenuMapper.xml
  27. 4 0
      boman-web-core/.rebel-remote.xml.bak
  28. 16 0
      boman-web-core/.rebel.xml.bak
  29. 8 6
      boman-web-core/src/main/java/com/boman/web/core/controller/CommonController.java
  30. 55 39
      boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java
  31. 56 215
      boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java
  32. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/common/CommonServiceImpl.java
  33. 2 10
      boman-web-core/src/main/java/com/boman/web/core/service/common/ICommonService.java
  34. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/save/BaseSaveServiceImpl.java
  35. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/save/IBaseSaveService.java
  36. 9 38
      boman-web-core/src/main/java/com/boman/web/core/service/select/BaseSelectServiceImpl.java
  37. 3 9
      boman-web-core/src/main/java/com/boman/web/core/service/select/IBaseSelectService.java
  38. 20 52
      boman-web-core/src/main/java/com/boman/web/core/utils/ColumnUtils.java
  39. 193 0
      boman-web-core/src/main/java/com/boman/web/core/utils/HandlerFormDataUtils.java
  40. 2 2
      boman-web-core/src/main/java/com/boman/web/core/utils/IdUtils.java
  41. 20 0
      boman-web-core/src/main/java/com/boman/web/core/utils/JSONObjectUtils.java
  42. 10 10
      ruoyi-ui/src/api/activiti/definition.js
  43. 13 0
      ruoyi-ui/src/api/modeler.js
  44. binární
      ruoyi-ui/src/assets/images/pic_sy_ytj.png
  45. 60 0
      ruoyi-ui/src/components/BigPicture/index.vue
  46. 37 15
      ruoyi-ui/src/components/DynamicForm/index.vue
  47. 44 16
      ruoyi-ui/src/components/DynamicForms/index.vue
  48. 3 3
      ruoyi-ui/src/components/FormItemComponent/index.vue
  49. 3 2
      ruoyi-ui/src/components/HistoricalProcess/index.vue
  50. 48 24
      ruoyi-ui/src/components/MutipleSelectPop/index.vue
  51. 23 16
      ruoyi-ui/src/components/StandardTable/index.vue
  52. 48 24
      ruoyi-ui/src/components/mutipleSelectPop/index.vue
  53. 30 16
      ruoyi-ui/src/components/todoProcess/index.vue
  54. 2 0
      ruoyi-ui/src/main.js
  55. 1 0
      ruoyi-ui/src/utils/request.js
  56. 30 25
      ruoyi-ui/src/views/activiti/modeler/index.vue
  57. 9 24
      ruoyi-ui/src/views/index.vue
  58. 30 12
      ruoyi-ui/src/views/system/editing/index.vue
  59. 32 10
      ruoyi-ui/src/views/system/form/index.vue
  60. 2 1
      ruoyi-ui/src/views/system/post/index.vue
  61. 25 8
      ruoyi-ui/src/views/system/surface/index.vue
  62. 254 178
      ruoyi-ui/src/views/system/table/index.vue
  63. 25 2
      ruoyi-ui/src/views/tool/gen/basicInfoForm.vue
  64. 10 10
      ruoyi-ui/src/views/tool/gen/editTable.vue

+ 1 - 1
boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteFileService.java

@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RequestPart;
 import org.springframework.web.multipart.MultipartFile;
 import com.boman.common.core.constant.ServiceNameConstants;
 import com.boman.common.core.domain.R;
-import com.boman.system.api.domain.SysFile;
+import com.boman.domain.SysFile;
 import com.boman.system.api.factory.RemoteFileFallbackFactory;
 
 /**

+ 25 - 3
boman-api/boman-api-system/src/main/java/com/boman/system/api/RemoteSysMenuService.java

@@ -5,9 +5,9 @@ import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.system.api.domain.SysMenu;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * @author tjf
@@ -18,10 +18,32 @@ public interface RemoteSysMenuService {
 
     /**
      * 新增菜单
+     *
      * @param menu 菜单
      * @return
      */
     @PostMapping("/menu")
     public AjaxResult add(@Validated @RequestBody SysMenu menu);
 
+    /**
+     * 查询菜单信息
+     *
+     * @param menu
+     * @return
+     */
+    @PostMapping("/menu/listAll")
+    public List<SysMenu> listAll(@Validated @RequestBody SysMenu menu);
+
+    /**
+     * 删除菜单
+     * @param id
+     * @return
+     */
+    @DeleteMapping("/menu/remove/{id}")
+    public AjaxResult remove(@PathVariable("id") Long id);
+
+    @PutMapping("/menu")
+    public AjaxResult edit(@Validated @RequestBody SysMenu menu);
+
+
 }

+ 1 - 1
boman-api/boman-api-system/src/main/java/com/boman/system/api/factory/RemoteFileFallbackFactory.java

@@ -6,7 +6,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 import com.boman.common.core.domain.R;
 import com.boman.system.api.RemoteFileService;
-import com.boman.system.api.domain.SysFile;
+import com.boman.domain.SysFile;
 import feign.hystrix.FallbackFactory;
 
 /**

+ 15 - 3
boman-api/boman-domain/src/main/java/com.boman.domain/GenTable.java

@@ -29,7 +29,11 @@ public class GenTable extends BaseEntity
     public static final String I = "I";
 
     /** 编号 */
-    private Long Id;
+    private Long id;
+    /**
+     * 前端传来提示修改的状态 1:修改gen_table  2:修改gen_table_column
+     */
+    private String updateType;
 
     /** 表名称 */
 //    @NotBlank(message = "表名称不能为空")
@@ -190,6 +194,14 @@ public class GenTable extends BaseEntity
      */
     private Boolean isContainsBlob;
 
+    public String getUpdateType() {
+        return updateType;
+    }
+
+    public void setUpdateType(String updateType) {
+        this.updateType = updateType;
+    }
+
     public String getAkColumnName() {
         return akColumnName;
     }
@@ -319,11 +331,11 @@ public class GenTable extends BaseEntity
     }
 
     public Long getId() {
-        return Id;
+        return id;
     }
 
     public void setId(Long id) {
-        Id = id;
+        this.id = id;
     }
 
     public String getTableName()

+ 22 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/GenTableColumn.java

@@ -150,12 +150,27 @@ public class GenTableColumn extends BaseEntity
      */
     private String regular;
 
+    /**
+     * readonly, 前端回显的时候,判断是否可编辑
+     */
+    private boolean readonly;
+
     /**
      * 查询时:{"fkTableName":"外键表的表名", "fkColumnName":"关联外键表的列名", "dkColumnName":"关联表需要展示的字段名"}
      * 根据列名获取关联表字段的值和名称{"name":"12", "value":"dept_id"}
      */
     private Map<String, Object> fkInfo;
 
+    private List<SysFile> annex;
+
+    public List<SysFile> getAnnex() {
+        return annex;
+    }
+
+    public void setAnnex(List<SysFile> annex) {
+        this.annex = annex;
+    }
+
     public Map<String, Object> getFkInfo() {
         return fkInfo;
     }
@@ -601,4 +616,11 @@ public class GenTableColumn extends BaseEntity
         this.columnValue = columnValue;
     }
 
+    public boolean isReadonly() {
+        return readonly;
+    }
+
+    public void setReadonly(boolean readonly) {
+        this.readonly = readonly;
+    }
 }

+ 1 - 13
boman-api/boman-api-system/src/main/java/com/boman/system/api/domain/SysFile.java → boman-api/boman-domain/src/main/java/com.boman.domain/SysFile.java

@@ -1,7 +1,4 @@
-package com.boman.system.api.domain;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+package com.boman.domain;
 
 /**
  * 文件信息
@@ -66,13 +63,4 @@ public class SysFile
         this.uid = uid;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("name", getName())
-            .append("url", getUrl())
-            .append("uid", getUid())
-            .append("status", getStatus())
-            .toString();
-    }
 }

+ 10 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/constant/SubmitConstant.java

@@ -60,4 +60,14 @@ public class SubmitConstant {
      * 批量提交的时候,状态压根就不符合
      */
     public static final String NOT_ALLOWED = "NOT_ALLOWED";
+
+    /**
+     * STATUS
+     */
+    public static final String STATUS = "status";
+
+    /**
+     * READ_ONLY
+     */
+    public static final boolean READONLY = true;
 }

+ 8 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/constant/UserConstants.java

@@ -82,4 +82,12 @@ public class UserConstants
     public static final String INCREMENT = "1";
 
     public static final String ISMENU = "Y";
+    /**
+     * 基本信息保存
+     */
+    public static final String UPLOAD_TYPE = "1";
+    /**
+     * 字段保存
+     */
+    public static final String UPLOAD_TYPE_TWO = "2";
 }

+ 4 - 12
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/array/ArrayUtils.java

@@ -1,8 +1,6 @@
 package com.boman.common.core.utils.array;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 
 /**
  * @author shiqian
@@ -22,18 +20,12 @@ public class ArrayUtils extends org.apache.commons.lang3.ArrayUtils {
     }
 
     /**
-     * 按照逗号切割,转成list, 给id用的,因为id都是long
+     * 数组是否为空
      *
-     * @param ids ids
+     * @param value 数组
      * @return 是否包含
      */
-    public static List<Long> split(String ids) {
-        String[] split = ids.split(",");
-        List<Long> result = new ArrayList<>(split.length);
-        for (String idStr : split) {
-            result.add(Long.parseLong(idStr));
-        }
-
-        return result;
+    public static boolean equalsEmptyArray(String value) {
+        return "[]".equals(value);
     }
 }

+ 5 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/collection/CollectionUtils.java

@@ -2,6 +2,7 @@ package com.boman.common.core.utils.collection;
 
 import com.boman.common.core.utils.obj.ObjectUtils;
 
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -14,4 +15,8 @@ public class CollectionUtils {
         ObjectUtils.requireNonNull(longList);
         return longList.toArray(new Long[0]);
     }
+
+    public static boolean containsIgnoreCase(Collection<String> list, String key) {
+        return list.contains(key.toLowerCase()) || list.contains(key.toUpperCase());
+    }
 }

+ 2 - 2
boman-common/boman-common-redis/src/main/java/com/boman/common/redis/service/RedisService.java

@@ -248,8 +248,8 @@ public class RedisService
      * @return long 增加以后的值
      */
 
-    public long increment(String key, long... increment) {
-        return redisTemplate.opsForValue().increment(key, ArrayUtils.isEmpty(increment) ? 1L : increment[0]);
+    public int increment(String key, long... increment) {
+         return Integer.parseInt(redisTemplate.opsForValue().increment(key, ArrayUtils.isEmpty(increment) ? 1 : increment[0]).toString());
     }
 
 }

+ 1 - 1
boman-modules/boman-file/src/main/java/com/boman/file/controller/SysFileController.java

@@ -9,7 +9,7 @@ import org.springframework.web.multipart.MultipartFile;
 import com.boman.common.core.domain.R;
 import com.boman.common.core.utils.file.FileUtils;
 import com.boman.file.service.ISysFileService;
-import com.boman.system.api.domain.SysFile;
+import com.boman.domain.SysFile;
 
 /**
  * 文件请求处理

+ 23 - 15
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenController.java

@@ -7,6 +7,8 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import com.boman.common.core.constant.UserConstants;
+import com.boman.gen.service.ILoadTableServer;
+import com.boman.gen.service.LoadTableServerImpl;
 import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -44,6 +46,9 @@ public class GenController extends BaseController {
     @Autowired
     private IGenTableColumnService genTableColumnService;
 
+    @Autowired
+    private ILoadTableServer loadTableServer;
+
     /**
      * 查询代码生成列表
      */
@@ -65,9 +70,9 @@ public class GenController extends BaseController {
         List<GenTable> tables = genTableService.selectGenTableAll();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("info" , table);
-        map.put("rows" , list);
-        map.put("tables" , tables);
+        map.put("info", table);
+        map.put("rows", list);
+        map.put("tables", tables);
         return AjaxResult.success(map);
     }
 
@@ -120,7 +125,7 @@ public class GenController extends BaseController {
      * 导入表结构(保存)
      */
     @PreAuthorize(hasPermi = "tool:gen:list")
-    @Log(title = "代码生成" , businessType = BusinessType.IMPORT)
+    @Log(title = "代码生成", businessType = BusinessType.IMPORT)
     @PostMapping("/importTable")
     public AjaxResult importTableSave(String tables) {
         String[] tableNames = Convert.toStrArray(tables);
@@ -134,11 +139,12 @@ public class GenController extends BaseController {
      * 修改保存代码生成业务
      */
     @PreAuthorize(hasPermi = "tool:gen:edit")
-    @Log(title = "代码生成" , businessType = BusinessType.UPDATE)
+    @Log(title = "代码生成", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult editSave(@Validated @RequestBody GenTable genTable) {
         genTableService.validateEdit(genTable);
         genTableService.updateGenTable(genTable);
+        loadTableServer.loadTable(new GenTable());
         return AjaxResult.success();
     }
 
@@ -146,10 +152,11 @@ public class GenController extends BaseController {
      * 删除代码生成
      */
     @PreAuthorize(hasPermi = "tool:gen:remove")
-    @Log(title = "代码生成" , businessType = BusinessType.DELETE)
+    @Log(title = "代码生成", businessType = BusinessType.DELETE)
     @DeleteMapping("/{tableIds}")
     public AjaxResult remove(@PathVariable Long[] tableIds) {
         genTableService.deleteGenTableByIds(tableIds);
+        loadTableServer.loadTable(new GenTable());
         return AjaxResult.success();
     }
 
@@ -167,7 +174,7 @@ public class GenController extends BaseController {
      * 生成代码(下载方式)
      */
     //@PreAuthorize(hasPermi = "tool:gen:code")
-    @Log(title = "代码生成" , businessType = BusinessType.GENCODE)
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/download/{tableName}")
     public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
         byte[] data = genTableService.downloadCode(tableName);
@@ -178,7 +185,7 @@ public class GenController extends BaseController {
      * 生成代码(自定义路径)
      */
     @PreAuthorize(hasPermi = "tool:gen:code")
-    @Log(title = "代码生成" , businessType = BusinessType.GENCODE)
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
     public AjaxResult genCode(@PathVariable("tableName") String tableName) {
         genTableService.generatorCode(tableName);
@@ -189,7 +196,7 @@ public class GenController extends BaseController {
      * 同步数据库
      */
     @PreAuthorize(hasPermi = "tool:gen:edit")
-    @Log(title = "代码生成" , businessType = BusinessType.UPDATE)
+    @Log(title = "代码生成", businessType = BusinessType.UPDATE)
     @GetMapping("/synchDb/{tableName}")
     public AjaxResult synchDb(@PathVariable("tableName") String tableName) {
         genTableService.synchDb(tableName);
@@ -200,7 +207,7 @@ public class GenController extends BaseController {
      * 批量生成代码
      */
     @PreAuthorize(hasPermi = "tool:gen:code")
-    @Log(title = "代码生成" , businessType = BusinessType.GENCODE)
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/batchGenCode")
     public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
         String[] tableNames = Convert.toStrArray(tables);
@@ -213,8 +220,8 @@ public class GenController extends BaseController {
      */
     private void genCode(HttpServletResponse response, byte[] data) throws IOException {
         response.reset();
-        response.setHeader("Content-Disposition" , "attachment; filename=\"boMan.zip\"");
-        response.addHeader("Content-Length" , "" + data.length);
+        response.setHeader("Content-Disposition", "attachment; filename=\"boMan.zip\"");
+        response.addHeader("Content-Length", "" + data.length);
         response.setContentType("application/octet-stream; charset=UTF-8");
         IOUtils.write(data, response.getOutputStream());
     }
@@ -226,10 +233,11 @@ public class GenController extends BaseController {
      */
     @PostMapping("/addTable")
     public AjaxResult add(@Validated @RequestBody GenTable genTable) {
-        if (UserConstants.NOT_UNIQUE.equals(genTableService.checkTableNameUnique(genTable)))
-        {
+        if (UserConstants.NOT_UNIQUE.equals(genTableService.checkTableNameUnique(genTable))) {
             return AjaxResult.error("新增表名'" + genTable.getTableName() + "'失败,表名已存在");
         }
-        return genTableService.insertGenTable(genTable);
+        AjaxResult ajaxResult = genTableService.insertGenTable(genTable);
+        loadTableServer.loadTable(new GenTable());
+        return ajaxResult;
     }
 }

+ 7 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableColumnMapper.java

@@ -27,6 +27,13 @@ public interface GenTableColumnMapper
      */
     public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
 
+    /**
+     * 查询所有是输入或者显示的字段
+     * @param tableId
+     * @return
+     */
+    public List<GenTableColumn> selectGenTableColumnIsListByTableId(Long tableId);
+
     /**
      * 查询字段列表
      * @param genTableColumn

+ 4 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableMapper.java

@@ -2,6 +2,7 @@ package com.boman.gen.mapper;
 
 import java.util.List;
 import com.boman.domain.GenTable;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 业务 数据层
@@ -73,6 +74,9 @@ public interface GenTableMapper
      */
     public int updateGenTable(GenTable genTable);
 
+
+    public int updateGenTableColumnNull(@Param("tableId") Long tableId);
+
     /**
      * 批量删除业务
      * 

+ 88 - 60
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java

@@ -18,6 +18,7 @@ import com.google.common.collect.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -36,8 +37,6 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     private GenTableMapper genTableMapper;
     @Autowired
     private TableSqlMapper tableSqlMapper;
-    @Autowired
-    private ILoadTableServer loadTableServer;
 
     /**
      * 查询业务字段列表
@@ -49,16 +48,16 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) {
         List<GenTableColumn> genTableColumns = genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
         for (GenTableColumn genTableColumn : genTableColumns) {
-            if (genTableColumn.getHrParentId() != null){
+            if (genTableColumn.getHrParentId() != null) {
                 for (GenTableColumn tableColumn : genTableColumns) {
-                    if (genTableColumn.getHrParentId().equals(tableColumn.getId())){
+                    if (genTableColumn.getHrParentId().equals(tableColumn.getId())) {
                         genTableColumn.setHrParentName(tableColumn.getColumnName());
                         break;
                     }
                 }
             }
-            if (genTableColumn.getForeignKey() != null){
-                GenTableColumn genTableColumn1 = selectGenTableColumnListByColumnId(genTableColumn.getId());
+            if (genTableColumn.getForeignKey() != null) {
+                GenTableColumn genTableColumn1 = selectGenTableColumnListByColumnId(genTableColumn.getForeignKey());
                 genTableColumn.setForeignKeyName(genTableColumn1.getColumnName());
             }
         }
@@ -127,9 +126,10 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     @Override
     public int insertGenTableColumn(GenTableColumn genTableColumn) {
         int i = genTableColumnMapper.insertGenTableColumn(genTableColumn);
-        isAk(genTableColumn);
-        insertCreateLog(genTableColumn, BusinessType.INSERT);
-        loadTableServer.loadTable(new GenTable());
+        List<GenTableColumn> list = new ArrayList<>();
+        list.add(genTableColumn);
+        isAk(list);
+        insertCreateLog(list, BusinessType.INSERT);
         return i;
     }
 
@@ -141,78 +141,108 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
      */
     @Override
     public int updateGenTableColumn(GenTableColumn genTableColumn) {
+        List<GenTableColumn> list = new ArrayList<>();
+        list.add(genTableColumn);
+        isAk(list);
+        insertCreateLog(list, BusinessType.UPDATE);
+        return genTableColumnMapper.updateGenTableColumn(genTableColumn);
+    }
+
+
+    /**
+     * 批量修改genTableColumn
+     *
+     * @param genTableColumn
+     * @return
+     */
+    @Override
+    public void updateGenTableColumnList(List<GenTableColumn> genTableColumn) {
         isAk(genTableColumn);
         insertCreateLog(genTableColumn, BusinessType.UPDATE);
-        int i = genTableColumnMapper.updateGenTableColumn(genTableColumn);
-        loadTableServer.loadTable(new GenTable());
-        return i;
+        for (GenTableColumn tableColumn : genTableColumn) {
+            genTableColumnMapper.updateGenTableColumn(tableColumn);
+        }
     }
 
     /**
      * 插入表sql日志
      */
-    public void insertCreateLog(GenTableColumn genTableColumn, BusinessType type) {
-        GenTable genTable = genTableMapper.selectGenTableById(genTableColumn.getTableId());
+    public void insertCreateLog(List<GenTableColumn> genTableColumnList, BusinessType type) {
+        GenTable genTable = genTableMapper.selectGenTableById(genTableColumnList.get(0).getTableId());
+        TableSql tableSql = tableSqlMapper.selectTableSqlByTableId(genTableColumnList.get(0).getTableId());
         //新增业务字段的同时新增一条建表sql修改日志
-        TableSql tableSql = tableSqlMapper.selectTableSqlByTableId(genTableColumn.getTableId());
         String createLog = "";
         if (tableSql != null) {
             createLog = tableSql.getCreateLog();
         }
         StringBuffer sb = new StringBuffer(createLog);
-        //ALTER TABLE table_name ADD COLUMN column_name VARCHAR(100) DEFAULT NULL COMMENT '新加字段';
-        sb.append("\r\n").append(DateUtils.getTime()).append(" ").append(SecurityUtils.getUsername()).append(" ALTER TABLE ").append(genTable.getTableName());
-        if (BusinessType.INSERT.equals(type)) {
-            sb.append(" ADD COLUMN ").append(genTableColumn.getColumnName()).append(" ").append(genTableColumn.getColumnType());
-            sb = genTableColumn.getDefaultValue() == null ? sb.append(" DEFAULT NULL COMMENT ") : sb.append(" DEFAULT '").append(genTableColumn.getDefaultValue()).append("' COMMENT '");
-            sb.append(genTableColumn.getColumnComment()).append("';");
-        } else if (BusinessType.UPDATE.equals(type)) {
-            sb.append(" MODIFY ").append(genTableColumn.getColumnName()).append(" ").append(genTableColumn.getColumnType()).append(";");
-        } else if (BusinessType.DELETE.equals(type)) {
-            sb.append(" DROP ").append(genTableColumn.getColumnName()).append(";");
+        for (GenTableColumn genTableColumn : genTableColumnList) {
+            //ALTER TABLE table_name ADD COLUMN column_name VARCHAR(100) DEFAULT NULL COMMENT '新加字段';
+            sb.append("\r\n").append(DateUtils.getTime()).append(" ").append(SecurityUtils.getUsername()).append(" ALTER TABLE ").append(genTable.getTableName());
+            if (BusinessType.INSERT.equals(type)) {
+                sb.append(" ADD COLUMN ").append(genTableColumn.getColumnName()).append(" ").append(genTableColumn.getColumnType());
+                sb = genTableColumn.getDefaultValue() == null ? sb.append(" DEFAULT NULL COMMENT ") : sb.append(" DEFAULT '").append(genTableColumn.getDefaultValue()).append("' COMMENT '");
+                sb.append(genTableColumn.getColumnComment()).append("';");
+            } else if (BusinessType.UPDATE.equals(type)) {
+                sb.append(" MODIFY ").append(genTableColumn.getColumnName()).append(" ").append(genTableColumn.getColumnType()).append(";");
+            } else if (BusinessType.DELETE.equals(type)) {
+                sb.append(" DROP ").append(genTableColumn.getColumnName()).append(";");
+            }
+        }
+        if (tableSql != null) {
+            tableSql.setCreateLog(sb.toString());
+            tableSqlMapper.updateTableSql(tableSql);
         }
-        tableSql.setCreateLog(sb.toString());
-        tableSqlMapper.updateTableSql(tableSql);
     }
 
     /**
      * 判断对象是否设置显示和输入字段
      *
-     * @param genTableColumn
+     * @param genTableColumnList
      */
-    public void isAk(GenTableColumn genTableColumn) {
-        //是否是输入
-        String isIn = genTableColumn.getIsIn();
-        //是否是显示
-        String isOut = genTableColumn.getIsOut();
-        List<GenTableColumn> genTableColumns = genTableColumnMapper.selectGenTableColumnListByTableId(genTableColumn.getTableId());
+    public void isAk(List<GenTableColumn> genTableColumnList) {
         GenTable genTable = new GenTable();
-        if (UserConstants.YES.equals(isIn)) {
-            //判断是否已经存在输入字段且不是同一个字段
-            for (GenTableColumn tableColumn : genTableColumns) {
-                if (UserConstants.YES.equals(tableColumn.getIsIn()) && !tableColumn.getId().equals(genTableColumn.getId())) {
-                    tableColumn.setIsIn("N");
-                    genTableColumnMapper.updateGenTableColumn(tableColumn);
-                    break;
+        for (GenTableColumn genTableColumn : genTableColumnList) {
+            //是否是输入
+            String isIn = genTableColumn.getIsIn();
+            //是否是显示
+            String isOut = genTableColumn.getIsOut();
+            //查询出该表所有是输入或者是显示的字段
+            List<GenTableColumn> genTableColumns = genTableColumnMapper.selectGenTableColumnIsListByTableId(genTableColumn.getTableId());
+            if (UserConstants.YES.equals(isIn)) {
+                //判断是否已经存在输入字段且不是同一个字段
+                if (genTableColumns.size() > 0) {
+                    for (GenTableColumn tableColumn : genTableColumns) {
+                        if (UserConstants.YES.equals(tableColumn.getIsIn()) && !tableColumn.getId().equals(genTableColumn.getId())) {
+                            tableColumn.setIsIn("N");
+                            genTableColumnMapper.updateGenTableColumn(tableColumn);
+                            break;
+                        }
+                    }
                 }
+                genTable.setId(genTableColumn.getTableId());
+                genTable.setAkColumn(genTableColumn.getId());
             }
-            genTable.setId(genTableColumn.getTableId());
-            genTable.setAkColumn(genTableColumn.getId());
-        }
-        if (UserConstants.YES.equals(isOut)) {
-            //判断是否已经存在显示字段且不是同一个字段
-            for (GenTableColumn tableColumn : genTableColumns) {
-                if (UserConstants.YES.equals(tableColumn.getIsOut()) && !tableColumn.getId().equals(genTableColumn.getId())) {
-                    tableColumn.setIsOut("N");
-                    genTableColumnMapper.updateGenTableColumn(tableColumn);
-                    break;
+            if (UserConstants.YES.equals(isOut)) {
+                //判断是否已经存在显示字段且不是同一个字段
+                if (genTableColumns.size() > 0) {
+                    for (GenTableColumn tableColumn : genTableColumns) {
+                        if (UserConstants.YES.equals(tableColumn.getIsOut()) && !tableColumn.getId().equals(genTableColumn.getId())) {
+                            tableColumn.setIsOut("N");
+                            genTableColumnMapper.updateGenTableColumn(tableColumn);
+                            break;
+                        }
+                    }
+                    genTable.setId(genTableColumn.getTableId());
+                    genTable.setDkColumn(genTableColumn.getId());
                 }
             }
-            genTable.setId(genTableColumn.getTableId());
-            genTable.setDkColumn(genTableColumn.getId());
         }
         if (genTable.getId() != null) {
             genTableMapper.updateGenTable(genTable);
+        } else {
+            //表明没有显示和输入字段更新到gen表上
+            genTableMapper.updateGenTableColumnNull(genTableColumnList.get(0).getTableId());
         }
     }
 
@@ -225,9 +255,7 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
      */
     @Override
     public int deleteGenTableColumnByIds(String ids) {
-        int i = genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
-        loadTableServer.loadTable(new GenTable());
-        return i;
+        return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
     }
 
     /**
@@ -239,13 +267,13 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
     @Override
     public int deleteGenTableColumnByColumnIds(String ids) {
         Long[] longs = Convert.toLongArray(ids);
+        List<GenTableColumn> list = new ArrayList<>();
         for (Long aLong : longs) {
             GenTableColumn genTableColumn = genTableColumnMapper.selectGenTableColumnByColumnId(aLong);
-            insertCreateLog(genTableColumn, BusinessType.DELETE);
+            list.add(genTableColumn);
         }
-        int i = genTableColumnMapper.deleteGenTableColumnByColumnIds(Convert.toLongArray(ids));
-        loadTableServer.loadTable(new GenTable());
-        return i;
+        insertCreateLog(list, BusinessType.DELETE);
+        return genTableColumnMapper.deleteGenTableColumnByColumnIds(Convert.toLongArray(ids));
     }
 
     /**

+ 136 - 56
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableServiceImpl.java

@@ -1,12 +1,13 @@
 package com.boman.gen.service;
 
+import java.awt.*;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.StringWriter;
-import java.util.LinkedHashMap;
+import java.lang.reflect.Array;
+import java.util.*;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
@@ -48,6 +49,9 @@ import com.boman.gen.util.GenUtils;
 import com.boman.gen.util.VelocityInitializer;
 import com.boman.gen.util.VelocityUtils;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
 /**
  * 业务 服务层实现
  *
@@ -75,9 +79,6 @@ public class GenTableServiceImpl implements IGenTableService {
     @Autowired
     private GenTableRelationMapper genTableRelationMapper;
 
-    @Autowired
-    private ILoadTableServer loadTableServer;
-
     /**
      * 查询业务信息
      *
@@ -97,10 +98,12 @@ public class GenTableServiceImpl implements IGenTableService {
             if (tablePrimaryKey != null && tablePrimaryKey.equals(columnId)) {
                 genTable.setTablePrimaryKeyName(column.getColumnName());
                 index++;
-            }  if (akColumn != null && akColumn.equals(columnId)) {
+            }
+            if (akColumn != null && akColumn.equals(columnId)) {
                 genTable.setAkColumnName(column.getColumnName());
                 index++;
-            }  if (dkColumn != null && dkColumn.equals(columnId)) {
+            }
+            if (dkColumn != null && dkColumn.equals(columnId)) {
                 genTable.setDkColumnName(column.getColumnName());
                 index++;
             }
@@ -181,16 +184,19 @@ public class GenTableServiceImpl implements IGenTableService {
     @Override
     @Transactional
     public void updateGenTable(GenTable genTable) {
-        String options = JSON.toJSONString(genTable.getParams());
-        genTable.setOptions(options);
-        isMenu(genTable, BusinessType.UPDATE);
-        int row = genTableMapper.updateGenTable(genTable);
-        if (row > 0) {
-            for (GenTableColumn cenTableColumn : genTable.getColumns()) {
-                tableColumnService.updateGenTableColumn(cenTableColumn);
+        String updateType = genTable.getUpdateType();
+        if (UserConstants.UPLOAD_TYPE.equals(updateType)) {
+            String options = JSON.toJSONString(genTable.getParams());
+            genTable.setOptions(options);
+            isMenu(genTable, BusinessType.UPDATE);
+            genTableMapper.updateGenTable(genTable);
+        }
+        if (UserConstants.UPLOAD_TYPE_TWO.equals(updateType)) {
+            List<GenTableColumn> columns = genTable.getColumns();
+            if (columns.size() > 0){
+                tableColumnService.updateGenTableColumnList(columns);
             }
         }
-        loadTableServer.loadTable(new GenTable());
     }
 
     /**
@@ -207,7 +213,6 @@ public class GenTableServiceImpl implements IGenTableService {
         tableSqlService.deleteTableSqlByTableIds(tableIds);
         //删除关联关系
         genTableRelationMapper.deleteGenTableRelationByParentId(tableIds);
-        loadTableServer.loadTable(new GenTable());
     }
 
     /**
@@ -445,6 +450,8 @@ public class GenTableServiceImpl implements IGenTableService {
      */
     @Override
     public AjaxResult insertGenTable(GenTable genTable) {
+        String menuRole = genTable.getMenuRole();
+        genTable.setMenuRole(menuRole.toUpperCase());
         //新增表成功的时候,新增字段公共字段
         int i = genTableMapper.insertGenTable(genTable);
         if (i > 0) {
@@ -459,7 +466,6 @@ public class GenTableServiceImpl implements IGenTableService {
             TableSql tableSql = new TableSql();
             tableSql.setTableId(genTable.getId());
             tableSqlService.insertTableSql(tableSql);
-            loadTableServer.loadTable(new GenTable());
             return AjaxResult.success();
         }
         return AjaxResult.error();
@@ -526,12 +532,15 @@ public class GenTableServiceImpl implements IGenTableService {
             genTableColumn.setSort(num + i);
             genTableColumn.setCreateBy("admin");
             genTableColumn.setCreateTime(DateUtils.getNowDate());
-            genTableColumn.setHrParentId(genTableColumnBaseInfo.getId());
+            genTableColumn.setHrParentId(genTableColumnLog.getId());
             genTableColumn.setMask("000000");
             if (i == 0) {
                 genTableColumn.setSort(1);
                 genTableColumn.setIsPk("1");
-                genTableColumn.setHrParentId(genTableColumnLog.getId());
+                genTableColumn.setHrParentId(genTableColumnBaseInfo.getId());
+            }
+            if ("is_del".equals(columnName[i])) {
+                genTableColumn.setDefaultValue("N");
             }
             genTableColumnMapper.insertGenTableColumn(genTableColumn);
             //获得id字段的id
@@ -548,52 +557,123 @@ public class GenTableServiceImpl implements IGenTableService {
      * @param genTable
      */
     public void isMenu(GenTable genTable, BusinessType type) {
-
+        String tableName = genTable.getTableName();
         if (type.equals(BusinessType.UPDATE)) {
             //先查询之前是否是菜单
             GenTable genTableOld = genTableMapper.selectGenTableById(genTable.getId());
             if (UserConstants.ISMENU.equals(genTableOld.getIsMenu())) {
-                return;
+                //在判断是否新增/减少了菜单权限
+                String menuRoleOld = genTableOld.getMenuRole();
+                String menuRole = genTable.getMenuRole();
+                String[] strings = Convert.toStrArray("", menuRole.toUpperCase());
+                Set<String> set = new HashSet(Arrays.asList(strings));
+                Set<String> setTwo = new HashSet(Arrays.asList(strings));
+                String[] strArray = Convert.toStrArray("", menuRoleOld);
+                List<String> stringsOld = new ArrayList<>(Arrays.asList(strArray));
+                List<String> stringsOldTwo = new ArrayList<>(Arrays.asList(strArray));
+                SysMenu sysMenu = new SysMenu();
+                sysMenu.setSysTableName(tableName);
+                List<SysMenu> sysMenus = remoteSysMenuService.listAll(sysMenu);
+                //原先有,现在没有就删除
+                stringsOld.removeAll(set);
+                if (stringsOld.size() > 0) {
+                    for (String name : stringsOldTwo) {
+                        //获取到菜单名称
+                        String value = RoleEnum.getValue(name);
+                        for (SysMenu menu : sysMenus) {
+                            if (menu.getMenuName().equals(value)) {
+                                //删除
+                                remoteSysMenuService.remove(menu.getId());
+                            }
+                        }
+                    }
+                }
+                setTwo.removeAll(stringsOldTwo);
+                if (setTwo.size() > 0) {
+                    //获取parentId
+                    Long parentId = 0L;
+                    for (SysMenu menu : sysMenus) {
+                        if ("C".equals(menu.getMenuType())) {
+                            parentId = menu.getId();
+                            break;
+                        }
+                    }
+                    //现在有,原先没有,就判断是否有被隐藏停用的/否则新增
+                    for (int i = 0; i < setTwo.size(); i++) {
+                        SysMenu menu = new SysMenu();
+                        menu.setParentId(parentId);
+                        String value = RoleEnum.getValue(strings[i]);
+                        if (StringUtils.isNotBlank(value)) {
+                            for (SysMenu sysMenu1 : sysMenus) {
+                                if (value.equals(sysMenu1.getMenuName())) {
+                                    sysMenu1.setStatus("0");
+                                    sysMenu1.setVisible("0");
+                                    remoteSysMenuService.edit(sysMenu1);
+                                    break;
+                                }
+                            }
+                            menu.setMenuName(value);
+                            menu.setOrderNum(String.valueOf(i + 1));
+                            menu.setMenuType("F");
+                            menu.setIcon("#");
+                            //路由
+                            menu.setPath("#");
+                            menu.setCreateBy(SecurityUtils.getUsername());
+                            menu.setSysTableName(tableName);
+                            remoteSysMenuService.add(menu);
+                        }
+                    }
+                }
             }
         }
         String isMenu = genTable.getIsMenu();
         if (StringUtils.isNotBlank(isMenu) && isMenu.equals(UserConstants.ISMENU)) {
-            //生成主菜单
             SysMenu sysMenu = new SysMenu();
-            //表描述当菜单名称
-            sysMenu.setMenuName(genTable.getTableComment());
-            sysMenu.setParentId(2007L);
-            //路由地址(使用表名称)
-            sysMenu.setPath(genTable.getTableName());
-            //组件
-            sysMenu.setComponent("system/surface/index");
-            sysMenu.setMenuType("C");
-            sysMenu.setOrderNum("0");
-            sysMenu.setIcon("system");
-            sysMenu.setCreateBy(SecurityUtils.getUsername());
-            sysMenu.setSysTableName(genTable.getTableName());
-            sysMenu.setStatus("1");
-            AjaxResult add = remoteSysMenuService.add(sysMenu);
-            Long parentId = 0L;
-            if (add.size() > 2) {
-                String id = String.valueOf(add.get("data")) ;
-                parentId = Long.valueOf(id);
-            }
-            //获取菜单id
-            String menuRole = genTable.getMenuRole();
-            String[] strings = Convert.toStrArray("",menuRole);
-            if (strings.length > 0) {
-                for (int i = 0; i < strings.length; i++) {
-                    SysMenu menu = new SysMenu();
-                    menu.setParentId(parentId);
-                    menu.setMenuName(RoleEnum.getValue(strings[i]));
-                    menu.setOrderNum(String.valueOf(i + 1));
-                    menu.setMenuType("F");
-                    menu.setIcon("#");
-                    //路由
-                    menu.setPath("#");
-                    sysMenu.setCreateBy(SecurityUtils.getUsername());
-                    remoteSysMenuService.add(menu);
+            sysMenu.setSysTableName(tableName);
+            List<SysMenu> sysMenus = remoteSysMenuService.listAll(sysMenu);
+            //判断当前表名是否生成过菜单
+            if (sysMenus.size() == 0) {
+                //生成主菜单
+                //表描述当菜单名称
+                sysMenu.setMenuName(genTable.getTableComment());
+                sysMenu.setParentId(2007L);
+                //路由地址(使用表名称)
+                sysMenu.setPath(genTable.getTableName());
+                //组件
+                sysMenu.setComponent("system/surface/index");
+                sysMenu.setMenuType("C");
+                sysMenu.setOrderNum("0");
+                sysMenu.setIcon("system");
+                sysMenu.setCreateBy(SecurityUtils.getUsername());
+                sysMenu.setStatus("1");
+                AjaxResult add = remoteSysMenuService.add(sysMenu);
+                Long parentId = 0L;
+                if (add.size() > 2) {
+                    String id = String.valueOf(add.get("data"));
+                    parentId = Long.valueOf(id);
+                }
+                //获取菜单id
+                String menuRole = genTable.getMenuRole();
+                String[] strings = Convert.toStrArray("", menuRole);
+                Set set = new HashSet(Arrays.asList(strings));
+                strings = (String[]) set.toArray(new String[0]);
+                if (strings.length > 0) {
+                    for (int i = 0; i < strings.length; i++) {
+                        SysMenu menu = new SysMenu();
+                        menu.setParentId(parentId);
+                        String value = RoleEnum.getValue(strings[i]);
+                        if (StringUtils.isNotBlank(value)) {
+                            menu.setMenuName(value);
+                            menu.setOrderNum(String.valueOf(i + 1));
+                            menu.setMenuType("F");
+                            menu.setIcon("#");
+                            //路由
+                            menu.setPath("#");
+                            menu.setCreateBy(SecurityUtils.getUsername());
+                            menu.setSysTableName(tableName);
+                            remoteSysMenuService.add(menu);
+                        }
+                    }
                 }
             }
         }

+ 7 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableColumnService.java

@@ -62,6 +62,13 @@ public interface IGenTableColumnService
      */
     public int updateGenTableColumn(GenTableColumn genTableColumn);
 
+    /**
+     * 批量修改业务字段
+     * @param genTableColumn
+     * @return
+     */
+    public void updateGenTableColumnList(List<GenTableColumn> genTableColumn);
+
     /**
      * 删除业务字段信息
      * 

+ 5 - 0
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml

@@ -50,6 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by sort
     </select>
 
+    <select id="selectGenTableColumnIsListByTableId" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
+        <include refid="selectGenTableColumnVo"/>
+        where table_id = #{tableId} and (is_in = 'Y' or is_out = 'Y')
+    </select>
+
     <select id="selectGenTableColumnList" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
         <include refid="selectGenTableColumnVo"/>
         <where>

+ 6 - 2
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -226,8 +226,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark = #{remark},</if>
             <if test="isMenu != null and isMenu != ''">is_menu = #{isMenu},</if>
             <if test="menuRole != null and menuRole != ''">menu_role = #{menuRole},</if>
-            <if test="akColumn != null">ak_column = #{akColumn},</if>
-            <if test="dkColumn != null">dk_column = #{dkColumn},</if>
+            ak_column = #{akColumn},
+            dk_column = #{dkColumn},
 			<if test="triggerCreate != null and triggerCreate != ''">trigger_create = #{triggerCreate},</if>
 			<if test="triggerRetrieve != null and triggerRetrieve != ''">trigger_retrieve = #{triggerRetrieve},</if>
 			<if test="triggerUpdate != null and triggerUpdate != ''">trigger_update = #{triggerUpdate},</if>
@@ -241,6 +241,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </set>
         where id = #{id}
     </update>
+
+	<update id="updateGenTableColumnNull" parameterType="long">
+		update gen_table set ak_column = null, dk_column = null where id = #{tableId}
+	</update>
     
     <delete id="deleteGenTableByIds" parameterType="Long">
         delete from gen_table where id in 

+ 28 - 0
boman-modules/boman-system/src/main/java/com/boman/system/controller/SysMenuController.java

@@ -48,6 +48,15 @@ public class SysMenuController extends BaseController
         return AjaxResult.success(menus);
     }
 
+    /**
+     * 获取所有菜单列表
+     */
+    @PostMapping("/listAll")
+    public List<SysMenu> listAll(@RequestBody SysMenu menu)
+    {
+        return menuService.selectMenuListAll(menu);
+    }
+
     /**
      * 获取某人的所有菜单
      */
@@ -161,6 +170,25 @@ public class SysMenuController extends BaseController
         return toAjax(menuService.deleteMenuById(id));
     }
 
+    /**
+     * 逻辑删除菜单
+     */
+    @PreAuthorize(hasPermi = "system:menu:remove")
+    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/remove/{id}")
+    public AjaxResult delete(@PathVariable("id") Long id)
+    {
+        if (menuService.hasChildById(id))
+        {
+            return AjaxResult.error("存在子菜单,不允许删除");
+        }
+        if (menuService.checkMenuExistRole(id))
+        {
+            return AjaxResult.error("菜单已分配,不允许删除");
+        }
+        return toAjax(menuService.removeMenuById(id));
+    }
+
     /**
      * 获取路由信息
      * 

+ 1 - 1
boman-modules/boman-system/src/main/java/com/boman/system/controller/SysProfileController.java

@@ -20,7 +20,7 @@ import com.boman.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
 import com.boman.common.security.service.TokenService;
 import com.boman.system.api.RemoteFileService;
-import com.boman.system.api.domain.SysFile;
+import com.boman.domain.SysFile;
 import com.boman.system.api.domain.SysUser;
 import com.boman.system.api.model.LoginUser;
 import com.boman.system.service.ISysUserService;

+ 7 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysMenuMapper.java

@@ -107,6 +107,13 @@ public interface SysMenuMapper
      */
     public int deleteMenuById(Long id);
 
+    /**
+     * 逻辑删除
+     * @param id
+     * @return
+     */
+    public int updateMenuById(Long id);
+
     /**
      * 校验菜单名称是否唯一
      * 

+ 4 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/ISysMenuService.java

@@ -33,6 +33,8 @@ public interface ISysMenuService
      */
     public List<SysMenu> selectMenuList(SysMenu menu, Long userId);
 
+    public List<SysMenu> selectMenuListAll(SysMenu menu);
+
     /**
      * 根据用户ID查询权限
      * 
@@ -152,6 +154,8 @@ public interface ISysMenuService
      */
     public int deleteMenuById(Long id);
 
+    public int removeMenuById(Long id);
+
     /**
      * 校验菜单名称是否唯一
      * 

+ 91 - 126
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysMenuServiceImpl.java

@@ -24,12 +24,11 @@ import com.boman.system.service.ISysMenuService;
 
 /**
  * 菜单 业务层处理
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class SysMenuServiceImpl implements ISysMenuService
-{
+public class SysMenuServiceImpl implements ISysMenuService {
     public static final String PREMISSION_STRING = "perms[\"{0}\"]";
 
     @Autowired
@@ -43,54 +42,51 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 根据用户查询系统菜单列表
-     * 
+     *
      * @param userId 用户ID
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuList(Long userId)
-    {
+    public List<SysMenu> selectMenuList(Long userId) {
         return selectMenuList(new SysMenu(), userId);
     }
 
     /**
      * 查询系统菜单列表
-     * 
+     *
      * @param menu 菜单信息
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
-    {
+    public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
         List<SysMenu> menuList = null;
         // 管理员显示所有菜单信息
-        if (SysUser.isAdmin(userId))
-        {
+        if (SysUser.isAdmin(userId)) {
             menuList = menuMapper.selectMenuList(menu);
-        }
-        else
-        {
+        } else {
             menu.getParams().put("userId", userId);
             menuList = menuMapper.selectMenuListByUserId(menu);
         }
         return menuList;
     }
 
+    @Override
+    public List<SysMenu> selectMenuListAll(SysMenu menu) {
+        return menuMapper.selectMenuList(menu);
+    }
+
     /**
      * 根据用户ID查询权限
-     * 
+     *
      * @param id 用户ID
      * @return 权限列表
      */
     @Override
-    public Set<String> selectMenuPermsById(Long id)
-    {
+    public Set<String> selectMenuPermsById(Long id) {
         List<String> perms = menuMapper.selectMenuPermsById(id);
         Set<String> permsSet = new HashSet<>();
-        for (String perm : perms)
-        {
-            if (StringUtils.isNotEmpty(perm))
-            {
+        for (String perm : perms) {
+            if (StringUtils.isNotEmpty(perm)) {
                 permsSet.addAll(Arrays.asList(perm.trim().split(",")));
             }
         }
@@ -99,20 +95,16 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 根据用户ID查询菜单
-     * 
+     *
      * @param id 用户名称
      * @return 菜单列表
      */
     @Override
-    public List<SysMenu> selectMenuTreeById(Long id)
-    {
+    public List<SysMenu> selectMenuTreeById(Long id) {
         List<SysMenu> menus = null;
-        if (SecurityUtils.isAdmin(id))
-        {
+        if (SecurityUtils.isAdmin(id)) {
             menus = menuMapper.selectMenuTreeAll();
-        }
-        else
-        {
+        } else {
             menus = menuMapper.selectMenuTreeById(id);
         }
         return getChildPerms(menus, 0);
@@ -154,54 +146,48 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 根据角色ID查询菜单树信息
-     * 
+     *
      * @param roleId 角色ID
      * @return 选中菜单列表
      */
     @Override
-    public List<Integer> selectMenuListByRoleId(Long roleId)
-    {
+    public List<Integer> selectMenuListByRoleId(Long roleId) {
         SysRole role = roleMapper.selectRoleById(roleId);
         return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
     }
 
     /**
      * 构建前端路由所需要的菜单
-     * 
+     *
      * @param menus 菜单列表
      * @return 路由列表
      */
     @Override
-    public List<RouterVo> buildMenus(List<SysMenu> menus)
-    {
+    public List<RouterVo> buildMenus(List<SysMenu> menus) {
         List<RouterVo> routers = new LinkedList<RouterVo>();
-        for (SysMenu menu : menus)
-        {
+        for (SysMenu menu : menus) {
             RouterVo router = new RouterVo();
             router.setHidden("1".equals(menu.getVisible()));
             router.setName(getRouteName(menu));
             router.setPath(getRouterPath(menu));
             router.setComponent(getComponent(menu));
             router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
-            if (menu.getSysTableName() != null){
+            if (menu.getSysTableName() != null) {
                 router.setSysTableName(menu.getSysTableName());
             }
             List<SysMenu> cMenus = menu.getChildren();
-            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
-            {
+            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
                 router.setAlwaysShow(true);
                 router.setRedirect("noRedirect");
                 router.setChildren(buildMenus(cMenus));
-            }
-            else if (isMeunFrame(menu))
-            {
+            } else if (isMeunFrame(menu)) {
                 List<RouterVo> childrenList = new ArrayList<RouterVo>();
                 RouterVo children = new RouterVo();
                 children.setPath(menu.getPath());
                 children.setComponent(menu.getComponent());
                 children.setName(StringUtils.capitalize(menu.getPath()));
                 children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache())));
-                if (menu.getSysTableName() != null){
+                if (menu.getSysTableName() != null) {
                     children.setSysTableName(menu.getSysTableName());
                 }
                 childrenList.add(children);
@@ -214,7 +200,7 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 构建前端所需要树结构
-     * 
+     *
      * @param menus 菜单列表
      * @return 树结构列表
      */
@@ -281,13 +267,12 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 构建前端所需要下拉树结构
-     * 
+     *
      * @param menus 菜单列表
      * @return 下拉树结构列表
      */
     @Override
-    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
-    {
+    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
         List<SysMenu> menuTrees = buildMenuTree(menus);
         return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
@@ -299,103 +284,104 @@ public class SysMenuServiceImpl implements ISysMenuService
      * @return 下拉树结构列表
      */
     @Override
-    public List<TreeSelect> buildMenuTreeSelectNotAddLeafNode(List<SysMenu> menus)
-    {
+    public List<TreeSelect> buildMenuTreeSelectNotAddLeafNode(List<SysMenu> menus) {
         List<SysMenu> menuTrees = buildMenuTreeNotAddLeafNode(menus);
         return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
     /**
      * 根据菜单ID查询信息
-     * 
+     *
      * @param id 菜单ID
      * @return 菜单信息
      */
     @Override
-    public SysMenu selectMenuById(Long id)
-    {
+    public SysMenu selectMenuById(Long id) {
         return menuMapper.selectMenuById(id);
     }
 
     /**
      * 是否存在菜单子节点
-     * 
+     *
      * @param id 菜单ID
      * @return 结果
      */
     @Override
-    public boolean hasChildById(Long id)
-    {
+    public boolean hasChildById(Long id) {
         int result = menuMapper.hasChildById(id);
         return result > 0 ? true : false;
     }
 
     /**
      * 查询菜单使用数量
-     * 
+     *
      * @param id 菜单ID
      * @return 结果
      */
     @Override
-    public boolean checkMenuExistRole(Long id)
-    {
+    public boolean checkMenuExistRole(Long id) {
         int result = roleMenuMapper.checkMenuExistRole(id);
         return result > 0 ? true : false;
     }
 
     /**
      * 新增保存菜单信息
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
     @Override
-    public AjaxResult insertMenu(SysMenu menu)
-    {
+    public AjaxResult insertMenu(SysMenu menu) {
         int i = menuMapper.insertMenu(menu);
-        if (menu.getId() != null){
-             return AjaxResult.success(Integer.parseInt(menu.getId().toString()));
-         }
-        return i > 0?AjaxResult.success():AjaxResult.error();
+        if (menu.getId() != null) {
+            return AjaxResult.success(Integer.parseInt(menu.getId().toString()));
+        }
+        return i > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
     /**
      * 修改保存菜单信息
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
     @Override
-    public int updateMenu(SysMenu menu)
-    {
+    public int updateMenu(SysMenu menu) {
         return menuMapper.updateMenu(menu);
     }
 
     /**
      * 删除菜单管理信息
-     * 
+     *
      * @param id 菜单ID
      * @return 结果
      */
     @Override
-    public int deleteMenuById(Long id)
-    {
+    public int deleteMenuById(Long id) {
         return menuMapper.deleteMenuById(id);
     }
 
+    /**
+     * 逻辑删除
+     * @param id
+     * @return
+     */
+    @Override
+    public int removeMenuById(Long id) {
+        return menuMapper.updateMenuById(id);
+    }
+
     /**
      * 校验菜单名称是否唯一
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
     @Override
-    public String checkMenuNameUnique(SysMenu menu)
-    {
+    public String checkMenuNameUnique(SysMenu menu) {
         Long id = StringUtils.isNull(menu.getId()) ? -1L : menu.getId();
         SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
-        if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -403,16 +389,14 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 获取路由名称
-     * 
+     *
      * @param menu 菜单信息
      * @return 路由名称
      */
-    public String getRouteName(SysMenu menu)
-    {
+    public String getRouteName(SysMenu menu) {
         String routerName = StringUtils.capitalize(menu.getPath());
         // 非外链并且是一级目录(类型为目录)
-        if (isMeunFrame(menu))
-        {
+        if (isMeunFrame(menu)) {
             routerName = StringUtils.EMPTY;
         }
         return routerName;
@@ -420,22 +404,19 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 获取路由地址
-     * 
+     *
      * @param menu 菜单信息
      * @return 路由地址
      */
-    public String getRouterPath(SysMenu menu)
-    {
+    public String getRouterPath(SysMenu menu) {
         String routerPath = menu.getPath();
         // 非外链并且是一级目录(类型为目录)
         if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
-                && UserConstants.NO_FRAME.equals(menu.getIsFrame()))
-        {
+                && UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
             routerPath = "/" + menu.getPath();
         }
         // 非外链并且是一级目录(类型为菜单)
-        else if (isMeunFrame(menu))
-        {
+        else if (isMeunFrame(menu)) {
             routerPath = "/";
         }
         return routerPath;
@@ -443,19 +424,15 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 获取组件信息
-     * 
+     *
      * @param menu 菜单信息
      * @return 组件信息
      */
-    public String getComponent(SysMenu menu)
-    {
+    public String getComponent(SysMenu menu) {
         String component = UserConstants.LAYOUT;
-        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu))
-        {
+        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMeunFrame(menu)) {
             component = menu.getComponent();
-        }
-        else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
-        {
+        } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
             component = UserConstants.PARENT_VIEW;
         }
         return component;
@@ -463,43 +440,38 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 是否为菜单内部跳转
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
-    public boolean isMeunFrame(SysMenu menu)
-    {
+    public boolean isMeunFrame(SysMenu menu) {
         return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
                 && menu.getIsFrame().equals(UserConstants.NO_FRAME);
     }
 
     /**
      * 是否为parent_view组件
-     * 
+     *
      * @param menu 菜单信息
      * @return 结果
      */
-    public boolean isParentView(SysMenu menu)
-    {
+    public boolean isParentView(SysMenu menu) {
         return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
     }
 
     /**
      * 根据父节点的ID获取所有子节点
-     * 
-     * @param list 分类表
+     *
+     * @param list     分类表
      * @param parentId 传入的父节点ID
      * @return String
      */
-    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
-    {
+    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
         List<SysMenu> returnList = new ArrayList<SysMenu>();
-        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
-        {
+        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
             SysMenu t = (SysMenu) iterator.next();
             // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
-            if (t.getParentId() == parentId)
-            {
+            if (t.getParentId() == parentId) {
                 recursionFn(list, t);
                 returnList.add(t);
             }
@@ -509,19 +481,16 @@ public class SysMenuServiceImpl implements ISysMenuService
 
     /**
      * 递归列表
-     * 
+     *
      * @param list
      * @param t
      */
-    private void recursionFn(List<SysMenu> list, SysMenu t)
-    {
+    private void recursionFn(List<SysMenu> list, SysMenu t) {
         // 得到子节点列表
         List<SysMenu> childList = getChildList(list, t);
         t.setChildren(childList);
-        for (SysMenu tChild : childList)
-        {
-            if (hasChild(list, tChild))
-            {
+        for (SysMenu tChild : childList) {
+            if (hasChild(list, tChild)) {
                 recursionFn(list, tChild);
             }
         }
@@ -530,15 +499,12 @@ public class SysMenuServiceImpl implements ISysMenuService
     /**
      * 得到子节点列表
      */
-    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
-    {
+    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
         List<SysMenu> tlist = new ArrayList<SysMenu>();
         Iterator<SysMenu> it = list.iterator();
-        while (it.hasNext())
-        {
+        while (it.hasNext()) {
             SysMenu n = (SysMenu) it.next();
-            if (n.getParentId().longValue() == t.getId().longValue())
-            {
+            if (n.getParentId().longValue() == t.getId().longValue()) {
                 tlist.add(n);
             }
         }
@@ -548,8 +514,7 @@ public class SysMenuServiceImpl implements ISysMenuService
     /**
      * 判断是否有子节点
      */
-    private boolean hasChild(List<SysMenu> list, SysMenu t)
-    {
+    private boolean hasChild(List<SysMenu> list, SysMenu t) {
         return getChildList(list, t).size() > 0;
     }
 }

+ 7 - 0
boman-modules/boman-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -47,6 +47,9 @@
 			<if test="status != null and status != ''">
 				AND status = #{status}
 			</if>
+			<if test="sysTableName != null and sysTableName != ''">
+				AND sys_table_name = #{sysTableName}
+			</if>
 		</where>
 		order by parent_id, order_num
 	</select>
@@ -197,4 +200,8 @@
 	    delete from sys_menu where id = #{id}
 	</delete>
 
+	<update id="updateMenuById" parameterType="Long">
+	    update  sys_menu  set status = '1', visible = '1'  where id = #{id}
+	</update>
+
 </mapper> 

+ 4 - 0
boman-web-core/.rebel-remote.xml.bak

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rebel-remote xmlns="http://www.zeroturnaround.com/rebel/remote">
+    <id>com.boman.boman-web-core</id>
+</rebel-remote>

+ 16 - 0
boman-web-core/.rebel.xml.bak

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
+  Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
+-->
+<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
+
+	<id>boman-modules-system</id>
+
+	<classpath>
+		<dir name="E:/boman-framwork/boman-web-core/target/classes">
+		</dir>
+	</classpath>
+
+</application>

+ 8 - 6
boman-web-core/src/main/java/com/boman/web/core/controller/CommonController.java

@@ -43,14 +43,16 @@ public class CommonController {
     }
 
     /**
-     * 功能描述: 根据条件count
+     * 功能描述: getMaxId
      *
-     * @param dto dto
-     * @return java.lang.Long
+     * @param tableName tableName
+     * @param pkName        pkName
+     * @return com.boman.common.core.web.domain.AjaxResult
      */
-    @GetMapping("count")
-    public int count(@RequestBody FormDataDto dto) {
-        return commonService.count(dto);
+    @GetMapping("tableName/{tableName}/pkName/{pkName}")
+    public Long getMaxId(@PathVariable("tableName") String tableName, @PathVariable("pkName") String pkName) {
+        Integer maxId = commonService.getMaxId(tableName, pkName);
+        return Long.valueOf(maxId.toString());
     }
 
 }

+ 55 - 39
boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java

@@ -2,7 +2,6 @@ package com.boman.web.core.mapper;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.utils.ColumnUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.*;
 import org.apache.ibatis.annotations.Param;
@@ -95,8 +94,8 @@ public interface StandardlyMapper {
     @Select("select id from ${tableName} where ${akColumnName} = #{akColumnValue}")
     Long selectIdByAkColumn(@Param("tableName") String tableName, @Param("akColumnName") String akColumnName, @Param("akColumnValue") String akColumnValue);
 
-    @Select("select max(${pkName}) from ${tableName}")
-    Long selectMaxId(@Param("tableName") String tableName, @Param("pkName") String pkName);
+    @Select("select ifnull(max(${pkName}),0) from ${tableName}")
+    int selectMaxId(@Param("tableName") String tableName, @Param("pkName") String pkName);
 
     /**
      * 功能描述: 根据id查所有
@@ -165,12 +164,17 @@ public interface StandardlyMapper {
     /**
      * 功能描述: 根据tableName和map(属性名和属性值)进行查查
      * {@link SqlProvider#getByMap(java.util.Map)}
-     * @param tableName tableName
-     * @param param     属性名和属性值
+     *
+     * @param tableName     tableName
+     * @param condition     属性名和属性值
+     * @param packCondition 属性名和属性值 条件
      * @return java.util.List<com.alibaba.fastjson.JSONObject>
      */
     @SelectProvider(type = SqlProvider.class, method = "getByMap")
-    List<JSONObject> getByMap(@Param("tableName") String tableName, @Param("param") JSONObject param, @Param("limitOne") boolean limitOne);
+    List<JSONObject> getByMap(@Param("tableName") String tableName
+            , @Param("condition") JSONObject condition
+            , @Param("packCondition") JSONObject packCondition
+            , @Param("limitOne") boolean limitOne);
 
     public static class SqlProvider {
         static final String[] READONLY_COLUMNS = new String[]{"OWNERID", "OWNERNAME", "OWNERENAME", "CREATIONDATE", "ID"};
@@ -537,22 +541,20 @@ public interface StandardlyMapper {
         }
 
         public String getByMap(Map<String, Object> para) {
-            JSONObject param = (JSONObject) para.get("param");
+            JSONObject condition = (JSONObject) para.get("condition");
+            JSONObject packCondition = (JSONObject) para.get("packCondition");
             String tableName = (String) para.get("tableName");
             boolean limitOne = (boolean) para.get("limitOne");
 
             String result;
             StringBuilder wholeSql = new StringBuilder();
             wholeSql.append("select * from ").append(tableName);
-            if (isEmpty(param)) {
+            if (isEmpty(condition)) {
                 result = wholeSql.toString();
             } else {
-                wholeSql.append(" where ");
-                for (Map.Entry<String, Object> entry : param.entrySet()) {
-                    wholeSql.append(entry.getKey()).append(" = ").append(entry.getValue()).append(" and ");
-                }
-
-                result = StringUtils.substringBeforeLast(wholeSql.toString(), "and");
+                // 条件
+                packCondition(packCondition, wholeSql);
+                result = wholeSql.toString();
             }
 
             result = limitOne ? result + " limit 1" : result;
@@ -616,20 +618,24 @@ public interface StandardlyMapper {
          * @param wholeSql      sql
          */
         private void packCondition(JSONObject packCondition, StringBuilder wholeSql) {
-            if (isNotEmpty(packCondition)) {
-                wholeSql.append(" where ");
-                StringBuilder conditionSql = new StringBuilder();
-                for (Map.Entry<String, Object> entry : packCondition.entrySet()) {
-                    String key = entry.getKey();
-                    List<Object> types = ((List<Object>) entry.getValue());
-                    // com.boman.web.core.service.TableServiceCmdService.packColCondition 这里是拼参数的地方
-                    Object valueObj = types.get(0);
-                    String queryType = (String) types.get(1);
-                    String columnType = (String) types.get(2);
-                    conditionSql.append(key).append(covert(queryType, columnType, key, valueObj)).append(" and ");
-                }
-                wholeSql.append(StringUtils.substringBeforeLast(conditionSql.toString(), " and"));
+            if (isEmpty(packCondition)) {
+                return;
             }
+
+            wholeSql.append(" where ");
+            StringBuilder conditionSql = new StringBuilder();
+            for (Map.Entry<String, Object> entry : packCondition.entrySet()) {
+                String key = entry.getKey();
+                Object valueObj = entry.getValue();
+                List<String> types = ((List<String>) valueObj);
+                /** {@link com.boman.web.core.utils.ColumnUtils.packColCondition} 这里是拼参数的地方 **/
+                String value = types.get(0);
+                String queryType = types.get(1);
+                String columnType = types.get(2);
+                conditionSql.append(key).append(covert(queryType, columnType, key, value)).append(" and ");
+            }
+
+            wholeSql.append(StringUtils.substringBeforeLast(conditionSql.toString(), " and"));
         }
 
         /**
@@ -638,40 +644,50 @@ public interface StandardlyMapper {
          * @param queryType  like > < =
          * @param columnType varchar char textarea timestamp
          * @param key        key
-         * @param valueObj   valueObj
+         * @param value      value
          * @return java.lang.String
          */
-        private String covert(String queryType, String columnType, String key, Object valueObj) {
+        private String covert(String queryType, String columnType, String key, String value) {
             // false 不需要转义
             boolean needEscape = columnType.contains(VARCHAR) || columnType.contains(CHAR)
                     || columnType.contains(DATETIME) || columnType.contains(TIMESTAMP);
-            Object value;
             switch (queryType) {
                 case EQ:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " = " + value;
                 case LIKE:
                     return " like " + "concat('%', #{condition." + key + "}, '%')";
                 case NE:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " != " + value;
                 case GT:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " &gt; " + value;
                 case GTE:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " &gt;= " + value;
                 case LT:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " &lt; " + value;
                 case LTE:
-                    value = needEscape ? escapeStr((String) valueObj) : valueObj;
+                    value = needEscape ? escapeStr(value) : value;
                     return " &lt;= " + value;
                 default:
-                    // in
-                    List<Object> list = ((List<Object>) valueObj);
-                    return  " in (" + ColumnUtils.joinList(list) + ")";
+                    String[] split = value.split(",");
+                    String front = split[0].replace("[", "");
+                    String back =  split[1].replace("]", "");
+                    String max, min;
+                    if (front.compareTo(back) > 0) {
+                        max = back;
+                        min = front;
+                    } else {
+                        max = front;
+                        min = back;
+                    }
 
+                    max = needEscape ? escapeStr(max) : max;
+                    min = needEscape ? escapeStr(min) : min;
+                    return " between " + min + " and " + max;
             }
         }
     }

+ 56 - 215
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -3,9 +3,7 @@ package com.boman.web.core.service;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.TypeReference;
 import com.boman.common.core.constant.GenConstants;
-import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.array.ArrayUtils;
 import com.boman.common.core.utils.collection.CollectionUtils;
@@ -13,33 +11,19 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.common.redis.RedisKey;
 import com.boman.common.redis.service.RedisService;
-import com.boman.domain.GenTable;
-import com.boman.domain.GenTableColumn;
-import com.boman.domain.SysDictData;
-import com.boman.domain.SysRoleData;
 import com.boman.domain.constant.*;
-import com.boman.domain.exception.UnSuchFunctionException;
 import com.boman.gen.api.RemoteGenTableColumnService;
 import com.boman.gen.api.RemoteGenTableService;
-import com.boman.system.api.RemoteDeptService;
+import com.boman.domain.GenTable;
+import com.boman.domain.GenTableColumn;
 import com.boman.system.api.RemoteDictDataService;
-import com.boman.system.api.RemoteRoleDataService;
-import com.boman.system.api.RemoteUserService;
-import com.boman.system.api.domain.SysFile;
-import com.boman.system.api.domain.SysMenu;
-import com.boman.system.api.domain.SysRole;
-import com.boman.system.api.domain.SysUser;
-import com.boman.system.api.model.LoginUser;
-import com.boman.web.core.domain.ActionType;
-import com.boman.web.core.domain.FormDataDto;
-import com.boman.web.core.domain.RowResult;
-import com.boman.web.core.domain.TableContext;
+import com.boman.domain.SysFile;
+import com.boman.web.core.domain.*;
 import com.boman.web.core.service.delete.IBaseDeleteService;
 import com.boman.web.core.service.save.IBaseSaveService;
 import com.boman.web.core.service.select.IBaseSelectService;
 import com.boman.web.core.service.submit.IBaseSubmitService;
 import com.boman.web.core.service.update.IBaseUpdateService;
-import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.IdUtils;
 import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
@@ -56,10 +40,13 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Predicate;
 
+import static com.boman.common.core.constant.GenConstants.HTML_FILE_UPLOAD;
+import static com.boman.common.core.constant.GenConstants.HTML_IMAGE_UPLOAD;
 import static com.boman.common.core.utils.obj.ObjectUtils.*;
 import static com.boman.domain.constant.FormDataConstant.*;
-import static com.boman.web.core.utils.AuthUtils.*;
 import static com.boman.web.core.utils.ColumnUtils.*;
+import static com.boman.web.core.utils.HandlerFormDataUtils.*;
+import static com.boman.web.core.utils.JSONObjectUtils.containsKeyIgnoreCase;
 
 /**
  * @author shiqian
@@ -84,27 +71,18 @@ public class TableServiceCmdService {
     @Resource
     private RestTemplate restTemplate;
     @Resource
-    private TableContext tableContext;
-    @Resource
     private RemoteDictDataService remoteDictDataService;
     @Resource
     private RemoteGenTableService remoteGenTableService;
     @Resource
     private RemoteGenTableColumnService remoteGenTableColumnService;
-    @Resource
-    private RemoteDeptService remoteDeptService;
-    @Resource
-    private RemoteRoleDataService remoteRoleDataService;
-    @Resource
-    private RemoteUserService remoteUserService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
     public final AjaxResult objectSave(FormDataDto dto) {
         AjaxResult result = AjaxResult.success();
 
-        // 权限校验在此方法中
-        TableContext context = tableContext.createContext(dto);
+        TableContext context = TableContext.createContext(dto);
         // 拿到pkName和maxId
         String pkName = context.getPkName();
         JSONObject commitData = context.getCommitData();
@@ -117,7 +95,7 @@ public class TableServiceCmdService {
 
         // 新增
         if (ActionType.INSERT.equals(context.getActionType())) {
-            Long maxId = IdUtils.getMaxId(dto.getTable(), pkName);
+            Integer maxId = IdUtils.getMaxId(dto.getTable(), pkName);
             RowResult rowResult = saveService.insertRow(context, maxId);
             if (RowResult.checkSuccess(rowResult)) {
                 LOGGER.info("保存成功,封装到数据库的数据为: {}", JSON.toJSONString(rowResult.getData()));
@@ -177,34 +155,25 @@ public class TableServiceCmdService {
      */
     public AjaxResult objectDelete(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
-
+        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
+        requireNonNull(idArr);
+        // 拿到pkName
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
         String pkName = IdUtils.getPkName(genTable.getColumns());
 
-        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-        requireNonNull(idArr, "删除时,所传idList为空");
-
-        RowResult rowResult;
         List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
         for (Long id : idArr) {
-            // 校验权限
-            if (BooleanUtils.isTrue(checkAuthObjectDelete(genTable, id, pkName))) {
-                rowResult = deleteService.deleteById(dto.getTable(), pkName, id);
-                if (rowResult.isOk()) {
-                    LOGGER.info("删除成功, tableName: {}, id: {}, 操作人: {}", tableContext.getTableName(), id, getLoginUser().getUsername());
-                    continue;
-                }
-                LOGGER.info("删除失败, tableName: {}, id: {}, 操作人: {}", tableContext.getTableName(), id, getLoginUser().getUsername());
-            } else {
-                rowResult = RowResult.create(RowResult.FAIL, "无操作权限");
-            }
-
+            RowResult rowResult = deleteService.deleteById(dto.getTable(), pkName, id);
             result.add(rowResult);
+            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
         }
 
+        // RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
+
         return AjaxResult.success(result);
     }
 
+
     /**
      * 功能描述: 通用删除接口 (真的删除)
      *
@@ -223,22 +192,10 @@ public class TableServiceCmdService {
         List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
         JSONObject jsonObject = new JSONObject();
         jsonObject.put(dto.getLogicDelName(), dto.getLogicDelValue());
-
-        RowResult rowResult;
         for (Long id : idArr) {
-            // 校验权限
-            if (BooleanUtils.isTrue(checkAuthObjectDelete(genTable, id, pkName))) {
-                rowResult = deleteService.objectLogicDelete(new Long[]{id}, dto.getTable(), pkName, jsonObject);
-                if (rowResult.isOk()) {
-                    LOGGER.info("逻辑删除成功, tableName: {}, id: {}, 操作人: {}", tableContext.getTableName(), id, getLoginUser().getUsername());
-                    continue;
-                }
-                LOGGER.info("逻辑删除失败, tableName: {}, id: {}, 操作人: {}", tableContext.getTableName(), id, getLoginUser().getUsername());
-            } else {
-                rowResult = RowResult.create(RowResult.FAIL, "无操作权限");
-            }
-
+            RowResult rowResult = deleteService.objectLogicDelete(new Long[]{id}, dto.getTable(), pkName, jsonObject);
             result.add(rowResult);
+            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
         }
 
         return AjaxResult.success(result);
@@ -253,17 +210,16 @@ public class TableServiceCmdService {
     public AjaxResult queryList(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
+        String tableName = genTable.getTableName();
         JSONObject fixedData = ifNullSetEmpty(dto.getFixedData());
         List<GenTableColumn> columns = genTable.getColumns();
 
         // 查询条件
         JSONObject condition = ifNullSetEmpty(fixedData.getJSONObject(CONDITION));
-        // 权限
-        checkAuthQueryList(genTable, condition);
         // 检查列
         checkColumn(condition, columns);
         // 封装好以后的查询条件
-        JSONObject packCondition = ifNullSetEmpty(selectService.packColCondition(columns, condition));
+        JSONObject packCondition = ifNullSetEmpty(packColCondition(columns, condition));
         JSONArray showData = fixedData.getJSONArray(SHOW_DATA);
         // 检查列
         checkColumn(showData, genTable.getColumns());
@@ -281,12 +237,14 @@ public class TableServiceCmdService {
             return AjaxResult.success(rows);
         }
 
-        List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
-                , showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
+        List<JSONObject> result = selectService.selectByCondition(tableName, condition, packCondition, showData, dto);
+        result = filter(result, ObjectUtils::isNotEmpty);
         // 处理blob
-        handlerBlobWithJSONObject(genTable.getIsContainsBlob(), result);
+        handleBlob(result, genTable.getIsContainsBlob());
         // 处理日期、外键、字典值
-        handler(result = filter(result, ObjectUtils::isNotEmpty), columns);
+        handleDictForQueryList(result, columns);
+        handleDateTimeForQueryList(result, columns);
+        handleFkForQueryList(result, columns);
         // 定制接口
         result = isCustomized(dto.getTable(), result, "trigger_retrieve");
 
@@ -294,126 +252,6 @@ public class TableServiceCmdService {
         return AjaxResult.success(rows);
     }
 
-    private void handler(List<JSONObject> result, List<GenTableColumn> columns) {
-        // 处理时间
-        handlerDate(result, columns);
-        // 处理字典值
-        handlerSysDictData(result, columns);
-        // 处理外键
-        handlerForeignKey(result, columns);
-    }
-
-    /**
-     * 功能描述: 处理外键 todo 待优化
-     *
-     * @param result  result
-     * @param columns 该表对应的所有的列
-     */
-    private void handlerForeignKey(List<JSONObject> result, List<GenTableColumn> columns) {
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
-            return;
-        }
-        // 拿到所有有fk的列
-        List<GenTableColumn> fkColumns = filter(columns, col -> ObjectUtils.isNotEmpty(col.getForeignKey()));
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(fkColumns)) {
-            return;
-        }
-
-        for (GenTableColumn column : fkColumns) {
-            JSONObject jsonObject = new JSONObject();
-            String selfColumnName = column.getColumnName();
-            for (JSONObject json : result) {
-                if (json.containsKey(selfColumnName.toUpperCase()) || json.containsKey(selfColumnName.toLowerCase())) {
-                    Map<String, Object> fkInfoMap = column.getFkInfo();
-                    Object fkTableName = fkInfoMap.get(FK_TABLE_NAME);
-                    Object fkColumnName = fkInfoMap.get(FK_COLUMN_NAME);
-                    Object dkColumnName = fkInfoMap.get(DK_COLUMN_NAME);
-                    Object primaryTableFkValue = json.get(selfColumnName);
-
-                    JSONObject param = new JSONObject();
-                    param.put(fkColumnName.toString(), primaryTableFkValue);
-                    JSONObject fkInfo = selectService.getOneByMap(fkTableName.toString(), param);
-
-                    Object value = fkInfo.get(dkColumnName);
-                    jsonObject.put(SINGLE_OBJ_NAME, primaryTableFkValue);
-                    jsonObject.put(SINGLE_OBJ_VALUE, value);
-                    json.put(selfColumnName.toLowerCase(), jsonObject);
-                }
-            }
-        }
-    }
-
-    /**
-     * 功能描述: 把timeStamp转为string, 默认类型为:YYYY_MM_DD
-     *
-     * @param result 被转的数据
-     */
-    private void handlerDate(List<JSONObject> result, List<GenTableColumn> columns) {
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
-            return;
-        }
-
-        for (JSONObject jsonObject : result) {
-            for (GenTableColumn column : columns) {
-                if (jsonObject.containsKey(column.getColumnName()) && NEED_CONVERT_DATE_LIST.contains(column.getColumnType())) {
-                    Date date = jsonObject.getTimestamp(column.getColumnName());
-                    if (null != date) {
-                        jsonObject.put(column.getColumnName(), DateUtils.dateTime(date));
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * 功能描述: 处理附件,把数据拿出来转换成name、url形式
-     *
-     * @param result 被转的数据
-     */
-    private void handlerAnnex(List<JSONObject> result, List<GenTableColumn> columns) {
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
-            return;
-        }
-
-        for (JSONObject jsonObject : result) {
-            for (GenTableColumn column : columns) {
-                if (jsonObject.containsKey(column.getColumnName())) {
-                    String value = jsonObject.getString(column.getColumnName());
-                    List<SysFile> fileList = JSON.parseObject(value, new TypeReference<List<SysFile>>() {
-                    }.getType());
-                    jsonObject.put(column.getColumnName(), fileList);
-                }
-            }
-        }
-    }
-
-    /**
-     * 功能描述: 把返回值中含有字典值的转为可视化的心事
-     *
-     * @param result 被转的数据
-     */
-    private void handlerSysDictData(List<JSONObject> result, List<GenTableColumn> columns) {
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
-            return;
-        }
-
-        for (JSONObject jsonObject : result) {
-            for (GenTableColumn column : columns) {
-                String dictType = column.getDictType();
-                if (isNotEmpty(dictType) && jsonObject.containsKey(column.getColumnName())) {
-                    String dictLabel = null;
-                    try {
-                        dictLabel = remoteDictDataService.selectDictLabel(dictType, jsonObject.getString(column.getColumnName()));
-                        jsonObject.put(column.getColumnName(), dictLabel);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-
     /**
      * 功能描述: 获取单表单数据
      *
@@ -438,25 +276,39 @@ public class TableServiceCmdService {
         JSONObject json = selectService.selectById(tableName, pkName, id);
         requireNonNull(json, "id 为[" + id + "]的数据不存在, 表名为[" + tableName + "]");
         // 处理blob
-        handlerBlobWithJSONObject(genTable.getIsContainsBlob(), Collections.singletonList(json));
-        List<GenTableColumn> parentColumns = filterHrAndSort(columns);
+        handleBlob(Collections.singletonList(json), genTable.getIsContainsBlob());
 
+        List<GenTableColumn> parentColumns = filterHrAndSort(columns);
         // 处理成hr的形式
         for (GenTableColumn hrColumn : parentColumns) {
             List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
             for (GenTableColumn column : columns) {
                 if (hrColumn.getId().equals(column.getHrParentId())) {
-                    // handler column
-                    if (json.containsKey(column.getColumnName())) {
-                        handlerSysDictData(Collections.singletonList(json), Collections.singletonList(column));
-                        handlerDate(Collections.singletonList(json), Collections.singletonList(column));
-                        handlerForeignKey(Collections.singletonList(json), Collections.singletonList(column));
-                        if (GenConstants.HTML_IMAGE_UPLOAD.equalsIgnoreCase(column.getHtmlType())
-                                || GenConstants.HTML_FILE_UPLOAD.equalsIgnoreCase(column.getHtmlType())) {
-                            handlerAnnex(Collections.singletonList(json), Collections.singletonList(column));
+                    String columnName = column.getColumnName();
+                    String columnType = column.getColumnType();
+                    String htmlType = column.getHtmlType();
+                    String dictType = column.getDictType();
+                    if (containsKeyIgnoreCase(json, columnName)) {
+                        // sysDict
+                        if (isNotEmpty(dictType)) {
+                            // 既要sysDictData还得要columnValue
+                            column.setSysDictData(listSysDictDataByType(dictType));
+                            column.setColumnValue(json.get(columnName));
+                        }
+                        // dateTime
+                        if (NEED_CONVERT_DATE_LIST.contains(columnType)) {
+                            column.setColumnValue(getStrDate(json.getTimestamp(columnName)));
+                        }
+                        // fk
+                        if (isNotEmpty(column.getForeignKey())) {
+                            column.setFkInfo(getFkMap(column.getFkInfo(), json.get(columnName)));
+                        }
+                        // annex
+                        if (HTML_IMAGE_UPLOAD.equalsIgnoreCase(htmlType) || HTML_FILE_UPLOAD.equalsIgnoreCase(htmlType)) {
+                            column.setAnnex(getAnnex(json.getString(columnName)));
                         }
 
-                        column.setColumnValue(json.get(column.getColumnName()));
+                        column.setReadonly(SubmitConstant.STATUS.equals(columnName));
                     }
 
                     children.add(column);
@@ -509,7 +361,7 @@ public class TableServiceCmdService {
         // genTable.getMenuRole() 暂时数据库没有数据,
         jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
 
-        jsonObject.put(ViewTypeConst.VIEW_TYPE, Strings.nullToEmpty(genTable.getTplCategory()));
+        jsonObject.put(ViewConst.VIEW_TYPE, Strings.nullToEmpty(genTable.getTplCategory()));
         jsonObject.put(RULES, packRequireColumn(columns));
         return AjaxResult.success(jsonObject);
     }
@@ -617,6 +469,7 @@ public class TableServiceCmdService {
                 if (!SubmitConstant.NOT_SUBMIT.equals(dbStatus)) {
                     commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
                 } else {
+                    commitDatum.put(SubmitConstant.STATUS, SubmitConstant.SUBMITTED);
                     handlerSubmit(tableName, pkName, commitDatum);
                 }
             } else {
@@ -624,6 +477,7 @@ public class TableServiceCmdService {
                 if (!SubmitConstant.SUBMITTED.equals(dbStatus)) {
                     commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
                 } else {
+                    commitDatum.put(SubmitConstant.STATUS, SubmitConstant.NOT_SUBMIT);
                     handlerSubmit(tableName, pkName, commitDatum);
                 }
             }
@@ -814,18 +668,5 @@ public class TableServiceCmdService {
         AjaxResult ajaxResult = remoteGenTableColumnService.listColumnsByTableId(table.getId());
         return ajaxResult;
     }
-
-    public List<SysDictData> listSysDictDataByType(String dictType) {
-        List<SysDictData> sysDictData = null;
-        try {
-            sysDictData = remoteDictDataService.listByType(dictType);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return sysDictData;
-    }
-
-
-
 }
 

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/common/CommonServiceImpl.java

@@ -61,7 +61,7 @@ public class CommonServiceImpl implements ICommonService {
     }
 
     @Override
-    public Long getMaxId(String tableName, String pkName) {
+    public Integer getMaxId(String tableName, String pkName) {
         return IdUtils.getMaxId(tableName, pkName);
     }
 

+ 2 - 10
boman-web-core/src/main/java/com/boman/web/core/service/common/ICommonService.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.service.common;
 
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.domain.FormDataDto;
+import io.swagger.models.auth.In;
 
 import java.util.List;
 
@@ -30,13 +30,5 @@ public interface ICommonService {
      */
     List<JSONObject> getByMap(String tableName, JSONObject condition);
 
-    Long getMaxId(String tableName, String pkName);
-
-    /**
-     * 功能描述: 根据条件count
-     *
-     * @param dto dto
-     * @return java.lang.Long
-     */
-    int count(FormDataDto dto);
+    Integer getMaxId(String tableName, String pkName);
 }

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/save/BaseSaveServiceImpl.java

@@ -44,7 +44,7 @@ public class BaseSaveServiceImpl implements IBaseSaveService {
      * @return com.boman.system.common.RowResult
      */
     @Override
-    public RowResult insertRow(TableContext context, Long maxId) {
+    public RowResult insertRow(TableContext context, Integer maxId) {
         List<GenTableColumn> columns = context.getColumns();
         JSONObject commitData = context.getCommitData();
         ColumnUtils.packUpdateByAndTime(columns, commitData, new Timestamp(System.currentTimeMillis()), true);

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/save/IBaseSaveService.java

@@ -19,6 +19,6 @@ public interface IBaseSaveService {
      * @param maxId   最大的SEQ
      * @return com.boman.system.common.RowResult
      */
-    RowResult insertRow(TableContext context, Long maxId);
+    RowResult insertRow(TableContext context, Integer maxId);
 
 }

+ 9 - 38
boman-web-core/src/main/java/com/boman/web/core/service/select/BaseSelectServiceImpl.java

@@ -2,21 +2,18 @@ package com.boman.web.core.service.select;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.redis.RedisKey;
 import com.boman.domain.GenTable;
-import com.boman.domain.GenTableColumn;
+import com.boman.web.core.domain.FormDataDto;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.service.TableServiceCmdService;
 import com.boman.web.core.utils.ColumnUtils;
-import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
-import java.util.Map;
 
 import static com.boman.common.core.utils.obj.ObjectUtils.isEmpty;
 import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
@@ -49,12 +46,11 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
      * @return java.util.List<com.alibaba.fastjson.JSONObject>
      */
     @Override
-    public List<JSONObject> selectByCondition(String tableName, JSONObject condition
-            , JSONObject packCondition, JSONArray showData, String orderBy, Integer limit, Integer offset) {
+    public List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition, JSONArray showData, FormDataDto dto) {
         requireNonNull(tableName, "表名为空");
         requireNonNull(showData, "表: [" + tableName + "] , 过滤了可展示字段,一个展示字段都没有,还查个鬼啊");
-        requireNonNull(orderBy);
-        return mapper.selectByCondition(tableName, condition, packCondition, showData, orderBy, limit, offset);
+        String orderBy = requireNonNull(dto.getOrderBy());
+        return mapper.selectByCondition(tableName, condition, packCondition, showData, orderBy, dto.getLimit(), dto.getOffset());
     }
 
     /**
@@ -71,7 +67,8 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
         // 判断condition中列是否都在此table中
         GenTable gent = cmdService.getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
         ColumnUtils.checkColumn(param, gent.getColumns());
-        return mapper.getByMap(tableName, param, false);
+        JSONObject packColCondition = ColumnUtils.packColCondition(gent.getColumns(), param);
+        return mapper.getByMap(tableName, param, packColCondition, false);
     }
 
 
@@ -89,7 +86,8 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
         // 判断condition中列是否都在此table中
         GenTable gent = cmdService.getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
         ColumnUtils.checkColumn(param, gent.getColumns());
-        List<JSONObject> result = mapper.getByMap(tableName, param, true);
+        JSONObject packColCondition = ColumnUtils.packColCondition(gent.getColumns(), param);
+        List<JSONObject> result = mapper.getByMap(tableName, param, packColCondition, true);
         return isEmpty(result) ? null : result.get(0);
     }
 
@@ -104,6 +102,7 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
     @Override
     public int countByCondition(String tableName, JSONObject condition, JSONObject packCondition) {
         requireNonNull(tableName, "表名为空");
+
         return mapper.countByCondition(tableName, condition, packCondition);
     }
 
@@ -140,32 +139,4 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
 
         return mapper.selectByIdList(tableName, pkName, idList, showData);
     }
-
-    /**
-     * 功能描述: 封装成查询条件 key: 列名,  value:查询条件_查询类别
-     * eg: [{"config_name": ["系统配置", "EQ", "varchar(100)"]}]
-     *
-     * @param columns columns
-     * @return com.alibaba.fastjson.JSONObject
-     */
-    @Override
-    public JSONObject packColCondition(List<GenTableColumn> columns, JSONObject condition) {
-        requireNonNull(columns);
-
-        JSONObject result = new JSONObject(columns.size());
-        for (Map.Entry<String, Object> entry : condition.entrySet()) {
-            String key = entry.getKey();
-            Object value = entry.getValue();
-            for (GenTableColumn column : columns) {
-                // long string collection 暂时只作此三种类型判断
-                if (column.getColumnName().equalsIgnoreCase(key) && ObjectUtils.isNotEmpty(value)) {
-                    // columnType 作为判断需不需要转义的一个标准,防止索引失效
-                    result.put(key, Lists.newArrayList(value, column.getQueryType(), column.getColumnType()));
-                    break;
-                }
-            }
-        }
-
-        return result;
-    }
 }

+ 3 - 9
boman-web-core/src/main/java/com/boman/web/core/service/select/IBaseSelectService.java

@@ -2,7 +2,7 @@ package com.boman.web.core.service.select;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.domain.GenTableColumn;
+import com.boman.web.core.domain.FormDataDto;
 
 import java.util.List;
 
@@ -37,13 +37,10 @@ public interface IBaseSelectService {
      * @param condition     原始查询条件
      * @param packCondition 封装的查询条件
      * @param showData      前台需要查询的列
-     * @param orderBy       orderBy
-     * @param limit         分页
-     * @param offset        分页
+     * @param dto       dto.orderBy dto.limit dto.offset
      * @return java.util.List<com.alibaba.fastjson.JSONObject>
      */
-    List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition
-            , JSONArray showData, String orderBy, Integer limit, Integer offset);
+    List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition, JSONArray showData, FormDataDto dto);
 
     /**
      * 功能描述: 根据条件查询
@@ -75,7 +72,4 @@ public interface IBaseSelectService {
      * @return com.alibaba.fastjson.JSONObject
      */
     List<JSONObject> selectByIdList(String tableName, String pkName, List<Long> idList, List<String> showData);
-
-
-    JSONObject packColCondition(List<GenTableColumn> columns, JSONObject condition);
 }

+ 20 - 52
boman-web-core/src/main/java/com/boman/web/core/utils/ColumnUtils.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.StringUtils;
+import com.boman.common.core.utils.collection.CollectionUtils;
 import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.domain.GenTableColumn;
 import com.boman.domain.exception.UnknownColumnException;
@@ -202,64 +203,41 @@ public class ColumnUtils {
         List<String> all = map(origin, GenTableColumn::getColumnName);
         for (Object obj : target) {
             String columnName = (String) obj;
-            if (!all.contains(columnName.toLowerCase()) || !all.contains(columnName.toUpperCase())) {
+            if (!CollectionUtils.containsIgnoreCase(all, columnName)) {
                 throw new UnknownColumnException("此表 [" + tableName + "]中没有 [" + columnName + "] 字段");
             }
         }
     }
 
     /**
-     * 功能描述: 根据从数据库查出来的返回值来确实是否是blob, 转为字符串! 转为字符串! 转为字符串!
+     * 功能描述: 封装成查询条件 key: 列名,  value:查询条件_查询类别
+     * eg: [{"config_name": ["系统配置", "EQ", "varchar(100)"]}]
      *
-     * @param isContainsBlob 此表中的字段是否含有blob的列, true含
-     * @param result         result
+     * @param columns columns
+     * @return com.alibaba.fastjson.JSONObject
      */
-    public static void handlerBlobWithJSONObject(Boolean isContainsBlob, List<JSONObject> result) {
-        // 不包含
-        if (BooleanUtils.isFalse(isContainsBlob)) {
-            return;
+    public static JSONObject packColCondition(List<GenTableColumn> columns, JSONObject condition) {
+        if (isEmpty(condition)) {
+            return condition;
         }
 
-        for (JSONObject jsonObject : result) {
-            for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
-                Object value = entry.getValue();
-                if (isNotEmpty(value) && BYTE_ARRAY.equals(value.getClass().getSimpleName())) {
-                    entry.setValue(byteToString(((byte[]) value)));
+        JSONObject packColCondition = new JSONObject(columns.size());
+        for (Map.Entry<String, Object> entry : condition.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            for (GenTableColumn column : columns) {
+                // long string collection 暂时只作此三种类型判断
+                if (column.getColumnName().equalsIgnoreCase(key) && ObjectUtils.isNotEmpty(value)) {
+                    // columnType 作为判断需不需要转义的一个标准,防止索引失效
+                    packColCondition.put(key, Lists.newArrayList(String.valueOf(value), column.getQueryType(), column.getColumnType()));
+                    break;
                 }
             }
         }
-    }
-
-    /**
-     * 功能描述: 根据从数据库查出来的返回值来确实是否是blob, 转为字符串! 转为字符串! 转为字符串!
-     *
-     * @param result result
-     */
-    public static void handlerBlobWithTableColumn(Boolean isContainsBlob, List<GenTableColumn> result) {
-        // 不包含
-        if (BooleanUtils.isFalse(isContainsBlob)) {
-            return;
-        }
-
-        for (GenTableColumn column : result) {
-            Object value = column.getColumnValue();
-            if (isNotEmpty(value) && BYTE_ARRAY.equals(value.getClass().getSimpleName())) {
-                column.setColumnValue(byteToString(((byte[]) value)));
-            }
-        }
-    }
 
-    public static String byteToString(byte[] bytes) {
-        String result = "";
-        if (ArrayUtils.isNotEmpty(bytes)) {
-            result = new String(bytes, StandardCharsets.UTF_8);
-        }
-
-        return result;
+        return packColCondition;
     }
 
-
-
     /**
      * 功能描述: 数字小的在前面,数字大的在后面
      *
@@ -298,14 +276,4 @@ public class ColumnUtils {
         }
     }
 
-    /**
-     * 连接字符串数组集合
-     *
-     * @param iterable 集合
-     * @return 连接结果
-     */
-    public static String joinList(Iterable iterable) {
-        Joiner joiner = Joiner.on(", ").skipNulls();
-        return joiner.join(iterable);
-    }
 }

+ 193 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/HandlerFormDataUtils.java

@@ -0,0 +1,193 @@
+package com.boman.web.core.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.SpringUtils;
+import com.boman.common.core.utils.array.ArrayUtils;
+import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.domain.GenTableColumn;
+import com.boman.domain.SysDictData;
+import com.boman.domain.SysFile;
+import com.boman.system.api.RemoteDictDataService;
+import com.boman.web.core.service.select.IBaseSelectService;
+import org.apache.commons.lang3.BooleanUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import static com.boman.common.core.utils.obj.ObjectUtils.*;
+import static com.boman.domain.constant.FormDataConstant.*;
+import static com.boman.web.core.utils.JSONObjectUtils.containsKeyIgnoreCase;
+
+/**
+ * @author shiqian
+ * @date 2021年04月29日 14:32
+ **/
+public class HandlerFormDataUtils {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(HandlerFormDataUtils.class);
+
+    /**
+     * 功能描述: 处理字典值,不查询所有的字典值, 不放入sysDictData,只根据dictValue查询dictLabel
+     *
+     * @param result     db中查出的结果
+     * @param allColumns 所有的列
+     */
+    public static void handleDictForQueryList(List<JSONObject> result, List<GenTableColumn> allColumns) {
+        if (isEmpty(result)) {
+            return;
+        }
+
+        RemoteDictDataService remoteDictDataService = SpringUtils.getBean(RemoteDictDataService.class);
+        for (JSONObject jsonObject : result) {
+            for (GenTableColumn column : allColumns) {
+                String dictType = column.getDictType();
+                String columnName = column.getColumnName();
+                if (containsKeyIgnoreCase(jsonObject, columnName) && isNotEmpty(dictType)) {
+                    // 列表需要字典值的dictLabel, 不放入sysDictData
+                    String dictLabel = remoteDictDataService.selectDictLabel(dictType, jsonObject.getString(columnName));
+                    jsonObject.put(columnName, dictLabel);
+                }
+            }
+        }
+    }
+
+    /**
+     * 功能描述: 把timeStamp转为string, 默认类型为:YYYY_MM_DD
+     *
+     * @param result 被转的数据
+     */
+    public static void handleDateTimeForQueryList(List<JSONObject> result, List<GenTableColumn> allColumns) {
+        if (isEmpty(result)) {
+            return;
+        }
+
+        for (JSONObject jsonObject : result) {
+            for (GenTableColumn column : allColumns) {
+                String columnName = column.getColumnName();
+                String columnType = column.getColumnType();
+                if (containsKeyIgnoreCase(jsonObject, columnName) && NEED_CONVERT_DATE_LIST.contains(columnType)) {
+                    jsonObject.put(columnName, getStrDate(jsonObject.getTimestamp(columnName)));
+                }
+            }
+        }
+    }
+
+    /**
+     * 功能描述: 处理外键
+     *
+     * @param result     result
+     * @param allColumns 该表对应的所有的列
+     */
+    public static void handleFkForQueryList(List<JSONObject> result, List<GenTableColumn> allColumns) {
+        if (isEmpty(result)) {
+            return;
+        }
+        // 拿到所有有fk的列
+        List<GenTableColumn> fkColumns = filter(allColumns, col -> ObjectUtils.isNotEmpty(col.getForeignKey()));
+        if (isEmpty(fkColumns)) {
+            return;
+        }
+
+        for (JSONObject jsonObject : result) {
+            for (GenTableColumn column : fkColumns) {
+                String selfColumnName = column.getColumnName();
+                if (containsKeyIgnoreCase(jsonObject, selfColumnName)) {
+                    JSONObject fkMap = getFkMap(column.getFkInfo(), jsonObject.get(selfColumnName));
+                    jsonObject.put(selfColumnName.toLowerCase(), fkMap);
+                }
+            }
+        }
+    }
+
+    /**
+     * 功能描述: 根据从数据库查出来的返回值来确实是否是blob, 转为字符串! 转为字符串! 转为字符串!
+     *
+     * @param isContainsBlob 此表中的字段是否含有blob的列, true含
+     * @param result         result
+     */
+    public static void handleBlob(List<JSONObject> result, Boolean isContainsBlob) {
+        // 不包含
+        if (BooleanUtils.isFalse(isContainsBlob)) {
+            return;
+        }
+
+        for (JSONObject jsonObject : result) {
+            for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
+                Object value = entry.getValue();
+                if (isNotEmpty(value) && BYTE_ARRAY.equals(value.getClass().getSimpleName())) {
+                    entry.setValue(byteToString(((byte[]) value)));
+                }
+            }
+        }
+    }
+
+    public static List<SysDictData> listSysDictDataByType(String dictType) {
+        RemoteDictDataService remoteDictDataService = SpringUtils.getBean(RemoteDictDataService.class);
+        List<SysDictData> list = null;
+        try {
+            list = remoteDictDataService.listByType(dictType);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return list;
+    }
+
+    /**
+     * 功能描述: yyyy-MM-dd
+     *
+     * @param date date
+     * @return java.lang.String
+     */
+    public static String getStrDate(Date date) {
+        if (null == date) {
+            return null;
+        }
+
+        return DateUtils.dateTime(date);
+    }
+
+    public static JSONObject getFkMap(Map<String, Object> fkInfoMap, Object value) {
+        Object fkTableName = fkInfoMap.get(FK_TABLE_NAME);
+        Object fkColumnName = fkInfoMap.get(FK_COLUMN_NAME);
+        Object dkColumnName = fkInfoMap.get(DK_COLUMN_NAME);
+
+        // 到子表中查
+        JSONObject param = new JSONObject();
+        param.put(fkColumnName.toString(), value);
+        IBaseSelectService selectService = SpringUtils.getBean(IBaseSelectService.class);
+        JSONObject fkInfo = selectService.getOneByMap(fkTableName.toString(), param);
+
+        JSONObject result = new JSONObject();
+        Object fkValue = fkInfo.get(dkColumnName);
+        result.put(SINGLE_OBJ_NAME, value);
+        result.put(SINGLE_OBJ_VALUE, fkValue);
+        return result;
+    }
+
+    public static List<SysFile> getAnnex(String value) {
+        if (ArrayUtils.equalsEmptyArray(value)) {
+            return null;
+        } else {
+            return JSON.parseObject(value, new TypeReference<List<SysFile>>() {
+            }.getType());
+        }
+    }
+
+    public static String byteToString(byte[] bytes) {
+        String result = "";
+        if (ArrayUtils.isNotEmpty(bytes)) {
+            result = new String(bytes, StandardCharsets.UTF_8);
+        }
+
+        return result;
+    }
+
+}

+ 2 - 2
boman-web-core/src/main/java/com/boman/web/core/utils/IdUtils.java

@@ -21,7 +21,7 @@ import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
 public class IdUtils {
 
 
-    public static Long getMaxId(String tableName, String pkName) {
+    public static int getMaxId(String tableName, String pkName) {
         RedisService redisService = SpringUtils.getBean(RedisService.class);
         String sequencesKey = RedisKey.SEQ + tableName.toUpperCase();
         boolean isExist = redisService.exists(sequencesKey);
@@ -31,7 +31,7 @@ public class IdUtils {
 
         // 查数据库
         StandardlyMapper mapper = SpringUtils.getBean(StandardlyMapper.class);
-        long maxId = mapper.selectMaxId(tableName, pkName);
+        int maxId = mapper.selectMaxId(tableName, pkName);
         if (maxId <= 0) {
             maxId = 1;
             redisService.setCacheObject(sequencesKey, maxId);

+ 20 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/JSONObjectUtils.java

@@ -0,0 +1,20 @@
+package com.boman.web.core.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author shiqian
+ * @date 2021年04月29日 15:21
+ **/
+public class JSONObjectUtils {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JSONObjectUtils.class);
+
+    public static boolean containsKeyIgnoreCase(JSONObject json, String key) {
+        return json.containsKey(key.toLowerCase()) || json.containsKey(key.toUpperCase());
+    }
+
+
+}

+ 10 - 10
ruoyi-ui/src/api/activiti/definition.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 新增关联表
 export function addGendefini(data) {
   return request({
-    url: '/p/cs/task/relation/list',
+    url: '/jflow/p/cs/task/relation/list',
     method: 'post',
     data
   })
@@ -11,7 +11,7 @@ export function addGendefini(data) {
 // 刪除
 export function addGendefinideal(data) {
   return request({
-    url: '/p/cs/task/batch/deal',
+    url: '/jflow/p/cs/task/batch/deal',
     method: 'post',
     data
   })
@@ -19,7 +19,7 @@ export function addGendefinideal(data) {
 // 查詢
 export function addGendefiniqur(data) {
   return request({
-    url: '/p/cs/task/backlog/list',
+    url: '/jflow/p/cs/task/backlog/list',
     method: 'post',
     data
   })
@@ -28,7 +28,7 @@ export function addGendefiniqur(data) {
 // mesetet
 export function addGenmutipor(data) {
   return request({
-    url: '/p/c/identity/org/treequery',
+    url: '/jflow/p/c/identity/org/treequery',
     method: 'post',
     data
   })
@@ -36,7 +36,7 @@ export function addGenmutipor(data) {
 //查找用户信息
 export function addGenmutiporuder(data) {
   return request({
-    url: '/p/c/identity/user/list',
+    url: '/jflow/p/c/identity/user/list',
     method: 'post',
     data
   })
@@ -44,7 +44,7 @@ export function addGenmutiporuder(data) {
 //获取树数据
 export function addGenmutiportree(data) {
   return request({
-    url: '/p/c/identity/org/treeload',
+    url: '/jflow/p/c/identity/org/treeload',
     method: 'post',
     data
   })
@@ -54,7 +54,7 @@ export function addGenmutiportree(data) {
 // 获取流程图信息  flowshow
 export function addGenflowshow(data) {
   return request({
-    url: '/p/c/task/backlog/detail',
+    url: '/jflow/p/c/task/backlog/detail',
     method: 'post',
     data
   })
@@ -63,7 +63,7 @@ export function addGenflowshow(data) {
 //业务关系下拉数据   historicap
 export function addGenhistoricap(data) {
   return request({
-    url: '/p/cs/task/relation/list',
+    url: '/jflow/p/cs/task/relation/list',
     method: 'post',
     data
   })
@@ -71,7 +71,7 @@ export function addGenhistoricap(data) {
 // history 查询列表
 export function addGenhistorihistory(data) {
   return request({
-    url: '/p/cs/task/history/list',
+    url: '/jflow/p/cs/task/history/list',
     method: 'post',
     data
   })
@@ -79,7 +79,7 @@ export function addGenhistorihistory(data) {
 //提交
 export function addGenhistorilisr(data) {
   return request({
-    url: "/p/cs/process/manualsubmit",
+    url: "/jflow/p/cs/process/manualsubmit",
     method: 'post',
     data
   })

+ 13 - 0
ruoyi-ui/src/api/modeler.js

@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+// 流程模型列表
+export const getSearch = (data) => {
+  return request({
+    headers: {
+      'accountName': 'guest'
+    },
+    url: '/jflow/p/cs/module/search',
+    method: 'post',
+    data
+  })
+}

binární
ruoyi-ui/src/assets/images/pic_sy_ytj.png


+ 60 - 0
ruoyi-ui/src/components/BigPicture/index.vue

@@ -0,0 +1,60 @@
+<template>
+  <div :class="{'hidden': !hidden.status}" @click="hidden.status=false" class="heibox">
+    <div class="imgs" @click.stop="">
+      <img :src="urls" alt="" class="img">
+    </div>
+  </div>
+</template>
+
+<script>
+  import {
+    scrollTo
+  } from '@/utils/scroll-to'
+
+  export default {
+    name: 'BigPicture',
+    props: {
+      urls: {
+        default: '',
+        type: String
+      },
+      hidden: {
+        type: Object,
+        default: () => {
+          return {
+            status: ''
+          }
+        }
+      }
+    },
+    methods: {
+
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .heibox {
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0,0,0,.8);
+    position: fixed;
+    z-index: 99999;
+    top: 0;
+    left: 0;
+    .imgs{
+      width: 80%;
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%,-50%);
+      .img{
+        width: 100%;
+        object-fit: contain;
+      }
+    }
+  }
+  .hidden {
+    display: none;
+  }
+</style>

+ 37 - 15
ruoyi-ui/src/components/DynamicForm/index.vue

@@ -2,56 +2,56 @@
   <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
     <!-- 输入框 -->
     <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-      clearable @keyup.enter.native="handleQuery" />
+      clearable @keyup.enter.native="handleQuery"  :disabled="formConfig.disabshow" />
     <!-- 多行输入框 -->
     <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
-      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" />
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow"/>
     <!-- 下拉框 -->
-    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo.fkTableName)"
-      filterable :placeholder="'请输入'+formConfig.columnComment">
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo)"
+      filterable :placeholder="'请输入'+formConfig.columnComment" :disabled="formConfig.disabshow">
       <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel"
         :value="itemChild.dictValue">
       </el-option>
     </el-select>
     <!-- 下拉框搜索 -->
-    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo.fkTableName)"
+    <el-select :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo)"
       filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
       <el-option v-for="itemChild in filterList" :key="itemChild.table_id" :label="itemChild.table_name" :value="itemChild.table_id">
       </el-option>
     </el-select>
     <!-- 复选框 -->
-    <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
+    <el-checkbox-group :disabled="formConfig.disabshow" v-model="config" v-if="formConfig.htmlType == 'checkbox'">
       <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue"
         :key="itemChild.dictLabel">
         {{itemChild.dictLabel}}
       </el-checkbox>
     </el-checkbox-group>
     <!-- 单选框 -->
-    <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
+    <el-radio-group :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
       <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
     </el-radio-group>
     <!-- 时间控件 -->
-    <el-date-picker v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
+    <el-date-picker :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
       :placeholder="'请输入'+formConfig.columnComment">
     </el-date-picker>
     <!-- 上传图片 -->
-    <el-upload v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
+    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
       :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-success="upImageFn"
       :on-remove="reseImage">
       <i class="el-icon-plus"></i>
     </el-upload>
-    <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
+    <el-dialog :disabled="formConfig.disabshow" :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
       <img width="100%" :src="dialogImageUrl" alt="">
     </el-dialog>
     <!-- 上传文件 -->
-    <el-upload class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
+    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
       :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
       :file-list="config">
       <el-button size="small" type="primary">点击上传</el-button>
       <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
     </el-upload>
     <!-- 富文本 -->
-    <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+    <editor  :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
   </el-form-item>
 </template>
 
@@ -90,7 +90,7 @@
     components: {
       Editor
     },
-    props: {
+    props: {
       formConfig: {
         type: Object,
         required: true,
@@ -100,8 +100,28 @@
       },
     },
     created() {
-      this.config = {}
+      this.config = {}
+      // console.log(this.formConfig.mask.slice(3,4),876454)
+      console.log(this.formConfig.fkInfo)
+      if(this.formConfig.readonly == true){
+        this.formConfig.disabshow = true
+      }else if(this.formConfig.mask.slice(3,4) == '0'){
+        this.formConfig.disabshow = true
+      }else{
+        this.formConfig.disabshow = false
+      }
+      if(this.formConfig.fkInfo == null){
+          this.formConfig.fkInfo=false
+      }
       this.init()
+    },
+    watch: {
+      'config': {
+         handler: function() {
+             this.$emit('modelFn',this.formConfig.columnName,this.config[this.formConfig.columnName])
+         },
+         deep: true
+     }
     },
     mounted() {},
     methods: {
@@ -131,8 +151,10 @@
           this.config = []
         } else {
           this.$set(this.config, this.formConfig.columnName, (this.formConfig.columnValue || ''))
+        }
+        if(this.formConfig.fkInfo){
+          this.aliemg.table = this.formConfig.fkInfo.fkTableName
         }
-        this.aliemg.table = this.formConfig.fkInfo.fkTableName
       },
       handleChange(file, fileList) {
         this.fileList = fileList.slice(-3);

+ 44 - 16
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -2,56 +2,56 @@
   <el-form-item :label="formConfig.columnComment" style="display: inline-block;" :prop="formConfig.columnName">
     <!-- 输入框 -->
     <el-input v-if="formConfig.htmlType == 'input'" v-model="config[formConfig.columnName]" :placeholder="'请输入'+formConfig.columnComment"
-      clearable @keyup.enter.native="handleQuery" />
+      clearable @keyup.enter.native="handleQuery"  :disabled="formConfig.disabshow" />
     <!-- 多行输入框 -->
     <el-input v-if="formConfig.htmlType == 'textarea'" type="textarea" v-model="config[formConfig.columnName]"
-      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" />
+      :placeholder="'请输入'+formConfig.columnComment" clearable @keyup.enter.native="handleQuery" :disabled="formConfig.disabshow"/>
     <!-- 下拉框 -->
-    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo.fkTableName)"
-      filterable :placeholder="'请输入'+formConfig.columnComment">
+    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(!formConfig.fkInfo)"
+      filterable :placeholder="'请输入'+formConfig.columnComment" :disabled="formConfig.disabshow">
       <el-option v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictLabel"
         :value="itemChild.dictValue">
       </el-option>
     </el-select>
     <!-- 下拉框搜索 -->
-    <el-select v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo.fkTableName)"
+    <el-select :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'select'&&(formConfig.fkInfo)"
       filterable remote :remote-method="remoteMethod" :loading="loading" :placeholder="'请输入'+formConfig.columnComment">
-      <el-option v-for="itemChild in filterList" :key="itemChild.table_id" :label="itemChild.table_name" :value="itemChild.table_id">
+      <el-option v-for="itemChild in filterList" :key="itemChild.id" :label="itemChild.table_name" :value="itemChild.id">
       </el-option>
     </el-select>
     <!-- 复选框 -->
-    <el-checkbox-group v-model="config" v-if="formConfig.htmlType == 'checkbox'">
+    <el-checkbox-group :disabled="formConfig.disabshow" v-model="config" v-if="formConfig.htmlType == 'checkbox'">
       <el-checkbox @change="handleCheckedCitiesChange" v-for="itemChild in formConfig.sysDictData" :label="itemChild.dictValue"
         :key="itemChild.dictLabel">
         {{itemChild.dictLabel}}
       </el-checkbox>
     </el-checkbox-group>
     <!-- 单选框 -->
-    <el-radio-group v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
+    <el-radio-group :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'radio'">
       <el-radio v-for="itemChild in formConfig.sysDictData" :key="itemChild.dictValue" :label="itemChild.dictValue">{{itemChild.dictLabel}}</el-radio>
     </el-radio-group>
     <!-- 时间控件 -->
-    <el-date-picker v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
+    <el-date-picker :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'datetime'" type="date"
       :placeholder="'请输入'+formConfig.columnComment">
     </el-date-picker>
     <!-- 上传图片 -->
-    <el-upload v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
+    <el-upload :disabled="formConfig.disabshow" v-if="formConfig.htmlType == 'imageUpload'" :headers="{Authorization: 'Bearer ' + getToken()}" :action="process + '/boman-file/upload'"
       :file-list="config" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-success="upImageFn"
       :on-remove="reseImage">
       <i class="el-icon-plus"></i>
     </el-upload>
-    <el-dialog :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
+    <el-dialog :disabled="formConfig.disabshow" :visible.sync="dialogVisible" v-if="formConfig.htmlType == 'imageUpload'">
       <img width="100%" :src="dialogImageUrl" alt="">
     </el-dialog>
     <!-- 上传文件 -->
-    <el-upload class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
+    <el-upload :disabled="formConfig.disabshow" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}" v-if="formConfig.htmlType == 'fileUpload'"
       :action="process + '/boman-file/upload'" :on-change="handleChange" :on-success="upImageFn" :on-remove="reseImage"
       :file-list="config">
       <el-button size="small" type="primary">点击上传</el-button>
       <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
     </el-upload>
     <!-- 富文本 -->
-    <editor v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
+    <editor  :disabled="formConfig.disabshow" v-model="config[formConfig.columnName]" v-if="formConfig.htmlType == 'editor'" :min-height="192" />
   </el-form-item>
 </template>
 
@@ -90,18 +90,44 @@
     components: {
       Editor
     },
-    props: {
+    props: {
       formConfig: {
         type: Object,
         required: true,
         'default': {
           sysDictData: []
         }
+      },
+      type: {
+        type: Number,
+        default: 1
       },
     },
     created() {
-      this.config = {}
+      this.config = {}
+      // console.log(this.formConfig.mask.slice(3,4),876454)
+      console.log(this.formConfig.fkInfo)
+      if(this.type){
+        if(this.formConfig.readonly == true){
+          this.formConfig.disabshow = true
+        }else if(this.formConfig.mask.slice(3,4) == '0'){
+          this.formConfig.disabshow = true
+        }else{
+          this.formConfig.disabshow = false
+        }
+        if(this.formConfig.fkInfo == null){
+            this.formConfig.fkInfo=false
+        }
+      }
       this.init()
+    },
+    watch: {
+      'config': {
+         handler: function() {
+             this.$emit('modelFn',this.formConfig.columnName,this.config[this.formConfig.columnName])
+         },
+         deep: true
+     }
     },
     mounted() {},
     methods: {
@@ -131,8 +157,10 @@
           this.config = []
         } else {
           this.$set(this.config, this.formConfig.columnName, (this.formConfig.columnValue || ''))
+        }
+        if(this.formConfig.fkInfo){
+          this.aliemg.table = this.formConfig.fkInfo.fkTableName
         }
-        this.aliemg.table = this.formConfig.fkInfo.fkTableName
       },
       handleChange(file, fileList) {
         this.fileList = fileList.slice(-3);

+ 3 - 3
ruoyi-ui/src/components/FormItemComponent/index.vue

@@ -21,9 +21,9 @@
       </div>
     </div>
     <p v-if="buttonType">
-      <Button type="primary" @click="search">搜索</Button>
-      <Button type="fcdefault" @click="reset">重置</Button>
-    </p>
+      <el-button type="primary" plain icon="el-icon-search" @click="search">搜索</el-button>
+      <el-button icon="el-icon-refresh" size="mini" @click="reset">重置</el-button>
+      </p>
   </div>
 </template>
 <script>

+ 3 - 2
ruoyi-ui/src/components/HistoricalProcess/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 历史流程 -->
   <div class="HistoricalProcess">
-    <Button type="primary" @click="searchData.page = 1;queryLists()">查询</Button>
+    <el-button type="primary" plain icon="el-icon-search" size="mini" @click="searchData.page = 1;queryLists()">查询</el-button>
     <FormItemComponent
       class="form"
       :formItemLists="formLists"
@@ -330,7 +330,8 @@ export default {
         })
         .then(res => {
           if (res.data.resultCode === 0) {
-            this.$Message.success(res.data.resultMsg);
+            this.msgSuccess(res.data.resultMsg);
+            // this.$Message.success(res.data.resultMsg);
           }
         });
     }

+ 48 - 24
ruoyi-ui/src/components/MutipleSelectPop/index.vue

@@ -50,17 +50,6 @@
         <Tabs size="small" @on-click="tabClick" :animated="false">
           <TabPane v-for="(item,key) in TabPaneData" :key="key" :label="item.tab">
             <div class="dialog_center_page">
-              <div class="dialog_p10">
-                <Page
-                  :total="item.total"
-                  :page-size="item.pageSize"
-                  :current="item.pageNum"
-                  @on-change="pageChange"
-                  :page-size-opts="item.pageOptions"
-                  show-total
-                  size="small"
-                />
-              </div>
               <div>
                 <Table
                   border
@@ -79,6 +68,17 @@
                   :data="item.list"
                 ></Table>
               </div>
+              <div class="dialog_p10">
+                <Page
+                  :total="item.total"
+                  :page-size="item.pageSize"
+                  :current="item.pageNum"
+                  @on-change="pageChange"
+                  :page-size-opts="item.pageOptions"
+                  show-total
+                  size="small"
+                />
+              </div>
             </div>
           </TabPane>
         </Tabs>
@@ -413,9 +413,11 @@ export default {
             //没有找到相同的就加入
             this.resultRightData.list.push(selectObj);
           } else {
-            this.$Message.warning(
-              selectObj.ENAME + "已经选择过了,请不要重复选择!"
-            );
+            this.$message({
+                      message: selectObj.ENAME + "已经选择过了,请不要重复选择!",
+                      type: 'warning'
+                    });
+
           }
         } else {
           this.$set(this.resultRightData, "list", [selectObj]);
@@ -519,16 +521,22 @@ export default {
                 //没有找到相同的就加入
                 this.resultRightData.list.push(selectObj);
               } else {
-                this.$Message.warning(
-                  item.ENAME + "已经选择过了,请不要重复选择!"
-                );
+                  this.$message({
+                          message:  item.ENAME + "已经选择过了,请不要重复选择!",
+                          type: 'warning'
+                        });
+
               }
             } else {
               this.$set(this.resultRightData, "list", [selectObj]);
             }
           });
         } else {
-          this.$Message.warning("请选择部门");
+          his.$message({
+                  message:"请选择部门!",
+                  type: 'warning'
+                });
+          // this.$Message.warning("请选择部门");
         }
         this.getTreeData();
       }
@@ -546,7 +554,11 @@ export default {
       if (!this.isMutiple) {
         //单选逻辑
         if (Object.keys(this.selectDatas).length === 0) {
-          this.$Message.warning("请选择人员");
+          this.$message({
+                    message: '请选择人员',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("请选择人员");
           return;
         }
         this.resultRightData.total
@@ -577,9 +589,13 @@ export default {
                 //没有找到相同的就加入
                 this.resultRightData.list.push(selectObj);
               } else {
-                this.$Message.warning(
-                  item.ENAME + "已经选择过了,请不要重复选择!"
-                );
+                this.$message({
+                          message: item.ENAME + "已经选择过了,请不要重复选择!",
+                          type: 'warning'
+                        });
+                // this.$Message.warning(
+                //   item.ENAME + "已经选择过了,请不要重复选择!"
+                // );
               }
             } else {
               this.$set(this.resultRightData, "list", [selectObj]);
@@ -593,7 +609,11 @@ export default {
                 this.resultRightData.list.length
               );
         } else {
-          this.$Message.warning("请选择人员");
+          this.$message({
+                    message: '请选择人员',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("请选择人员");
         }
       }
       //刷新表格数据
@@ -764,7 +784,11 @@ export default {
           this.translator(parent, children, key);
           return parent;
         } else {
-          this.$Message.warning("数据有问题,请检查...");
+          this.$message({
+                    message: '数据有问题,请检查...',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("数据有问题,请检查...");
           return;
         }
       } else {

+ 23 - 16
ruoyi-ui/src/components/StandardTable/index.vue

@@ -1,20 +1,7 @@
 <template>
   <div class="StandardTable">
-    <Page
-      v-if="showPage"
-     class="page"
-     :total="total"
-     show-total
-     show-sizer
-     show-elevator
-     transfer
-     :page-size="pageSize"
-     :current="currentPage"
-     :page-size-opts="pageSizeOpts"
-     v-on="standardTableEvent"
-    />
 
-    <div 
+    <div
       class="table"
       v-if="showTable"
     >
@@ -33,6 +20,22 @@
 
 
     </div>
+    <div class="stabd">
+      <Page
+       v-if="showPage"
+       class="page"
+       :total="total"
+       show-total
+       show-sizer
+       show-elevator
+       transfer
+       :page-size="pageSize"
+       :current="currentPage"
+       :page-size-opts="pageSizeOpts"
+       v-on="standardTableEvent"
+      />
+    </div>
+
   </div>
 </template>
 <script>
@@ -109,7 +112,7 @@ export default {
   .page{
     margin-bottom: 8px;
   }
-  
+
   .table{
     flex: 1;
     overflow: hidden;
@@ -124,5 +127,9 @@ export default {
     }
   }
 }
+.stabd{
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 20px;
+}
 </style>
-

+ 48 - 24
ruoyi-ui/src/components/mutipleSelectPop/index.vue

@@ -50,17 +50,6 @@
         <Tabs size="small" @on-click="tabClick" :animated="false">
           <TabPane v-for="(item,key) in TabPaneData" :key="key" :label="item.tab">
             <div class="dialog_center_page">
-              <div class="dialog_p10">
-                <Page
-                  :total="item.total"
-                  :page-size="item.pageSize"
-                  :current="item.pageNum"
-                  @on-change="pageChange"
-                  :page-size-opts="item.pageOptions"
-                  show-total
-                  size="small"
-                />
-              </div>
               <div>
                 <Table
                   border
@@ -79,6 +68,17 @@
                   :data="item.list"
                 ></Table>
               </div>
+              <div class="dialog_p10">
+                <Page
+                  :total="item.total"
+                  :page-size="item.pageSize"
+                  :current="item.pageNum"
+                  @on-change="pageChange"
+                  :page-size-opts="item.pageOptions"
+                  show-total
+                  size="small"
+                />
+              </div>
             </div>
           </TabPane>
         </Tabs>
@@ -413,9 +413,11 @@ export default {
             //没有找到相同的就加入
             this.resultRightData.list.push(selectObj);
           } else {
-            this.$Message.warning(
-              selectObj.ENAME + "已经选择过了,请不要重复选择!"
-            );
+            this.$message({
+                      message: selectObj.ENAME + "已经选择过了,请不要重复选择!",
+                      type: 'warning'
+                    });
+
           }
         } else {
           this.$set(this.resultRightData, "list", [selectObj]);
@@ -519,16 +521,22 @@ export default {
                 //没有找到相同的就加入
                 this.resultRightData.list.push(selectObj);
               } else {
-                this.$Message.warning(
-                  item.ENAME + "已经选择过了,请不要重复选择!"
-                );
+                  this.$message({
+                          message:  item.ENAME + "已经选择过了,请不要重复选择!",
+                          type: 'warning'
+                        });
+
               }
             } else {
               this.$set(this.resultRightData, "list", [selectObj]);
             }
           });
         } else {
-          this.$Message.warning("请选择部门");
+          his.$message({
+                  message:"请选择部门!",
+                  type: 'warning'
+                });
+          // this.$Message.warning("请选择部门");
         }
         this.getTreeData();
       }
@@ -546,7 +554,11 @@ export default {
       if (!this.isMutiple) {
         //单选逻辑
         if (Object.keys(this.selectDatas).length === 0) {
-          this.$Message.warning("请选择人员");
+          this.$message({
+                    message: '请选择人员',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("请选择人员");
           return;
         }
         this.resultRightData.total
@@ -577,9 +589,13 @@ export default {
                 //没有找到相同的就加入
                 this.resultRightData.list.push(selectObj);
               } else {
-                this.$Message.warning(
-                  item.ENAME + "已经选择过了,请不要重复选择!"
-                );
+                this.$message({
+                          message: item.ENAME + "已经选择过了,请不要重复选择!",
+                          type: 'warning'
+                        });
+                // this.$Message.warning(
+                //   item.ENAME + "已经选择过了,请不要重复选择!"
+                // );
               }
             } else {
               this.$set(this.resultRightData, "list", [selectObj]);
@@ -593,7 +609,11 @@ export default {
                 this.resultRightData.list.length
               );
         } else {
-          this.$Message.warning("请选择人员");
+          this.$message({
+                    message: '请选择人员',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("请选择人员");
         }
       }
       //刷新表格数据
@@ -764,7 +784,11 @@ export default {
           this.translator(parent, children, key);
           return parent;
         } else {
-          this.$Message.warning("数据有问题,请检查...");
+          this.$message({
+                    message: '数据有问题,请检查...',
+                    type: 'warning'
+                  });
+          // this.$Message.warning("数据有问题,请检查...");
           return;
         }
       } else {

+ 30 - 16
ruoyi-ui/src/components/todoProcess/index.vue

@@ -2,8 +2,8 @@
   <!-- 待办流程 -->
   <div class="TodoProcess">
     <div class="btnArea">
-      <Button type="primary" @click="searchData.page = 1;queryLists()">查询</Button>
-      <Button type="primary" ghost @click="openModal(2)">转派</Button>
+      <el-button type="primary" plain icon="el-icon-search" size="mini"  @click="searchData.page = 1;queryLists()">查询</el-button>
+      <el-button type="primary"  icon="el-icon-refresh-left" size="mini" ghost @click="openModal(2)">转派</el-button>
     </div>
     <FormItemComponent
       class="form"
@@ -11,15 +11,15 @@
       :buttonType="false"
       @formChange="formChange"
     ></FormItemComponent>
-    <StandardTable
-      class="table"
-      :currentPage="searchData.page"
-      :pageSize="searchData.pageSize"
-      :total="total"
-      :columns="columns"
-      :data="data"
-      :standardTableEvent="standardTableEvent"
-    ></StandardTable>
+   <StandardTable
+     class="table"
+     :currentPage="searchData.page"
+     :pageSize="searchData.pageSize"
+     :total="total"
+     :columns="columns"
+     :data="data"
+     :standardTableEvent="standardTableEvent"
+   ></StandardTable>
     <Modal
       v-model="openControl"
       :title="modaltitle"
@@ -29,6 +29,7 @@
       @on-ok="ok"
       @on-cancel="cancel"
     >
+
       <div class="modalCotent">
         <mutipleSelectPop
           ref="dialogtest"
@@ -59,7 +60,7 @@
 import FormItemComponent from "../FormItemComponent";
 import ItemComponent from "../ItemComponent";
 import StandardTable from "../StandardTable";
-import mutipleSelectPop from "../MutipleSelectPop";
+import mutipleSelectPop from "../MutipleSelectPop/index.vue";
 import FlowChartShow from "../FlowChartShow";
 import {
     addGendefini,
@@ -404,7 +405,11 @@ export default {
       if(this.resultData.list.length>0){
          sendData.delegateId = this.resultData.list[0].ID;
       }else{
-        this.$Message.warning("请选择转派人员");
+        this.$message({
+                 message: "请选择转派人员",
+                 type: 'warning'
+               });
+        // this.$Message.warning("请选择转派人员");
         return
       }
       // sendData.userId = this.userInfo.userId;
@@ -412,9 +417,14 @@ export default {
         let data = res.data;
         if (data.resultCode === 0) {
           this.queryLists();
-          this.$Message.success(data.resultMsg);
+          this.msgSuccess(data.resultMsg);
+          // this.$Message.success();
         } else {
-          this.$Message.warning(data.resultMsg);
+          this.$message({
+                   message: data.resultMsg,
+                   type: 'warning'
+                 });
+          // this.$Message.warning(data.resultMsg);
         }
       });
     },
@@ -454,7 +464,11 @@ export default {
         this.resultData.total=0;
       }
       } else {
-        this.$Message.warning("请选择单据");
+         this.$message({
+                  message: '请选择单据',
+                  type: 'warning'
+                });
+        // this.$Message.warning("请选择单据");
       }
     },
     onRowClick(row, index, vm) {

+ 2 - 0
ruoyi-ui/src/main.js

@@ -27,6 +27,8 @@ import DynamicForm from "@/components/DynamicForm"
 import DynamicForms from "@/components/DynamicForms"
 import MemoranDum from "@/components/MemoranDum"
 import 'burgeon-ui/dist/styles/burgeon-ui.css';
+import BigPicture from "@/components/BigPicture";
+Vue.component('BigPicture', BigPicture)
 import BurgeonUi from 'burgeon-ui';
 Vue.use(BurgeonUi);
 // 全局方法挂载

+ 1 - 0
ruoyi-ui/src/utils/request.js

@@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode'
 import { tansParams } from "@/utils/ruoyi";
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
+axios.defaults.headers['accountName'] = 'guest'
 // 创建axios实例
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分

+ 30 - 25
ruoyi-ui/src/views/activiti/modeler/index.vue

@@ -82,7 +82,12 @@ import FormItemComponent from '@/components/FormItemComponent';
 import ItemComponent from '@/components/ItemComponent';
 import StandardTable from '@/components/StandardTable';
 import listModalComponent from '@/components/listModalComponent'
+import {
+    getSearch
+  } from '@/api/modeler.js'
+
 // import router from '../config/router.config'
+
 import {  mapMutations,mapState } from 'vuex';
 export default {
   name:'TemplateManagementLists',
@@ -191,7 +196,7 @@ export default {
     }
   },
   methods:{
-    // ...mapMutations(['currentChange','changeKeepAliveArray']),
+    ...mapMutations(['currentChange','changeKeepAliveArray']),
     formChange (data) {  //表单数据修改时,修改searchData数据
       if(data.status){
         this.formLists[0].item.value = data.name
@@ -225,31 +230,31 @@ export default {
       let obj = Object.assign({},this.searchData)
       delete obj.createTime
       delete obj.status
-      // this.$network.post('/p/cs/module/search', obj).then((res) => {
-      //   if(res.data.resultCode !== 0){
-      //     return
-      //   }
-      //   let data = res.data.data
-      //   this.total = data.total
+      getSearch(obj).then((res) => {
+        if(res.data.resultCode !== 0){
+          return
+        }
+        let data = res.data.data
+        this.total = data.total
 
-      //   this.listsConfig = data.records.reduce((arr,item) => {
-      //     let items = {
-      //       event:{
-      //         queryLists:() => {
-      //           this.queryLists()
-      //         }
-      //       }
-      //     }
-      //     items = Object.assign(items,item)
-      //     arr.push({
-      //       row:1,
-      //       col:1,
-      //       component:listModalComponent,
-      //       item:items
-      //     })
-      //     return arr
-      //   },[])
-      // });
+        this.listsConfig = data.records.reduce((arr,item) => {
+          let items = {
+            event:{
+              queryLists:() => {
+                this.queryLists()
+              }
+            }
+          }
+          items = Object.assign(items,item)
+          arr.push({
+            row:1,
+            col:1,
+            component:listModalComponent,
+            item:items
+          })
+          return arr
+        },[])
+      });
     },
     addTemplate () {  //新建模版
       this.changeKeepAliveArray(['TemplateManagementLists'])

+ 9 - 24
ruoyi-ui/src/views/index.vue

@@ -112,7 +112,7 @@
                  <el-tab-pane label="用户管理" name="first"> -->
                    <div style="height: 84%;">
                         <div style="height: 85%;">
-                          <h3 style="text-align: center;">{{tieku}}</h3>
+                          <h3 style="text-align: center; margin: 35px 0;">{{tieku}}</h3>
                                         <p class="index_profilep" > {{comg}}	</p>
                         </div>
                                       <!-- {{getLisprofileone[0].info_content}} -->
@@ -170,14 +170,14 @@
                 <span @click="memoere"><i class="el-icon-date"></i>创建备忘录</span>
               </p>
               <ul >
-                <li v-for="(item,index) in getmemorandum" :key="index" @click="index_deledetfe(item.id)">
+                <li v-for="(item,index) in getmemorandum" :key="index" >
                   <p>{{item.memorandum_title}}
                   </p>
                   <div class="index_navspande">
                     <span>
                     {{item.remind_time}}
                     </span>
-                    <img src="../assets/images/deletety.png" alt="" v-if="shower">
+                    <img src="../assets/images/deletety.png" alt="" v-if="shower" @click="index_deledetfe(item.id)">
                   </div>
                 </li>
 
@@ -454,23 +454,11 @@ export default {
      brightDate () {
        // let ary = []
        var that =  this
-       // console.log(that.calendarData,887)
        if(that.calendarData.length !==null){
          for (var i = 0 ; i < that.calendarData.length; i++) {
-           // that.ary.push(that.calendarData[i].startDate)
-           // that.ary.push(that.calendarData[i].begin_time.slice(0,10))
-           // that.ary.push(that.calendarData[i].all_date.split(','))
            that.calendarData[i].love="yu"
            if(that.calendarData[i].remind_time !== undefined){
-             // that.rjtu.concat(that.calendarData[i].all_date.join(','))
              that.ary.push(that.calendarData[i].remind_time)
-             // that.calendarData[i].all_date.fi
-             // that.calendarData[i].remind_time.filter(route => {
-             //   // console.log(route,9875)
-             //   that.ary.push(route)
-             // })
-             // that.ary = that.calendarData[i].all_date
-             // console.log(that.calendarData[i].all_date.join(','),754)
            }
          }
        }
@@ -489,23 +477,20 @@ export default {
           let conert = ''
           let conertre = ''
           let nujue= 0
-          let nujeug = []
-          let setre = []
-          this.truew = []
           console.log(this.calendarData)
           for (var i = 0 ; i < this.calendarData.length; i++) {
             if(this.calendarData[i].schedule_content !== undefined){
            this.calendarData[i].schedule_content = this.calendarData[i].schedule_content.replace(/<\/?[^>]*>/g, '')
             }
             if(data == this.calendarData[i].remind_time){
-              content  = content  + this.calendarData[i].schedule_content + '、'
-              console.log(i,this.calendarData.length)
+              console.log(content,this.calendarData[i].schedule_content)
+              if(content  == this.calendarData[i].schedule_content + '、'){
+                content  = content
+              }else{
+                content  = content  + this.calendarData[i].schedule_content + '、'
+              }
             }
-                console.log(content)
           }
-          console.log(content)
-          // console.log(this.rjtu,12345)
-          // content = this.rjtu.join(',')
          return content
         },
     //数据  第一部分列表

+ 30 - 12
ruoyi-ui/src/views/system/editing/index.vue

@@ -3,6 +3,7 @@
     <!-- 头部 -->
     <div class="eniting_header">
       <!-- <p class="p">表编辑</p> -->
+      <div class="imge_tab"><img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew"></div>
       <div class="ppl">
         <p v-for="(item,index) in tabldie" :key="index" @click="enditTab(index)">
           <img src="../../../assets/images/icon_tbtab_normal.png" alt="" class="index_headerImg" v-if="num !== index">
@@ -19,12 +20,12 @@
     <!-- 内容 -->
     <div class="eniting_nav">
       <el-collapse v-model="activeNames" @change="handleChange">
-        <el-form :model="queryParams" ref="queryForm" :inline="true" :rules="queryData.rules" label-width="120px">
+        <el-form :rules="queryData.rules" :model="queryParams" ref="queryForm" :inline="true" label-width="120px">
           <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index"
             class="eitde">
             <el-row>
               <el-col :span="24" :key="index">
-                <dynamic-forms :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items"
+                <dynamic-forms @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items"
                   v-for="(items,indexs) in item.hrChildren" :key='indexs' />
               </el-col>
             </el-row>
@@ -46,6 +47,7 @@
   } from '@/api/system/table.js';
   export default {
     name: "index",
+    inject: ['reload'],
     data() {
       return {
         activeNames: ['1'],
@@ -93,6 +95,7 @@
         },
         jeigneu: [],
         jeigneutwo: [],
+        imgShoew:true
       };
     },
     mounted() {
@@ -111,12 +114,14 @@
       this.deledlid.table = this.$route.query.tables
       this.deledlid.idList.push(this.$route.query.id)
       console.log(this.deledlid)
-
       // tab
       this.edingelsietab()
     },
     filters: {},
     methods: {
+      modelFn(obj, cont) {
+        this.$set(this.queryParams,obj,cont)
+      },
       handleChange(val) {
         console.log(val);
       },
@@ -185,6 +190,18 @@
           this.jeigneutwo.push('刷新')
           this.jeigneutwo.push('返回')
           console.log(this.queryData, 567)
+          // 图片的显示隐藏
+          if(this.queryData.showData.length !==0){
+           this.queryData.showData.filter(route => {
+               if(route.hrChildren.length !== 0){
+                  if(route.hrChildren[1].readonly == true){
+                        this.imgShoew = true
+                  }else{
+                    this.imgShoew = false
+                  }
+               }
+           })
+          }
         })
       },
       // 数据信息
@@ -206,8 +223,7 @@
           if (this.tabldie.length !== 0) {
             this.init()
           } else {
-            this.msgSuccess("暂无数据");
-
+            this.msgSuccess("暂无tab数据");
             this.$router.go(-1)
           }
           // this.msgSuccess("反提交成功");
@@ -224,20 +240,16 @@
         console.log(index, 4)
         for (let item of this.queryData.showData) {
           for (var i = 0; i < item.hrChildren.length; i++) {
-            if (item.hrChildren[i].htmlType == 'checkbox' || item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[
-                i].htmlType == 'fileUpload') {
+            if (item.hrChildren[i].htmlType == 'checkbox') {
               this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config
-              console.log(this.$refs[item.hrChildren[i].columnName][0].config)
+            }else if(item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload'){
+              this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config)
             } else {
               this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[
                 item.hrChildren[i].columnName]
-              console.log(this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName])
             }
           }
         }
-        console.log(this.queryParams)
-        this.queryParams.image = JSON.stringify(this.queryParams.image)
-        this.queryParams.file = JSON.stringify(this.queryParams.file)
         if (this.queryParams.pageNum !== undefined) {
           this.queryParams.pageNum = undefined
         }
@@ -342,6 +354,7 @@
 
 <style lang="scss">
   .eniting_header {
+    position: relative;
     .el-divider--horizontal {
       margin-top: 0;
     }
@@ -505,4 +518,9 @@
       // padding: 23px;
     }
   }
+  .imge_tab{
+    position: absolute;
+    right: 0;
+    top: 5px;
+  }
 </style>

+ 32 - 10
ruoyi-ui/src/views/system/form/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="tabForm">
-    <div class="tabForm_header">
+    <div class="tabForm_header">
+      <div class="imge_tab"><img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew"></div>
       <div class="table_headerBtun" v-if="queryData.buttonList">
         <el-button type="primary" size="small" plain @click="handleQuery(item)" v-for="(item,index) in queryData.buttonList.split('')" :key="index">{{item | btnConversion}}</el-button>
         <el-button type="primary" size="small" plain @click="handleQuery('sx')">刷新</el-button>
@@ -10,11 +11,11 @@
     <!-- 内容 -->
     <div class="table_nav">
       <el-collapse v-model="activeNames">
-         <el-form :model="queryParams" ref="queryForm" :rules="queryData.rules" :inline="true" label-width="120px">
+         <el-form :model="queryParams" :rules="queryData.rules" ref="queryForm" :inline="true" label-width="120px">
         <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index" class="eitde">
             <el-row :gutter="0">
               <el-col :span="24"  :key="index">
-                  <dynamic-forms :ref="items.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren" :key='indexs' />
+                  <dynamic-forms @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren" :key='indexs' />
               </el-col>
             </el-row>
         </el-collapse-item>
@@ -120,7 +121,8 @@
         deledlid:{
           table:'',
           idList:[]
-        }
+        },
+        imgShoew:true
       };
     },
     filters:{
@@ -159,7 +161,10 @@
       this.init()
       this.edingelsietab()
     },
-    methods: {
+    methods: {
+      modelFn(obj, cont) {
+        this.$set(this.queryParams,obj,cont)
+      },
       handleCurrentChange() {
 
       },
@@ -199,6 +204,18 @@
           console.log(res)
           let data = res.data
           this.queryData = data
+          // 图片的显示隐藏
+          if(this.queryData.showData.length !==0){
+           this.queryData.showData.filter(route => {
+               if(route.hrChildren.length !== 0){
+                  if(route.hrChildren[1].readonly == true){
+                        this.imgShoew = true
+                  }else{
+                    this.imgShoew = false
+                  }
+               }
+           })
+          }
           if(this.xidugje == 'sx'){
             if(res.code == 200){
               this.msgSuccess("操作成功");
@@ -231,6 +248,7 @@
          this.total = res.data.total - 0
          console.log(this.total)
          console.log(this.postList,567)
+
        })
       },
       // tab点击
@@ -263,16 +281,15 @@
         }
          for(let item of this.queryData.showData){
            for(var i = 0 ; i < item.hrChildren.length ; i++){
-             if(item.hrChildren[i].htmlType == 'checkbox' || item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload'){
+             if(item.hrChildren[i].htmlType == 'checkbox'){
                this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config
+             }else if(item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload'){
+               this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName][0].config)
              } else{
                this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]
              }
            }
          }
-         this.queryParams.image = JSON.stringify(this.queryParams.image)
-         this.queryParams.file = JSON.stringify(this.queryParams.file)
-         console.log(this.queryParams)
          if(index == 'D'){
            //删除
            this.handleDelete(this.deledlid)
@@ -427,7 +444,7 @@
       border-radius: 6px;
       padding: 23px;
       margin-bottom: 20px;
-
+      position: relative;
     }
 
     // 内容
@@ -515,5 +532,10 @@
       color: #3C8DBC;
       border-bottom: 3px solid #3C8DBC;
     }
+  }
+  .imge_tab{
+    position: absolute;
+    right: 0;
+    top: 5px;
   }
 </style>

+ 2 - 1
ruoyi-ui/src/views/system/post/index.vue

@@ -275,7 +275,8 @@ export default {
       });
     },
     /** 提交按钮 */
-    submitForm: function() {
+    submitForm: function() {
+      // console.log(this.form,23456)
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != undefined) {

+ 25 - 8
ruoyi-ui/src/views/system/surface/index.vue

@@ -8,7 +8,7 @@
           :key="index">{{item | btnConversion}}</el-button>
       </div>
       <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
-        <dynamic-form :ref="item.columnName" :config="queryParams" @inputs="changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList"
+        <dynamic-forms :ref="item.columnName" :config="queryParams" @inputs="changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList"
           :key='index' />
         <el-form-item>
           <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -20,14 +20,20 @@
     <div class="table_nav">
       <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in tabData"
-          :key="index" />
+        <template v-for="(item, index) in tabData">
+          <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" :key="index">
+            <template slot-scope="scope">
+              <img class="img_icon" v-if="item.htmlType=='imageUpload'&&scope.row[scope.column.property]" @click="imgBtn(JSON.parse(scope.row[scope.column.property])[0].url)" :src="JSON.parse(scope.row[scope.column.property])[0].url" alt="">
+              <span v-else>{{ scope.row[scope.column.property] }}</span>
+            </template>
+          </el-table-column>
+        </template>
       </el-table>
       <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
         @pagination="getList" />
-    </div>
+    </div>
+    <BigPicture ref="BigPicture" :urls="pir_imgs"></BigPicture>
   </div>
-
 </template>
 
 <script>
@@ -46,7 +52,8 @@
   export default {
     name: "index",
     data() {
-      return {
+      return {
+        pir_imgs: '', // 图片链接
         tabData: [],
         multiple: true,
         single: true,
@@ -128,7 +135,11 @@
       this.init();
       this.getList();
     },
-    methods: {
+    methods: {
+      imgBtn(url) {
+        this.pir_imgs = url
+        this.$refs.BigPicture.hidden.status = true
+      },
       routerFn(id, tables) {
         if (this.queryData.viewType == 'crud') {
           this.$router.push({
@@ -287,7 +298,13 @@
 </script>
 
 
-<style lang="scss">
+<style lang="scss">
+  .img_icon{
+    width: 120px;
+    height: 120px;
+    cursor: pointer;
+    object-fit: cover;
+  }
   .table_header {
     .el-divider--horizontal {
       margin-top: 16px;

+ 254 - 178
ruoyi-ui/src/views/system/table/index.vue

@@ -2,23 +2,25 @@
   <div class="table_total">
     <div class="table_header">
       <!-- <p>单表</p>
-      <el-divider></el-divider> -->
+      <el-divider></el-divider> -->
+      <div class="imge_tab"><img src="../../../assets/images/pic_sy_ytj.png" alt="" v-if="imgShoew" ></div>
       <div class="table_headerBtun" v-if="queryData.buttonList">
-        <el-button type="primary" size="mini"  plain v-for="(item,index) in jeigneutwo" :key="index" @click="handleQuery(item)">{{item}}</el-button>
+        <el-button type="primary" size="mini" plain v-for="(item,index) in jeigneutwo" :key="index" @click="handleQuery(item)">{{item}}</el-button>
       </div>
     </div>
     <!-- 内容 -->
     <div class="table_nav headertable_nav">
-      <el-collapse v-model="activeNames" @change="handleChange">
-        <el-form :model="queryParams" ref="queryForm" :inline="true" :rules="queryData.rules" label-width="120px">
-        <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index" >
+      <el-collapse v-model="activeNames" @change="handleChange">
+        <el-form :model="queryParams" :rules="queryData.rules" ref="queryForm" :inline="true" label-width="120px">
+          <el-collapse-item :title="item.columnComment" :name="index" v-for="(item,index) in queryData.showData" :key="index">
 
-            <el-row :gutter="0">
-              <el-col :span="24"  :key="index">
-                  <dynamic-forms :ref="items.columnName" :config="queryParams" @inputs = "changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren" :key='indexs' />
-              </el-col>
+            <el-row>
+              <el-col :span="24" :key="index">
+                <dynamic-forms @modelFn="modelFn" :ref="items.columnName" :config="queryParams" @inputs="changeFn" :formConfig="items" v-for="(items,indexs) in item.hrChildren"
+                  :key='indexs' />
+              </el-col>
             </el-row>
-        </el-collapse-item>
+          </el-collapse-item>
         </el-form>
       </el-collapse>
     </div>
@@ -26,25 +28,25 @@
 </template>
 <script>
   import {
-    getTableQuery,
-    getQueryList,
-    tableSubimt,
-    tableSubimtanit,
-    addbjectSave,
+    getTableQuery,
+    getQueryList,
+    tableSubimt,
+    tableSubimtanit,
+    addbjectSave,
     delMenutab
   } from '@/api/system/table.js'
   export default {
-    name: "index",
+    name: "index",
     inject: ['reload'],
     data() {
       return {
         // 显示搜索条件
         showSearch: true,
         activeNames: [0],
-        title: '单表1',
-        tabledeLise:{
-          table:'',
-          isUi:true
+        title: '单表1',
+        tabledeLise: {
+          table: '',
+          isUi: true
         },
         queryData: {},
         // 查询参数
@@ -82,7 +84,8 @@
         jeigneu:[],
         jeigneutwo:[],
         xidugje:0,
-        tijeq:0
+        tijeq:0,
+        imgShoew:true
       };
     },
     // filters:{
@@ -107,27 +110,27 @@
     //     }
     //   }
     // },
-    mounted() {
-      // this.tableZbie.fixedData.id = 0
-       this.deledlid.idList = []
-       this.formeanti.table = this.$route.query.tables
-       // this.formeanti.id = this.$route.query.id
-       this.forme.table = this.$route.query.tables
-       this.forme.objId = this.$route.query.id
-       this.tableZbie.table = this.$route.query.tables
-       this.tableZbie.fixedData.id = this.$route.query.id
-       this.formy.id = this.$route.query.id
-       this.deledlid.table = this.$route.query.tables
-       this.deledlid.idList.push(this.$route.query.id)
-       console.log(this.$route.query.id)
-       console.log(this.tableZbie.table)
-
-      this.init()
+    mounted() {
+      // this.tableZbie.fixedData.id = 0
+      this.deledlid.idList = []
+      this.formeanti.table = this.$route.query.tables
+      // this.formeanti.id = this.$route.query.id
+      this.forme.table = this.$route.query.tables
+      this.forme.objId = this.$route.query.id
+      this.tableZbie.table = this.$route.query.tables
+      this.tableZbie.fixedData.id = this.$route.query.id
+      this.formy.id = this.$route.query.id
+      this.deledlid.table = this.$route.query.tables
+      this.deledlid.idList.push(this.$route.query.id)
+      this.init()
       // this.tablsie()
     },
     methods: {
+      modelFn(obj, cont) {
+        this.$set(this.queryParams,obj,cont)
+      },
       changeFn(obj) {
-        for(let key in obj){
+        for (let key in obj) {
           this.queryParams[key] = obj[key]
         }
       },
@@ -135,80 +138,85 @@
 
       },
       /** 搜索按钮操作 */
-      handleQuery(index) {
-         for(let item of this.queryData.showData){
-           for(var i = 0 ; i < item.hrChildren.length ; i++){
-             if(item.hrChildren[i].htmlType == 'checkbox' || item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload'){
-               this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config
-             } else{
-               this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[item.hrChildren[i].columnName]
-             }
-           }
-         }
-         this.queryParams.image = JSON.stringify(this.queryParams.image)
-         this.queryParams.file = JSON.stringify(this.queryParams.file)
-         console.log(this.queryParams)
-         if(this.queryParams.pageNum !== undefined){
-           this.queryParams.pageNum = undefined
-         }
-         if(this.queryParams.pageSize !== undefined){
-           this.queryParams.pageSize = undefined
-         }
-
-         if(index == '删除'){
-           //删除
-           console.log(this.formy.id)
-           this.handleDelete(this.deledlid)
-         }else if(index == '提交'){
-           //提交  保存
-            this.formeanti.commitData = []
-            this.formy.status = 1
-            this.formeanti.commitData.push(this.formy)
-           this.antiSubmission()
-         }else if(index == '反提交'){
-           //反提交  保存
-            this.formeanti.commitData = []
-            this.formy.status = 2
-            this.formeanti.commitData.push(this.formy)
-            console.log(this.formeanti)
-           this.antiSubmission()
-         }else if(index == '保存'){
-           // 修改
-           // this.xidugje = '保存'
-           this.forme.fixedData = this.queryParams
-           this.submitForm()
-         }else if(index == '新增'){
-           //新增
-           this.$router.push({
-             path: '/business/table',
-             query: {id:-1,tables:this.forme.table},
-           })
-          // // this.forme.objId = "-1"
-          //  this.queryParams = {}
-          this.xidugje = 0
-          // this.tableZbie.fixedData.id = -1
-          // this.formy.id = '-1'
-          // this.init()
-          this.reload()
-         }else if(index == '返回'){
-           if(this.xidugje ==0){
-              this.$router.go(-2)
-           }else{
-             this.$router.go(-1)
-           }
-         }else if(index == '刷新'){
-           this.xidugje = 1
-           this.reload()
-         }
-
-
+      handleQuery(index) {
+        for (let item of this.queryData.showData) {
+          for (var i = 0; i < item.hrChildren.length; i++) {
+            if (item.hrChildren[i].htmlType == 'checkbox') {
+              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config
+            } else if (item.hrChildren[i].htmlType == 'imageUpload' || item.hrChildren[i].htmlType == 'fileUpload') {
+              if (this.$refs[item.hrChildren[i].columnName][0].config.length) {
+                this.queryParams[item.hrChildren[i].columnName] = JSON.stringify(this.$refs[item.hrChildren[i].columnName]
+                  [0].config)
+              }
+            } else {
+              this.queryParams[item.hrChildren[i].columnName] = this.$refs[item.hrChildren[i].columnName][0].config[
+                item.hrChildren[i].columnName]
+            }
+          }
+        }
+        if (this.queryParams.pageNum !== undefined) {
+          this.queryParams.pageNum = undefined
+        }
+        if (this.queryParams.pageSize !== undefined) {
+          this.queryParams.pageSize = undefined
+        }
+
+        if (index == '删除') {
+          //删除
+          console.log(this.formy.id)
+          this.handleDelete(this.deledlid)
+        } else if (index == '提交') {
+          //提交  保存
+          this.formeanti.commitData = []
+          this.formy.status = 1
+          this.formeanti.commitData.push(this.formy)
+          this.antiSubmission()
+        } else if (index == '反提交') {
+          //反提交  保存
+          this.formeanti.commitData = []
+          this.formy.status = 2
+          this.formeanti.commitData.push(this.formy)
+          this.antiSubmission()
+        } else if (index == '保存') {
+          // 修改
+          // this.xidugje = '保存'
+          this.forme.fixedData = this.queryParams
+          this.submitForm()
+        } else if (index == '新增') {
+          //新增
+          this.$router.push({
+            path: '/business/table',
+            query: {
+              id: -1,
+              tables: this.forme.table
+            },
+          })
+          // // this.forme.objId = "-1"
+          //  this.queryParams = {}
+          this.xidugje = 0
+          // this.tableZbie.fixedData.id = -1
+          // this.formy.id = '-1'
+          // this.init()
+          this.reload()
+        } else if (index == '返回') {
+          if (this.xidugje == 0) {
+            this.$router.go(-2)
+          } else {
+            this.$router.go(-1)
+          }
+        } else if (index == '刷新') {
+          this.xidugje = 1
+          this.reload()
+        }
+
+
         console.log(this.forme)
         // this.getList();
       },
       getList() {
 
       },
-      init() {
+      init() {
         getTableQuery(
           this.tableZbie
         ).then(res => {
@@ -216,6 +224,7 @@
           console.log(res.data)
           this.queryData = {}
           this.queryData = data
+          // imgShoew
           this.jeigneutwo = []
           this.jeigneu = []
           this.jeigneu = data.buttonList.split('')
@@ -263,94 +272,105 @@
           })
           this.jeigneutwo.push('刷新')
           this.jeigneutwo.push('返回')
-          console.log(this.jeigneutwo,567)
-          console.log(this.xidugje)
+          // console.log(this.jeigneutwo,567)
+          // console.log(this.xidugje)
           if(this.xidugje == '刷新'){
             if(res.code == 200){
               this.msgSuccess("操作成功");
             }
           }
-
+         // 图片的显示隐藏
+         if(this.queryData.showData.length !==0){
+          this.queryData.showData.filter(route => {
+              if(route.hrChildren.length !== 0){
+                 if(route.hrChildren[1].readonly == true){
+                       this.imgShoew = true
+                 }else{
+                   this.imgShoew = false
+                 }
+              }
+          })
+         }
+        })
+      },
+      tablsie() {
+        console.log(1234)
+        getQueryList(
+          this.tabledeLise
+        ).then(res => {
+          let data = res.data
+          this.taleLisst = data
+          // console.log(this.queryData.queryList)
         })
-      },
-      tablsie(){
-        console.log(1234)
-        getQueryList(
-          this.tabledeLise
-        ).then(res => {
-          let data = res.data
-          this.taleLisst = data
-          // console.log(this.queryData.queryList)
-        })
       },
       handleChange(val) {
         console.log(val);
-      },
-      // 按钮点击
-      delet(index){
-      console.log(index)
-      if(index == 'D'){
-        this.handleDelete(this.formy.id)
-      }
-      },
-      /** 新增 修改提交按钮 */
-      submitForm: function() {
-        this.$refs["queryForm"].validate(valid => {
-          if (valid) {
-            addbjectSave(this.forme).then(response => {
-              this.msgSuccess("保存成功");
-              this.open = false;
-              console.log(this.xidugje)
-              this.$router.replace('surface')
-            });
-          }
-        });
-      },
-      // 提交反提交
-      antiSubmission(){
-        this.$refs["queryForm"].validate(valid => {
-          if (valid) {
-            if (this.formy.status == 1) {
-              // 提交
-              tableSubimt(this.formeanti).then(response => {
-                this.msgSuccess("提交成功");
-                this.$router.go(-1)
-                // this.open = false;
-                // this.getList();
-              });
-            } else if(this.formy.status == 2){
-              // 反提交
-              tableSubimtanit(this.formeanti).then(response => {
-                this.msgSuccess("反提交成功");
-                this.$router.go(-1)
-                // this.open = false;
-                // this.getList();
-              });
-            }
-          }
-        });
-      },
-      //删除
-      handleDelete(index) {
-        this.$confirm('是否确认删除', "警告", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
-            return delMenutab(index);
-          }).then(() => {
-            // this.getList();
-            this.msgSuccess("删除成功");
-            this.$router.go(-1)
-          })
+      },
+      // 按钮点击
+      delet(index) {
+        console.log(index)
+        if (index == 'D') {
+          this.handleDelete(this.formy.id)
+        }
+      },
+      /** 新增 修改提交按钮 */
+      submitForm: function() {
+        this.$refs["queryForm"].validate(valid => {
+          if (valid) {
+            addbjectSave(this.forme).then(response => {
+              this.msgSuccess("保存成功");
+              this.open = false;
+              console.log(this.xidugje)
+              this.$router.go(-1)
+            });
+          }
+        });
+      },
+      // 提交反提交
+      antiSubmission() {
+        this.$refs["queryForm"].validate(valid => {
+          if (valid) {
+            if (this.formy.status == 1) {
+              // 提交
+              tableSubimt(this.formeanti).then(response => {
+                this.msgSuccess("提交成功");
+                this.$router.go(-1)
+                // this.open = false;
+                // this.getList();
+              });
+            } else if (this.formy.status == 2) {
+              // 反提交
+              tableSubimtanit(this.formeanti).then(response => {
+                this.msgSuccess("反提交成功");
+                this.$router.go(-1)
+                // this.open = false;
+                // this.getList();
+              });
+            }
+          }
+        });
+      },
+      //删除
+      handleDelete(index) {
+        this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delMenutab(index);
+        }).then(() => {
+          // this.getList();
+          this.msgSuccess("删除成功");
+          this.$router.go(-1)
+        })
       }
     },
   };
 </script>
 
-
 <style  lang="scss">
   .table_header{
+    position: relative;
     .el-divider--horizontal{
       margin-top: 16px;
     }
@@ -420,4 +440,60 @@
     margin: 0;
 
   }
+  .imge_tab{
+    position: absolute;
+    right: 0;
+    top: 5px;
+  }
 </style>
+
+
+
+<style scoped lang="scss">
+  .app-main {
+    // background-color: #eef0ff !important;
+  }
+
+  .table_total {
+    background-color: #eef0ff;
+    height: 100%;
+    padding: 20px;
+
+    // 头部
+    .table_header {
+      background-color: #fff;
+      border-radius: 6px;
+      padding: 23px;
+      margin-bottom: 20px;
+
+      p {
+        font-size: 15px;
+        font-weight: bold;
+        color: #3C8DBC;
+        line-height: 36px;
+      }
+
+      p::before {
+        content: "";
+        display: block;
+        width: 18px;
+        height: 8px;
+        background: #3C8DBC;
+        border-radius: 3px;
+
+      }
+    }
+
+    // 内容
+    .headertable_nav {
+      background-color: #fff;
+      border-radius: 6px;
+      padding: 23px;
+    }
+  }
+
+  p {
+    margin: 0;
+
+  }
+</style>

+ 25 - 2
ruoyi-ui/src/views/tool/gen/basicInfoForm.vue

@@ -28,6 +28,13 @@
         <el-form-item  label="菜单权限" prop="menuRole">
           <el-input v-model="info.menuRole" placeholder="请输入菜单权限" />
         </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item  label="页面模板" prop="tplCategory">
+          <el-select style="width: 100%;" v-model="info.tplCategory" placeholder="页面模板" clearable>
+            <el-option v-for="dict in embedEdit" :key="dict.id" :label="dict.name" :value="dict.id" />
+          </el-select>
+        </el-form-item>
       </el-col>
       <el-col :span="12" >
         <el-form-item label="新增程序" prop="triggerCreate">
@@ -97,7 +104,20 @@ export default {
     }
   },
   data() {
-    return {
+    return {
+      embedEdit: [{
+        name: '单表',
+        id: 'crud',
+      },{
+        name: '头页签',
+        id: 'headTab',
+      },{
+        name: '主子表',
+        id: 'itemTab',
+      },{
+        name: '树表',
+        id: 'tree',
+      }],
       rules: {
         tableName: [
           { required: true, message: "表名称不能为空", trigger: "blur" }
@@ -107,7 +127,10 @@ export default {
         ],
         menuRole: [
           { required: true, message: "菜单权限不能为空", trigger: "blur" }
-        ]
+        ],
+        viewType: [
+          { required: true, message: "页面模板不能为空", trigger: "blur" }
+        ],
       }
     };
   }

+ 10 - 10
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -327,14 +327,14 @@
         </el-form-item>
         <el-form-item label="关联表:" prop="relationParentId">
           <el-select style="width: 100%;" v-model="form.relationParentId" placeholder="请选择关联表" @change="relationFn"
-            v-loadmore="loadMore">
-            <el-option v-for="item in tableList.rows" :key="item.tableId" :label="item.tableComment" :value="item.tableId">
+           >
+            <el-option v-for="item in tableList.rows" :key="item.id" :label="item.tableComment" :value="item.id">
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="字段:" prop="relationChildId">
-          <el-select style="width: 100%;" v-model="form.relationChildId" placeholder="请选择字段" v-loadmore="loadMore">
-            <el-option v-for="item in genList" v-if="item.foreignKey" :key="item.columnId" :label="item.columnName" :value="item.columnId">
+          <el-select style="width: 100%;" v-model="form.relationChildId" placeholder="请选择字段">
+            <el-option v-for="item in genList" v-if="item.foreignKey" :key="item.id" :label="item.columnName" :value="item.id">
             </el-option>
           </el-select>
         </el-form-item>
@@ -366,7 +366,7 @@
     <!-- 快速搜索对话框 -->
     <el-dialog :close-on-click-modal="false" :title="titleopenquery" :visible.sync="openquery" width="1200px" append-to-body>
       <el-form ref="formquery" @row-dblclick="dbSelectedZd" :model="formquery" :rules="rules" label-width="100px">
-          <dynamic-forms :ref="item.columnName" :config="formquery.fixedData" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
+          <dynamic-forms :type='0' :ref="item.columnName" :config="formquery.fixedData" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.queryList" :key='index' />
       <el-form-item style="display: inline-block;">
         <el-button type="primary"   @click="handleQuery">搜索</el-button>
         <el-button   @click="openquery = false">取消</el-button>
@@ -517,7 +517,7 @@
         genList: [],
         glbParams: {
           pageNum: 1,
-          pageSize: 10,
+          pageSize: 10000000,
         },
         // 关联表查询参数
         queryParams: {
@@ -589,7 +589,8 @@
         // 获取表详细信息
         getGenTable(tableId).then(res => {
           this.cloumns = res.data.rows;
-          this.info = res.data.info;
+          this.info = res.data.info;
+          console.log(this.info,33456)
           this.tables = res.data.tables;
         });
         //查询数据库sql
@@ -613,11 +614,10 @@
         listAllColumnsByTableId({
           id:tableId
         }).then(response => {
-          console.log(response.data,9999888)
           this.columList = response.data;
         });
         // 关联表数据
-        listTable(this.glbParams).then(response => {
+        listTable(this.glbParams).then(response => {
           this.tableList = response;
         });
         /** 查询菜单下拉列表 */
@@ -640,7 +640,7 @@
       tableBtn(row){
         this.openquery = false
         this.ForeName = row.column_name
-        this.formZd.foreignKey = row.column_id
+        this.formZd.foreignKey = row.id
       },
       fkzdFn() {
         this.queryedit()