Explorar o código

Merge remote-tracking branch 'origin/master'

Administrator %!s(int64=4) %!d(string=hai) anos
pai
achega
89f95fd6e7

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

@@ -52,6 +52,13 @@ public class ObjectUtils {
         return input;
     }
 
+    public static Boolean requireNonNull(Boolean input, String... errorMsg) {
+        if (input == null) {
+            throw new IllegalArgumentException(errorMsg[0]);
+        }
+        return input;
+    }
+
     public static <T> T requireNonNull(T input, String... errorMsg) {
         if (input == null) {
             throw new IllegalArgumentException(errorMsg[0]);

+ 2 - 2
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/GenTableColumn.java

@@ -18,8 +18,8 @@ public class GenTableColumn extends BaseEntity
     /** 是查询字段 */
     public static final String IS_QUERY = "1";
 
-    /** 是列表展示字段 */
-    public static final String IS_LIST = "1";
+    /** 主键 */
+    public static final String IS_PK = "1";
 
     /** 编号 */
     private Long columnId;

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

@@ -1,7 +1,7 @@
 package com.boman.web.core.controller;
 
 import com.boman.common.core.web.domain.AjaxResult;
-import com.boman.web.core.domain.BaseTableDTO;
+import com.boman.web.core.domain.FormDataDto;
 import com.boman.web.core.service.common.ICommonService;
 import org.springframework.web.bind.annotation.*;
 
@@ -38,7 +38,7 @@ public class CommonController {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     @PostMapping
-    public AjaxResult getByMap(@RequestBody BaseTableDTO dto) {
+    public AjaxResult getByMap(@RequestBody FormDataDto dto) {
         return AjaxResult.success(commonService.getByMap(dto.getTable(), dto.getFixedData()));
     }
 

+ 19 - 19
boman-web-core/src/main/java/com/boman/web/core/controller/ObjController.java

@@ -2,7 +2,7 @@ package com.boman.web.core.controller;
 
 import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.gen.controller.MyController;
-import com.boman.web.core.domain.BaseTableSaveDTO;
+import com.boman.web.core.domain.FormDataDto;
 import com.boman.web.core.service.TableServiceCmdService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,13 +38,13 @@ public class ObjController {
      *                    }
      *                }
      *
-     * @param baseTableSaveDTO 前台传过来的dto
+     * @param formDataDto 前台传过来的dto
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     @ApiOperation(value = "单对象保存")
     @PostMapping("/objectSave")
-    public AjaxResult objectSave(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
-        return tableServiceCmdService.objectSave(baseTableSaveDTO);
+    public AjaxResult objectSave(@RequestBody FormDataDto formDataDto) {
+        return tableServiceCmdService.objectSave(formDataDto);
     }
 
     /**
@@ -59,13 +59,13 @@ public class ObjController {
      *
      *
      *
-     * @param baseTableSaveDTO 前台传过来的dto
+     * @param formDataDto 前台传过来的dto
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     @ApiOperation(value = "单对象删除")
     @PostMapping("/objectDelete")
-    public AjaxResult objectDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
-        return tableServiceCmdService.objectDelete(baseTableSaveDTO);
+    public AjaxResult objectDelete(@RequestBody FormDataDto formDataDto) {
+        return tableServiceCmdService.objectDelete(formDataDto);
     }
 
     /**
@@ -81,13 +81,13 @@ public class ObjController {
      *                           ]
      *                       }
      *
-     * @param baseTableSaveDTO 前台传过来的dto
+     * @param formDataDto 前台传过来的dto
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     @ApiOperation(value = "单对象逻辑删除")
     @PostMapping("/objectLogicDelete")
-    public AjaxResult objectLogicDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
-        return tableServiceCmdService.objectLogicDelete(baseTableSaveDTO);
+    public AjaxResult objectLogicDelete(@RequestBody FormDataDto formDataDto) {
+        return tableServiceCmdService.objectLogicDelete(formDataDto);
     }
 
     /**
@@ -103,7 +103,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取单表单数据")
     @PostMapping("/getObject")
-    public AjaxResult getObject(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getObject(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.getObject(condition);
     }
 
@@ -130,7 +130,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单列表数据")
     @PostMapping("/queryList")
-    public AjaxResult queryList(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult queryList(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.queryList(condition);
     }
 
@@ -148,7 +148,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单查询字段和按钮")
     @PostMapping("/getTableQuery")
-    public AjaxResult getTableQuery(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getTableQuery(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.getTableQuery(condition);
     }
 
@@ -166,7 +166,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单查询字段")
     @PostMapping("/getQueryParam")
-    public AjaxResult getQueryParam(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getQueryParam(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.getQueryParam(condition);
     }
 
@@ -185,7 +185,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单表头")
     @PostMapping("/getTableHead")
-    public AjaxResult getTableHead(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getTableHead(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.getTableHead(condition);
     }
 
@@ -203,7 +203,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单按钮")
     @PostMapping("/getButton")
-    public AjaxResult getButton(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getButton(@RequestBody FormDataDto condition) {
         return AjaxResult.success( tableServiceCmdService.getButton(condition.getTable()));
     }
 
@@ -215,7 +215,7 @@ public class ObjController {
      */
     @ApiOperation(value = "获取表单子表")
     @PostMapping("/objectTab")
-    public AjaxResult objectTab(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult objectTab(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.objectTab(condition);
     }
 
@@ -237,7 +237,7 @@ public class ObjController {
      */
     @ApiOperation(value = "表单提交接口")
     @PostMapping("/objectSubmit")
-    public AjaxResult objectSubmit(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult objectSubmit(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.objectSubmit(condition, true);
     }
 
@@ -261,7 +261,7 @@ public class ObjController {
      */
     @ApiOperation(value = "反提交接口")
     @PostMapping("/objectUnSubmit")
-    public AjaxResult objectUnSubmit(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult objectUnSubmit(@RequestBody FormDataDto condition) {
         return tableServiceCmdService.objectSubmit(condition, false);
     }
 

+ 5 - 6
boman-web-core/src/main/java/com/boman/web/core/controller/TableController.java

@@ -2,7 +2,6 @@ package com.boman.web.core.controller;
 
 import com.boman.common.core.web.domain.AjaxResult;
 import com.boman.gen.domain.GenTable;
-import com.boman.web.core.domain.BaseTableSaveDTO;
 import com.boman.web.core.service.TableServiceCmdService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,11 +33,11 @@ public class TableController {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    @ApiOperation(value = "根据表名获取表单所有信息")
-    @PostMapping("/getByTableName")
-    public AjaxResult getByTableName(@RequestBody BaseTableSaveDTO condition) {
-        return tableServiceCmdService.getByTableName(condition);
-    }
+//    @ApiOperation(value = "根据表名获取表单所有信息")
+//    @PostMapping("/getByTableName")
+//    public AjaxResult getByTableName(@RequestBody BaseTableSaveDTO condition) {
+//        return tableServiceCmdService.getByTableName(condition);
+//    }
 
     /**
      * 功能描述: 根据表名获取表信息、表字段和表字段对应的字典值

+ 0 - 50
boman-web-core/src/main/java/com/boman/web/core/domain/BaseTableDTO.java

@@ -1,50 +0,0 @@
-package com.boman.web.core.domain;
-
-import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.annotation.JSONField;
-
-/**
- * @author shiqian
- * @description
- * @date 2021年03月22日 09:53
- **/
-public class BaseTableDTO {
-
-    @JSONField(name = "objId")
-    private Long objId;
-
-    @JSONField(name = "fixedData")
-    private JSONObject fixedData;
-
-    /**
-     * 前台传参中的表名
-     */
-    @JSONField(name = "table")
-    private String table;
-
-
-    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;
-    }
-
-}

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/BaseTableSaveDTO.java → boman-web-core/src/main/java/com/boman/web/core/domain/FormDataDto.java

@@ -14,7 +14,7 @@ import java.util.List;
  * @since:2018/12/27
  * @createat:2018/12/274:41 PM
  */
-public class BaseTableSaveDTO implements Serializable {
+public class FormDataDto implements Serializable {
 
     private static final long serialVersionUID = -8653990707913725671L;
     @JSONField(name = "objId")

+ 2 - 3
boman-web-core/src/main/java/com/boman/web/core/domain/TableContext.java

@@ -8,7 +8,6 @@ import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
 import com.boman.web.core.utils.IdUtils;
 
-import java.sql.Timestamp;
 import java.util.List;
 import java.util.Map;
 
@@ -31,7 +30,7 @@ public class TableContext {
     private JSONObject commitData;
     private List<GenTableColumn> columns;
 
-    public static TableContext createContext(BaseTableSaveDTO dto) {
+    public static TableContext createContext(FormDataDto dto) {
         TableContext context = new TableContext();
         context.setId(dto.getObjId());
         String tableName = requireNonNull(dto.getTable(), "tableName is empty");
@@ -58,7 +57,7 @@ public class TableContext {
 
     }
 
-    private static void packCommitData(BaseTableSaveDTO dto, TableContext context, List<GenTableColumn> columns
+    private static void packCommitData(FormDataDto dto, TableContext context, List<GenTableColumn> columns
             , JSONObject fixedData, JSONObject commitData) {
         boolean isInsert = ltZero(dto.getObjId());
         context.setActionType(isInsert ? ActionType.INSERT : ActionType.UPDATE);

+ 22 - 0
boman-web-core/src/main/java/com/boman/web/core/domain/ViewConst.java

@@ -0,0 +1,22 @@
+package com.boman.web.core.domain;
+
+/**
+ * @author shiqian
+ * @date 2021年04月20日 16:20
+ **/
+public class ViewConst {
+
+    public static final String VIEW_TYPE = "viewType";
+
+    /**  只有主表展示信息的模板  页面   **/
+   public static final String CRUD = "crud";
+
+    /**  上面展示主表信息、下面是列表  页面   **/
+   public static final String HEAD_TAB = "headTab";
+
+    /**  tab切换子表信息 页面    **/
+   public static final String ITEM_TAB = "itemTab";
+
+    /**  tree 页面    **/
+   public static final String TREE = "tree";
+}

+ 57 - 54
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -33,7 +33,6 @@ import com.boman.web.core.service.update.IBaseUpdateService;
 import com.boman.web.core.utils.IdUtils;
 import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.slf4j.Logger;
@@ -83,7 +82,7 @@ public class TableServiceCmdService {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
-    public final AjaxResult objectSave(BaseTableSaveDTO dto) {
+    public final AjaxResult objectSave(FormDataDto dto) {
         AjaxResult result = AjaxResult.success();
 
         TableContext context = TableContext.createContext(dto);
@@ -124,7 +123,7 @@ public class TableServiceCmdService {
      * @param dto 前台传过来的dto
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult objectDelete(BaseTableSaveDTO dto) {
+    public AjaxResult objectDelete(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requireNonNull(idArr);
@@ -151,7 +150,7 @@ public class TableServiceCmdService {
      * @param dto 前台传过来的dto
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult objectLogicDelete(BaseTableSaveDTO dto) {
+    public AjaxResult objectLogicDelete(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requireNonNull(idArr);
@@ -178,7 +177,7 @@ public class TableServiceCmdService {
      * @param dto condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult queryList(BaseTableSaveDTO dto) {
+    public AjaxResult queryList(FormDataDto dto) {
         requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
 
         // 拿到每个字段对应的查询类型,=、 like、 >、 <
@@ -208,12 +207,6 @@ public class TableServiceCmdService {
 
         List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
                 , showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
-        // 处理时间
-//        handlerDate(result, columns);
-        // 处理字典值
-//        handlerSysDictData(result, columns);
-        // 处理外键
-//        handlerForeignKey(result, columns);
 
         handler(result =  filter(result, ObjectUtils::isNotEmpty), columns);
         // 定制接口
@@ -317,7 +310,7 @@ public class TableServiceCmdService {
                 if (jsonObject.containsKey(column.getColumnName())) {
                     String value = jsonObject.getString(column.getColumnName());
                     JSONArray fileList = JSON.parseArray(value);
-                    ArrayList<SysFile> files = Lists.newArrayListWithCapacity(2);
+                    ArrayList<SysFile> files = Lists.newArrayListWithCapacity(fileList.size());
                     for (Object obj : fileList) {
                         JSONObject fileItem = (JSONObject) obj;
                         SysFile file = new SysFile();
@@ -378,18 +371,20 @@ public class TableServiceCmdService {
      * @param dto condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult getObject(BaseTableSaveDTO dto) {
+    public AjaxResult getObject(FormDataDto dto) {
         String tableName = requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
 
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
         String pkName = IdUtils.getPkName(genTable.getColumns());
         JSONObject fixedData = dto.getFixedData();
         Long id = fixedData.getLong(FormDataConstant.ID);
-        requireNonNull(id);
+        requireNonNull(id, "如果是回显,则传参为此行记录的id, 如为新增,则传-1,传null可不行");
+        Boolean isUi = requireNonNull(dto.getIsUi(), "未传isUi这个参数");
+
         List<GenTableColumn> columns = genTable.getColumns();
         // id = -1时,查询该表单对应的字段名称
         if (ltZero(id)) {
-            return getByTableName(tableName, columns);
+            return getByTableName(tableName, columns, isUi);
         }
 
         // 默认查所有字段,不支持自定义
@@ -506,7 +501,7 @@ public class TableServiceCmdService {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult getTableQuery(BaseTableSaveDTO condition) {
+    public AjaxResult getTableQuery(FormDataDto condition) {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
         List<GenTableColumn> columns = genTable.getColumns();
         JSONObject jsonObject = new JSONObject();
@@ -532,7 +527,7 @@ public class TableServiceCmdService {
         // genTable.getMenuRole() 暂时数据库没有数据,
         jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
 
-        // jsonObject.put(FormDataConstant.TABLE_HEAD_LIST, getTableHeadList(genTable));
+         jsonObject.put(ViewConst.VIEW_TYPE, genTable.getTplCategory());
         return AjaxResult.success(jsonObject);
     }
 
@@ -548,7 +543,7 @@ public class TableServiceCmdService {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult getQueryParam(BaseTableSaveDTO condition) {
+    public AjaxResult getQueryParam(FormDataDto condition) {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
         List<GenTableColumn> columns = genTable.getColumns();
         // 查询字段
@@ -578,7 +573,7 @@ public class TableServiceCmdService {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult getTableHead(BaseTableSaveDTO condition) {
+    public AjaxResult getTableHead(FormDataDto condition) {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
         return AjaxResult.success(getTableHeadList(genTable));
     }
@@ -613,7 +608,7 @@ public class TableServiceCmdService {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult objectTab(BaseTableSaveDTO condition) {
+    public AjaxResult objectTab(FormDataDto condition) {
         //获取到主表对象
         GenTable genTable = getTableFromRedisByTableName(RedisKey.RELATION, condition.getTable());
         //从主表对象的relationList中获取出所有子表表对象
@@ -654,7 +649,7 @@ public class TableServiceCmdService {
      * @param isSubmit  提交true, 反提交false
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult objectSubmit(BaseTableSaveDTO condition, boolean isSubmit) {
+    public AjaxResult objectSubmit(FormDataDto condition, boolean isSubmit) {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
         List<JSONObject> commitData = condition.getCommitData();
         requireNonNull(commitData, "啥都不提交, 调什么接口??");
@@ -797,47 +792,55 @@ public class TableServiceCmdService {
      * @param condition condition
      * @return com.boman.common.core.web.domain.AjaxResult
      */
-    public AjaxResult getByTableName(BaseTableSaveDTO condition) {
-        requireNonNull(condition.getTable(), "tableName = [" + condition.getTable() + "] 此表不存在");
-        requireNonNull(condition.getIsUi(), "根据表名获取表字段,未传 isUi 这个字段");
-        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
-        List<GenTableColumn> allColumns = genTable.getColumns();
-        // 把新增可见的列过滤出来
-//        List<GenTableColumn> returnData = ColumnUtils.filterNeedShowData(allColumns, 0, INSERT_VISIBLE::equals);
-        // 普通的展示,不带折叠的
-        if (BooleanUtils.isFalse(condition.getIsUi())) {
-            packDictDataToColumns(allColumns, ObjectUtils::isNotEmpty);
-            return AjaxResult.success(genTable);
-        } else {
-            // 带折叠的展示
-            return getByTableName(genTable.getTableName(), allColumns);
-        }
-    }
-
-    public AjaxResult getByTableName(String tableName, List<GenTableColumn> allColumns) {
+//    public AjaxResult getByTableName(BaseTableSaveDTO condition) {
+//        requireNonNull(condition.getTable(), "tableName = [" + condition.getTable() + "] 此表不存在");
+//        requireNonNull(condition.getIsUi(), "根据表名获取表字段,未传 isUi 这个字段");
+//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+//        List<GenTableColumn> allColumns = genTable.getColumns();
+//        // 把新增可见的列过滤出来
+////        List<GenTableColumn> returnData = ColumnUtils.filterNeedShowData(allColumns, 0, INSERT_VISIBLE::equals);
+//        // 普通的展示,不带折叠的
+//        if (BooleanUtils.isFalse(condition.getIsUi())) {
+//            packDictDataToColumns(allColumns, ObjectUtils::isNotEmpty);
+//            return AjaxResult.success(genTable);
+//        } else {
+//            // 带折叠的展示
+//            return getByTableName(genTable.getTableName(), allColumns, true);
+//        }
+//    }
+
+    public AjaxResult getByTableName(String tableName, List<GenTableColumn> allColumns, Boolean isUi) {
+        List<GenTableColumn> resultCols;
         List<GenTableColumn> parentColumns = GenUtils.filterHrAndSort(allColumns);
-//        List<GenTableColumn> parentColumns = filter(allColumns, col -> HR.equalsIgnoreCase(col.getHtmlType()));
-        allColumns = filterData(allColumns, 0, MaskConstant.LIST_VISIBLE::equals);
-
-        // 把孩子放入父亲的怀抱
-        for (GenTableColumn hrColumn : parentColumns) {
-            List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
-            for (GenTableColumn column : allColumns) {
-                if (hrColumn.getColumnId().equals(column.getHrParentId())) {
-                    children.add(column);
+        // 所有新增可见的列
+        allColumns = filterData(allColumns, 0, MaskConstant.INSERT_VISIBLE::equals);
+        // 带折叠
+        if (BooleanUtils.isTrue(isUi)) {
+            // 把孩子放入父亲的怀抱
+            for (GenTableColumn hrColumn : parentColumns) {
+                List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
+                for (GenTableColumn column : allColumns) {
+                    if (hrColumn.getColumnId().equals(column.getHrParentId())) {
+                        children.add(column);
+                    }
                 }
+                hrColumn.setHrChildren(children);
             }
-            hrColumn.setHrChildren(children);
-        }
 
-        // 把孩子对应的字典值放进去
-        for (GenTableColumn hrColumn : parentColumns) {
-            packDictDataToColumns(hrColumn.getHrChildren(), ObjectUtils::isNotEmpty);
+            // 把孩子对应的字典值放进去
+            for (GenTableColumn hrColumn : parentColumns) {
+                packDictDataToColumns(hrColumn.getHrChildren(), ObjectUtils::isNotEmpty);
+            }
+            resultCols = parentColumns;
+        } else {
+            // 不带折叠
+            packDictDataToColumns(allColumns, ObjectUtils::isNotEmpty);
+            resultCols = allColumns;
         }
 
         JSONObject result = new JSONObject();
         result.put(BUTTON_LIST, getButton(tableName));
-        result.put(SHOW_DATA, parentColumns);
+        result.put(SHOW_DATA, resultCols);
         return AjaxResult.success(result);
     }
 

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

@@ -46,7 +46,7 @@ public class IdUtils {
         }
 
         for (GenTableColumn tableColumn : columnList) {
-            if ("1".equalsIgnoreCase(tableColumn.getIsPk())) {
+            if (GenTableColumn.IS_PK.equalsIgnoreCase(tableColumn.getIsPk())) {
                 return requireNonNull(tableColumn.getColumnName(), "主键名称为空");
             }
         }

+ 24 - 1
ruoyi-ui/src/api/system/config.js

@@ -70,9 +70,17 @@ export function listIndexfou(data) {
     data: data
   })
 }
+// export function listIndextanl(data) {
+//   return request({
+//     url: '/boman-web-core/p/cs/table/getByTableName',
+//     method: 'post',
+//     data: data
+//   })
+// }
+
 export function listIndextanl(data) {
   return request({
-    url: '/boman-web-core/p/cs/table/getByTableName',
+    url: '/boman-web-core/p/cs/getObject',
     method: 'post',
     data: data
   })
@@ -94,6 +102,14 @@ export function delConfig(id) {
   })
 }
 
+export function delIndexnabd(data) {
+  return request({
+    url: 'boman-web-core/p/cs/objectDelete',
+    method: 'POST',
+    data
+  })
+}
+
 // 清理参数缓存
 export function clearCache() {
   return request({
@@ -101,3 +117,10 @@ export function clearCache() {
     method: 'delete'
   })
 }
+// 查询用户个人信息
+export function getUserProfile() {
+  return request({
+    url: '/system/user/profile',
+    method: 'get'
+  })
+}

BIN=BIN
ruoyi-ui/src/assets/images/deletety.png


+ 1 - 1
ruoyi-ui/src/settings.js

@@ -4,7 +4,7 @@ module.exports = {
   urls: `http://192.168.101.110:8090`,
   // urls: `http://192.168.101.49:8080`,
 
-  // urls: `http://192.168.101.10:8080`,
+  // urls: ``,
 
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light

+ 144 - 85
ruoyi-ui/src/views/index.vue

@@ -7,7 +7,7 @@
           <p class="index_headetab">
             <span :class="[num == index ? ' spanto' : '']" v-for="(item,index) in editableTabs" :key="index" @click="tabSbu(item.dictValue)">{{item.dictLabel}}</span>
           </p>
-                <div >
+                <div style="height: 80%;">
                   <ul class="index_headerUl">
                     <li v-for="(item,index) in configList" :key="index">
                         <img src="../assets/images/icon_list_sj.png" alt="">
@@ -30,18 +30,15 @@
                 </div>
         </div>
         <!-- 列表 -->
-          <el-col :sm="24" :lg="24"  style="margin-top: 20px;">
-               <div class="index_heade index_headeNav">
+          <!-- <el-col :sm="24" :lg="24"  style="margin-top: 20px;" >
+               <div class="index_heade index_headeNav" v-show="true">
                  <img src="../assets/images/icon_more.png" alt="" class="index_headerImg">
                  <p class="index_headetab">
                    <span :class="[numlist == index ? ' spanto' : '']" v-for="(item,index) in attendance" :key="index" @click="tabList(index)">{{item}} <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="tableDataalid" 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="申请人"
@@ -57,7 +54,6 @@
 
                                     width="70"
                                   />
-                                  <!-- :formatter="typeFormat" -->
                                   <el-table-column
                                     label="请假类型"
                                     align="center"
@@ -65,13 +61,8 @@
 
                                     width="75"
                                   />
-                                  <!-- :formatter="statusFormat" -->
                                   <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
@@ -108,7 +99,7 @@
                            </div>
                          </div>
                </div>
-          </el-col>
+          </el-col> -->
         <!-- </el-row> -->
         <!-- 公司概况 -->
         <el-col :sm="24" :lg="24">
@@ -119,10 +110,11 @@
             </p>
             <!-- <el-tabs v-model="activeName" @tab-click="handleClick">
                  <el-tab-pane label="用户管理" name="first"> -->
-                   <div >
-                     <h3 style="text-align: center;">{{tieku}}</h3>
-                     <!-- {{getLisprofileone[0].info_title}} -->
-                                      <p class="index_profilep" > {{comg}}	</p>
+                   <div style="height: 67%;">
+                        <div style="height: 80%;">
+                          <h3 style="text-align: center;">{{tieku}}</h3>
+                                        <p class="index_profilep" > {{comg}}	</p>
+                        </div>
                                       <!-- {{getLisprofileone[0].info_content}} -->
                                       <div class="index_haderPagin">
                                         <el-pagination
@@ -178,14 +170,19 @@
                 <span @click="memoere"><i class="el-icon-date"></i>创建备忘录</span>
               </p>
               <ul >
-                <li v-for="(item,index) in getmemorandum" :key="index">
+                <li v-for="(item,index) in getmemorandum" :key="index" @click="index_deledetfe(item.id)">
                   <p>{{item.memorandum_title}}
                   </p>
-                  <span>{{item.remind_time}}</span>
+                  <div class="index_navspande">
+                    <span>
+                    {{item.remind_time}}
+                    </span>
+                    <img src="../assets/images/deletety.png" alt="">
+                  </div>
                 </li>
 
               </ul>
-              <img src="../assets/images/icon_more.png" alt="">
+              <img src="../assets/images/icon_more.png" alt="" class="imjud">
 <!--              <el-calendar v-model="value">
               </el-calendar> -->
 
@@ -205,18 +202,8 @@
                         <div class="index_memoranduMailnav">
                            <div class="tab_tol">
                              <el-table stripe v-loading="loading" :data="postList.rows" @selection-change="handleSelectionChange">
-                               <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in postList.tableHeadList" :key="index" />
+                               <el-table-column :label="item.columnComment" align="center" :prop="item.columnName" v-for="(item,index) in postList.tableHeadList" :key="index" width="75px" />
                              </el-table>
-                          	<!-- <tr class="tr_one">
-                          		<th style=" text-align: center;" v-for="(item,index) in tableDataalid" :key="index">{{item.columnComment}}</th>
-                          	</tr>
-                          		<tr v-for="(item,index) in getLisaillie" :key="index" :class=" [index%2  ==0 ? 'two_tr two_trtwo':'two_tr']" @click="chakn(item)">
-                          			<td style=" text-align: center;" >{{ item.contacts_name }}</td>
-                          			<td style="text-align: center;">{{ item.dept_id  }}</td>
-                          			<td style=" text-align: center;" >{{ item.phone }}</td>
-                          			<td style=" text-align: center;" >{{ item.is_del == 1? '删除' :  '未删除'}}</td>
-                          			<td style="text-align: center; " >{{ item.remark}}</td>
-                          		</tr> -->
                            </div>
                           <div class="index_haderPagin index_haderPaginfoiu">
                             <el-pagination
@@ -244,7 +231,7 @@
            <el-form ref="form" :model="form" :rules="rules" label-width="160px" class="from_index">
              <el-row>
                <el-col :span="24" >
-                <dynamic-forms   :ref="item.columnName" :config="form.fixedData" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.columns" :key='index' />
+                <dynamic-forms   :ref="item.columnName" :config="form.fixedData" @inputs = "changeFn" :formConfig="item" v-for="(item,index) in queryData.showData" :key='index' />
                </el-col>
              </el-row>
            </el-form>
@@ -266,7 +253,7 @@
 </template>
 
 <script>
-import { listIndex, listIndextwo, listIndextherr, listIndexfou, listIndextanl, getConfig, delConfig, addConfig, addConfigindex, updateConfig, clearCache } from "@/api/system/config";
+import { listIndex, getUserProfile, listIndextwo, listIndextherr, listIndexfou, listIndextanl, getConfig, delConfig, addConfig, addConfigindex, updateConfig, clearCache, delIndexnabd } from "@/api/system/config";
 import Editor from '@/components/Editor';
 export default {
   name: "index",
@@ -297,9 +284,12 @@ export default {
         orderBy:'create_time desc',
         pageNo:1,
         pageSize:6,
-        condition:{
-          notice_type:1
+        fixedData:{
+          condition:{
+            notice_type:1
+          }
         }
+
       },
       queryParamstab:{
         table:'sys_notice',
@@ -316,9 +306,12 @@ export default {
         orderBy:'create_time desc',
         pageNo:1,
         pageSize:1,
-        condition:{
-          notice_type:1
+        fixedData:{
+          condition:{
+            info_type:1
+          }
         }
+
       },
       // 日历
       queryParamscalendar:{
@@ -326,6 +319,11 @@ export default {
         orderBy:'create_time desc',
         pageNo:1,
         pageSize:10,
+        fixedData:{
+          condition:{
+            create_by:''
+          }
+        }
       },
       // 备忘录
       queryParamstabmemorandum:{
@@ -333,6 +331,11 @@ export default {
         orderBy:'create_time desc',
         pageNo:1,
         pageSize:6,
+        fixedData:{
+          condition:{
+            create_by:''
+          }
+        }
       },
       // 通讯录
       queryParamsail:{
@@ -376,12 +379,19 @@ export default {
       //日历弹框
       calendaradd:{
         table:'sys_schedule',
-        isUi:false
+        isUi:false,
+        fixedData:{
+          id:-1
+        }
+
       },
       //备忘录弹框
       calendaraddmer:{
         table:'sys_memorandum',
-        isUi:false
+        isUi:false,
+        fixedData:{
+          id:-1
+        }
       },
       // input
       inputList:[],
@@ -406,24 +416,35 @@ export default {
       truew:[],
       fales:[],
       postList:{},
-      arr:'2,2,3,3,4,4'
+      arr:'2,2,3,3,4,4',
+      // 删除参数
+      deledlid:{
+        table:'sys_memorandum',
+        idList:[],
+        user: {
+          oldPassword: undefined,
+          newPassword: undefined,
+          confirmPassword: undefined
+        },
+      }
     };
   },
 
   created() {
+    // console.log(this.user)
     this.unique(this.arr)
-    this.getLisalendar()//日历
     this.getList()
     this.getListtab()
     this.getLiser()
     this.getLisprofile()
-    this.getLismemorandum()  //备忘录
+    // 用户信息
+    this.getUser()
+    // this.getLismemorandum()  //备忘录
     this.getLisail()//通讯录
     this.getLisailtwo()
 
   },
   computed: {
-
      // 时间高亮的数组
      brightDate () {
        // let ary = []
@@ -445,9 +466,7 @@ export default {
            // that.ary = that.calendarData[i].all_date
            // console.log(that.calendarData[i].all_date.join(','),754)
          }
-         // console.log(that.calendarData[i].all_date,754)
        }
-       // console.log( that.rjtu,7545)
        console.log(that.ary)
        return that.ary
      }
@@ -570,8 +589,13 @@ export default {
     //数据  第一部分列表
     getList() {
       this.loading = true;
+      this.configList = []
       listIndex(this.queryParams).then(response => {
-          this.configList = response.data.rows;
+          if(response.data.rows !== null){
+            this.configList = response.data.rows;
+          }else {
+            this.configList.push({notice_title: "暂无数据"});
+          }
           console.log(this.configList)
           this.total = response.data.total;
           this.loading = false;
@@ -595,8 +619,14 @@ export default {
       listIndex(this.queryParamstabprofile).then(response => {
           if(response.data !== undefined){
             this.getLisprofileone = response.data.rows;
-            this.tieku = this.getLisprofileone[0].info_title
-            this.comg = this.getLisprofileone[0].info_content
+            if(response.data.rows !== null){
+              this.tieku = this.getLisprofileone[0].info_title
+              this.comg = this.getLisprofileone[0].info_content
+            }else {
+              this.tieku = '暂无数据'
+              this.comg = '暂无数据'
+            }
+
             console.log(this.getLisprofileone[0].info_title,98)
             this.totalprofile = response.data.total;
           }
@@ -607,6 +637,7 @@ export default {
     //数据  日历数据列表
     getLisalendar() {
       this.loading = true;
+      this.queryParamscalendar.fixedData.condition.create_by = this.user.userName
       listIndex(this.queryParamscalendar).then(response => {
           if(response.data !== undefined){
             this.calendarData = response.data.rows;
@@ -619,9 +650,15 @@ export default {
     //数据  备忘录数据列表
     getLismemorandum() {
       this.loading = true;
+      this.getmemorandum = []
+      this.queryParamstabmemorandum.fixedData.condition.create_by = this.user.userName
       listIndex(this.queryParamstabmemorandum).then(response => {
           if(response.data !== undefined){
-            this.getmemorandum = response.data.rows;
+            if(response.data.rows !== null){
+              this.getmemorandum = response.data.rows;
+            }else{
+              this.getmemorandum.push({memorandum_title:'暂无数据'})
+            }
             console.log(this.getmemorandum,98765)
           }
           this.loading = false;
@@ -671,6 +708,9 @@ export default {
          if(response.data !== undefined){
            this.tableDataalid = response.data.tableHeadList;
            this.postList = response.data
+           this.postList.rows.filter(route => {
+             route.dept_id = route.dept_id.value
+           })
            console.log(this.tableDataalid,67)
            this.totalprofile = response.data.total;
          }
@@ -685,18 +725,6 @@ export default {
      listIndextanl(this.calendaradd).then(response => {
          if(response.data !== undefined){
            this.queryData = response.data
-           this.queryData.columns.filter(route => {
-             // console.log(route)
-             if(route.htmlType == "input" || route.htmlType == 'textarea'){
-               this.inputList.push(route)
-             }else if(route.htmlType == "select"){
-               this.selectList.push(route)
-             }else if(route.htmlType == "datetime"){
-               this.dataList.push(route)
-             }else if(route.htmlType == "editor"){
-               this.editorList.push(route)
-             }
-         })
         // console.log(this.selectList)
 
          }
@@ -711,20 +739,7 @@ export default {
      listIndextanl(this.calendaraddmer).then(response => {
          if(response.data !== undefined){
            this.queryData = response.data
-           this.queryData.columns.filter(route => {
-             // console.log(route)
-             if(route.htmlType == "input" || route.htmlType == 'textarea'){
-               this.inputList.push(route)
-             }else if(route.htmlType == "select"){
-               this.selectList.push(route)
-             }else if(route.htmlType == "datetime"){
-               this.dataList.push(route)
-             }else if(route.htmlType == "editor"){
-               this.editorList.push(route)
-             }
-         })
         // console.log(this.selectList)
-
          }
          this.loading = false;
        }
@@ -766,7 +781,7 @@ export default {
     tabSbu(index){
       console.log(index)
      this.num = index - 1
-     this.queryParams.condition.notice_type = index
+     this.queryParams.fixedData.condition.notice_type = index
      this.getList()
     },
     // 第二部分tab点击numlist
@@ -776,7 +791,7 @@ export default {
     // 第三部分tab点击
     tabSbuprofile(index){
       this.numprofile = index - 1
-      this.queryParamstabprofile.condition.notice_type = index
+      this.queryParamstabprofile.fixedData.condition.info_type = index
       this.getLisprofile()
     },
     // 表单重置
@@ -799,7 +814,7 @@ export default {
       }
       this.getLisalendaraddd()
       this.open = true;
-      this.title = "添加日";
+      this.title = "添加日";
     },
     /** 提交按钮操作 */
     handleQuery() {
@@ -859,6 +874,25 @@ export default {
      this.title = "添加备忘录";
      this.getLisalendaradddmer()
     },
+    // 备忘录删除
+    index_deledetfe(id){
+      var that =  this
+      that.deledlid.idList = []
+      that.deledlid.idList.push(id)
+
+     this.$confirm('是否确认删除名称为"' + id + '"的数据项?', "警告", {
+         confirmButtonText: "确定",
+         cancelButtonText: "取消",
+         type: "warning"
+       }).then(function() {
+         return delIndexnabd(that.deledlid);
+       }).then(() => {
+         this.getLismemorandum();
+         this.msgSuccess("删除成功");
+         // this.$router.go(-1)
+       })
+    },
+
     handleSelectionChange() {
 
     },
@@ -876,6 +910,14 @@ export default {
      // const res = new Map();
      // console.log(arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1)))
      // return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
+    },
+    getUser() {
+      getUserProfile().then(response => {
+        this.user = response.data;
+        this.getLisalendar()
+        this.getLismemorandum()
+       console.log(this.user,97653)
+      });
     }
   },
 };
@@ -1025,6 +1067,7 @@ export default {
       width: 100%;
       padding: 0;
       margin: 0;
+      height: 85%;
       li{
         margin: 0;
         display: flex;
@@ -1152,6 +1195,7 @@ export default {
     margin-bottom: 20px;
     height: 316px;
     .index_profilep{
+
       font-size: 12px;
       font-family: PingFang SC;
       font-weight: bold;
@@ -1184,7 +1228,7 @@ export default {
       left: 0;
       bottom: -96px;
     }
-    img{
+    .imjud{
       width: 23px;
       height: 6px;
       position: absolute;
@@ -1206,12 +1250,25 @@ export default {
           line-height: 36px;
           flex: 1;
         }
-        span{
-          font-size: 12px;
-          font-family: PingFang SC;
-          font-weight: 400;
-          color: #343434;
-          line-height: 36px;
+        .index_navspande{
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          span{
+            font-size: 12px;
+            font-family: PingFang SC;
+            font-weight: 400;
+            color: #343434;
+            line-height: 36px;
+            flex: 1;
+          }
+          img{
+            width: 16px;
+            height: 16px;
+            margin-left: 5px;
+            cursor: pointer;
+          }
+
         }
 
       }
@@ -1230,6 +1287,7 @@ export default {
     }
     .index_memoranduMailnav{
       padding: 0 20px;
+      height: 90%;
     }
     .index_navTimeimg{
       height: 47px;
@@ -1248,6 +1306,7 @@ export default {
 // table
 .tab_tol{
   // display: flex;
+  height: 80%;
   .tr_one{
     display: flex;
     justify-content: space-around;

+ 29 - 15
ruoyi-ui/src/views/system/surface/index.vue

@@ -130,17 +130,38 @@
       this.getList();
     },
     methods: {
+      routerFn(id,tables) {
+        if(this.queryData.viewType == 'crud'){
+          this.$router.push({
+            path: '/business/table',
+            query: {
+              id,
+              tables,
+            },
+          })
+        }else if(this.queryData.viewType == 'headTab') {
+          this.$router.push({
+            path: '/business/editing',
+            query: {
+              id,
+              tables,
+            },
+          })
+        }else if(this.queryData.viewType == 'itemTab'){
+          this.$router.push({
+            path: '/business/form',
+            query: {
+              id,
+              tables,
+            },
+          })
+        }
+      },
       headerBtn(item) {
         switch (item) {
           case 'A':
             {
-              this.$router.push({
-                path: '/business/table',
-                query: {
-                  id: -1,
-                  tables: this.tabName,
-                },
-              })
+              this.routerFn(-1,this.tabName)
               return
             }
           case 'M':
@@ -150,14 +171,7 @@
                 return
               }
               const id = this.ids.join(',')
-              // id = id.join(',')
-              this.$router.push({
-                path: '/business/form',
-                query: {
-                  id,
-                  tables: this.tabName,
-                },
-              })
+              this.routerFn(id,this.tabName)
               return
             }
           case 'D':

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

@@ -140,7 +140,7 @@
              }
            }
          }
-         this.queryParams.image = JSON.stringify(this.queryParams.image)   
+         this.queryParams.image = JSON.stringify(this.queryParams.image)
          this.queryParams.file = JSON.stringify(this.queryParams.file)
          console.log(this.queryParams)
          if(this.queryParams.pageNum !== undefined){