瀏覽代碼

页面更新

sr 4 年之前
父節點
當前提交
5b48568a7d
共有 40 個文件被更改,包括 2061 次插入854 次删除
  1. 22 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/JSONArrayUtils.java
  2. 17 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/collection/CollectionUtils.java
  3. 82 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java
  4. 14 0
      boman-common/boman-common-redis/src/main/java/com/boman/common/redis/RedisKey.java
  5. 3 9
      boman-modules/boman-gen/pom.xml
  6. 41 41
      boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenController.java
  7. 82 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableColumnController.java
  8. 77 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableRelationController.java
  9. 54 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTable.java
  10. 101 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTableRelation.java
  11. 9 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableColumnMapper.java
  12. 47 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableRelationMapper.java
  13. 61 47
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java
  14. 77 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableRelationServiceImpl.java
  15. 137 144
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableServiceImpl.java
  16. 10 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableColumnService.java
  17. 49 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableRelationService.java
  18. 9 0
      boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableService.java
  19. 11 1
      boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml
  20. 17 1
      boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableMapper.xml
  21. 99 0
      boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableRelationMapper.xml
  22. 0 0
      boman-modules/boman-job/src/main/resources/mapper/job/GenTableRelationMapper.xml
  23. 1 1
      boman-modules/boman-system/pom.xml
  24. 24 36
      boman-modules/boman-system/src/main/java/com/boman/system/common/BaseTableSaveDTO.java
  25. 6 24
      boman-modules/boman-system/src/main/java/com/boman/system/common/BusinessResult.java
  26. 23 0
      boman-modules/boman-system/src/main/java/com/boman/system/common/FormDataConstant.java
  27. 2 0
      boman-modules/boman-system/src/main/java/com/boman/system/common/MainTableRecord.java
  28. 2 2
      boman-modules/boman-system/src/main/java/com/boman/system/common/RowRecord.java
  29. 8 0
      boman-modules/boman-system/src/main/java/com/boman/system/common/RowResult.java
  30. 4 4
      boman-modules/boman-system/src/main/java/com/boman/system/common/StoredProcedureService.java
  31. 99 13
      boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java
  32. 7 6
      boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceContext.java
  33. 36 1
      boman-modules/boman-system/src/main/java/com/boman/system/common/ValueHolder.java
  34. 77 0
      boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjController.java
  35. 0 32
      boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjSaveController.java
  36. 72 15
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java
  37. 2 0
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysConfigMapper.java
  38. 51 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseDeleteService.java
  39. 16 0
      boman-modules/boman-system/src/main/resources/rebel.xml
  40. 612 477
      ruoyi-ui/src/views/index.vue

+ 22 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/JSONArrayUtils.java

@@ -0,0 +1,22 @@
+package com.boman.common.core.utils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.boman.common.core.utils.obj.ObjectUtils;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 11:07
+ **/
+public class JSONArrayUtils {
+    
+    public static long[] jsonArrayToLongArray(JSONArray jsonArray){
+        ObjectUtils.requireNonNull(jsonArray);
+        long[] result = new long[jsonArray.size()];
+        for (int i = 0; i < jsonArray.size(); i++) {
+            result[i] = jsonArray.getLong(i);
+        }
+
+        return result;
+    }
+
+}

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

@@ -0,0 +1,17 @@
+package com.boman.common.core.utils.collection;
+
+import com.boman.common.core.utils.obj.ObjectUtils;
+
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 14:16
+ **/
+public class CollectionUtils {
+
+    public static Long[] listToArray(List<Long> longList){
+        ObjectUtils.requireNonNull(longList);
+        return longList.toArray(new Long[0]);
+    }
+}

+ 82 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java

@@ -0,0 +1,82 @@
+package com.boman.common.core.utils.obj;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.util.Collection;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 10:39
+ **/
+public class ObjectUtils {
+
+    private static final String NULL = "null";
+    private static final String UNDEFINED = "undefined";
+
+    public static  <T> Collection<T> requiredNonNull(Collection<T> input){
+        if (null == input || input.size() == 0) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+    public static long[] requiredNonNull(long[] input){
+        if (ArrayUtils.isEmpty(input)) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+
+        return input;
+    }
+
+
+    public static Long[] requiredNonNull(Long[] input){
+        if (ArrayUtils.isEmpty(input)) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+
+        return input;
+    }
+
+    public static <T> T requireNonNull(T input) {
+        if (input == null) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+
+    public static String requireNonNull(String input) {
+        if (input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input)) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+    public static int requireNonNull(int input) {
+        if (input <= 0) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+
+    public static JSONObject requireNonNull(JSONObject input) {
+        if (input == null || input.isEmpty()) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+
+    public static JSONArray requireNonNull(JSONArray input) {
+        if (input == null || input.isEmpty()) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+
+
+}

+ 14 - 0
boman-common/boman-common-redis/src/main/java/com/boman/common/redis/RedisKey.java

@@ -0,0 +1,14 @@
+package com.boman.common.redis;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 13:25
+ **/
+public class RedisKey {
+
+    /**
+     * 建表的信息存在redis中的key
+     * eg: table:tableName
+     */
+    public static final String TABLE_INFO = "table:";
+}

+ 3 - 9
boman-modules/boman-gen/pom.xml

@@ -75,20 +75,14 @@
     </dependencies>
 
     <build>
-        <finalName>${project.artifactId}</finalName>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
+                <configuration>
+                    <classifier>execute</classifier>
+                </configuration>
             </plugin>
         </plugins>
     </build>
-   
 </project>

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

@@ -5,6 +5,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
+
+import com.boman.common.core.constant.UserConstants;
+import com.boman.common.core.utils.SecurityUtils;
 import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -30,13 +33,12 @@ import com.boman.gen.service.IGenTableService;
 
 /**
  * 代码生成 操作处理
- * 
+ *
  * @author ruoyi
  */
 @RequestMapping("/gen")
 @RestController
-public class GenController extends BaseController
-{
+public class GenController extends BaseController {
     @Autowired
     private IGenTableService genTableService;
 
@@ -48,8 +50,7 @@ public class GenController extends BaseController
      */
     @PreAuthorize(hasPermi = "tool:gen:list")
     @GetMapping("/list")
-    public TableDataInfo genList(GenTable genTable)
-    {
+    public TableDataInfo genList(GenTable genTable) {
         startPage();
         List<GenTable> list = genTableService.selectGenTableList(genTable);
         return getDataTable(list);
@@ -60,15 +61,14 @@ public class GenController extends BaseController
      */
     @PreAuthorize(hasPermi = "tool:gen:query")
     @GetMapping(value = "/{talbleId}")
-    public AjaxResult getInfo(@PathVariable Long talbleId)
-    {
+    public AjaxResult getInfo(@PathVariable Long talbleId) {
         GenTable table = genTableService.selectGenTableById(talbleId);
         List<GenTable> tables = genTableService.selectGenTableAll();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
         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);
     }
 
@@ -77,8 +77,7 @@ public class GenController extends BaseController
      */
     @PreAuthorize(hasPermi = "tool:gen:list")
     @GetMapping("/db/list")
-    public TableDataInfo dataList(GenTable genTable)
-    {
+    public TableDataInfo dataList(GenTable genTable) {
         startPage();
         List<GenTable> list = genTableService.selectDbTableList(genTable);
         return getDataTable(list);
@@ -88,8 +87,7 @@ public class GenController extends BaseController
      * 查询数据表字段列表
      */
     @GetMapping(value = "/column/{talbleId}")
-    public TableDataInfo columnList(Long tableId)
-    {
+    public TableDataInfo columnList(Long tableId) {
         TableDataInfo dataInfo = new TableDataInfo();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
         dataInfo.setRows(list);
@@ -101,10 +99,9 @@ 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)
-    {
+    public AjaxResult importTableSave(String tables) {
         String[] tableNames = Convert.toStrArray(tables);
         // 查询表信息
         List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
@@ -116,10 +113,9 @@ 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)
-    {
+    public AjaxResult editSave(@Validated @RequestBody GenTable genTable) {
         genTableService.validateEdit(genTable);
         genTableService.updateGenTable(genTable);
         return AjaxResult.success();
@@ -129,10 +125,9 @@ 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)
-    {
+    public AjaxResult remove(@PathVariable Long[] tableIds) {
         genTableService.deleteGenTableByIds(tableIds);
         return AjaxResult.success();
     }
@@ -142,8 +137,7 @@ public class GenController extends BaseController
      */
     @PreAuthorize(hasPermi = "tool:gen:preview")
     @GetMapping("/preview/{tableId}")
-    public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
-    {
+    public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException {
         Map<String, String> dataMap = genTableService.previewCode(tableId);
         return AjaxResult.success(dataMap);
     }
@@ -152,10 +146,9 @@ 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
-    {
+    public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
         byte[] data = genTableService.downloadCode(tableName);
         genCode(response, data);
     }
@@ -164,10 +157,9 @@ 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)
-    {
+    public AjaxResult genCode(@PathVariable("tableName") String tableName) {
         genTableService.generatorCode(tableName);
         return AjaxResult.success();
     }
@@ -176,10 +168,9 @@ 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)
-    {
+    public AjaxResult synchDb(@PathVariable("tableName") String tableName) {
         genTableService.synchDb(tableName);
         return AjaxResult.success();
     }
@@ -188,10 +179,9 @@ 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
-    {
+    public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
         String[] tableNames = Convert.toStrArray(tables);
         byte[] data = genTableService.downloadCode(tableNames);
         genCode(response, data);
@@ -200,12 +190,22 @@ public class GenController extends BaseController
     /**
      * 生成zip文件
      */
-    private void genCode(HttpServletResponse response, byte[] data) throws IOException
-    {
+    private void genCode(HttpServletResponse response, byte[] data) throws IOException {
         response.reset();
-        response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.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());
     }
+
+
+    /**
+    * @Description 数据表 新增功能
+    * @Author: tjf
+    * @Date: 2021/3/24
+    */
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody GenTable genTable) {
+        return genTableService.insertGenTable(genTable);
+    }
 }

+ 82 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableColumnController.java

@@ -0,0 +1,82 @@
+package com.boman.gen.controller;
+
+
+import com.boman.common.core.constant.UserConstants;
+import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.common.core.web.domain.AjaxResult;
+import com.boman.common.log.annotation.Log;
+import com.boman.common.log.enums.BusinessType;
+import com.boman.common.security.annotation.PreAuthorize;
+import com.boman.gen.domain.GenTableColumn;
+import com.boman.gen.service.IGenTableColumnService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author tjf
+ * @Description gen_table_column
+ * @Date 2021/3/24
+ */
+@RequestMapping("/genTableColumn")
+@RestController
+public class GenTableColumnController extends BaseController {
+
+    @Autowired
+    private IGenTableColumnService genTableColumnService;
+
+
+
+    /**
+    * @Description 新增业务表字段
+    * @author tjf
+    * @Date 2021/3/24
+    */
+    @PostMapping
+    @Log(title = "新增业务表字段", businessType = BusinessType.INSERT)
+    public AjaxResult add(@Validated @RequestBody GenTableColumn genTableColumn) {
+        if (UserConstants.NOT_UNIQUE.equals(genTableColumnService.checkColumnNameUnique(genTableColumn)))
+        {
+            return AjaxResult.error("修改参数'" + genTableColumn.getColumnName() + "'失败,参数键名已存在");
+        }
+        genTableColumn.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(genTableColumnService.insertGenTableColumn(genTableColumn));
+    }
+
+
+
+    /**
+    * @Description 修改业务表字段 列名称不可以修改
+    * @author tjf
+    * @Date 2021/3/24
+    */
+    @Log(title = "修改业务表字段", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody GenTableColumn genTableColumn)
+    {
+        genTableColumn.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax( genTableColumnService.updateGenTableColumn(genTableColumn));
+    }
+
+    /**
+     * 删除表字段
+     */
+    @Log(title = "删除表字段", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{columnIds}")
+    public AjaxResult remove(@PathVariable String columnIds)
+    {
+        return toAjax(genTableColumnService.deleteGenTableColumnByIds(columnIds));
+    }
+
+    /**
+     * 根据表编号获取字段详细信息
+     */
+    @GetMapping(value = "/{tableId}")
+    public AjaxResult getInfo(@PathVariable Long tableId)
+    {
+        return AjaxResult.success(genTableColumnService.selectGenTableColumnListByTableId(tableId));
+    }
+
+}

+ 77 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/GenTableRelationController.java

@@ -0,0 +1,77 @@
+package com.boman.gen.controller;
+
+
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.common.core.web.domain.AjaxResult;
+import com.boman.common.core.web.page.TableDataInfo;
+import com.boman.gen.domain.GenTableRelation;
+import com.boman.gen.service.IGenTableRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**关联关系表
+ * @author tjf
+ * @Date: 2021/03/25/16:02
+ */
+@RequestMapping("/genTableRelation")
+@RestController
+public class GenTableRelationController extends BaseController {
+    @Autowired
+    private IGenTableRelationService genTableRelationService;
+
+
+    /**
+     * 查询关联关系表列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo genTableRelationList(GenTableRelation genTableRelation) {
+        startPage();
+        List<GenTableRelation> list = genTableRelationService.selectGenTableRelationList(genTableRelation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 根据关联关系表编号获取详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id)
+    {
+        return AjaxResult.success(genTableRelationService.selectGenTableRelationById(id));
+    }
+
+    /**
+     * 新增关联关系表
+     */
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody GenTableRelation genTableRelation)
+    {
+
+        genTableRelation.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(genTableRelationService.insertGenTableRelation(genTableRelation));
+    }
+
+    /**
+     * 修改关联关系表
+     */
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody GenTableRelation genTableRelation)
+    {
+
+        genTableRelation.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(genTableRelationService.updateGenTableRelation(genTableRelation));
+    }
+
+    /**
+     * 删除关联关系表
+     */
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(genTableRelationService.deleteGenTableRelation(ids));
+    }
+
+}

+ 54 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTable.java

@@ -80,6 +80,28 @@ public class GenTable extends BaseEntity
     /** 其它生成选项 */
     private String options;
 
+    /**
+     * 是否菜单
+     */
+    private String isMenu;
+
+    /**
+     * 菜单权限(AMDQSUE)
+     */
+    @NotBlank(message = "菜单权限不能为空")
+    private String menuRole;
+
+    /**
+     * 输入字段
+     */
+    private Long akColumn;
+
+    /**
+     * 输出字段
+     */
+    private Long dkColumn;
+
+
     /** 树编码字段 */
     private String treeCode;
 
@@ -95,6 +117,38 @@ public class GenTable extends BaseEntity
     /** 上级菜单名称字段 */
     private String parentMenuName;
 
+    public Long getAkColumn() {
+        return akColumn;
+    }
+
+    public void setAkColumn(Long akColumn) {
+        this.akColumn = akColumn;
+    }
+
+    public Long getDkColumn() {
+        return dkColumn;
+    }
+
+    public void setDkColumn(Long dkColumn) {
+        this.dkColumn = dkColumn;
+    }
+
+    public String getIsMenu() {
+        return isMenu;
+    }
+
+    public void setIsMenu(String isMenu) {
+        this.isMenu = isMenu;
+    }
+
+    public String getMenuRole() {
+        return menuRole;
+    }
+
+    public void setMenuRole(String menuRole) {
+        this.menuRole = menuRole;
+    }
+
     public Long getTableId()
     {
         return tableId;

+ 101 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTableRelation.java

@@ -0,0 +1,101 @@
+package com.boman.gen.domain;
+
+import com.boman.common.core.web.domain.BaseEntity;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:04
+ */
+public class GenTableRelation extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 描述(tap页显示的名称)
+     */
+    private String description;
+
+    /**
+     * 关联表(gen_table的id)
+     */
+    private Long relationParentId;
+
+    /**
+     * 字段(关联主表PK gen_table_column的id)
+     */
+    private Long relationChildId;
+
+    /**
+     *关联方式(1:1 1:N 取值字典表)
+     */
+    private Long relationType;
+
+    /**
+     * 是否删除(1是)
+     */
+    private String isDel;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Long getRelationParentId() {
+        return relationParentId;
+    }
+
+    public void setRelationParentId(Long relationParentId) {
+        this.relationParentId = relationParentId;
+    }
+
+    public Long getRelationChildId() {
+        return relationChildId;
+    }
+
+    public void setRelationChildId(Long relationChildId) {
+        this.relationChildId = relationChildId;
+    }
+
+    public Long getRelationType() {
+        return relationType;
+    }
+
+    public void setRelationType(Long relationType) {
+        this.relationType = relationType;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    @Override
+    public String toString() {
+        return "GenTableRelation{" +
+                "id=" + id +
+                ", description='" + description + '\'' +
+                ", relationParentId=" + relationParentId +
+                ", relationChildId=" + relationChildId +
+                ", relationType=" + relationType +
+                ", isDel='" + isDel + '\'' +
+                '}';
+    }
+}

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

@@ -66,4 +66,13 @@ public interface GenTableColumnMapper
      * @return 结果
      */
     public int deleteGenTableColumnByIds(Long[] ids);
+
+
+
+    /**校验column_name是否重复
+    * @Description
+    * @author tjf
+    * @Date 2021/3/25
+    */
+    public GenTableColumn checkColumnNameUnique(String columnName);
 }

+ 47 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/GenTableRelationMapper.java

@@ -0,0 +1,47 @@
+package com.boman.gen.mapper;
+
+import com.boman.gen.domain.GenTableRelation;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:13
+ */
+public interface GenTableRelationMapper {
+    /**
+     * 查询列表
+     * @param genTableRelation
+     * @return
+     */
+    List<GenTableRelation> selectGenTableRelationList (GenTableRelation genTableRelation);
+
+    /**
+     * 根据id查询详情
+     * @param id
+     * @return
+     */
+    GenTableRelation selectGenTableRelationById (Long id);
+
+
+    /**
+     * 插入
+     * @param genTableRelation
+     * @return
+     */
+    int insertGenTableRelation (GenTableRelation genTableRelation);
+
+    /**
+     * 修改
+     * @param genTableRelation
+     * @return
+     */
+    int updateGenTableRelation (GenTableRelation genTableRelation);
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    int deleteGenTableRelation (Long[] ids);
+}

+ 61 - 47
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableColumnServiceImpl.java

@@ -2,6 +2,9 @@ package com.boman.gen.service;
 
 import java.util.Collections;
 import java.util.List;
+
+import com.boman.common.core.constant.UserConstants;
+import com.boman.common.core.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.boman.common.core.text.Convert;
@@ -10,75 +13,86 @@ import com.boman.gen.mapper.GenTableColumnMapper;
 
 /**
  * 业务字段 服务层实现
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class GenTableColumnServiceImpl implements IGenTableColumnService 
-{
-	@Autowired
-	private GenTableColumnMapper genTableColumnMapper;
+public class GenTableColumnServiceImpl implements IGenTableColumnService {
+    @Autowired
+    private GenTableColumnMapper genTableColumnMapper;
 
-	/**
+    /**
      * 查询业务字段列表
-     * 
+     *
      * @param tableId 业务字段编号
      * @return 业务字段集合
      */
-	@Override
-	public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId)
-	{
-	    return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
-	}
+    @Override
+    public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) {
+        return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
+    }
 
-	/**
-	 * 查询业务字段列表
-	 *
-	 * @param tableIdList 业务字段编号List
-	 * @return 业务字段集合
-	 */
-	@Override
-	public List<GenTableColumn> listByTableIdList(List<Long> tableIdList) {
-		if (null == tableIdList || tableIdList.isEmpty()) {
-			return Collections.emptyList();
-		}
+    /**
+     * 查询业务字段列表
+     *
+     * @param tableIdList 业务字段编号List
+     * @return 业务字段集合
+     */
+    @Override
+    public List<GenTableColumn> listByTableIdList(List<Long> tableIdList) {
+        if (null == tableIdList || tableIdList.isEmpty()) {
+            return Collections.emptyList();
+        }
 
-		return genTableColumnMapper.listByTableIdList(tableIdList);
-	}
+        return genTableColumnMapper.listByTableIdList(tableIdList);
+    }
 
-	/**
+    /**
      * 新增业务字段
-     * 
+     *
      * @param genTableColumn 业务字段信息
      * @return 结果
      */
-	@Override
-	public int insertGenTableColumn(GenTableColumn genTableColumn)
-	{
-	    return genTableColumnMapper.insertGenTableColumn(genTableColumn);
-	}
-	
-	/**
+    @Override
+    public int insertGenTableColumn(GenTableColumn genTableColumn) {
+        return genTableColumnMapper.insertGenTableColumn(genTableColumn);
+    }
+
+    /**
      * 修改业务字段
-     * 
+     *
      * @param genTableColumn 业务字段信息
      * @return 结果
      */
-	@Override
-	public int updateGenTableColumn(GenTableColumn genTableColumn)
-	{
-	    return genTableColumnMapper.updateGenTableColumn(genTableColumn);
-	}
+    @Override
+    public int updateGenTableColumn(GenTableColumn genTableColumn) {
+        return genTableColumnMapper.updateGenTableColumn(genTableColumn);
+    }
 
-	/**
+    /**
      * 删除业务字段对象
-     * 
+     *
      * @param ids 需要删除的数据ID
      * @return 结果
      */
-	@Override
-	public int deleteGenTableColumnByIds(String ids)
-	{
-		return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
-	}
+    @Override
+    public int deleteGenTableColumnByIds(String ids) {
+        return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
+    }
+
+    /**
+     * 校验column_name是否重复
+     *
+     * @param genTableColumn
+     * @return
+     */
+    @Override
+    public String checkColumnNameUnique(GenTableColumn genTableColumn) {
+        Long columnId = StringUtils.isNull(genTableColumn.getColumnId()) ? -1L : genTableColumn.getColumnId();
+        GenTableColumn column = genTableColumnMapper.checkColumnNameUnique(genTableColumn.getColumnName());
+        if (StringUtils.isNotNull(column) && column.getColumnId().longValue() != columnId.longValue()) {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
 }

+ 77 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableRelationServiceImpl.java

@@ -0,0 +1,77 @@
+package com.boman.gen.service;
+
+import com.boman.gen.domain.GenTableRelation;
+import com.boman.gen.mapper.GenTableRelationMapper;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:14
+ */
+@Service
+public class GenTableRelationServiceImpl implements IGenTableRelationService {
+
+    @Autowired
+    private GenTableRelationMapper genTableRelationMapper;
+
+    /**
+     * 查询列表
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public List<GenTableRelation> selectGenTableRelationList(GenTableRelation genTableRelation) {
+        List<GenTableRelation> genTableRelations = genTableRelationMapper.selectGenTableRelationList(genTableRelation);
+        return genTableRelations;
+    }
+
+    /**
+     * 根据id查询详情
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public GenTableRelation selectGenTableRelationById(Long id) {
+        GenTableRelation genTableRelation = genTableRelationMapper.selectGenTableRelationById(id);
+        return genTableRelation;
+    }
+
+    /**
+     * 新增
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public int insertGenTableRelation(GenTableRelation genTableRelation) {
+        return genTableRelationMapper.insertGenTableRelation(genTableRelation);
+    }
+
+    /**
+     * 修改
+     *
+     * @param genTableRelation
+     * @return
+     */
+    @Override
+    public int updateGenTableRelation(GenTableRelation genTableRelation) {
+        return genTableRelationMapper.updateGenTableRelation(genTableRelation);
+    }
+
+    /**
+     * 删除
+     *
+     * @param ids
+     * @return
+     */
+    @Override
+    public int deleteGenTableRelation(Long[] ids) {
+        return genTableRelationMapper.deleteGenTableRelation(ids);
+    }
+}

+ 137 - 144
boman-modules/boman-gen/src/main/java/com/boman/gen/service/GenTableServiceImpl.java

@@ -10,6 +10,9 @@ import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
+
+import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.web.domain.AjaxResult;
 import org.apache.commons.io.IOUtils;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
@@ -38,12 +41,11 @@ import com.boman.gen.util.VelocityUtils;
 
 /**
  * 业务 服务层实现
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class GenTableServiceImpl implements IGenTableService
-{
+public class GenTableServiceImpl implements IGenTableService {
     private static final Logger log = LoggerFactory.getLogger(GenTableServiceImpl.class);
 
     @Autowired
@@ -54,13 +56,12 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 查询业务信息
-     * 
+     *
      * @param id 业务ID
      * @return 业务信息
      */
     @Override
-    public GenTable selectGenTableById(Long id)
-    {
+    public GenTable selectGenTableById(Long id) {
         GenTable genTable = genTableMapper.selectGenTableById(id);
         setTableFromOptions(genTable);
         return genTable;
@@ -68,68 +69,62 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 查询业务列表
-     * 
+     *
      * @param genTable 业务信息
      * @return 业务集合
      */
     @Override
-    public List<GenTable> selectGenTableList(GenTable genTable)
-    {
-        return genTableMapper.selectGenTableList(genTable);
+    public List<GenTable> selectGenTableList(GenTable genTable) {
+        List<GenTable> genTables = genTableMapper.selectGenTableList(genTable);
+        return genTables;
     }
 
     /**
      * 查询据库列表
-     * 
+     *
      * @param genTable 业务信息
      * @return 数据库表集合
      */
     @Override
-    public List<GenTable> selectDbTableList(GenTable genTable)
-    {
+    public List<GenTable> selectDbTableList(GenTable genTable) {
         return genTableMapper.selectDbTableList(genTable);
     }
 
     /**
      * 查询据库列表
-     * 
+     *
      * @param tableNames 表名称组
      * @return 数据库表集合
      */
     @Override
-    public List<GenTable> selectDbTableListByNames(String[] tableNames)
-    {
+    public List<GenTable> selectDbTableListByNames(String[] tableNames) {
         return genTableMapper.selectDbTableListByNames(tableNames);
     }
 
     /**
      * 查询所有表信息
-     * 
+     *
      * @return 表信息集合
      */
     @Override
-    public List<GenTable> selectGenTableAll()
-    {
+    public List<GenTable> selectGenTableAll() {
         return genTableMapper.selectGenTableAll();
     }
 
     /**
      * 修改业务
-     * 
+     *
      * @param genTable 业务信息
      * @return 结果
      */
     @Override
     @Transactional
-    public void updateGenTable(GenTable genTable)
-    {
+    public void updateGenTable(GenTable genTable) {
         String options = JSON.toJSONString(genTable.getParams());
         genTable.setOptions(options);
         int row = genTableMapper.updateGenTable(genTable);
-        if (row > 0)
-        {
-            for (GenTableColumn cenTableColumn : genTable.getColumns())
-            {
+        if (row > 0) {
+            for (GenTableColumn cenTableColumn : genTable.getColumns()) {
                 genTableColumnMapper.updateGenTableColumn(cenTableColumn);
             }
         }
@@ -137,62 +132,53 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 删除业务对象
-     * 
+     *
      * @param tableIds 需要删除的数据ID
      * @return 结果
      */
     @Override
     @Transactional
-    public void deleteGenTableByIds(Long[] tableIds)
-    {
+    public void deleteGenTableByIds(Long[] tableIds) {
         genTableMapper.deleteGenTableByIds(tableIds);
         genTableColumnMapper.deleteGenTableColumnByIds(tableIds);
     }
 
     /**
      * 导入表结构
-     * 
+     *
      * @param tableList 导入表列表
      */
     @Override
     @Transactional
-    public void importGenTable(List<GenTable> tableList)
-    {
+    public void importGenTable(List<GenTable> tableList) {
         String operName = SecurityUtils.getUsername();
-        try
-        {
-            for (GenTable table : tableList)
-            {
+        try {
+            for (GenTable table : tableList) {
                 String tableName = table.getTableName();
                 GenUtils.initTable(table, operName);
                 int row = genTableMapper.insertGenTable(table);
-                if (row > 0)
-                {
+                if (row > 0) {
                     // 保存列信息
                     List<GenTableColumn> genTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
-                    for (GenTableColumn column : genTableColumns)
-                    {
+                    for (GenTableColumn column : genTableColumns) {
                         GenUtils.initColumnField(column, table);
                         genTableColumnMapper.insertGenTableColumn(column);
                     }
                 }
             }
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new CustomException("导入失败:" + e.getMessage());
         }
     }
 
     /**
      * 预览代码
-     * 
+     *
      * @param tableId 表编号
      * @return 预览数据列表
      */
     @Override
-    public Map<String, String> previewCode(Long tableId)
-    {
+    public Map<String, String> previewCode(Long tableId) {
         Map<String, String> dataMap = new LinkedHashMap<>();
         // 查询表信息
         GenTable table = genTableMapper.selectGenTableById(tableId);
@@ -206,8 +192,7 @@ public class GenTableServiceImpl implements IGenTableService
 
         // 获取模板列表
         List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
-        for (String template : templates)
-        {
+        for (String template : templates) {
             // 渲染模板
             StringWriter sw = new StringWriter();
             Template tpl = Velocity.getTemplate(template, Constants.UTF8);
@@ -219,13 +204,12 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 生成代码(下载方式)
-     * 
+     *
      * @param tableName 表名称
      * @return 数据
      */
     @Override
-    public byte[] downloadCode(String tableName)
-    {
+    public byte[] downloadCode(String tableName) {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         ZipOutputStream zip = new ZipOutputStream(outputStream);
         generatorCode(tableName, zip);
@@ -235,12 +219,11 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 生成代码(自定义路径)
-     * 
+     *
      * @param tableName 表名称
      */
     @Override
-    public void generatorCode(String tableName)
-    {
+    public void generatorCode(String tableName) {
         // 查询表信息
         GenTable table = genTableMapper.selectGenTableByName(tableName);
         // 设置主子表信息
@@ -254,21 +237,16 @@ public class GenTableServiceImpl implements IGenTableService
 
         // 获取模板列表
         List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
-        for (String template : templates)
-        {
-            if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
-            {
+        for (String template : templates) {
+            if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm")) {
                 // 渲染模板
                 StringWriter sw = new StringWriter();
                 Template tpl = Velocity.getTemplate(template, Constants.UTF8);
                 tpl.merge(context, sw);
-                try
-                {
+                try {
                     String path = getGenPath(table, template);
                     FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8);
-                }
-                catch (IOException e)
-                {
+                } catch (IOException e) {
                     throw new CustomException("渲染模板失败,表名:" + table.getTableName());
                 }
             }
@@ -277,52 +255,49 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 同步数据库
-     * 
+     *
      * @param tableName 表名称
      */
     @Override
-    @Transactional
-    public void synchDb(String tableName)
-    {
+    @Transactional(rollbackFor = Exception.class)
+    public void synchDb(String tableName) {
         GenTable table = genTableMapper.selectGenTableByName(tableName);
+        //获取表字段集合
         List<GenTableColumn> tableColumns = table.getColumns();
+        //获取列名称集合
         List<String> tableColumnNames = tableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
-
+        //根据表名称查询原列信息
         List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
-        if (StringUtils.isEmpty(dbTableColumns))
-        {
+        if (StringUtils.isEmpty(dbTableColumns)) {
             throw new CustomException("同步数据失败,原表结构不存在");
         }
+        //获取原表列名称集合
         List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
 
         dbTableColumns.forEach(column -> {
-            if (!tableColumnNames.contains(column.getColumnName()))
-            {
+            if (!tableColumnNames.contains(column.getColumnName())) {
                 GenUtils.initColumnField(column, table);
                 genTableColumnMapper.insertGenTableColumn(column);
             }
         });
 
         List<GenTableColumn> delColumns = tableColumns.stream().filter(column -> !dbTableColumnNames.contains(column.getColumnName())).collect(Collectors.toList());
-        if (StringUtils.isNotEmpty(delColumns))
-        {
+        if (StringUtils.isNotEmpty(delColumns)) {
             genTableColumnMapper.deleteGenTableColumns(delColumns);
         }
     }
 
     /**
      * 批量生成代码(下载方式)
-     * 
+     *
      * @param tableNames 表数组
      * @return 数据
      */
     @Override
-    public byte[] downloadCode(String[] tableNames)
-    {
+    public byte[] downloadCode(String[] tableNames) {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         ZipOutputStream zip = new ZipOutputStream(outputStream);
-        for (String tableName : tableNames)
-        {
+        for (String tableName : tableNames) {
             generatorCode(tableName, zip);
         }
         IOUtils.closeQuietly(zip);
@@ -332,8 +307,7 @@ public class GenTableServiceImpl implements IGenTableService
     /**
      * 查询表信息并生成代码
      */
-    private void generatorCode(String tableName, ZipOutputStream zip)
-    {
+    private void generatorCode(String tableName, ZipOutputStream zip) {
         // 查询表信息
         GenTable table = genTableMapper.selectGenTableByName(tableName);
         // 设置主子表信息
@@ -347,23 +321,19 @@ public class GenTableServiceImpl implements IGenTableService
 
         // 获取模板列表
         List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
-        for (String template : templates)
-        {
+        for (String template : templates) {
             // 渲染模板
             StringWriter sw = new StringWriter();
             Template tpl = Velocity.getTemplate(template, Constants.UTF8);
             tpl.merge(context, sw);
-            try
-            {
+            try {
                 // 添加到zip
                 zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table)));
                 IOUtils.write(sw.toString(), zip, Constants.UTF8);
                 IOUtils.closeQuietly(sw);
-				zip.flush();
+                zip.flush();
                 zip.closeEntry();
-            }
-            catch (IOException e)
-            {
+            } catch (IOException e) {
                 log.error("渲染模板失败,表名:" + table.getTableName(), e);
             }
         }
@@ -371,107 +341,132 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 修改保存参数校验
-     * 
+     *
      * @param genTable 业务信息
      */
     @Override
-    public void validateEdit(GenTable genTable)
-    {
-        if (GenConstants.TPL_TREE.equals(genTable.getTplCategory()))
-        {
+    public void validateEdit(GenTable genTable) {
+        if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {
             String options = JSON.toJSONString(genTable.getParams());
             JSONObject paramsObj = JSONObject.parseObject(options);
-            if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE)))
-            {
+            if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE))) {
                 throw new CustomException("树编码字段不能为空");
-            }
-            else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE)))
-            {
+            } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE))) {
                 throw new CustomException("树父编码字段不能为空");
-            }
-            else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME)))
-            {
+            } else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME))) {
                 throw new CustomException("树名称字段不能为空");
-            }
-            else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
-            {
-                if (StringUtils.isEmpty(genTable.getSubTableName()))
-                {
+            } else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {
+                if (StringUtils.isEmpty(genTable.getSubTableName())) {
                     throw new CustomException("关联子表的表名不能为空");
-                }
-                else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
-                {
+                } else if (StringUtils.isEmpty(genTable.getSubTableFkName())) {
                     throw new CustomException("子表关联的外键名不能为空");
                 }
             }
         }
     }
 
+    /**
+     * 代码生成业务表新增
+     *
+     * @param genTable
+     * @return
+     */
+    @Override
+    public AjaxResult insertGenTable(GenTable genTable) {
+        //判断是否是菜单
+        //新增表成功的时候,新增字段公共字段
+
+        int i = genTableMapper.insertGenTable(genTable);
+        if (i > 0) {
+            insertCommonColumn(genTable.getTableId());
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
+    }
+    /**
+     * 新建表时新增对应公共字段
+     *
+     * @param tableId
+     */
+    public void insertCommonColumn(Long tableId) {
+
+        String[]  columnName = new String[]{"create_by","create_time","update_by","update_time","is_del"};
+        String[]  columnComment = new String[]{"创建者","创建时间","更新者","更新时间","是否删除"};
+        String[]  columnType = new String[]{"varchar(64)","datetime","varchar(64)","datetime","char(1)"};
+        String[]  htmlType = new String[]{"input","datetime","input","datetime","input"};
+
+        for (int i = 0; i < columnName.length; i++) {
+            GenTableColumn genTableColumn = new GenTableColumn();
+            genTableColumn.setTableId(tableId);
+            genTableColumn.setColumnName(columnName[i]);
+            genTableColumn.setColumnComment(columnComment[i]);
+            genTableColumn.setColumnType(columnType[i]);
+            genTableColumn.setIsPk("0");
+            genTableColumn.setIsIncrement("0");
+            genTableColumn.setIsInsert("1");
+            genTableColumn.setQueryType("EQ");
+            genTableColumn.setHtmlType(htmlType[i]);
+            genTableColumn.setSort(i+1);
+            genTableColumn.setCreateBy("admin");
+            genTableColumn.setCreateTime(DateUtils.getNowDate());
+            genTableColumnMapper.insertGenTableColumn(genTableColumn);
+        }
+    }
+
     /**
      * 设置主键列信息
-     * 
+     *
      * @param table 业务表信息
      */
-    public void setPkColumn(GenTable table)
-    {
-        for (GenTableColumn column : table.getColumns())
-        {
-            if (column.isPk())
-            {
+    public void setPkColumn(GenTable table) {
+        for (GenTableColumn column : table.getColumns()) {
+            if (column.isPk()) {
                 table.setPkColumn(column);
                 break;
             }
         }
-        if (StringUtils.isNull(table.getPkColumn()))
-        {
+        if (StringUtils.isNull(table.getPkColumn())) {
             table.setPkColumn(table.getColumns().get(0));
         }
-        if (GenConstants.TPL_SUB.equals(table.getTplCategory()))
-        {
-            for (GenTableColumn column : table.getSubTable().getColumns())
-            {
-                if (column.isPk())
-                {
+        if (GenConstants.TPL_SUB.equals(table.getTplCategory())) {
+            for (GenTableColumn column : table.getSubTable().getColumns()) {
+                if (column.isPk()) {
                     table.getSubTable().setPkColumn(column);
                     break;
                 }
             }
-            if (StringUtils.isNull(table.getSubTable().getPkColumn()))
-            {
+            if (StringUtils.isNull(table.getSubTable().getPkColumn())) {
                 table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0));
             }
         }
     }
+
     /**
      * 设置主子表信息
-     * 
+     *
      * @param table 业务表信息
      */
-    public void setSubTable(GenTable table)
-    {
+    public void setSubTable(GenTable table) {
         String subTableName = table.getSubTableName();
-        if (StringUtils.isNotEmpty(subTableName))
-        {
+        if (StringUtils.isNotEmpty(subTableName)) {
             table.setSubTable(genTableMapper.selectGenTableByName(subTableName));
         }
     }
 
     /**
      * 设置代码生成其他选项值
-     * 
+     *
      * @param genTable 设置后的生成对象
      */
-    public void setTableFromOptions(GenTable genTable)
-    {
+    public void setTableFromOptions(GenTable genTable) {
         JSONObject paramsObj = JSONObject.parseObject(genTable.getOptions());
-        if (StringUtils.isNotNull(paramsObj))
-        {
+        if (StringUtils.isNotNull(paramsObj)) {
             String treeCode = paramsObj.getString(GenConstants.TREE_CODE);
             String treeParentCode = paramsObj.getString(GenConstants.TREE_PARENT_CODE);
             String treeName = paramsObj.getString(GenConstants.TREE_NAME);
             String parentMenuId = paramsObj.getString(GenConstants.PARENT_MENU_ID);
             String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
-            
+
             genTable.setTreeCode(treeCode);
             genTable.setTreeParentCode(treeParentCode);
             genTable.setTreeName(treeName);
@@ -482,16 +477,14 @@ public class GenTableServiceImpl implements IGenTableService
 
     /**
      * 获取代码生成地址
-     * 
-     * @param table 业务表信息
+     *
+     * @param table    业务表信息
      * @param template 模板文件路径
      * @return 生成地址
      */
-    public static String getGenPath(GenTable table, String template)
-    {
+    public static String getGenPath(GenTable table, String template) {
         String genPath = table.getGenPath();
-        if (StringUtils.equals(genPath, "/"))
-        {
+        if (StringUtils.equals(genPath, "/")) {
             return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table);
         }
         return genPath + File.separator + VelocityUtils.getFileName(template, table);

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

@@ -49,4 +49,14 @@ public interface IGenTableColumnService
      * @return 结果
      */
     public int deleteGenTableColumnByIds(String ids);
+
+
+    /**
+    *校验column_name是否重复
+    * @param genTableColumn
+    * @return 结果
+    * @author tjf
+    * @Date 2021/3/24
+    */
+    public String checkColumnNameUnique(GenTableColumn genTableColumn);
 }

+ 49 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableRelationService.java

@@ -0,0 +1,49 @@
+package com.boman.gen.service;
+
+import com.boman.gen.domain.GenTableRelation;
+
+import java.util.List;
+
+/**
+ * @author tjf
+ * @Date: 2021/03/25/16:14
+ */
+public interface IGenTableRelationService {
+
+    /**
+     * 查询列表
+     * @param genTableRelation
+     * @return
+     */
+    public List<GenTableRelation> selectGenTableRelationList(GenTableRelation genTableRelation);
+
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    public GenTableRelation selectGenTableRelationById(Long id);
+
+
+    /**
+     * 新增
+     * @param genTableRelation
+     * @return
+     */
+    public int insertGenTableRelation(GenTableRelation genTableRelation);
+
+    /**
+     * 修改
+     * @param genTableRelation
+     * @return
+     */
+    public int updateGenTableRelation(GenTableRelation genTableRelation);
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     */
+    public int deleteGenTableRelation(Long[] ids);
+
+}

+ 9 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/service/IGenTableService.java

@@ -2,6 +2,8 @@ package com.boman.gen.service;
 
 import java.util.List;
 import java.util.Map;
+
+import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.gen.domain.GenTable;
 
 /**
@@ -118,4 +120,11 @@ public interface IGenTableService
      * @param genTable 业务信息
      */
     public void validateEdit(GenTable genTable);
+
+    /**
+     * 代码生成业务新增
+     * @param genTable
+     * @return
+     */
+    public AjaxResult insertGenTable(GenTable genTable);
 }

+ 11 - 1
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml

@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isQuery"        column="is_query"       />
         <result property="queryType"      column="query_type"     />
         <result property="htmlType"       column="html_type"      />
+        <result property="foreignKey"     column="foreign_key"      />
         <result property="dictType"       column="dict_type"      />
         <result property="sort"           column="sort"           />
         <result property="createBy"       column="create_by"      />
@@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 	
 	<sql id="selectGenTableColumnVo">
-        select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
+        select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, foreign_key, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
     </sql>
 	
     <select id="selectGenTableColumnListByTableId" parameterType="GenTableColumn" resultMap="GenTableColumnResult">
@@ -71,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="isQuery != null and isQuery != ''">is_query,</if>
 			<if test="queryType != null and queryType != ''">query_type,</if>
 			<if test="htmlType != null and htmlType != ''">html_type,</if>
+			<if test="foreignKey != null ">foreign_key,</if>
 			<if test="dictType != null and dictType != ''">dict_type,</if>
 			<if test="sort != null">sort,</if>
 			<if test="createBy != null and createBy != ''">create_by,</if>
@@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
 			<if test="queryType != null and queryType != ''">#{queryType},</if>
 			<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
+			<if test="foreignKey != null">#{foreignKey},</if>
 			<if test="dictType != null and dictType != ''">#{dictType},</if>
 			<if test="sort != null">#{sort},</if>
 			<if test="createBy != null and createBy != ''">#{createBy},</if>
@@ -112,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             query_type = #{queryType},
             html_type = #{htmlType},
             dict_type = #{dictType},
+            foreign_key = #{foreignKey},
             sort = #{sort},
             update_by = #{updateBy},
             update_time = sysdate()
@@ -125,6 +129,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{tableId}
         </foreach>
     </delete>
+
+
+    <select id="checkColumnNameUnique" parameterType="Long" resultType="com.boman.gen.domain.GenTableColumn">
+        <include refid="selectGenTableColumnVo"/>
+        where column_name = #{columnName} limit 1
+    </select>
     
     <delete id="deleteGenTableColumns">
         delete from gen_table_column where column_id in 

+ 17 - 1
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -25,6 +25,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateBy"       column="update_by"         />
 		<result property="updateTime"     column="update_time"       />
 		<result property="remark"         column="remark"            />
+		<result property="isMenu"         column="is_menu"            />
+		<result property="menuRole"         column="menu_role"            />
+		<result property="akColumn"         column="ak_column"            />
+		<result property="dkColumn"         column="dk_column"            />
 		<collection  property="columns"  javaType="java.util.List"  resultMap="GenTableColumnResult" />
 	</resultMap>
 	
@@ -54,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 	
 	<sql id="selectGenTableVo">
-        select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
+        select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark, is_menu, menu_role, ak_column, dk_column from gen_table
     </sql>
     
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
@@ -150,6 +154,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="genType != null and genType != ''">gen_type,</if>
 			<if test="genPath != null and genPath != ''">gen_path,</if>
 			<if test="remark != null and remark != ''">remark,</if>
+			<if test="isMenu != null and isMenu != ''">is_menu,</if>
+			<if test="menuRole != null and menuRole != ''">menu_role,</if>
+			<if test="akColumn != null ">ak_column,</if>
+			<if test="dkColumn != null">dk_column,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
 			create_time
          )values(
@@ -165,6 +173,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="genType != null and genType != ''">#{genType},</if>
 			<if test="genPath != null and genPath != ''">#{genPath},</if>
 			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="isMenu != null and isMenu != ''">#{isMenu},</if>
+			<if test="menuRole != null and menuRole != ''">#{menuRole},</if>
+			<if test="akColumn != null">#{akColumn},</if>
+			<if test="dkColumn != null ">#{dkColumn},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
 			sysdate()
          )
@@ -189,6 +201,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="options != null and options != ''">options = #{options},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <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>
             update_time = sysdate()
         </set>
         where table_id = #{tableId}

+ 99 - 0
boman-modules/boman-gen/src/main/resources/mapper/generator/GenTableRelationMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.boman.gen.mapper.GenTableRelationMapper">
+
+	<resultMap type="GenTableRelation" id="GenTableRelationResult">
+		<result property="id"     column="id"      />
+		<result property="description"     column="description"      />
+		<result property="relationParentId"     column="relation_parent_id"      />
+		<result property="relationChildId"     column="relation_child_id"      />
+		<result property="relationType"     column="relation_type"      />
+		<result property="createBy"     column="create_by"      />
+		<result property="createTime"     column="create_time"      />
+		<result property="updateBy"     column="update_by"      />
+		<result property="updateTime"     column="update_time"      />
+		<result property="isDel"     column="is_del"      />
+	</resultMap>
+
+	<sql id="selectGenTableRelationVo">
+        select id, description, relation_parent_id, relation_child_id, relation_type, create_by, create_time, update_by, update_time, is_del
+		from gen_table_relation
+    </sql>
+
+	<select id="selectGenTableRelationList" parameterType="GenTableRelation" resultMap="GenTableRelationResult">
+		<include refid="selectGenTableRelationVo"/>
+		<where>
+			<if test="description != null and description != ''">
+				AND description like concat('%', #{description}, '%')
+			</if>
+			<if test="relationParentId != null">
+				AND relation_parent_id = #{relationParentId}
+			</if>
+			<if test="relationChildId != null ">
+				AND relation_child_id = #{relationChildId}
+			</if>
+			<if test="relationType != null ">
+				AND relation_type = #{relationType}
+			</if>
+			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+			</if>
+			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+			</if>
+		</where>
+	</select>
+
+
+	<select id="selectGenTableRelationById" parameterType="GenTableRelation" resultMap="GenTableRelationResult">
+		<include refid="selectGenTableRelationVo"/>
+		where id = #{id}
+	</select>
+
+	<insert id="insertGenTableRelation" parameterType="GenTableRelation">
+		insert into gen_table_relation (
+		<if test="description != null and description != '' ">description,</if>
+		<if test="relationParentId != null">relation_parent_id,</if>
+		<if test="relationChildId != null">relation_child_id,</if>
+		<if test="relationType != null">relation_type,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		<if test="updateBy != null and updateBy != ''">update_by,</if>
+		<if test="updateTime != null and updateTime != ''">update_time,</if>
+		create_time
+		)values(
+		<if test="description != null and description != ''">#{description},</if>
+		<if test="relationParentId != null">#{relationParentId},</if>
+		<if test="relationChildId != null">#{relationChildId},</if>
+		<if test="relationType != null">#{relationType},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+		<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
+		sysdate()
+		)
+	</insert>
+
+	<update id="updateGenTableRelation" parameterType="GenTableRelation">
+		update gen_table_relation
+		<set>
+			<if test="description != null and description != ''">description = #{description},</if>
+			<if test="relationParentId != null">relation_parent_id = #{relationParentId},</if>
+			<if test="relationChildId != null">relation_child_id = #{relationChildId},</if>
+			<if test="relationType != null">relation_type = #{relationType},</if>
+			<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+			<if test="create_time != null">create_time = #{createTime},</if>
+			<if test="updateBy != null and updateBy != null">update_by = #{updateBy},</if>
+			update_time = sysdate()
+		</set>
+		where id = #{id}
+	</update>
+
+	<update id="deleteGenTableRelation" parameterType="GenTableRelation">
+		update gen_table_relation
+		set is_del = '1' where id in
+		<foreach item="ids" collection="array" open="(" separator="," close=")">
+			#{ids}
+		</foreach>
+	</update>
+</mapper> 

+ 0 - 0
boman-modules/boman-job/src/main/resources/mapper/job/SysJobMapper.xml → boman-modules/boman-job/src/main/resources/mapper/job/GenTableRelationMapper.xml


+ 1 - 1
boman-modules/boman-system/pom.xml

@@ -114,5 +114,5 @@
             </plugin>
         </plugins>
     </build>
-   
+
 </project>

+ 24 - 36
boman-modules/boman-system/src/main/java/com/boman/system/common/BaseTableSaveDTO.java

@@ -2,14 +2,21 @@ package com.boman.system.common;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @author:zc
  * @since:2018/12/27
  * @createat:2018/12/274:41 PM
  */
+@Data
+@ToString
+@EqualsAndHashCode
 public class BaseTableSaveDTO implements Serializable {
 
     private static final long serialVersionUID = -8653990707913725671L;
@@ -22,40 +29,21 @@ public class BaseTableSaveDTO implements Serializable {
     @JSONField(name = "table")
     private String table;
 
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public Long getObjId() {
-        return objId;
-    }
-
-    public void setObjId(Long objId) {
-        this.objId = objId;
-    }
-
-    public JSONObject getFixedData() {
-        return fixedData;
-    }
-
-    public void setFixedData(JSONObject fixedData) {
-        this.fixedData = fixedData;
-    }
-
-    public String getTable() {
-        return table;
-    }
-
-    public void setTable(String table) {
-        this.table = table;
-    }
-
-    @Override
-    public String toString() {
-        return "BaseTableSaveDTO{" +
-                "objId=" + objId +
-                ", fixedData=" + fixedData +
-                ", table='" + table + '\'' +
-                '}';
-    }
+    /**
+     * 逻辑删除,数据库对应的属性名称
+     */
+    @JSONField(name = "logicDelName")
+    private String logicDelName;
+
+    /**
+     * 逻辑删除,数据库对应的属性值
+     */
+    @JSONField(name = "logicDelValue")
+    private String logicDelValue;
+
+    /**
+     * 删除时,前台传过来需要删除的idList
+     */
+    @JSONField(name = "idList")
+    private List<Long> idList;
 }

+ 6 - 24
boman-modules/boman-system/src/main/java/com/boman/system/common/BusinessResult.java

@@ -116,14 +116,8 @@ public class BusinessResult implements Serializable {
                 Object this$notice = this.getNotice();
                 Object other$notice = other.getNotice();
                 if (this$notice == null) {
-                    if (other$notice != null) {
-                        return false;
-                    }
-                } else if (!this$notice.equals(other$notice)) {
-                    return false;
-                }
-
-                return true;
+                    return other$notice == null;
+                } else return this$notice.equals(other$notice);
             }
         }
     }
@@ -227,14 +221,8 @@ public class BusinessResult implements Serializable {
                     Object this$message = this.getMessage();
                     Object other$message = other.getMessage();
                     if (this$message == null) {
-                        if (other$message != null) {
-                            return false;
-                        }
-                    } else if (!this$message.equals(other$message)) {
-                        return false;
-                    }
-
-                    return true;
+                        return other$message == null;
+                    } else return this$message.equals(other$message);
                 }
             }
         }
@@ -292,14 +280,8 @@ public class BusinessResult implements Serializable {
                     Object this$msgType = this.getMsgType();
                     Object other$msgType = other.getMsgType();
                     if (this$msgType == null) {
-                        if (other$msgType != null) {
-                            return false;
-                        }
-                    } else if (!this$msgType.equals(other$msgType)) {
-                        return false;
-                    }
-
-                    return true;
+                        return other$msgType == null;
+                    } else return this$msgType.equals(other$msgType);
                 }
             }
         }

+ 23 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/FormDataConstant.java

@@ -0,0 +1,23 @@
+package com.boman.system.common;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 09:47
+ **/
+public class FormDataConstant {
+
+    /**
+     * 删除数据时,需要删除的业务表的主键
+     */
+    public static final String ID_LIST = "idList";
+
+    /**
+     * 查询的条件
+     */
+    public static final String CONDITION = "condition";
+
+    /**
+     * 查询后需要返回到前台的字段
+     */
+    public static final String SHOW_DATA = "showData";
+}

+ 2 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/MainTableRecord.java

@@ -1,6 +1,8 @@
 package com.boman.system.common;
 
 import com.alibaba.fastjson.JSONObject;
+
+
 import com.boman.gen.domain.GenTable;
 import com.google.common.collect.Maps;
 import lombok.Data;

+ 2 - 2
boman-modules/boman-system/src/main/java/com/boman/system/common/RowRecord.java

@@ -3,6 +3,7 @@ package com.boman.system.common;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.gen.domain.GenTable;
 import com.boman.system.mapper.StandardlyMapper;
+import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
@@ -11,7 +12,7 @@ import lombok.extern.slf4j.Slf4j;
  * @author zc
  * @date 2019/02/19
  */
-@Getter
+@Data
 @Slf4j
 public class RowRecord {
 
@@ -19,7 +20,6 @@ public class RowRecord {
 
     private Table table;
 
-    @Setter
     private Long id;
     private DbRowAction action;
 

+ 8 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/RowResult.java

@@ -78,4 +78,12 @@ public class RowResult {
     public void setData(final Object data) {
         this.data = data;
     }
+
+    public static boolean checkSuccess(RowResult rowResult){
+        return null != rowResult && ValueHolder.OK == rowResult.getCode();
+    }
+
+    public static boolean checkFail(RowResult rowResult){
+        return !checkSuccess(rowResult);
+    }
 }

+ 4 - 4
boman-modules/boman-system/src/main/java/com/boman/system/common/StoredProcedureService.java

@@ -18,17 +18,17 @@ import java.util.Map;
 @Slf4j
 public class StoredProcedureService {
 
-    @Autowired
+/*    @Autowired
     private StoredProcedureMapper storedProcedureMapper;
 
-    /**
+    *//**
      * 增删改提交 统一存储过程
      *
      * @param state      是否启用存储过程
      * @param storedName 存储过程名
      * @param pId        对象ID
      * @param tableName  表名
-     */
+     *//*
     @Transactional(rollbackFor = Exception.class)
     public void storedProcedure(String state, String storedName, Long pId, Long pIsAdd, String tableName) {
         if (StringUtils.isNotBlank(state)) {
@@ -66,7 +66,7 @@ public class StoredProcedureService {
                 }
             }
         }
-    }
+    }*/
 
     /**
      * 页面调用存储过程

+ 99 - 13
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -1,9 +1,15 @@
 package com.boman.system.common;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.boman.common.core.utils.SpringUtils;
 import com.boman.common.core.utils.StringUtils;
+import com.boman.common.core.utils.collection.CollectionUtils;
+import com.boman.common.redis.RedisKey;
+import com.boman.common.redis.service.RedisService;
+import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
+import com.boman.system.service.impl.BaseDeleteService;
 import com.boman.system.service.impl.BaseSaveService;
 import com.boman.system.utils.IdUtils;
 import org.slf4j.Logger;
@@ -11,8 +17,13 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
 import java.util.List;
 
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
+import static com.boman.common.core.utils.obj.ObjectUtils.requiredNonNull;
+import static com.boman.system.common.FormDataConstant.*;
+
 /**
  * @author shiqian
  * @description
@@ -22,33 +33,108 @@ import java.util.List;
 public class TableServiceCmdService {
 
     @Autowired
-    private TableServiceContext tableServiceContext;
+    private BaseDeleteService deleteService;
+    @Autowired
+    private BaseSaveService saveService;
+    @Autowired
+    private RedisService redisService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
-    public final ValueHolder execute(BaseTableSaveDTO baseTableSaveDTO, String actionName) throws Exception {
+    private BaseTableDTO packTableDTO(BaseTableSaveDTO baseTableSaveDTO) {
         BaseTableDTO baseTableDTO = new BaseTableDTO();
         baseTableDTO.setFixedData(baseTableSaveDTO.getFixedData());
         baseTableDTO.setObjId(baseTableSaveDTO.getObjId());
         baseTableDTO.setTable(baseTableSaveDTO.getTable());
-        return execute(baseTableDTO, actionName);
+        return baseTableDTO;
     }
 
-    public final ValueHolder execute(BaseTableDTO baseTableDTO, String actionName) {
-        TableServiceContext context = TableServiceContext.createFrom(baseTableDTO, actionName);
-        BaseSaveService baseSaveService = SpringUtils.getBean(BaseSaveService.class);
+    public final ValueHolder<RowResult> objectSave(BaseTableSaveDTO baseTableSaveDTO) {
+        BaseTableDTO baseTableDTO = packTableDTO(baseTableSaveDTO);
+        TableServiceContext context = TableServiceContext.createFrom(baseTableDTO);
+//        BaseSaveService baseSaveService = SpringUtils.getBean(BaseSaveService.class);
         // 拿到pkName和maxId
         List<GenTableColumn> columns = context.getTable().getColumns();
         String pkName = IdUtils.getPkName(columns);
         StringUtils.requireNonNull(pkName);
         Long maxId = IdUtils.getMaxId(baseTableDTO.getTable(), pkName);
-        RowResult rowResult = baseSaveService.insertRow(context.getRealTableName(), pkName, maxId, context.getRows().get(0));
+        RowResult rowResult = saveService.insertRow(context.getRealTableName(), pkName, maxId, context.getRows().get(0));
+        if (RowResult.checkSuccess(rowResult)) {
+            LOGGER.info("保存成功,封装到数据库的数据为: {}", JSON.toJSONString(rowResult.getData()));
+        } else {
+            LOGGER.error("保存失败,保持的原始数据为: {}", JSON.toJSONString(baseTableSaveDTO));
+        }
+
+        return ValueHolder.ok(rowResult);
+    }
+
+    /**
+     * 功能描述: 通用删除接口 (真的删除)
+     *
+     * @param dto 前台传过来的dto
+     * @return com.boman.system.common.ValueHolder
+     */
+    public ValueHolder<RowResult> objectDelete(BaseTableSaveDTO dto) {
+        requireNonNull(dto.getTable());
+        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
+        requiredNonNull(idArr);
+        // 拿到pkName
+        GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + requireNonNull(dto.getTable()));
+        requireNonNull(genTable);
+        String pkName = IdUtils.getPkName(genTable.getColumns());
+
+        RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName));
+        LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
+        return ValueHolder.ok(rowResult);
+    }
+
 
-        ValueHolder valueHolder = new ValueHolder();
-        valueHolder.setCode(ResultCode.SUCCESS);
-        valueHolder.setMessage("操作成功" + ((JSONObject) rowResult.getData()).getInteger("successCnt") + "条!");
-        valueHolder.setData(rowResult);
-        return valueHolder;
+    /**
+     * 功能描述: 通用删除接口 (真的删除)
+     *
+     * @param dto 前台传过来的dto
+     * @return com.boman.system.common.ValueHolder
+     */
+    public ValueHolder<RowResult> objectLogicDelete(BaseTableSaveDTO dto) {
+        requireNonNull(dto.getTable());
+        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
+        requiredNonNull(idArr);
+
+        // 拿到pkName
+        GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + requireNonNull(dto.getTable()));
+        requireNonNull(genTable);
+        String pkName = IdUtils.getPkName(genTable.getColumns());
+
+        JSONObject jsonObject= new JSONObject();
+        jsonObject.put(dto.getLogicDelName(), dto.getLogicDelValue());
+
+        RowResult rowResult = deleteService.objectLogicDelete(idArr, dto.getTable(), requireNonNull(pkName), jsonObject);
+        LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
+        return ValueHolder.ok(rowResult);
     }
 
+    /**
+     * 功能描述: 获取单表单数据
+     *
+     * @param condition condition
+     * @return com.boman.system.common.ValueHolder
+     */
+    public ValueHolder<RowResult> getObject(BaseTableSaveDTO dto) {
+        requireNonNull(dto.getTable());
+
+        // 拿到每个字段对应的查询类型,是 = 或者 like 或者 > 或者 <
+        GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + requireNonNull(dto.getTable()));
+        requireNonNull(genTable);
+        JSONObject fixedData = dto.getFixedData();
+        requireNonNull(fixedData);
+        // 查询条件
+        JSONObject condition = fixedData.getJSONObject(CONDITION);
+        // 需要返回到前台的列
+        JSONArray showData = fixedData.getJSONArray(SHOW_DATA);
+
+
+
+
+        return ValueHolder.ok("");
+    }
 }

+ 7 - 6
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceContext.java

@@ -2,6 +2,7 @@ package com.boman.system.common;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.SpringUtils;
+import com.boman.common.redis.RedisKey;
 import com.boman.common.redis.service.RedisService;
 import com.boman.gen.domain.GenTable;
 import com.google.common.base.Strings;
@@ -91,13 +92,13 @@ public class TableServiceContext {
     @Resource
     private RedisService redisService;
 
-    public static TableServiceContext createFrom(BaseTableDTO baseTableDTO, String actionName) {
+    public static TableServiceContext createFrom(BaseTableDTO baseTableDTO) {
         TableServiceContext result = new TableServiceContext();
         result.user = RequestUtil.getUser();
-        result.actionName = actionName.replace(PREFIX, "").toUpperCase();
-        if (StringUtils.isEmpty(result.actionName)) {
-            throw new IllegalArgumentException("actionName不能为空");
-        }
+//        result.actionName = actionName.replace(PREFIX, "").toUpperCase();
+//        if (StringUtils.isEmpty(result.actionName)) {
+//            throw new IllegalArgumentException("actionName不能为空");
+//        }
 
         String tableName = baseTableDTO.getTable();
         if (StringUtils.isEmpty(tableName)) {
@@ -106,7 +107,7 @@ public class TableServiceContext {
 
         //从redis中获取表信息
         RedisService redisService = SpringUtils.getBean(RedisService.class);
-        result.table = redisService.getCacheObject("table:" + tableName);
+        result.table = redisService.getCacheObject(RedisKey.TABLE_INFO + tableName);
 
         if (result.table == null) {
             throw new IllegalArgumentException(tableName + "表信息不存在");

+ 36 - 1
boman-modules/boman-system/src/main/java/com/boman/system/common/ValueHolder.java

@@ -1,6 +1,8 @@
 package com.boman.system.common;
 
 import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+
 import java.io.Serializable;
 
 /**
@@ -8,8 +10,12 @@ import java.io.Serializable;
  * @description
  * @date 2021年03月22日 09:26
  **/
+@Data
 public class ValueHolder<T> implements Serializable {
 
+    public static final int OK = 0;
+    public static final int FAIL = -1;
+
     private T data;
     private int code;
     private String message;
@@ -17,7 +23,7 @@ public class ValueHolder<T> implements Serializable {
     public ValueHolder() {
     }
 
-    public ValueHolder(T data, int code, String message) {
+    public ValueHolder(int code, String message, T data) {
         this.data = data;
         this.code = code;
         this.message = message;
@@ -36,6 +42,35 @@ public class ValueHolder<T> implements Serializable {
         return obj;
     }
 
+    public static <T> ValueHolder<T> ok(String message){
+        return new ValueHolder<>(OK, message);
+    }
+
+    public static <T> ValueHolder<T> ok(String message, T data){
+        return new ValueHolder<>(OK, message, data);
+    }
+
+
+    public static <T> ValueHolder<T> ok(T data){
+        return new ValueHolder<>(OK, "成功", data);
+    }
+
+
+    public static <T> ValueHolder<T> fail(String message, T data){
+        return new ValueHolder<>(FAIL, message, data);
+    }
+
+    public static <T> ValueHolder<T> fail(String message){
+        return new ValueHolder<>(FAIL, message);
+    }
+
+
+
+
+
+
+
+
     public boolean isOK() {
         return this.code == 0;
     }

+ 77 - 0
boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjController.java

@@ -0,0 +1,77 @@
+package com.boman.system.controller;
+
+import com.boman.system.common.BaseTableSaveDTO;
+import com.boman.system.common.RowResult;
+import com.boman.system.common.TableServiceCmdService;
+import com.boman.system.common.ValueHolder;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * @author shiqian
+ * @description
+ * @date 2021年03月22日 09:19
+ **/
+@RestController
+@RequestMapping("/p/cs")
+public class ObjController {
+
+    @Autowired
+    private TableServiceCmdService tableServiceCmdService;
+
+    /**
+     * 功能描述: 通用保存接口
+     *
+     * @param baseTableSaveDTO 前台传过来的dto
+     * @return com.boman.system.common.ValueHolder
+     */
+    @ApiOperation(value = "单对象保存")
+    @PostMapping("/objectSave")
+    public ValueHolder<RowResult> objectSave(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+        return tableServiceCmdService.objectSave(baseTableSaveDTO);
+    }
+
+    /**
+     * 功能描述: 通用删除接口 (真的删除)
+     *
+     * @param baseTableSaveDTO 前台传过来的dto
+     * @return com.boman.system.common.ValueHolder
+     */
+    @ApiOperation(value = "单对象删除")
+    @PostMapping("/objectDelete")
+    public ValueHolder<RowResult> objectDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+        return tableServiceCmdService.objectDelete(baseTableSaveDTO);
+    }
+
+    /**
+     * 功能描述: 通用删除接口 (逻辑删除)
+     *
+     * @param baseTableSaveDTO 前台传过来的dto
+     * @return com.boman.system.common.ValueHolder
+     */
+    @ApiOperation(value = "单对象逻辑删除")
+    @PostMapping("/objectLogicDelete")
+    public ValueHolder<RowResult> objectLogicDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+        return tableServiceCmdService.objectLogicDelete(baseTableSaveDTO);
+    }
+
+    /**
+     * 功能描述: 获取单表单数据
+     *
+     * @param condition condition
+     * @return com.boman.system.common.ValueHolder
+     */
+    @ApiOperation(value = "获取单表单数据")
+    @PostMapping("/getObject")
+    public ValueHolder<RowResult> getObject(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.getObject(condition);
+    }
+
+
+
+}

+ 0 - 32
boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjSaveController.java

@@ -1,32 +0,0 @@
-package com.boman.system.controller;
-
-import com.boman.system.common.BaseTableSaveDTO;
-import com.boman.system.common.TableServiceCmdService;
-import com.boman.system.common.ValueHolder;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-
-/**
- * @author shiqian
- * @description
- * @date 2021年03月22日 09:19
- **/
-@RestController
-@RequestMapping("/obj")
-public class ObjSaveController {
-
-    @Autowired
-    private TableServiceCmdService tableServiceCmdService;
-
-    @ApiOperation(value = "单对象保存")
-    @PostMapping("/objectSave")
-    public ValueHolder doSave(@RequestBody BaseTableSaveDTO baseTableSaveDTO) throws Exception {
-        return tableServiceCmdService.execute(baseTableSaveDTO, "SAVE");
-    }
-
-}

+ 72 - 15
boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java

@@ -1,8 +1,10 @@
 package com.boman.system.mapper;
 
 import com.alibaba.fastjson.JSONObject;
+import com.boman.common.core.utils.obj.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.*;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.jdbc.SQL;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,7 +28,8 @@ public interface StandardlyMapper {
             type = StandardlyMapper.SqlProvider.class,
             method = "update"
     )
-    int updateById(@Param("tableName") String var1, @Param("model") JSONObject var2);
+    int updateById(@Param("tableName") String var1, @Param("model") JSONObject var2
+            , @Param("pkName") String pkName, @Param("ids") Long[] ids);
 
     @UpdateProvider(
             type = StandardlyMapper.SqlProvider.class,
@@ -39,7 +42,7 @@ public interface StandardlyMapper {
             type = StandardlyMapper.SqlProvider.class,
             method = "delete"
     )
-    int deleteByIds(@Param("tableName") String var1, @Param("ids") long[] var2);
+    int deleteByIds(@Param("tableName") String var1, @Param("ids") Long[] var2, @Param("pkName") String pkName);
 
     @Delete({"DELETE FROM ${tableName} where ID = #{id}"})
     int deleteById(@Param("tableName") String var1, @Param("id") long var2);
@@ -83,6 +86,25 @@ public interface StandardlyMapper {
     @Select("select max(${pkName}) from ${tableName}")
     Long selectMaxId(@Param("tableName") String tableName, @Param("pkName") String pkName);
 
+    /**
+     * 功能描述: 自定义查询,需要查询的字段和value都在condition中
+     *
+     * @param tableName tableName
+     * @param condition condition
+     * @param limit     分页
+     * @param offset    分页
+     * @return java.util.List<com.alibaba.fastjson.JSONObject>
+     */
+    @SelectProvider(type = StandardlyMapper.SqlProvider.class, method = "selectByCondition")
+    List<JSONObject> selectByCondition(@Param("tableName") String tableName
+            , @Param("condition") JSONObject condition
+            , @Param("showData") JSONObject showData
+            , @Param("limit") int limit
+            , @Param("offset") int offset);
+
+
+
+
     public static class SqlProvider {
         static final String[] READONLY_COLUMNS = new String[]{"OWNERID", "OWNERNAME", "OWNERENAME", "CREATIONDATE", "ID"};
 
@@ -130,24 +152,34 @@ public interface StandardlyMapper {
         public String update(Map<String, Object> para) {
             String tableName = (String) para.get("tableName");
             JSONObject model = (JSONObject) para.get("model");
-            //if (isNullOrEmpty(tableName)) {
+            String pkName = (String) para.get("pkName");
+            Long[] ids = (Long[]) para.get("ids");
             if (StringUtils.isBlank(tableName)) {
                 throw new IllegalArgumentException("tableName 无效");
             } else if (!model.isEmpty()) {
                 keyToUpper(model);
                 SQL sql = new SQL();
                 sql.UPDATE(tableName);
-                Iterator var5 = model.keySet().iterator();
 
-                while (var5.hasNext()) {
-                    String key = (String) var5.next();
+                // 拼装set
+                model.forEach((key, value)->{
                     if (!isReadOnly(key)) {
-                        sql.SET(key + "= #{model." + key + "}");
+                        // 此处需要对value加一个""
+                        sql.SET(key + " = \"" + value + "\"");
                     }
+                });
+
+                // 拼装in
+                StringBuilder inSql = new StringBuilder();
+                for (int i = 0; i < ids.length; ++i) {
+                    inSql.append(String.format("#{ids[%d]}", i));
+                    inSql.append(",");
                 }
 
-                sql.WHERE("ID = #{model.ID}");
-                return sql.toString();
+                sql.WHERE(pkName + " in (" + inSql.toString());
+                String wholeSql = StringUtils.substringBeforeLast(sql.toString(), ",") + "))";
+                LOGGER.info("更改的sql语句为: {}", wholeSql);
+                return wholeSql;
             } else {
                 throw new IllegalArgumentException("model 无效");
             }
@@ -224,14 +256,15 @@ public interface StandardlyMapper {
                 }
 
                 String sqlStr = sql.toString();
-                LOGGER.info("新增拼接的sql语句为: {}", sqlStr);
+                LOGGER.info("新增的sql语句为: {}", sqlStr);
                 return sqlStr;
             }
         }
 
         public String delete(Map<String, Object> para) {
-            long[] ids = (long[]) ((long[]) para.get("ids"));
+            Long[] ids = (Long[]) para.get("ids");
             String tableName = (String) para.get("tableName");
+            String pkName = (String) para.get("pkName");
             if (isNullOrEmpty(tableName)) {
                 throw new IllegalArgumentException("tableName 无效");
             } else if (ids == null) {
@@ -239,13 +272,13 @@ public interface StandardlyMapper {
             } else if (ids.length == 0) {
                 return "";
             } else if (ids.length == 1) {
-                return "DELETE FROM " + tableName + " where ID = #{ids[0]}";
+                return "DELETE FROM " + tableName + " where " + pkName + " = #{ids[0]}";
             } else {
                 StringBuffer sql = new StringBuffer();
                 sql.append("DELETE FROM ");
                 sql.append(tableName);
                 sql.append(" WHERE ");
-                sql.append("ID in (");
+                sql.append(pkName + " in (");
 
                 for (int i = 0; i < ids.length; ++i) {
                     sql.append(String.format("#{ids[%d]}", i));
@@ -253,7 +286,9 @@ public interface StandardlyMapper {
                 }
 
                 sql.setCharAt(sql.length() - 1, ')');
-                return sql.toString();
+                String sqlStr = sql.toString();
+                LOGGER.info("删除的sql语句为: {}", sqlStr);
+                return sqlStr;
             }
         }
 
@@ -360,11 +395,33 @@ public interface StandardlyMapper {
                     }
 
                     sql.deleteCharAt(sql.length() - 1);
-                    return sql.toString();
+                    String sqlStr = sql.toString();
+                    LOGGER.info("更新的sql语句为: {}", sqlStr);
+                    return sqlStr;
                 }
             } else {
                 throw new IllegalArgumentException("model 无效");
             }
         }
+
+//        @Param("tableName") String tableName, @Param("condition") JSONObject condition, @Param("limit") int limit, @Param("offset") int offset
+        public String selectByCondition(Map<String, Object> para) {
+            JSONObject condition = (JSONObject) para.get("condition");
+            ObjectUtils.requireNonNull(condition);
+            String tableName = (String) para.get("tableName");
+            ObjectUtils.requireNonNull(tableName);
+            int limit = (int) para.get("limit");
+            ObjectUtils.requireNonNull(limit);
+            int offset = (int) para.get("offset");
+            ObjectUtils.requireNonNull(offset);
+
+            StringBuilder sql = new StringBuilder();
+            sql.append("select ");
+
+
+
+
+            return "";
+        }
     }
 }

+ 2 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/SysConfigMapper.java

@@ -3,12 +3,14 @@ package com.boman.system.mapper;
 import java.util.List;
 
 import com.boman.system.domain.SysConfig;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 参数配置 数据层
  * 
  * @author ruoyi
  */
+@Mapper
 public interface SysConfigMapper
 {
     /**

+ 51 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseDeleteService.java

@@ -0,0 +1,51 @@
+package com.boman.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.system.common.RowResult;
+import com.boman.system.mapper.StandardlyMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author shiqian
+ * @date 2021年03月26日 11:16
+ **/
+@Service
+public class BaseDeleteService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(BaseDeleteService.class);
+
+    @Autowired
+    private StandardlyMapper mapper;
+
+    /**
+     * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
+     *
+     * @param idArr     需要删除的iD
+     * @param tableName 业务主表
+     * @param pkName    业务表的主键名
+     * @return com.boman.system.common.RowResult
+     */
+    public RowResult objectDelete(Long[] idArr, String tableName, String pkName) {
+        int delete = mapper.deleteByIds(tableName, idArr, pkName);
+        return RowResult.ok("共删除了 " + delete + " 条记录");
+    }
+
+    /**
+     * 功能描述: 在此不对入参进行校验,所以在调用此方法之前一定要对参数进行校验,以免报错
+     *
+     * @param idArr     需要删除的iD
+     * @param tableName 业务主表
+     * @param pkName    业务表的主键名
+     * @param model     逻辑删除的字段和值
+     * @return com.boman.system.common.RowResult
+     */
+    public RowResult objectLogicDelete(Long[] idArr, String tableName, String pkName, JSONObject model) {
+        int delete = mapper.updateById(tableName, model, pkName, idArr);
+        return RowResult.ok("共删除了 " + delete + " 条记录");
+    }
+
+
+}

+ 16 - 0
boman-modules/boman-system/src/main/resources/rebel.xml

@@ -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-modules/boman-system/target/classes">
+		</dir>
+	</classpath>
+
+</application>

+ 612 - 477
ruoyi-ui/src/views/index.vue

@@ -1,448 +1,265 @@
 <template>
   <div class="app-container home">
-    <el-row :gutter="20">
-      <el-col :sm="24" :lg="24">
-        <blockquote class="text-warning" style="font-size: 14px">
-          领取阿里云通用云产品1888优惠券
-          <br />
-          <el-link
-            href="https://www.aliyun.com/minisite/goods?userCode=brki8iof"
-            type="primary"
-            target="_blank"
-            >https://www.aliyun.com/minisite/goods?userCode=brki8iof</el-link
-          >
-          <br />
-          领取腾讯云通用云产品2860优惠券
-          <br />
-          <el-link
-            href="https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console"
-            type="primary"
-            target="_blank"
-            >https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console</el-link
-          >
-          <br />
-          阿里云服务器折扣区
-          <el-link href="http://aly.ruoyi.vip" type="primary" target="_blank"
-            >>☛☛点我进入☚☚</el-link
-          >
-          &nbsp;&nbsp;&nbsp; 腾讯云服务器秒杀区
-          <el-link href="http://txy.ruoyi.vip" type="primary" target="_blank"
-            >>☛☛点我进入☚☚</el-link
-          ><br />
-          <h4 class="text-danger">
-            云产品通用红包,可叠加官网常规优惠使用。(仅限新用户)
-          </h4>
-        </blockquote>
+    <el-row :gutter="5">
+      <el-col :sm="24" :lg="17" style="padding-left: 15px">
+        <div class="index_heade">
+          <img src="../assets/images/icon_more.png" alt="" class="index_headerImg">
+          <p class="index_headetab">
+            <span :class="[num == index ? ' spanto' : '']" v-for="(item,index) in editableTabs" :key="index" @click="tabSbu(index)">{{item.title}}</span>
+          </p>
+                <div v-if="num == 0">
+                  <ul class="index_headerUl">
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                    <li>
+                        <img src="../assets/images/icon_list_sj.png" alt="">
+                        <p>国家统计局:3月份商品住宅销售价格涨幅总体稳定</p>
+                        <span>03/06</span>
+                    </li>
+                  </ul>
+                  <div class="index_haderPagin">
+                    <el-pagination
+                         @size-change="handleSizeChange"
+                         @current-change="handleCurrentChange"
+                         :current-page.sync="currentPage3"
+                         :page-size="pageSize"
+                         layout="prev, pager, next, jumper"
+                         :total="1000">
+                    </el-pagination>
+                    <span>共 85 条  每页显示 5 条  当前 1/17 页</span>
+                  </div>
+                </div>
+        </div>
+        <!-- 列表 -->
+          <el-col :sm="24" :lg="24"  style="margin-top: 20px;">
+               <div class="index_heade index_headeNav">
+                 <img src="../assets/images/icon_more.png" alt="" class="index_headerImg">
+                 <p class="index_headetab">
+                   <span :class="[num == index ? ' spanto' : '']" v-for="(item,index) in editableTabs" :key="index" @click="tabSbu(index)">{{item.title}} <p class="tab_i">3</p></span></span>
+                 </p>
+                 <!-- <el-tabs v-model="activeName" @tab-click="handleClick" > -->
+                     <!-- <el-tab-pane  name="first">
+                        <span slot="label" class="index_heseviewed"><p class="tab_i">3</p> 我的行程</span> -->
+                         <div v-if="num == 0">
+                           <el-table :data="tableData" style="width: 100%;margin-top: 10px;"  :stripe="true"   >
+                                   <!-- <el-table-column type="selection" width="55" align="center" /> -->
+                                   <el-table-column label="序号" align="center" prop="noticeId" width="60" height="53" max-height="53" />
+                                  <el-table-column
+                                    label="申请人"
+                                    align="center"
+                                    prop="name"
+                                    :show-overflow-tooltip="true"
+                                    width="70"
+                                  />
+                                  <el-table-column
+                                    label="部门"
+                                    align="center"
+                                    prop="name"
+                                    :formatter="typeFormat"
+                                    width="70"
+                                  />
+                                  <el-table-column
+                                    label="请假类型"
+                                    align="center"
+                                    prop="status"
+                                    :formatter="statusFormat"
+                                    width="75"
+                                  />
+                                  <el-table-column label="请假事由" align="center" prop="createBy" width="100"  :show-overflow-tooltip="true"/>
+                                  <el-table-column label="请假时间" align="center" prop="date" width="150"/>
+                                    <!-- <template slot-scope="scope">
+                                      <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+                                    </template> -->
+                                  <!-- </el-table-column> -->
+                                  <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                                    <template slot-scope="scope">
+                                      <el-button
+                                        size="small"
+                                        type="success"
+                                        @click="handleUpdate(scope.row)"
+                                        v-hasPermi="['system:notice:edit']"
+                                      >详情</el-button>
+                                      <el-button
+                                        size="small"
+                                        type="primary"
+                                        @click="handleDelete(scope.row)"
+                                        v-hasPermi="['system:notice:remove']"
+                                      >同意</el-button>
+                                      <el-button
+                                        size="small"
+                                        type="danger"
+                                        @click="handleDelete(scope.row)"
+                                        v-hasPermi="['system:notice:remove']"
+                                      >驳回</el-button>
+                                    </template>
+                                  </el-table-column>
+                                 </el-table>
+                           <div class="index_haderPagin">
+                             <el-pagination
+                                  @size-change="handleSizeChange"
+                                  @current-change="handleCurrentChange"
+                                  :current-page.sync="currentPage3"
+                                  :page-size="pageSize"
+                                  layout="prev, pager, next, jumper"
+                                  :total="1000">
+                             </el-pagination>
+                             <span>共 85 条  每页显示 5 条  当前 1/17 页</span>
+                           </div>
+                         </div>
+               </div>
+          </el-col>
+        <!-- </el-row> -->
+        <!-- 公司概况 -->
+        <el-col :sm="24" :lg="24">
+           <div class="index_heade  index_headeProfile">
+             <img src="../assets/images/icon_tjbj.png" alt="" class="index_headerImg">
+            <p class="index_headetab">
+              <span :class="[num == index ? ' spanto' : '']" v-for="(item,index) in editableTabs" :key="index" @click="tabSbu(index)">{{item.title}} </span>
+            </p>
+            <!-- <el-tabs v-model="activeName" @tab-click="handleClick">
+                 <el-tab-pane label="用户管理" name="first"> -->
+                   <div v-if="num == 0">
+                     <h3 style="text-align: center;">北京凯特伟业科技有限公司</h3>
+                                      <p class="index_profilep">	北京凯特伟业科技有限公司,是HBP集团(股票代码002554)下属全资子公司,主营业务互联网软件服务。公司拥有十余年软件开发经验,其案例遍布能源、通信、金融 、医疗、养老 、制造业等各行业。主要产品有JEPLUS软件开发平台、蒜瓣企业管理系统等,并提供saas服务。
+                     蒜瓣产品支持SAAS(即当前软件发展最流行的多租户模式,例如钉钉)和定制两种模式。一般企业不需要购买任何硬件,刚开始只需要简单注册即可,企业无需再配备IT方面的专业技术人员,同时又能得到最新的技术应用,满足企业对信息管理的需求;大型企业有专业化需求时,可采用定制模式。</p>
+                                      <div class="index_haderPagin">
+                                        <el-pagination
+                                             @size-change="handleSizeChange"
+                                             @current-change="handleCurrentChange"
+                                             :current-page.sync="currentPage3"
+                                             :page-size="pageSize"
+                                             layout="prev, pager, next, jumper"
+                                             :total="1000">
+                                        </el-pagination>
+                                        <span>共 85 条  每页显示 5 条  当前 1/17 页</span>
+                                      </div>
+                   </div>
+                <!-- </el-tab-pane>
+                 <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
+                 <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
+                 <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
+             </el-tabs> -->
 
-        <hr />
-      </el-col>
-    </el-row>
-    <el-row :gutter="20">
-      <el-col :sm="24" :lg="12" style="padding-left: 20px">
-        <h2>若依后台管理框架</h2>
-        <p>
-          一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了博曼办公协作。,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
-        </p>
-        <p>
-          <b>当前版本:</b> <span>v{{ version }}</span>
-        </p>
-        <p>
-          <el-tag type="danger">&yen;免费开源</el-tag>
-        </p>
-        <p>
-          <el-button
-            type="primary"
-            size="mini"
-            icon="el-icon-cloudy"
-            plain
-            @click="goTarget('https://gitee.com/y_project/RuoYi-Cloud')"
-            >访问码云</el-button
-          >
-          <el-button
-            size="mini"
-            icon="el-icon-s-home"
-            plain
-            @click="goTarget('http://ruoyi.vip')"
-            >访问主页</el-button
-          >
-        </p>
+           </div>
+        </el-col>
       </el-col>
 
-      <el-col :sm="24" :lg="12" style="padding-left: 50px">
-        <el-row>
-          <el-col :span="12">
-            <h2>技术选型</h2>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="6">
-            <h4>后端技术</h4>
-            <ul>
-              <li>SpringBoot</li>
-              <li>SpringCloud</li>
-              <li>Nacos</li>
-              <li>Sentinel</li>
-              <li>Seata</li>
-              <li>Minio</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-          <el-col :span="6">
-            <h4>前端技术</h4>
-            <ul>
-              <li>Vue</li>
-              <li>Vuex</li>
-              <li>Element-ui</li>
-              <li>Axios</li>
-              <li>Echarts</li>
-              <li>Quill</li>
-              <li>...</li>
-            </ul>
-          </el-col>
-        </el-row>
-      </el-col>
-    </el-row>
-    <el-divider />
-    <el-row :gutter="20">
-      <el-col :xs="24" :sm="24" :md="12" :lg="8">
-        <el-card class="update-log">
-          <div slot="header" class="clearfix">
-            <span>联系信息</span>
-          </div>
-          <div class="body">
-            <p>
-              <i class="el-icon-s-promotion"></i> 官网:<el-link
-                href="http://www.ruoyi.vip"
-                target="_blank"
-                >http://www.ruoyi.vip</el-link
-              >
-            </p>
-            <p>
-              <i class="el-icon-user-solid"></i> QQ群:<s>满42799195</s>
-              <s>满170157040</s>
-              <a
-                href="https://jq.qq.com/?_wv=1027&k=MI9Ro7lk"
-                target="_blank"
-              >
-                130643120</a
-              >
-            </p>
-            <p>
-              <i class="el-icon-chat-dot-round"></i> 微信:<a
-                href="javascript:;"
-                >/ *若依</a
-              >
-            </p>
-            <p>
-              <i class="el-icon-money"></i> 支付宝:<a
-                href="javascript:;"
-                class="支付宝信息"
-                >/ *若依</a
-              >
+      <el-col :sm="24" :lg="7" style="padding-left: 15px">
+         <div class="index_nav">
+          <div class="index_navTime">
+            <p class="index_navTimep">
+              <span>日程</span>
+              <span><i class="el-icon-date"></i>创建日程</span>
             </p>
+            <el-calendar v-model="value">
+            </el-calendar>
+            <img src="../assets/images/pic_kpbg.png" alt="" class="index_navTimeimg">
           </div>
-        </el-card>
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="12" :lg="8">
-        <el-card class="update-log">
-          <div slot="header" class="clearfix">
-            <span>更新日志</span>
-          </div>
-          <el-collapse accordion>
-            <el-collapse-item title="v2.5.0 - 2021-02-02">
-              <ol>
-                <li>增加分布式事务seata支持</li>
-                <li>代码生成模板支持主子表</li>
-                <li>表格右侧工具栏组件支持显隐列</li>
-                <li>图片组件添加预览&移除功能</li>
-                <li>Excel注解支持Image图片导出</li>
-                <li>操作按钮组调整为朴素按钮样式</li>
-                <li>代码生成支持文件上传组件</li>
-                <li>代码生成日期控件区分范围</li>
-                <li>代码生成数据库文本类型生成表单文本域</li>
-                <li>用户手机邮箱&菜单组件修改允许空字符串</li>
-                <li>修复header获取username中文情况下乱码</li>
-                <li>修复角色管理-编辑角色-功能权限显示异常</li>
-                <li>修正操作日志删除接口路径</li>
-                <li>修复IE11浏览器报错问题</li>
-                <li>修复sentinel流量告警前端不响应</li>
-                <li>修正侧边栏静态路由丢失问题</li>
-                <li>修复导入数据为负浮点数时丢失精度问题</li>
-                <li>修复Get请求参数特殊值无法正确的传参</li>
-                <li>更换过期的共享配置属性</li>
-                <li>添加启动执行脚本</li>
-                <li>升级element-ui到最新版本2.15.0</li>
-                <li>升级spring-boot到最新版本2.3.7</li>
-                <li>升级spring-cloud到Hoxton.SR9</li>
-                <li>升级spring-boot-alibaba到最新版2.2.5</li>
-                <li>升级spring-boot-admin到最新版2.3.1</li>
-                <li>升级druid到最新版本v1.2.4</li>
-                <li>升级fastjson到最新版1.2.75</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
-            <el-collapse-item title="v2.4.0 - 2020-12-22">
-              <ol>
-                <li>增加分布式文件Minio支持</li>
-                <li>支持多数据源切换</li>
-                <li>修复多级菜单之间切换无法缓存的问题</li>
-                <li>三级菜单自动配置组件</li>
-                <li>支持主题风格配置</li>
-                <li>服务之间feign调用传递用户信息</li>
-                <li>删除用户和角色解绑关联</li>
-                <li>去除用户手机邮箱部门必填验证</li>
-                <li>代码生成预览支持高亮显示</li>
-                <li>获取请求token方法移至权限工具类</li>
-                <li>代码生成预览提供滚动机制</li>
-                <li>权限工具类增加管理员判断</li>
-                <li>日志记录增加过滤多文件场景</li>
-                <li>修改用户头像预览宽高</li>
-                <li>Excel支持注解align对齐方式</li>
-                <li>项目添加robots.txt 防止系统被搜索引擎收录</li>
-                <li>移除path-to-regexp正则匹配插件</li>
-                <li>修改Set可能导致嵌套的问题</li>
-                <li>调整代码生成页列宽</li>
-                <li>回显数据字典防止空值报错</li>
-                <li>支持get请求映射params参数</li>
-                <li>登录后push添加catch防止出现检查错误</li>
-                <li>防止安全扫描YUI出现的风险提示</li>
-                <li>代码生成删除多余的数字float类型</li>
-                <li>Excel支持导入Boolean型数据</li>
-                <li>修正转换字符串的目标字符集属性</li>
-                <li>删除多余的依赖</li>
-                <li>修改node-sass为dart-sass</li>
-                <li>升级poi到最新版本4.1.2</li>
-                <li>升级axios到最新版本0.21.0</li>
-                <li>升级element-ui到最新版本2.14.1</li>
-                <li>升级vue到最新版本2.6.12</li>
-                <li>升级vuex到最新版本3.6.0</li>
-                <li>升级vue-cli到版本4.5.9</li>
-                <li>升级vue-router到最新版本3.4.9</li>
-                <li>升级vue-cli到最新版本4.4.6</li>
-                <li>升级vue-cropper到最新版本0.5.5</li>
-                <li>升级clipboard到最新版本2.0.6</li>
-                <li>升级core-js到最新版本3.8.1</li>
-                <li>升级echarts到最新版本4.9.0</li>
-                <li>升级file-saver到最新版本2.0.4</li>
-                <li>升级fuse.js到最新版本6.4.3</li>
-                <li>升级js-beautify到最新版本1.13.0</li>
-                <li>升级js-cookie到最新版本2.2.1</li>
-                <li>升级path-to-regexp到最新版本6.2.0</li>
-                <li>升级quill到最新版本1.3.7</li>
-                <li>升级screenfull到最新版本5.0.2</li>
-                <li>升级sortablejs到最新版本1.10.2</li>
-                <li>升级vuedraggable到最新版本2.24.3</li>
-                <li>升级chalk到最新版本4.1.0</li>
-                <li>升级eslint到最新版本7.15.0</li>
-                <li>升级eslint-plugin-vue到最新版本7.2.0</li>
-                <li>升级lint-staged到最新版本10.5.3</li>
-                <li>升级runjs到最新版本4.4.2</li>
-                <li>升级sass-loader到最新版本10.1.0</li>
-                <li>升级script-ext-html-webpack-plugin到最新版本2.1.5</li>
-                <li>升级svg-sprite-loader到最新版本5.1.1</li>
-                <li>升级vue-template-compiler到最新版本2.6.12</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
-            <el-collapse-item title="v2.3.0 - 2020-11-20">
-              <ol>
-                <li>新增文件服务应用(支持本地、FastDFS)</li>
-                <li>优化头像样式,鼠标移入悬停遮罩</li>
-                <li>AjaxResult重写put方法,以方便链式调用</li>
-                <li>代码生成支持上传控件</li>
-                <li>新增图片上传组件</li>
-                <li>支持用户头像更新</li>
-                <li>调整默认首页</li>
-                <li>角色权限验证hasRole匹配改为equals</li>
-                <li>修正数组权限为空判断</li>
-                <li>修正注释选中节点和半选节点获取</li>
-                <li>升级pagehelper到最新版1.3.0</li>
-                <li>升级fastjson到最新版1.2.74</li>
-                <li>修正定时任务执行一次权限标识</li>
-                <li>修复页签关闭所有固定标签路由不刷新问题</li>
-                <li>表单构建布局型组件新增按钮</li>
-                <li>调整日志路径到模块目录</li>
-                <li>修正菜单提示信息错误</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
-            <el-collapse-item title="v2.2.0 - 2020-10-10">
-              <ol>
-                <li>移除 OAuth2 改为 Redis</li>
-                <li>升级SpringCloud到最新版本Hoxton.SR8</li>
-                <li>升级SpringCloud Alibaba到最新版本2.2.3</li>
-                <li>升级SpringBoot Admin到最新版本2.3.0</li>
-                <li>升级Fastjson到最新版1.2.73</li>
-                <li>新增在线用户会话管理</li>
-                <li>修改用户个人资料/密码同步缓存信息</li>
-                <li>修复前端通用导出方法参数传值请求方式问题</li>
-                <li>菜单新增是否缓存keep-alive</li>
-                <li>菜单&数据权限新增(展开/折叠 全选/全不选 父子联动)</li>
-                <li>Job与Gen模块增加Redis默认配置</li>
-                <li>新增表格右侧工具栏组件right-toolbar</li>
-                <li>代码生成支持同步数据库</li>
-                <li>代码生成支持富文本控件</li>
-                <li>代码生成树模板去掉多余双引号</li>
-                <li>代码生成添加select必填选项</li>
-                <li>代码生成页面时不忽略remark属性</li>
-                <li>修复代码生成下载路径错误</li>
-                <li>左侧菜单文字过长显示省略号</li>
-                <li>表格操作列间距调整</li>
-                <li>Excel注解支持自动统计数据总和</li>
-                <li>Excel注解支持设置BigDecimal精度&舍入规则</li>
-                <li>导入Excel整形值校验优化</li>
-                <li>导出Excel类型NUMERIC支持精度浮点类型</li>
-                <li>导出Excel调整targetAttr获取值方法,防止get方法不规范</li>
-                <li>Token续期调整为后端刷新</li>
-                <li>Token设置默认有效期时长12小时</li>
-                <li>网关白名单放入nacos配置&支持模糊匹配</li>
-                <li>修复富文本工具栏样式不对齐问题</li>
-                <li>Editor组件优化,支持自定义高度&图片冲突问题</li>
-                <li>
-                  修复富文本空格和缩进保存后不生效问题&删除重复的placeholder
+         </div>
+         <!-- 备忘录 -->
+         <el-col :sm="24" :lg="24" >
+           <div class="index_nav index_memoranduNnavTime">
+            <div class="index_navTime ">
+              <p class="index_navTimep">
+                <span>日程</span>
+                <span><i class="el-icon-date"></i>创建日程</span>
+              </p>
+              <ul >
+                <li v-for="(index,item) in 6" :key="index">
+                  <p>今日的工作安排</p>
+                  <span>01-24</span>
                 </li>
-                <li>限制系统内置参数不允许删除</li>
-                <li>修正调用目标字符串最大长度</li>
-                <li>修改自定义权限实现</li>
-                <li>优化递归菜单&部门子节点</li>
-                <li>修改sass为node-sass,避免el-icon图标乱码</li>
-                <li>修复根节点为子部门时,树状结构显示问题</li>
-                <li>全局异常状态汉化拦截处理</li>
-                <li>唯一限制条件只返回单条数据</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
 
-            <el-collapse-item title="v2.1.0 - 2020-08-02">
-              <ol>
-                <li>表格工具栏右侧添加刷新&显隐查询栏</li>
-                <li>OAuth自动刷新续签Token</li>
-                <li>网关支持黑名单配置</li>
-                <li>权限配置自动注册</li>
-                <li>Feign配置自动注册</li>
-                <li>代码生成支持选择上级菜单</li>
-                <li>代码生成支持复选框</li>
-                <li>代码生成支持自定义路径</li>
-                <li>验证码类型支持(数组计算、字符验证)</li>
-                <li>Excel支持sort导出排序</li>
-                <li>Excel支持分割字符串组内容</li>
-                <li>excel 导入数字不需要格式化 ,导入允许列和属性个数不一致</li>
-                <li>新增菜单默认主类目</li>
-                <li>升级vue-cli版本到4.4.4</li>
-                <li>修改 node-sass 为 dart-sass</li>
-                <li>升级element-ui版本到2.13.2</li>
-                <li>删除babel,提高编译速度</li>
-                <li>修复验证码异常时network面板的中文会出现乱码问题</li>
-                <li>修复 utils/index.js 中不包含 parseTime 函数的 bug</li>
-                <li>优化selectDictLabel方法,数组迭代器换为some</li>
-                <li>修复客户端模式认证会出现错误</li>
-                <li>检查字符支持小数点&降级改成异常提醒</li>
-                <li>定时任务添加cron表达式验证</li>
-                <li>代码生成查询条件修正</li>
-                <li>修正角色管理导出权限权限字符</li>
-                <li>修正防止切换权限用户后登录出现404</li>
-                <li>终端设置安全码加密&更新缓存</li>
-                <li>修复头像上传成功二次打开无法改变裁剪框大小和位置问题</li>
-                <li>修复布局为small者mini用户表单显示错位问题</li>
-                <li>修复代码生成点击多次表修改数据不变化的问题</li>
-                <li>修复代码生成导入表结构出现异常页面不提醒问题</li>
-                <li>修复角色权限修改时已有权限未自动勾选异常</li>
-                <li>创建用户不允许选择系统管理员角色</li>
-                <li>添加全局异常处理(网关异常&业务异常)</li>
-                <li>修复终端查询Enter键搜索时是刷新页面而不是查询列表</li>
-                <li>删除job重复表单参数</li>
-                <li>代码生成浮点型改用BigDecimal</li>
-                <li>表单类型为Integer/Long设置整形默认值</li>
-                <li>修改用户管理复选框宽度,防止部分浏览器出现省略号</li>
-                <li>
-                  RedisCache中所有方法参数添加final,并优化list取出效率,添加其它常用redis方法
-                </li>
-                <li>修正定时任务日志权限字符</li>
-                <li>添加Jackson时区配置</li>
-                <li>代码生成相关问题修复</li>
-                <li>自定义oauth2返回异常信息</li>
-                <li>升级nacos到最新版1.3.0 全新内核构建</li>
-                <li>修正【代码生成】功能无法下载的问题</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
+              </ul>
+              <img src="../assets/images/icon_more.png" alt="">
+<!--              <el-calendar v-model="value">
+              </el-calendar> -->
+
+              <img src="../assets/images/pic_kpbg.png" alt="" class="index_navTimeimg">
+            </div>
+           </div>
+         </el-col >
+         <!-- 通讯录 -->
+         <el-col :sm="24" :lg="24">
+           <div class="index_nav index_memoranduMail">
+                       <div class="index_navTime ">
+                         <p class="index_navTimep">
+                           <span>通讯录</span>
+                           <img src="../assets/images/icon_more.png" alt="" class="index_navTimeimgtwo">
+                           <!-- <span><i class="el-icon-date"></i>创建日程</span> -->
+                         </p>
+                        <div class="index_memoranduMailnav">
+                          <el-table :data="tableData" style="width: 100%;margin-top: 10px;"  :stripe="true"  >
+                                  <!-- <el-table-column type="selection" width="55" align="center" /> -->
+                                  <!-- <el-table-column label="序号" align="center" prop="noticeId" width="60" height="53" max-height="53" /> -->
+                                 <el-table-column
+                                   label="申请人"
+                                   align="center"
+                                   prop="name"
+                                   :show-overflow-tooltip="true"
+                                   style="height: 38px;"
+                                 />
+                                 <el-table-column
+                                   label="部门"
+                                   align="center"
+                                   prop="name"
+                                   :formatter="typeFormat"
+                                   style="height: 38px;"
+                                 />
+                                 <el-table-column
+                                   label="请假类型"
+                                   align="center"
+                                   prop="status"
+                                   :formatter="statusFormat"
+                                   style="height: 38px;"
+                                 />
+
+                                </el-table>
+                          <div class="index_haderPagin index_haderPaginfoiu">
+                            <el-pagination
+                                 @size-change="handleSizeChange"
+                                 @current-change="handleCurrentChange"
+                                 :current-page.sync="currentPage3"
+                                 :page-size="pageSize"
+                                 :small= "true"
+                                 layout="prev, pager, next, jumper"
+                                 :total="1000">
+                            </el-pagination>
+                          </div>
+                        </div>
+                      <img src="../assets/images/pic_kpbg.png" alt="" class="index_navTimeimg">
+                       </div>
+            </div>
+         </el-col>
+
 
-            <el-collapse-item title="v2.0.0 - 2019-12-02">
-              <ol>
-                <li>新增代码生成</li>
-                <li>新增@RepeatSubmit注解,防止重复提交</li>
-                <li>新增菜单主目录添加/删除操作</li>
-                <li>日志记录过滤特殊对象,防止转换异常</li>
-                <li>修改代码生成路由脚本错误</li>
-                <li>用户上传头像实时同步缓存,无需重新登录</li>
-                <li>调整切换页签后不重新加载数据</li>
-                <li>添加jsencrypt实现参数的前端加密</li>
-                <li>系统退出删除用户缓存记录</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
-            <el-collapse-item title="v2.0.0 - 2020-06-10">
-              <ol>
-                <li>使用Sentinel代替Hystrix</li>
-                <li>菜单新增终端管理配置</li>
-                <li>菜单新增Nacos&Sentinel控制台</li>
-                <li>代码生成适配Cloud</li>
-                <li>记录登录退出日志信息</li>
-                <li>网关验证码过滤器添加放行校验</li>
-                <li>个性化的定制自动加载类</li>
-                <li>定时任务调整label-width,防止部署出现错位</li>
-                <li>调整表头固定列默认样式</li>
-                <li>代码生成模板调整,字段为String并且必填则加空串条件</li>
-                <li>代码生成字典Integer/Long使用parseInt</li>
-                <li>修复退出登录重定向到登录页,登录后参数丢失。</li>
-                <li>修正岗位导出权限注解</li>
-                <li>修复首页搜索菜单外链无法点击跳转问题</li>
-                <li>修复菜单管理选择图标,backspace删除时不过滤数据</li>
-                <li>用户管理部门分支节点不可检查&显示计数</li>
-                <li>数据范围过滤属性调整</li>
-                <li>字典管理添加缓存读取</li>
-                <li>参数管理支持缓存操作</li>
-                <li>升级fastjson到最新版1.2.70 修复高危安全漏洞</li>
-                <li>dev启动默认打开浏览器</li>
-                <li>使用vue-cli默认source-map</li>
-                <li>slidebar eslint报错优化</li>
-                <li>当tags-view滚动关闭右键菜单</li>
-                <li>支持一级菜单(和主页同级)在main区域显示</li>
-                <li>限制外链地址必须以http(s)😕/开头</li>
-                <li>tagview & sidebar 主题颜色与element ui(全局)同步</li>
-                <li>
-                  修复dict_sort不可update为0的问题&查询返回增加dict_sort升序排序
-                </li>
-                <li>权限部分代码调整</li>
-                <li>其他细节优化</li>
-              </ol>
-            </el-collapse-item>
-            <el-collapse-item title="v1.0.0 - 2020-05-20">
-              <ol>
-                <li>若依微服务系统正式发布</li>
-              </ol>
-            </el-collapse-item>
-          </el-collapse>
-        </el-card>
-      </el-col>
-      <el-col :xs="24" :sm="24" :md="12" :lg="8">
-        <el-card class="update-log">
-          <div slot="header" class="clearfix">
-            <span>捐赠支持</span>
-          </div>
-          <div class="body">
-            <img
-              src="https://oscimg.oschina.net/oscnet/up-d6695f82666e5018f715c41cb7ee60d3b73.png"
-              alt="donate"
-              width="100%"
-            />
-            <span style="display: inline-block; height: 30px; line-height: 30px"
-              >你可以请作者喝杯咖啡表示鼓励</span
-            >
-          </div>
-        </el-card>
       </el-col>
     </el-row>
+    <!-- <el-divider /> -->
+
   </div>
 </template>
 
@@ -453,77 +270,395 @@ export default {
     return {
       // 版本号
       version: "2.5.0",
+       currentPage3: 1,
+       pageSize:10,
+       activeName: 'second',
+        value: new Date(),
+        editableTabs: [{
+                 title: 'Tab 1',
+                 name: '1',
+                 content: 'Tab 1 content'
+               }, {
+                 title: 'Tab 2',
+                 name: '2',
+                 content: 'Tab 2 content'
+               }],
+      num:0
     };
   },
   methods: {
     goTarget(href) {
       window.open(href, "_blank");
     },
+     handleSizeChange(val) {
+            console.log(`每页 ${val} 条`);
+      },
+    handleCurrentChange(val) {
+            console.log(`当前页: ${val}`);
+      },
+    handleClick(tab, event) {
+              console.log(tab, event);
+      },
+      // tab点击
+    tabSbu(index){
+     this.num = index
+    }
   },
 };
 </script>
 
+<style lang="scss">
+  .home{
+    .el-tabs__header{
+     margin-bottom: 5px !important;
+    }
+    .el-calendar-table tr td:first-child{
+      border: 0 !important;
+    }
+    .el-calendar-table tr:first-child td{
+      border: 0 !important;
+    }
+    .el-calendar-table td{
+      border: 0 !important;
+    }
+    .el-calendar-table .el-calendar-day{
+      height: 30px;
+      text-align: center;
+      line-height: 30px;
+      border-radius: 30px;
+      padding: 0;
+      // background-color: #0B18E8;
+    }
+    .el-calendar-table td.is-selected{
+      // background-color: #0B18E8;
+       border-radius: 30px;
+    }
+    .el-calendar__header{
+      border: 0;
+      padding: 0 20px;
+    }
+    .el-calendar__body{
+      padding-top: 0;
+      padding-bottom: 0;
+    }
+    .el-pagination{
+      padding-left: 0;
+    }
+    .index_headeNav{
+      .el-tabs__item{
+        position: relative;
+      }
+    }
+    .el-table th.is-leaf, .el-table td{
+       border: 0 !important;
+    }
+    .el-calendar__title{
+      font-size: 12px;
+    }
+     .el-table td{
+       padding:  6px 0;
+     }
+     .index_haderPaginfoiu{
+       .el-pagination__jump{
+         display: block !important;
+         text-align: center;
+         margin-left: 0;
+       }
+     }
+
+  }
+</style>
+
+
 <style scoped lang="scss">
 .home {
+  // tab
+  .index_headetab{
+    display: flex;
+    border-bottom: 1px solid #E5E5E5;
+    height: 53px;
+    padding-top: 10px;
+    padding-bottom: 10px;
+   span{
+     width: 70px;
+     text-align: center;
+     line-height: 43px;
+     height: 43px;
+     font-size: 15px;
+     font-family: PingFang SC;
+     font-weight: bold;
+     color: #666;
+     position: relative;
+     // flex: 1;
+     // border-bottom: ;
+   }
+   .span{
+     content: '';
+     display: block;
+     width: 18px;
+     height: 8px;
+     border-radius: 3px;
+     background-color: #3C8DBC;
+     color: #3C8DBC !important;
+     // position: absolute;
+     // border-bottom: ;
+   }
+  .spanto{
+    color:#3C8DBC ;
+    border-bottom: 3px solid #3C8DBC;
+  }
+  }
+  p{
+    margin: 0;
+
+  }
+  ul{
+    margin: 0;
+    padding: 0;
+  }
+  background-color: #eef0ff;
   blockquote {
     padding: 10px 20px;
     margin: 0 0 20px;
     font-size: 17.5px;
     border-left: 5px solid #eee;
   }
-  hr {
-    margin-top: 20px;
-    margin-bottom: 20px;
-    border: 0;
-    border-top: 1px solid #eee;
-  }
-  .col-item {
-    margin-bottom: 20px;
-  }
-
-  ul {
-    padding: 0;
-    margin: 0;
+  .index_heade{
+    // border: 1px solid #eee;
+    // width: 100%;
+    padding: 0 20px;
+    height: 386px;
+    background-color: #fff;
+    position: relative;
+    border-radius: 6px;
+    .index_headerImg{
+      width: 23px;
+      height: 6px;
+      position: absolute;
+      right: 20px;
+      top:25px;
+    }
+    .index_headerUl{
+      width: 100%;
+      padding: 0;
+      margin: 0;
+      li{
+        margin: 0;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 43px;
+        img{
+          width: 11px;
+          height: 13px;
+        }
+        p{
+          font-size: 14px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #343434;
+          line-height: 36px;
+          margin: 0;
+          text-align: left;
+          flex: 1;
+          padding: 0 18px;
+        }
+        span{
+          font-size: 14px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #343434;
+          line-height: 36px;
+        }
+      }
+    }
+    .index_haderPagin{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin-top: 30px;
+      span{
+        flex: 1;
+        font-size: 12px;
+        font-family: PingFang SC;
+        font-weight: 400;
+        color: #343434;
+        text-align: right;
+        // line-height: 36px;
+      }
+    }
   }
+  //表格样式
+  .index_headeNav{
+    padding: 0 20px;
+    height: 550px;
+    background-color: #fff;
+    position: relative;
+    border-radius: 6px;
+     .tab_i{
+       position: absolute;
+       right: 1px;
+       top:5px;
+       border-radius: 50%;
+     // display: block;
+     width: 15px ;
+     height: 15px;
+     line-height: 15px;
+     text-align: center;
+     color: #fff;
+     background-color: red;
+     overflow:hidden; //超出的文本隐藏
+     text-overflow:ellipsis; //溢出用省略号显示
+     white-space:nowrap; //溢出不换行
+     font-size: 11px;
+     font-family: PingFang SC;
+     font-weight: bold;
 
-  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 13px;
-  color: #676a6c;
-  overflow-x: hidden;
-
-  ul {
-    list-style-type: none;
+      }
   }
-
-  h4 {
-    margin-top: 0px;
+  .index_nav{
+    // border: 1px solid #eee;
+    background-color: #fff;
+    height: 315px;
+    box-shadow: 0px 4px 4px 0px rgba(130, 150, 162, 0.64);
+    border-radius: 6px;
+    .index_navTime{
+      height: 270px;
+      position: relative;
+    }
+    .index_navTimeimg{
+      height: 47px;
+      width: 100%;
+      position: absolute;
+      bottom: -76px;
+      left: 0;
+    }
+    .index_navTimep{
+      padding: 10px 0;
+      margin: 0 20px;
+      margin-bottom: 10px;
+      border-bottom: 1px solid #E5E5E5;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+       span:nth-child(1){
+         font-size: 15px;
+         font-family: PingFang SC;
+         font-weight: bold;
+         color: #3C8DBC;
+       }
+       span:nth-child(1)::before{
+          content: "";
+         display: block;
+         width: 18px;
+         height: 8px;
+         background: #3C8DBC;
+         border-radius: 3px;
+       }
+       span:nth-child(2){
+         font-size: 12px;
+         font-family: PingFang SC;
+         font-weight: 400;
+         color: #3C8DBC;
+       }
+    }
   }
-
-  h2 {
-    margin-top: 10px;
-    font-size: 26px;
-    font-weight: 100;
+  // 公司概况样式
+  .index_headeProfile{
+    margin-top: 20px;
+    margin-bottom: 20px;
+    height: 316px;
+    .index_profilep{
+      font-size: 12px;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #343434;
+      line-height: 27px;
+    }
+    .index_haderPagin{
+      margin-top: 25px;
+    }
+    .index_headerImg{
+      width: 21px;
+      height: 21px;
+      top:9px;
+    }
   }
+  // 备忘录样式
+  .index_memoranduNnavTime{
+    height: 335px;
+    margin-top: 90px;
+    position: relative;
+    .index_navTimep{
+      padding: 20px 0;
+      // margin-bottom: 20px;
+    }
+    .index_navTimeimg{
+      height: 47px;
+      width: 100%;
+      position: absolute;
+      bottom: -76px;
+      left: 0;
+      bottom: -96px;
+    }
+    img{
+      width: 23px;
+      height: 6px;
+      position: absolute;
+      right: 20px;
+      bottom: -50px;
+    }
+    ul{
+      padding: 0 20px;
+      li{
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        border-bottom: 1px dashed #E5E5E5;
+        p{
+          font-size: 12px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #343434;
+          line-height: 36px;
+          flex: 1;
+        }
+        span{
+          font-size: 12px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #343434;
+          line-height: 36px;
+        }
 
-  p {
-    margin-top: 10px;
-
-    b {
-      font-weight: 700;
+      }
     }
   }
-
-  .update-log {
-    ol {
-      display: block;
-      list-style-type: decimal;
-      margin-block-start: 1em;
-      margin-block-end: 1em;
-      margin-inline-start: 0;
-      margin-inline-end: 0;
-      padding-inline-start: 40px;
+  //通讯录样式
+  .index_memoranduMail{
+    height: 363px;
+    margin-top: 100px;
+    .index_navTimeimgtwo{
+      width: 23px;
+      height: 6px;
+    }
+    .index_navTimep{
+      padding: 20px 0;
+    }
+    .index_memoranduMailnav{
+      padding: 0 20px;
     }
+    .index_navTimeimg{
+      height: 47px;
+      width: 100%;
+      position: absolute;
+      bottom: -76px;
+      left: 0;
+      bottom: -126px;
+    }
+   .index_haderPagin{
+     margin-top: 10px;
+   }
   }
 }
 </style>
-