Browse Source

Merge remote-tracking branch 'origin/master'

Administrator 4 years ago
parent
commit
55ab7fbafb
30 changed files with 581 additions and 72 deletions
  1. 47 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java
  2. 18 0
      boman-modules/boman-system/src/main/java/com/boman/system/common/BaseTableSaveDTO.java
  3. 58 0
      boman-modules/boman-system/src/main/java/com/boman/system/common/FormDataConstant.java
  4. 63 12
      boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java
  5. 57 7
      boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjController.java
  6. 94 13
      boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java
  7. 28 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/IBaseSelectService.java
  8. 50 0
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseSelectServiceImpl.java
  9. 1 1
      ruoyi-ui/.env.development
  10. 1 1
      ruoyi-ui/.env.production
  11. 1 1
      ruoyi-ui/.env.staging
  12. 1 1
      ruoyi-ui/package.json
  13. BIN
      ruoyi-ui/src/assets/images/icon_list_sj.png
  14. BIN
      ruoyi-ui/src/assets/images/icon_more.png
  15. BIN
      ruoyi-ui/src/assets/images/icon_tjbj.png
  16. BIN
      ruoyi-ui/src/assets/images/pic_kpbg.png
  17. BIN
      ruoyi-ui/src/assets/images/pic_tabbg@2x.png
  18. 22 3
      ruoyi-ui/src/assets/styles/sidebar.scss
  19. 4 4
      ruoyi-ui/src/assets/styles/variables.scss
  20. 58 0
      ruoyi-ui/src/components/SignNumArr/index.vue
  21. 17 9
      ruoyi-ui/src/layout/components/Navbar.vue
  22. 1 1
      ruoyi-ui/src/layout/components/Sidebar/Item.vue
  23. 9 8
      ruoyi-ui/src/layout/components/Sidebar/Logo.vue
  24. 4 2
      ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
  25. 2 2
      ruoyi-ui/src/layout/index.vue
  26. 1 1
      ruoyi-ui/src/settings.js
  27. 0 2
      ruoyi-ui/src/views/index.vue
  28. 2 2
      ruoyi-ui/src/views/login.vue
  29. 40 0
      ruoyi-ui/src/views/system/table/index.vue
  30. 2 2
      ruoyi-ui/vue.config.js

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

@@ -2,9 +2,12 @@ package com.boman.common.core.utils.obj;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.Collection;
+import java.util.Objects;
 
 /**
  * @author shiqian
@@ -46,6 +49,21 @@ public class ObjectUtils {
         return input;
     }
 
+    public static Integer requireNonNull(Integer input) {
+        if (input == null || input < 0) {
+            throw new IllegalArgumentException("所传参数为空");
+        }
+        return input;
+    }
+
+    public static boolean isEmpty(Integer input) {
+        return input == null || input < 0;
+    }
+
+    public static boolean isNotEmpty(Integer input) {
+        return !isEmpty(input);
+    }
+
 
     public static String requireNonNull(String input) {
         if (input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input)) {
@@ -69,6 +87,25 @@ public class ObjectUtils {
         return input;
     }
 
+    /**
+     * 功能描述: 暂且只做 string collection long 三种类型的校验
+     *
+     * @param input input
+     * @return boolean
+     */
+    public static boolean isEmpty(Object input) {
+        if (input instanceof String) {
+            return StringUtils.isEmpty((String) input);
+        } else if (input instanceof Collection) {
+            return CollectionUtils.isEmpty(((Collection<?>) input));
+        } else {
+            return Objects.isNull(input);
+        }
+    }
+
+    public static boolean isNotEmpty(Object input) {
+        return !isEmpty(input);
+    }
 
     public static JSONArray requireNonNull(JSONArray input) {
         if (input == null || input.isEmpty()) {
@@ -77,6 +114,16 @@ public class ObjectUtils {
         return input;
     }
 
+    /**
+     * 功能描述: 需要判断数据库是什么类型,如果是VARCHAR则需要转,如果是数字则无需转
+     *
+     * @param input 输入
+     * @return java.lang.String
+     */
+    public static String escapeStr(String input) {
+        return "'" + input + "'";
+    }
+
 
 
 }

+ 18 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/BaseTableSaveDTO.java

@@ -46,4 +46,22 @@ public class BaseTableSaveDTO implements Serializable {
      */
     @JSONField(name = "idList")
     private List<Long> idList;
+
+    /**
+     * orderBy eg: order_by columnName desc
+     */
+    @JSONField(name = "orderBy")
+    private String orderBy;
+
+    /**
+     * 分页
+     */
+    @JSONField(name = "limit")
+    private Integer limit;
+
+    /**
+     * 分页
+     */
+    @JSONField(name = "offset")
+    private Integer offset;
 }

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

@@ -1,5 +1,12 @@
 package com.boman.system.common;
 
+import org.apache.commons.compress.utils.Lists;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
 /**
  * @author shiqian
  * @date 2021年03月26日 09:47
@@ -20,4 +27,55 @@ public class FormDataConstant {
      * 查询后需要返回到前台的字段
      */
     public static final String SHOW_DATA = "showData";
+
+
+    /**
+     * equals
+     */
+    public static final String EQ = "EQ";
+
+    /**
+     * like
+     */
+    public static final String LIKE = "LIKE";
+
+    /**
+     * not equals
+     */
+    public static final String NE = "NE";
+
+    /**
+     * greater than
+     */
+    public static final String GT = "GT";
+
+    /**
+     * greater than or equal to
+     */
+    public static final String GTE = "GTE";
+
+    /**
+     * less than
+     */
+    public static final String LT = "LT";
+
+    /**
+     * less than or equal to
+     */
+    public static final String LTE = "LTE";
+
+    /**
+     * between and
+     */
+    public static final String BETWEEN = "BETWEEN";
+
+    /**
+     * 需要转义
+     */
+    public static final String VARCHAR = "varchar";
+
+    public static final String CHAR = "char";
+    public static final String DATETIME = "datetime";
+    public static final String TIMESTAMP = "timestamp";
+
 }

+ 63 - 12
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -5,10 +5,14 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.collection.CollectionUtils;
+import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.common.core.web.domain.AjaxResult;
 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.mapper.StandardlyMapper;
+import com.boman.system.service.IBaseSelectService;
 import com.boman.system.service.impl.BaseDeleteService;
 import com.boman.system.service.impl.BaseSaveService;
 import com.boman.system.utils.IdUtils;
@@ -19,10 +23,12 @@ import org.springframework.stereotype.Component;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 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.*;
+import static com.boman.system.common.FormDataConstant.CONDITION;
+import static com.boman.system.common.FormDataConstant.SHOW_DATA;
 
 /**
  * @author shiqian
@@ -38,6 +44,8 @@ public class TableServiceCmdService {
     private BaseSaveService saveService;
     @Autowired
     private RedisService redisService;
+    @Autowired
+    private IBaseSelectService selectService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
@@ -49,7 +57,7 @@ public class TableServiceCmdService {
         return baseTableDTO;
     }
 
-    public final ValueHolder<RowResult> objectSave(BaseTableSaveDTO baseTableSaveDTO) {
+    public final AjaxResult objectSave(BaseTableSaveDTO baseTableSaveDTO) {
         BaseTableDTO baseTableDTO = packTableDTO(baseTableSaveDTO);
         TableServiceContext context = TableServiceContext.createFrom(baseTableDTO);
 //        BaseSaveService baseSaveService = SpringUtils.getBean(BaseSaveService.class);
@@ -65,7 +73,7 @@ public class TableServiceCmdService {
             LOGGER.error("保存失败,保持的原始数据为: {}", JSON.toJSONString(baseTableSaveDTO));
         }
 
-        return ValueHolder.ok(rowResult);
+        return AjaxResult.success(rowResult);
     }
 
     /**
@@ -74,7 +82,7 @@ public class TableServiceCmdService {
      * @param dto 前台传过来的dto
      * @return com.boman.system.common.ValueHolder
      */
-    public ValueHolder<RowResult> objectDelete(BaseTableSaveDTO dto) {
+    public AjaxResult objectDelete(BaseTableSaveDTO dto) {
         requireNonNull(dto.getTable());
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requiredNonNull(idArr);
@@ -85,7 +93,7 @@ public class TableServiceCmdService {
 
         RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName));
         LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
-        return ValueHolder.ok(rowResult);
+        return AjaxResult.success(rowResult);
     }
 
 
@@ -95,7 +103,7 @@ public class TableServiceCmdService {
      * @param dto 前台传过来的dto
      * @return com.boman.system.common.ValueHolder
      */
-    public ValueHolder<RowResult> objectLogicDelete(BaseTableSaveDTO dto) {
+    public AjaxResult objectLogicDelete(BaseTableSaveDTO dto) {
         requireNonNull(dto.getTable());
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requiredNonNull(idArr);
@@ -110,31 +118,74 @@ public class TableServiceCmdService {
 
         RowResult rowResult = deleteService.objectLogicDelete(idArr, dto.getTable(), requireNonNull(pkName), jsonObject);
         LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
-        return ValueHolder.ok(rowResult);
+        return AjaxResult.success(rowResult);
     }
 
     /**
      * 功能描述: 获取单表单数据
      *
-     * @param condition condition
+     * @param dto condition
      * @return com.boman.system.common.ValueHolder
      */
-    public ValueHolder<RowResult> getObject(BaseTableSaveDTO dto) {
+    public AjaxResult getObject(BaseTableSaveDTO dto) {
         requireNonNull(dto.getTable());
 
-        // 拿到每个字段对应的查询类型,是 = 或者 like 或者 > 或者 <
+        // 拿到每个字段对应的查询类型,=、 like、 >、 <
         GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + requireNonNull(dto.getTable()));
         requireNonNull(genTable);
         JSONObject fixedData = dto.getFixedData();
         requireNonNull(fixedData);
         // 查询条件
         JSONObject condition = fixedData.getJSONObject(CONDITION);
+        List<GenTableColumn> columns = genTable.getColumns();
+        // 封装好以后的查询条件
+        JSONObject packCondition =  packColCondition(columns, condition);
         // 需要返回到前台的列
         JSONArray showData = fixedData.getJSONArray(SHOW_DATA);
+        List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
+                , showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
+        return AjaxResult.success(result);
+    }
 
+    /**
+     * 功能描述: 封装成查询条件 key: 列名,  value:查询条件_查询类别
+     *              eg: [{"config_name":"系统配置_like"}, {"config_name":"_like"}]
+     *
+     * @param columns columns
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    private JSONObject packColCondition(List<GenTableColumn> columns, JSONObject condition) {
+        requireNonNull(columns);
+
+        JSONObject result = new JSONObject(columns.size());
+        for (Map.Entry<String, Object> entry : condition.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            for (GenTableColumn column : columns) {
+                // long string collection 暂时只作此三种类型判断
+                if (column.getColumnName().equalsIgnoreCase(key) && ObjectUtils.isNotEmpty(value)) {
+                    // columnType 作为判断需不需要转义的一个标准,防止索引失效
+                    result.put(key, packValue(String.valueOf(value), column.getQueryType(), column.getColumnType()));
+                    break;
+                }
+            }
+        }
 
+        return result;
+    }
 
-
-        return ValueHolder.ok("");
+    /**
+     * 功能描述: 封装查询条件,在拼sql的时候按照此规则去取值
+     * {@link StandardlyMapper.SqlProvider#selectByCondition(java.util.Map)}
+     *
+     * @param value      查询的值
+     * @param queryType  queryType
+     * @param columnType columnType
+     * @return java.lang.String
+     */
+    public String packValue(String value, String queryType, String columnType) {
+        requireNonNull(value);
+        requireNonNull(queryType);
+        return value + "_" + queryType + "_" + columnType;
     }
 }

+ 57 - 7
boman-modules/boman-system/src/main/java/com/boman/system/controller/ObjController.java

@@ -1,9 +1,8 @@
 package com.boman.system.controller;
 
+import com.boman.common.core.web.domain.AjaxResult;
 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;
@@ -26,52 +25,103 @@ public class ObjController {
 
     /**
      * 功能描述: 通用保存接口
+     *                {
+     *                    "objId": 1,
+     *                    "table": "sys_config",
+     *                    "fixedData": {
+     *                        "CONFIG_NAME": "测试config_name",
+     *                        "CONFIG_KEY": "测试config_key",
+     *                        "CONFIG_VALUE": "测试config_value",
+     *                        "CONFIG_TYPE": "Y",
+     *                        "REMARK": "测试remark"
+     *                    }
+     *                }
      *
      * @param baseTableSaveDTO 前台传过来的dto
      * @return com.boman.system.common.ValueHolder
      */
     @ApiOperation(value = "单对象保存")
     @PostMapping("/objectSave")
-    public ValueHolder<RowResult> objectSave(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+    public AjaxResult objectSave(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
         return tableServiceCmdService.objectSave(baseTableSaveDTO);
     }
 
     /**
      * 功能描述: 通用删除接口 (真的删除)
+     *               eg:  {
+     *                         "table": "sys_config",
+     *                         "idList": [
+     *                             141,
+     *                             142
+     *                         ]
+     *                     }
+     *
+     *
      *
      * @param baseTableSaveDTO 前台传过来的dto
      * @return com.boman.system.common.ValueHolder
      */
     @ApiOperation(value = "单对象删除")
     @PostMapping("/objectDelete")
-    public ValueHolder<RowResult> objectDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+    public AjaxResult objectDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
         return tableServiceCmdService.objectDelete(baseTableSaveDTO);
     }
 
     /**
      * 功能描述: 通用删除接口 (逻辑删除)
      *
+     *                    eg:{
+     *                           "table": "sys_config",
+     *                           "logicDelName": "CONFIG_KEY",
+     *                           "logicDelValue": "我被修改了吧",
+     *                           "idList": [
+     *                               141,
+     *                               142
+     *                           ]
+     *                       }
+     *
      * @param baseTableSaveDTO 前台传过来的dto
      * @return com.boman.system.common.ValueHolder
      */
     @ApiOperation(value = "单对象逻辑删除")
     @PostMapping("/objectLogicDelete")
-    public ValueHolder<RowResult> objectLogicDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
+    public AjaxResult objectLogicDelete(@RequestBody BaseTableSaveDTO baseTableSaveDTO) {
         return tableServiceCmdService.objectLogicDelete(baseTableSaveDTO);
     }
 
     /**
      * 功能描述: 获取单表单数据
-     *
+     *                    eg:{
+     *                          "table": "sys_config",
+     *                          "limit": 0,
+     *                          "offset": 10,
+     *                          "orderBy": "create_time asc",
+     *                          "fixedData": {
+     *                              "condition": {
+     *                                  "CONFIG_NAME": "主框架",
+     *                                  "CONFIG_VALUE": "skin-blue",
+     *                                  "CREATE_TIME": ["2017-01-01", "2019-02-02"]
+     *                              },
+     *                              "showData": [
+     *                                  "CONFIG_ID", "CONFIG_NAME", "CONFIG_VALUE"
+     *                              ]
+     *                            }
+     *                        }
      * @param condition condition
      * @return com.boman.system.common.ValueHolder
      */
     @ApiOperation(value = "获取单表单数据")
     @PostMapping("/getObject")
-    public ValueHolder<RowResult> getObject(@RequestBody BaseTableSaveDTO condition) {
+    public AjaxResult getObject(@RequestBody BaseTableSaveDTO condition) {
         return tableServiceCmdService.getObject(condition);
     }
 
 
+    @ApiOperation(value = "表单提交接口")
+    @PostMapping("/objectSubmit")
+    public AjaxResult objectSubmit(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.getObject(condition);
+    }
+
 
 }

+ 94 - 13
boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java

@@ -1,7 +1,10 @@
 package com.boman.system.mapper;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.system.common.FormDataConstant;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.*;
 import org.apache.ibatis.annotations.Param;
@@ -13,6 +16,9 @@ import org.springframework.stereotype.Component;
 import java.util.*;
 import java.util.function.Consumer;
 
+import static com.boman.common.core.utils.obj.ObjectUtils.*;
+import static com.boman.system.common.FormDataConstant.*;
+
 /**
  * @author shiqian
  * @description
@@ -89,16 +95,21 @@ public interface StandardlyMapper {
     /**
      * 功能描述: 自定义查询,需要查询的字段和value都在condition中
      *
-     * @param tableName tableName
-     * @param condition condition
-     * @param limit     分页
-     * @param offset    分页
+     * @param tableName     tableName
+     * @param condition     condition
+     * @param packCondition 封装好的查询条件
+     * @param showData      需要查询的列
+     * @param orderBy       orderBy
+     * @param limit         分页
+     * @param offset        分页, 可以为null
      * @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("packCondition") JSONObject packCondition
+            , @Param("showData") JSONArray showData
+            , @Param("orderBy") String orderBy
             , @Param("limit") int limit
             , @Param("offset") int offset);
 
@@ -404,24 +415,94 @@ public interface StandardlyMapper {
             }
         }
 
-//        @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);
+            LOGGER.info("前台传过来的查询条件: {}", condition.toJSONString());
+            JSONObject packCondition = (JSONObject) para.get("packCondition");
             String tableName = (String) para.get("tableName");
-            ObjectUtils.requireNonNull(tableName);
+            String orderBy = (String) para.get("orderBy");
             int limit = (int) para.get("limit");
-            ObjectUtils.requireNonNull(limit);
             int offset = (int) para.get("offset");
-            ObjectUtils.requireNonNull(offset);
+            JSONArray showData = (JSONArray) para.get("showData");
+
+            StringBuilder wholeSql = new StringBuilder();
+            wholeSql.append("select ");
+            // showData
+            StringBuilder showDataSql = new StringBuilder();
+            for (Object columnObj : showData) {
+                String columnName = (String) columnObj;
+                showDataSql.append(columnName).append(", ");
+            }
 
-            StringBuilder sql = new StringBuilder();
-            sql.append("select ");
+            wholeSql.append(StringUtils.substringBeforeLast(showDataSql.toString(), ","));
+            wholeSql.append(" from ").append(tableName);
+            wholeSql.append(" where ");
+            // 条件
+            StringBuilder conditionSql = new StringBuilder();
+            for (Map.Entry<String, Object> entry : packCondition.entrySet()) {
+                String key = entry.getKey();
+                Object valueObj = entry.getValue();
+                String valueStr = ((String) valueObj);
+                String[] split = valueStr.split("_");
+                String value = split[0];
+                String queryType = split[1];
+                String columnType = split[2];
+                conditionSql.append(key).append(covert(queryType, columnType, key, value)).append(" and ");
+            }
 
+            wholeSql.append(StringUtils.substringBeforeLast(conditionSql.toString(), " and"));
+            wholeSql.append(" order by ").append(orderBy).append(" limit ").append(limit);
+            if (ObjectUtils.isNotEmpty(offset)) {
+                wholeSql.append(", ").append(offset);
+            }
 
+            String result = wholeSql.toString();
+            LOGGER.info("查询拼出的sql语句为:{}", result);
+            return result;
+        }
 
+        private String covert(String queryType, String columnType, String key, String value) {
+            // false 不需要转义
+            boolean needEscape = columnType.contains(VARCHAR) || columnType.contains(CHAR)
+                    || columnType.contains(DATETIME) || columnType.contains(TIMESTAMP);
+            switch (queryType) {
+                case FormDataConstant.EQ:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " = " + value;
+                case FormDataConstant.LIKE:
+                    return " like " + "concat('%', #{condition." + key + "}, '%')";
+                case FormDataConstant.NE:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " != " + value;
+                case FormDataConstant.GT:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " &gt; " + value;
+                case FormDataConstant.GTE:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " &gt;= " + value;
+                case FormDataConstant.LT:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " &lt; " + value;
+                case FormDataConstant.LTE:
+                    value = needEscape ? escapeStr(value) : value;
+                    return " &lt;= " + value;
+                default:
+                    String[] split = value.split(",");
+                    String front = split[0].replace("[", "");
+                    String back =  split[1].replace("]", "");
+                    String max, min;
+                    if (front.compareTo(back) > 0) {
+                        max = back;
+                        min = front;
+                    } else {
+                        max = front;
+                        min = back;
+                    }
 
-            return "";
+                    max = needEscape ? escapeStr(max) : max;
+                    min = needEscape ? escapeStr(min) : min;
+                    return " between " + min + " and " + max;
+            }
         }
     }
 }

+ 28 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/IBaseSelectService.java

@@ -0,0 +1,28 @@
+package com.boman.system.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年03月29日 10:22
+ **/
+public interface IBaseSelectService {
+
+    /**
+     * 功能描述: 根据条件查询
+     *
+     * @param tableName     tableName
+     * @param condition     原始查询条件
+     * @param packCondition 封装的查询条件
+     * @param showData      前台需要查询的列
+     * @param orderBy       orderBy
+     * @param limit         分页
+     * @param offset        分页
+     * @return java.util.List<com.alibaba.fastjson.JSONObject>
+     */
+    List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition
+            , JSONArray showData, String orderBy, Integer limit, Integer offset);
+}

+ 50 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseSelectServiceImpl.java

@@ -0,0 +1,50 @@
+package com.boman.system.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.boman.system.mapper.StandardlyMapper;
+import com.boman.system.service.IBaseSelectService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
+
+/**
+ * @author shiqian
+ * @date 2021年03月29日 10:22
+ **/
+@Service
+public class BaseSelectServiceImpl implements IBaseSelectService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(BaseSelectServiceImpl.class);
+
+    @Autowired
+    private StandardlyMapper mapper;
+
+
+    /**
+     * 功能描述: 根据条件查询
+     *
+     * @param tableName     tableName
+     * @param condition     原始查询条件
+     * @param packCondition 封装的查询条件
+     * @param showData      前台需要查询的列
+     * @param orderBy       orderBy
+     * @param limit         分页
+     * @param offset        分页
+     * @return java.util.List<com.alibaba.fastjson.JSONObject>
+     */
+    @Override
+    public List<JSONObject> selectByCondition(String tableName, JSONObject condition, JSONObject packCondition, JSONArray showData, String orderBy, Integer limit, Integer offset) {
+        requireNonNull(condition);
+        requireNonNull(packCondition);
+        requireNonNull(showData);
+        requireNonNull(limit);
+        requireNonNull(orderBy);
+        return mapper.selectByCondition(tableName, condition, packCondition, showData, orderBy, limit, offset);
+    }
+}

+ 1 - 1
ruoyi-ui/.env.development

@@ -1,7 +1,7 @@
 # 开发环境配置
 ENV = 'development'
 
-# 若依管理系统/开发环境
+# 博曼办公协作/开发环境
 VUE_APP_BASE_API = '/dev-api'
 
 # 路由懒加载

+ 1 - 1
ruoyi-ui/.env.production

@@ -1,5 +1,5 @@
 # 生产环境配置
 ENV = 'production'
 
-# 若依管理系统/生产环境
+# 博曼办公协作/生产环境
 VUE_APP_BASE_API = '/prod-api'

+ 1 - 1
ruoyi-ui/.env.staging

@@ -3,5 +3,5 @@ NODE_ENV = production
 # 测试环境配置
 ENV = 'staging'
 
-# 若依管理系统/测试环境
+# 博曼办公协作/测试环境
 VUE_APP_BASE_API = '/stage-api'

+ 1 - 1
ruoyi-ui/package.json

@@ -1,7 +1,7 @@
 {
   "name": "ruoyi",
   "version": "2.5.0",
-  "description": "若依管理系统",
+  "description": "博曼办公协作",
   "author": "若依",
   "license": "MIT",
   "scripts": {

BIN
ruoyi-ui/src/assets/images/icon_list_sj.png


BIN
ruoyi-ui/src/assets/images/icon_more.png


BIN
ruoyi-ui/src/assets/images/icon_tjbj.png


BIN
ruoyi-ui/src/assets/images/pic_kpbg.png


BIN
ruoyi-ui/src/assets/images/pic_tabbg@2x.png


+ 22 - 3
ruoyi-ui/src/assets/styles/sidebar.scss

@@ -64,6 +64,11 @@
       border: none;
       height: 100%;
       width: 100% !important;
+      .submenu-title-noDropdown.is-active{
+        span{
+          color: #3C8DBC!important;
+        }
+      }
     }
 
     .el-menu-item, .el-submenu__title {
@@ -80,29 +85,43 @@
       }
     }
 
+
     & .theme-dark .is-active > .el-submenu__title {
-      color: $subMenuActiveText !important;
+      span{
+        color: $subMenuActiveText !important;
+      }
     }
 
     & .nest-menu .el-submenu>.el-submenu__title,
     & .el-submenu .el-menu-item {
       min-width: $sideBarWidth !important;
 
+
       &:hover {
         background-color: rgba(0, 0, 0, 0.06) !important;
       }
     }
 
+
     & .theme-dark .nest-menu .el-submenu>.el-submenu__title,
     & .theme-dark .el-submenu .el-menu-item {
-      background-color: $subMenuBg !important;
-
+      background-color: $subMenuBg;
       &:hover {
         background-color: $subMenuHover !important;
+        span{
+          color: #fff!important;
+        }
       }
     }
+    .nest-menu .is-active{
+      span{
+        color: #fff!important;
+      }
+      background-color: #3C8DBC!important;
+    }
   }
 
+
   .hideSidebar {
     .sidebar-container {
       width: 54px !important;

+ 4 - 4
ruoyi-ui/src/assets/styles/variables.scss

@@ -11,9 +11,9 @@ $panGreen: #30B08F;
 // sidebar
 $menuText:#bfcbd9;
 $menuActiveText:#409EFF;
-$subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
+$subMenuActiveText:#3C8DBC; // https://github.com/ElemeFE/element/issues/12951
 
-$menuBg:#304156;
+$menuBg: #FAFAFA;
 $menuHover:#263445;
 $sidebarTitle: #ffffff;
 
@@ -21,8 +21,8 @@ $menuLightBg:#ffffff;
 $menuLightHover:#f0f1f5;
 $sidebarLightTitle: #001529;
 
-$subMenuBg:#1f2d3d;
-$subMenuHover:#001528;
+$subMenuBg:#FAFAFA;
+$subMenuHover:#3C8DBC;
 
 $sideBarWidth: 200px;
 

+ 58 - 0
ruoyi-ui/src/components/SignNumArr/index.vue

@@ -0,0 +1,58 @@
+<template>
+  <div class="sign_box">
+    <div class="sign_item" v-for="item in 4" @click="indexs = item">
+      <img src="@/assets/images/pic_tabbg@2x.png" v-show="indexs==item" alt="" class="img">
+      <img src="@/assets/404_images/404_cloud.png" alt="" class="icon">
+      <span>首页</span>
+    </div>
+
+  </div>
+</template>
+
+<script>
+  export default{
+    data() {
+      return {
+        indexs:1
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .sign_box{
+    padding-left: 52px;
+    .sign_item{
+      cursor: pointer;
+      float: left;
+      display: flex;
+      height: 60px;
+      justify-content: center;
+      align-items: center;
+      position: relative;
+      width: 153px;
+      padding-top: 10px;
+      box-sizing: border-box;
+      .img{
+        width: 153px;
+        height: 48px;
+        position: absolute;
+        left: 0;
+        bottom: 0;
+      }
+      .icon{
+        position: relative;
+        z-index: 1;
+        width: 20px;
+        height: 20px;
+        margin-right: 8px;
+      }
+      span{
+        position: relative;
+        z-index: 1;
+        color: #fff;
+        font-size: 17px;
+      }
+    }
+  }
+</style>

+ 17 - 9
ruoyi-ui/src/layout/components/Navbar.vue

@@ -1,13 +1,14 @@
 <template>
   <div class="navbar">
-    <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
+    <!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
 
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
+    <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" /> -->
 
+      <SignNumArr class="SignNumArr"/>
     <div class="right-menu">
-      <template v-if="device!=='mobile'">
+      <!-- <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
-        
+
         <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip>
@@ -22,7 +23,7 @@
           <size-select id="size-select" class="right-menu-item hover-effect" />
         </el-tooltip>
 
-      </template>
+      </template> -->
 
       <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
         <div class="avatar-wrapper">
@@ -48,6 +49,7 @@
 <script>
 import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
+import SignNumArr from '@/components/SignNumArr'
 import Hamburger from '@/components/Hamburger'
 import Screenfull from '@/components/Screenfull'
 import SizeSelect from '@/components/SizeSelect'
@@ -57,7 +59,7 @@ import RuoYiDoc from '@/components/RuoYi/Doc'
 
 export default {
   components: {
-    Breadcrumb,
+    SignNumArr,
     Hamburger,
     Screenfull,
     SizeSelect,
@@ -104,18 +106,23 @@ export default {
 
 <style lang="scss" scoped>
 .navbar {
-  height: 50px;
+  height: 60px;
   overflow: hidden;
   position: relative;
-  background: #fff;
+  background-color: #3C8DBC;
   box-shadow: 0 1px 4px rgba(0,21,41,.08);
 
+  .SignNumArr{
+    float: left;
+  }
+
   .hamburger-container {
     line-height: 46px;
     height: 100%;
     float: left;
     cursor: pointer;
     transition: background .3s;
+    color: #fff;
     -webkit-tap-highlight-color:transparent;
 
     &:hover {
@@ -170,7 +177,7 @@ export default {
           cursor: pointer;
           width: 40px;
           height: 40px;
-          border-radius: 10px;
+          border-radius: 50%;
         }
 
         .el-icon-caret-bottom {
@@ -178,6 +185,7 @@ export default {
           position: absolute;
           right: -20px;
           top: 25px;
+          color: #fff;
           font-size: 12px;
         }
       }

+ 1 - 1
ruoyi-ui/src/layout/components/Sidebar/Item.vue

@@ -21,7 +21,7 @@ export default {
     }
 
     if (title) {
-      vnodes.push(<span slot='title'>{(title)}</span>)
+      vnodes.push(<span slot='title' style="color: #343434">{(title)}</span>)
     }
     return vnodes
   }

+ 9 - 8
ruoyi-ui/src/layout/components/Sidebar/Logo.vue

@@ -1,12 +1,13 @@
 <template>
-  <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }">
+  <!-- <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }"> -->
+     <div class="sidebar-logo-container" :class="{'collapse':collapse}">
     <transition name="sidebarLogoFade">
       <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
-        <img v-if="logo" :src="logo" class="sidebar-logo">
-        <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1>
+        <!-- <img v-if="logo" :src="logo" class="sidebar-logo"> -->
+        <h1  class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" to="/">
-        <img v-if="logo" :src="logo" class="sidebar-logo">
+        <!-- <img v-if="logo" :src="logo" class="sidebar-logo"> -->
         <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1>
       </router-link>
     </transition>
@@ -35,7 +36,7 @@ export default {
   },
   data() {
     return {
-      title: '若依管理系统',
+      title: '博曼办公协作',
       logo: logoImg
     }
   }
@@ -55,9 +56,9 @@ export default {
 .sidebar-logo-container {
   position: relative;
   width: 100%;
-  height: 50px;
-  line-height: 50px;
-  background: #2b2f3a;
+  height: 60px;
+  line-height: 60px;
+  background-color: #3C8DBC;
   text-align: center;
   overflow: hidden;
 

+ 4 - 2
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue

@@ -3,14 +3,16 @@
     <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
-          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
+          <item :title="onlyOneChild.meta.title" />
+          <!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> -->
         </el-menu-item>
       </app-link>
     </template>
 
     <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
       <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
+        <!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> -->
+        <item v-if="item.meta" :title="item.meta.title" />
       </template>
       <sidebar-item
         v-for="child in item.children"

+ 2 - 2
ruoyi-ui/src/layout/index.vue

@@ -5,10 +5,10 @@
     <div :class="{hasTagsView:needTagsView}" class="main-container">
       <div :class="{'fixed-header':fixedHeader}">
         <navbar />
-        <tags-view v-if="needTagsView" />
+        <tags-view v-if="needTagsView&&false"/>
       </div>
       <app-main />
-      <right-panel v-if="showSettings">
+      <right-panel v-if="showSettings&&false">
         <settings />
       </right-panel>
     </div>

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

@@ -1,5 +1,5 @@
 module.exports = {
-  title: '若依管理系统',
+  title: '博曼办公协作',
 
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light

+ 0 - 2
ruoyi-ui/src/views/index.vue

@@ -101,7 +101,6 @@
                                         type="success"
                                         @click="handleUpdate(scope.row)"
                                         v-hasPermi="['system:notice:edit']"
-
                                       >详情</el-button>
                                       <el-button
                                         size="small"
@@ -130,7 +129,6 @@
                              <span>共 85 条  每页显示 5 条  当前 1/17 页</span>
                            </div>
                          </div>
-
                </div>
           </el-col>
         <!-- </el-row> -->

+ 2 - 2
ruoyi-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">博曼办公协作</h3>
       <el-form-item prop="username">
         <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -48,7 +48,7 @@
     </el-form>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2018-2021 ruoyi.vip All Rights Reserved.</span>
+      <!-- <span>Copyright © 2018-2021 ruoyi.vip All Rights Reserved.</span> -->
     </div>
   </div>
 </template>

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

@@ -0,0 +1,40 @@
+<template>
+ <div class="table_total">
+   <div class="table_header">
+     <p>单表</p>
+     <el-divider></el-divider>
+   </div>
+   <!-- 内容 -->
+   <div class="table_nav">
+     
+   </div>
+
+ </div>
+
+</template>
+
+<script>
+</script>
+
+
+<style  lang="scss">
+
+</style>
+
+
+
+<style scoped lang="scss">
+  .table_total{
+     background-color: #eef0ff;
+     padding: 20px;
+     // 头部
+     .table_header{
+        background-color: #fff;
+
+     }
+  }
+  p{
+    margin: 0;
+
+  }
+</style>

+ 2 - 2
ruoyi-ui/vue.config.js

@@ -6,7 +6,7 @@ function resolve(dir) {
   return path.join(__dirname, dir)
 }
 
-const name = defaultSettings.title || '若依管理系统' // 标题
+const name = defaultSettings.title || '博曼办公协作' // 标题
 
 const port = process.env.port || process.env.npm_config_port || 80 // 端口
 
@@ -34,7 +34,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8080`,
+        target: `http://192.168.101.10:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''