浏览代码

Merge remote-tracking branch 'origin/master'

Administrator 4 年之前
父节点
当前提交
0d09abd4ae

+ 28 - 18
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/obj/ObjectUtils.java

@@ -7,6 +7,8 @@ import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -18,40 +20,40 @@ public class ObjectUtils {
     private static final String NULL = "null";
     private static final String UNDEFINED = "undefined";
 
-    public static  <T> Collection<T> requiredNonNull(Collection<T> input){
+    public static  <T> Collection<T> requiredNonNull(Collection<T> input, String... errorMsg){
         if (null == input || input.size() == 0) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
 
-    public static long[] requiredNonNull(long[] input){
+    public static long[] requiredNonNull(long[] input, String... errorMsg){
         if (ArrayUtils.isEmpty(input)) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
 
         return input;
     }
 
 
-    public static Long[] requiredNonNull(Long[] input){
+    public static Long[] requiredNonNull(Long[] input, String... errorMsg){
         if (ArrayUtils.isEmpty(input)) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
 
         return input;
     }
 
-    public static <T> T requireNonNull(T input) {
+    public static <T> T requireNonNull(T input, String... errorMsg) {
         if (input == null) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
 
-    public static Integer requireNonNull(Integer input) {
+    public static Integer requireNonNull(Integer input, String... errorMsg) {
         if (input == null || input < 0) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
@@ -65,24 +67,24 @@ public class ObjectUtils {
     }
 
 
-    public static String requireNonNull(String input) {
+    public static String requireNonNull(String input, String... errorMsg) {
         if (input == null || input.isEmpty() || NULL.equalsIgnoreCase(input) || UNDEFINED.equalsIgnoreCase(input)) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
 
-    public static int requireNonNull(int input) {
+    public static int requireNonNull(int input, String... errorMsg) {
         if (input <= 0) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
 
 
-    public static JSONObject requireNonNull(JSONObject input) {
+    public static JSONObject requireNonNull(JSONObject input, String... errorMsg) {
         if (input == null || input.isEmpty()) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }
@@ -95,6 +97,14 @@ public class ObjectUtils {
         return input;
     }
 
+
+    public static List<JSONObject> ifNullSetEmpty(List<JSONObject> input) {
+        if (input == null || input.isEmpty()) {
+            input = Collections.emptyList();
+        }
+        return input;
+    }
+
     public static JSONArray ifNullSetEmpty(JSONArray input) {
         if (input == null || input.isEmpty()) {
             input = new JSONArray();
@@ -131,9 +141,9 @@ public class ObjectUtils {
         return !isEmpty(input);
     }
 
-    public static JSONArray requireNonNull(JSONArray input) {
+    public static JSONArray requireNonNull(JSONArray input, String... errorMsg) {
         if (input == null || input.isEmpty()) {
-            throw new IllegalArgumentException("所传参数为空");
+            throw new IllegalArgumentException(errorMsg[0]);
         }
         return input;
     }

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

@@ -47,6 +47,12 @@ public class BaseTableSaveDTO implements Serializable {
     @JSONField(name = "idList")
     private List<Long> idList;
 
+    /**
+     * 批量提交时,提交到后台的数据
+     */
+    @JSONField(name = "commitData")
+    private List<JSONObject> commitData;
+
     /**
      * orderBy eg: order_by columnName desc
      */
@@ -65,6 +71,12 @@ public class BaseTableSaveDTO implements Serializable {
     @JSONField(name = "pageSize")
     private Integer pageSize;
 
+    /**
+     * 状态
+     */
+    @JSONField(name = "status")
+    private String status;
+
 
     public int getLimit() {
         return pageNo == 0 ? 0 : (pageNo - 1) * pageSize;

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

@@ -1,12 +1,5 @@
 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
@@ -107,5 +100,9 @@ public class FormDataConstant {
     public static final String UPDATE_TIME = "UPDATE_TIME";
 
 
+    /**  状态 */
+    public static final String STATUS = "STATUS";
+
+
 
 }

+ 66 - 0
boman-modules/boman-system/src/main/java/com/boman/system/common/SubmitConstant.java

@@ -0,0 +1,66 @@
+package com.boman.system.common;
+
+import lombok.Data;
+
+/**
+ * @author shiqian
+ * @date 2021年04月01日 13:56
+ **/
+@Data
+public class SubmitConstant {
+
+    /**
+     * 提交人
+     */
+    public static final String SUBMIT_USERID = "submit_userid";
+
+    /**
+     * 提交时间
+     */
+    public static final  String SUBMIT_TIME = "submit_time";
+
+    /**
+     * 提交备注
+     */
+    public static final  String REMARK = "remark";
+
+    /**
+     * 未提交
+     */
+    public static final String NOT_SUBMIT = "1";
+
+    /**
+     * 已经提交了
+     */
+    public static final String SUBMITTED = "2";
+
+    /**
+     * 驳回
+     */
+    public static final String REJECT = "3";
+
+    /**
+     * 审核中
+     */
+    public static final String CHECKING = "4";
+
+    /**
+     * 批量提交的时候,状态符合标识
+     */
+    public static final String SUBMIT_RESULT = "submitResult";
+
+    /**
+     * 批量提交的时候,状态符合标识,且成功
+     */
+    public static final String SUCCESS = "SUCCESS";
+
+    /**
+     * 批量提交的时候,状态符合, 但是不知道什么原因失败了
+     */
+    public static final String FAIL = "FAIL";
+
+    /**
+     * 批量提交的时候,状态压根就不符合
+     */
+    public static final String NOT_ALLOWED = "NOT_ALLOWED";
+}

+ 81 - 11
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -3,6 +3,7 @@ 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.SecurityUtils;
 import com.boman.common.core.utils.collection.CollectionUtils;
 import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.web.domain.AjaxResult;
@@ -12,9 +13,7 @@ import com.boman.gen.controller.MyController;
 import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
 import com.boman.system.mapper.StandardlyMapper;
-import com.boman.system.service.IBaseDeleteService;
-import com.boman.system.service.IBaseSaveService;
-import com.boman.system.service.IBaseSelectService;
+import com.boman.system.service.*;
 import com.boman.system.utils.IdUtils;
 import com.google.common.collect.Lists;
 import org.slf4j.Logger;
@@ -22,10 +21,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.sql.Timestamp;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
@@ -49,6 +46,8 @@ public class TableServiceCmdService {
     private RedisService redisService;
     @Resource
     private IBaseSelectService selectService;
+    @Resource
+    private IBaseSubmitService submitService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
 
@@ -66,7 +65,7 @@ public class TableServiceCmdService {
         // 拿到pkName和maxId
         List<GenTableColumn> columns = context.getTable().getColumns();
         String pkName = IdUtils.getPkName(columns);
-        requireNonNull(pkName);
+        requireNonNull(pkName, "主键名称为空");;
 
         //
         List<String> allColumnNameList = columns.stream()
@@ -97,7 +96,7 @@ public class TableServiceCmdService {
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
         String pkName = IdUtils.getPkName(genTable.getColumns());
 
-        RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName));
+        RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
         LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
         return AjaxResult.success(rowResult);
     }
@@ -121,7 +120,7 @@ public class TableServiceCmdService {
         JSONObject jsonObject= new JSONObject();
         jsonObject.put(dto.getLogicDelName(), dto.getLogicDelValue());
 
-        RowResult rowResult = deleteService.objectLogicDelete(idArr, dto.getTable(), requireNonNull(pkName), jsonObject);
+        RowResult rowResult = deleteService.objectLogicDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"), jsonObject);
         LOGGER.info(rowResult.getMessage() + ", id: {}", Arrays.toString(idArr));
         return AjaxResult.success(rowResult);
     }
@@ -176,7 +175,7 @@ public class TableServiceCmdService {
         String pkName = IdUtils.getPkName(genTable.getColumns());
 
         JSONObject fixedData = dto.getFixedData();
-        requireNonNull(fixedData);
+        fixedData = ObjectUtils.ifNullSetEmpty(fixedData);
         Long id = fixedData.getLong(FormDataConstant.ID);
         requireNonNull(id);
 
@@ -287,6 +286,77 @@ public class TableServiceCmdService {
         return AjaxResult.success();
     }
 
+    /**
+     * 功能描述: 表单提交接口
+     *
+     * @param condition condition
+     * @param isSubmit  提交true, 反提交false
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    public AjaxResult objectSubmit(BaseTableSaveDTO condition, boolean isSubmit) {
+        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
+        List<JSONObject> commitData = condition.getCommitData();
+        requireNonNull(commitData, "啥都不提交, 调什么接口??");
+
+        String tableName = requireNonNull(genTable.getTableName());
+        String pkName = IdUtils.getPkName(genTable.getColumns());
+
+        // 先去查出之前的状态
+        List<Long> idList = commitData.stream().map(jsonObject -> jsonObject.getLong(FormDataConstant.ID))
+                .collect(Collectors.toList());
+        JSONArray showData = new JSONArray();
+        showData.add(FormDataConstant.STATUS);
+        showData.add(pkName);
+        List<JSONObject> beforeList = selectService.selectByIdList(tableName, pkName, idList, showData);
+        requireNonNull(beforeList);
+
+        // 符合条件的需要提交的
+        List<JSONObject> needCommitList = Lists.newArrayListWithCapacity(16);
+        // 不符合条件的需要提交的
+        List<JSONObject> notNeedCommitList = Lists.newArrayListWithCapacity(16);
+        Iterator<JSONObject> iterator = beforeList.iterator();
+        while (iterator.hasNext()){
+            JSONObject next = iterator.next();
+            String dbStatus = next.getString(FormDataConstant.STATUS);
+            // 只能是未提交的状态下,才能调用提交
+            if (isSubmit) {
+                if (!SubmitConstant.NOT_SUBMIT.equals(dbStatus)) {
+                    next.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
+                    notNeedCommitList.add(next);
+                    iterator.remove();
+                } else {
+                    needCommitList.add(next);
+                }
+            } else {
+                // 只有在已提交的情况下才能反提交
+                if (!SubmitConstant.SUBMITTED.equals(dbStatus)) {
+                    next.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
+                    notNeedCommitList.add(next);
+                    iterator.remove();
+                } else {
+                    needCommitList.add(next);
+                }
+            }
+        }
+
+        for (JSONObject jsonObject : needCommitList) {
+            jsonObject.put(SubmitConstant.SUBMIT_USERID, SecurityUtils.getUserId());
+            jsonObject.put(SubmitConstant.SUBMIT_TIME, new Timestamp(System.currentTimeMillis()));
+//            jsonObject.put(SubmitConstant.REMARK, "unknown");
+            int effective = submitService.handlerSubmit(tableName, pkName, jsonObject, jsonObject.getLong(FormDataConstant.ID));
+            if (effective > 0) {
+                jsonObject.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.SUCCESS);
+            } else {
+                jsonObject.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.FAIL);
+            }
+        }
+
+        needCommitList.addAll(notNeedCommitList);
+        return AjaxResult.success(needCommitList);
+    }
+
+
+    // todo redis中未找到,要去查数据库,然后再塞进去
     private GenTable getTableFromRedisByTableName(String redisKeyPrefix, String tableName){
         GenTable genTable = redisService.getCacheObject(redisKeyPrefix + requireNonNull(tableName));
         return requireNonNull(genTable);

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

@@ -164,5 +164,51 @@ public class ObjController {
         return tableServiceCmdService.objectTab(condition);
     }
 
+    /**
+     * 功能描述: 表单提交接口, 更改的字段类型和字段值都是一致的
+     *               {
+     *                   "table": "sys_config",
+     *                   "idList": [
+     *                       3
+     *                   ],
+     *                   "fixedData": {
+     *                       "status": "1",
+     *                       "type": "FINISHED"
+     *                   }
+     *
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @ApiOperation(value = "表单提交接口")
+    @PostMapping("/objectSubmit")
+    public AjaxResult objectSubmit(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.objectSubmit(condition, true);
+    }
+
+
+    /**
+     * 功能描述: 反提交接口, 更改的字段类型和字段值都是一致的
+     *                {
+     *                    "table": "sys_config",
+     *                    "fixedData": {
+     *                        "idList": [
+     *                            3
+     *                        ],
+     *                        "status": "1",
+     *                        "remark": "理由不够充分"
+     *                    }
+     *                }
+     *
+     *
+     * @param condition condition
+     * @return com.boman.common.core.web.domain.AjaxResult
+     */
+    @ApiOperation(value = "反提交接口")
+    @PostMapping("/objectUnSubmit")
+    public AjaxResult objectUnSubmit(@RequestBody BaseTableSaveDTO condition) {
+        return tableServiceCmdService.objectSubmit(condition, false);
+    }
+
 
 }

+ 86 - 0
boman-modules/boman-system/src/main/java/com/boman/system/mapper/StandardlyMapper.java

@@ -86,6 +86,14 @@ public interface StandardlyMapper {
     )
     int updates(@Param("tableName") String var1, @Param("models") Collection<Object> var2, @Param("processor") Consumer<JSONObject> var3);
 
+    /** {@link StandardlyMapper.SqlProvider#updateByIdList(java.util.Map)} */
+    @UpdateProvider(
+            type = StandardlyMapper.SqlProvider.class,
+            method = "updateByIdList"
+    )
+    int updateByIdList(@Param("tableName") String var1, @Param("pkName") String pkName
+            , @Param("idList") List<Long> var2, @Param("models") JSONObject models);
+
     @Select("select id from ${tableName} where ${akColumnName} = #{akColumnValue}")
     Long selectIdByAkColumn(@Param("tableName") String tableName, @Param("akColumnName") String akColumnName, @Param("akColumnValue") String akColumnValue);
 
@@ -104,6 +112,21 @@ public interface StandardlyMapper {
     JSONObject selectById(@Param("tableName") String tableName
             , @Param("pkName") String pkName, @Param("id") Long id);
 
+    /**
+     * 功能描述: 根据id查所有
+     * {@link StandardlyMapper.SqlProvider#selectByIdList(java.util.Map)}
+     *
+     * @param tableName 表名
+     * @param pkName    主键名称
+     * @param idList    主键值
+     * @param showData  需要展示的列
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @SelectProvider(type = StandardlyMapper.SqlProvider.class, method = "selectByIdList")
+    List<JSONObject> selectByIdList(@Param("tableName") String tableName
+            , @Param("pkName") String pkName, @Param("idList") List<Long> idList
+            , @Param("showData") JSONArray showData);
+
     /**
      * 功能描述: 自定义查询,需要查询的字段和value都在condition中
      * {@link StandardlyMapper.SqlProvider#selectByCondition(java.util.Map)}
@@ -300,6 +323,36 @@ public interface StandardlyMapper {
             }
         }
 
+
+        public String updateByIdList(Map<String, Object> para) {
+            String tableName = (String) para.get("tableName");
+            String pkName = (String) para.get("pkName");
+            List<Long> idList = (List<Long>) para.get("idList");
+            JSONObject models = (JSONObject) para.get("models");
+
+            StringBuilder wholeSql = new StringBuilder();
+            wholeSql.append("update ").append(tableName).append(" set ");
+            for (Map.Entry<String, Object> entry : models.entrySet()) {
+                String key = entry.getKey();
+                Object value = entry.getValue();
+                wholeSql.append(key).append(" = ").append(value).append(" , ");
+            }
+
+            wholeSql = new StringBuilder(StringUtils.substringBeforeLast(wholeSql.toString(), ","));
+            wholeSql.append(" where ").append(pkName).append(" in ( ");
+
+            for (int i = 0; i < idList.size(); ++i) {
+                wholeSql.append(String.format("#{idList[%d]}", i));
+                wholeSql.append(",");
+            }
+
+            wholeSql.setCharAt(wholeSql.length() - 1, ')');
+            String sqlStr = wholeSql.toString();
+            LOGGER.info("批量更新的sql语句为: {}", sqlStr);
+            return sqlStr;
+
+        }
+
         public String delete(Map<String, Object> para) {
             Long[] ids = (Long[]) para.get("ids");
             String tableName = (String) para.get("tableName");
@@ -481,6 +534,39 @@ public interface StandardlyMapper {
             return result;
         }
 
+        public String selectByIdList(Map<String, Object> para) {
+            String tableName = (String) para.get("tableName");
+            String pkName = (String) para.get("pkName");
+            List<Long> idList = (List<Long>) para.get(ID_LIST);
+            JSONArray showData = (JSONArray) para.get("showData");
+
+            StringBuilder wholeSql = new StringBuilder();
+            wholeSql.append("select ");
+            // showData
+            StringBuilder showDataSql = new StringBuilder();
+            if (ObjectUtils.isNotEmpty(showData)) {
+                for (Object columnObj : showData) {
+                    String columnName = (String) columnObj;
+                    showDataSql.append(columnName).append(", ");
+                }
+                wholeSql.append(StringUtils.substringBeforeLast(showDataSql.toString(), ","));
+            } else {
+                showDataSql.append(" * ");
+            }
+
+            wholeSql.append(" from ").append(tableName).append(" where ").append(pkName).append(" in ( ");
+
+            for (int i = 0; i < idList.size(); ++i) {
+                wholeSql.append(String.format("#{idList[%d]}", i));
+                wholeSql.append(",");
+            }
+
+            wholeSql.setCharAt(wholeSql.length() - 1, ')');
+            String sqlStr = wholeSql.toString();
+            LOGGER.info("批量查找的sql语句为: {}", sqlStr);
+            return sqlStr;
+        }
+
         public String countByCondition(Map<String, Object> para) {
             JSONObject condition = (JSONObject) para.get("condition");
             LOGGER.info("前台传过来的查询条件: {}", condition.toJSONString());

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

@@ -45,4 +45,15 @@ public interface IBaseSelectService {
      * @return com.alibaba.fastjson.JSONObject
      */
     JSONObject selectById(String tableName, String pkName, Long id);
+
+    /**
+     * 功能描述: 根据id查所有,不支持自定义查询列
+     *
+     * @param tableName 表名
+     * @param pkName    主键名称
+     * @param idList    主键值
+     * @param showData  需要展示的列
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    List<JSONObject> selectByIdList(String tableName, String pkName, List<Long> idList, JSONArray showData);
 }

+ 21 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/IBaseSubmitService.java

@@ -0,0 +1,21 @@
+package com.boman.system.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+/**
+ * @author shiqian
+ * @date 2021年03月29日 10:22
+ **/
+public interface IBaseSubmitService {
+
+    /**
+     * 功能描述: 处理提交流程
+     *
+     * @param tableName tableName
+     * @param pkName    pkName
+     * @param model     model
+     * @param id        主键
+     * @return int
+     */
+    int handlerSubmit(String tableName, String pkName, JSONObject model, Long id);
+}

+ 23 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/IBaseUpdateService.java

@@ -0,0 +1,23 @@
+package com.boman.system.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年03月29日 10:22
+ **/
+public interface IBaseUpdateService {
+
+    /**
+     * 功能描述: 批量修改, 默认需要更改的model,更改的字段类型和字段值都是一致的
+     *
+     * @param tableName  表名
+     * @param pkName     主键名
+     * @param idList     idList
+     * @param commitData 需要更改的model
+     * @return int
+     */
+    int updateByIdList(String tableName, String pkName, List<Long> idList, JSONObject commitData);
+}

+ 0 - 1
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseSaveServiceImpl.java

@@ -14,7 +14,6 @@ import org.springframework.stereotype.Component;
 
 import java.sql.Timestamp;
 import java.util.List;
-import java.util.Locale;
 
 /**
  * @author shiqian

+ 23 - 5
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseSelectServiceImpl.java

@@ -41,9 +41,8 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
     @Override
     public List<JSONObject> selectByCondition(String tableName, JSONObject condition
             , JSONObject packCondition, JSONArray showData, String orderBy, Integer limit, Integer offset) {
-        requireNonNull(tableName);
+        requireNonNull(tableName, "表名为空");
 //        requireNonNull(showData);
-        requireNonNull(limit);
         requireNonNull(orderBy);
         return mapper.selectByCondition(tableName, condition, packCondition, showData, orderBy, limit, offset);
     }
@@ -58,7 +57,7 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
      */
     @Override
     public int countByCondition(String tableName, JSONObject condition, JSONObject packCondition) {
-        requireNonNull(tableName);
+        requireNonNull(tableName, "表名为空");
         return mapper.countByCondition(tableName, condition, packCondition);
     }
 
@@ -72,9 +71,28 @@ public class BaseSelectServiceImpl implements IBaseSelectService {
      */
     @Override
     public JSONObject selectById(String tableName, String pkName, Long id) {
-        requireNonNull(tableName);
-        requireNonNull(pkName);
+        requireNonNull(tableName, "表名为空");
+        requireNonNull(pkName, "主键名称为空");;
         requireNonNull(id);
         return mapper.selectById(tableName, pkName, id);
     }
+
+    /**
+     * 功能描述: 根据id查所有,不支持自定义查询列
+     *
+     * @param tableName 表名
+     * @param pkName    主键名称
+     * @param idList    主键值
+     * @param showData  需要展示的列
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @Override
+    public List<JSONObject> selectByIdList(String tableName, String pkName
+            , List<Long> idList, JSONArray showData) {
+        requireNonNull(tableName, "表名为空");
+        requireNonNull(pkName, "主键名称为空");;
+        requireNonNull(idList);
+
+        return mapper.selectByIdList(tableName, pkName, idList, showData);
+    }
 }

+ 39 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseSubmitServiceImpl.java

@@ -0,0 +1,39 @@
+package com.boman.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.system.mapper.StandardlyMapper;
+import com.boman.system.service.IBaseSubmitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
+
+
+/**
+ * @author shiqian
+ * @date 2021年04月01日 14:56
+ **/
+@Service
+public class BaseSubmitServiceImpl implements IBaseSubmitService {
+
+
+    @Autowired
+    private StandardlyMapper mapper;
+
+    /**
+     * 功能描述: 处理提交流程
+     *
+     * @param tableName tableName
+     * @param pkName    pkName
+     * @param model     model
+     * @param id        主键
+     * @return int
+     */
+    @Override
+    public int handlerSubmit(String tableName, String pkName, JSONObject model, Long id) {
+        requireNonNull(model, "提交的数据为空");
+        Long[] longs = new Long[1];
+        longs[0] = id;
+        return mapper.updateById(tableName, model, pkName, longs);
+    }
+}

+ 45 - 0
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/BaseUpdateServiceImpl.java

@@ -0,0 +1,45 @@
+package com.boman.system.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.system.mapper.StandardlyMapper;
+import com.boman.system.service.IBaseUpdateService;
+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年04月01日 11:07
+ **/
+@Service
+public class BaseUpdateServiceImpl implements IBaseUpdateService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(BaseUpdateServiceImpl.class);
+
+    @Autowired
+    private StandardlyMapper mapper;
+
+    /**
+     * 功能描述: 批量修改
+     *
+     * @param tableName  表名
+     * @param pkName     主键名
+     * @param idList     idList
+     * @param commitData 需要更改的model
+     * @return int
+     */
+    @Override
+    public int updateByIdList(String tableName, String pkName, List<Long> idList, JSONObject commitData) {
+        requireNonNull(tableName, "表名为空");
+        requireNonNull(pkName, "主键名称为空");;
+        requireNonNull(idList);
+        requireNonNull(commitData, "需要更改的参数为空");
+
+        return mapper.updateByIdList(tableName, pkName, idList, commitData);
+    }
+}