Quellcode durchsuchen

删除多余class

shiqian vor 4 Jahren
Ursprung
Commit
1c243bf8fa

+ 0 - 70
boman-modules/boman-system/src/main/java/com/boman/system/common/BaseTableDTO.java

@@ -1,70 +0,0 @@
-//package com.boman.system.common;
-//
-//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;
-//
-//    @JSONField(name = "delMTable")
-//    private Boolean delMTable;
-//
-//    @JSONField(name = "tabItem")
-//    private JSONObject tabItem;
-//
-//    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;
-//    }
-//
-//    public Boolean getDelMTable() {
-//        return delMTable;
-//    }
-//
-//    public void setDelMTable(Boolean delMTable) {
-//        this.delMTable = delMTable;
-//    }
-//
-//    public JSONObject getTabItem() {
-//        return tabItem;
-//    }
-//
-//    public void setTabItem(JSONObject tabItem) {
-//        this.tabItem = tabItem;
-//    }
-//}

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

@@ -1,91 +0,0 @@
-//package com.boman.system.common;
-//
-//import com.alibaba.fastjson.JSONObject;
-//import com.alibaba.fastjson.annotation.JSONField;
-//import lombok.Data;
-//import lombok.EqualsAndHashCode;
-//import lombok.ToString;
-//
-//import java.io.Serializable;
-//import java.util.List;
-//
-///**
-// * @author:zc
-// * @since:2018/12/27
-// * @createat:2018/12/274:41 PM
-// */
-//@Data
-//@ToString
-//@EqualsAndHashCode
-//public class BaseTableSaveDTO implements Serializable {
-//
-//    private static final long serialVersionUID = -8653990707913725671L;
-//    @JSONField(name = "objId")
-//    private Long objId;
-//
-//    @JSONField(name = "fixedData")
-//    private JSONObject fixedData;
-//
-//    @JSONField(name = "table")
-//    private String table;
-//
-//    /**
-//     * 逻辑删除,数据库对应的属性名称
-//     */
-//    @JSONField(name = "logicDelName")
-//    private String logicDelName;
-//
-//    /**
-//     * 逻辑删除,数据库对应的属性值
-//     */
-//    @JSONField(name = "logicDelValue")
-//    private String logicDelValue;
-//
-//    /**
-//     * 删除时,前台传过来需要删除的idList
-//     */
-//    @JSONField(name = "idList")
-//    private List<Long> idList;
-//
-//    /**
-//     * 批量提交时,提交到后台的数据
-//     */
-//    @JSONField(name = "commitData")
-//    private List<JSONObject> commitData;
-//
-//    /**
-//     * orderBy eg: order_by columnName desc
-//     */
-//    @JSONField(name = "orderBy")
-//    private String orderBy;
-//
-//    /**
-//     * 分页
-//     */
-//    @JSONField(name = "pageNo")
-//    private Integer pageNo;
-//
-//    /**
-//     * 分页
-//     */
-//    @JSONField(name = "pageSize")
-//    private Integer pageSize;
-//
-//    /**
-//     * 状态
-//     */
-//    @JSONField(name = "status")
-//    private String status;
-//
-//
-//    public int getLimit() {
-//        return pageNo == 0 ? 0 : (pageNo - 1) * pageSize;
-//    }
-//
-//    public int getOffset(){
-//        return pageSize == 0 ? 10 : pageSize;
-//    }
-//
-//}
-//
-//

+ 0 - 11
boman-modules/boman-system/src/main/java/com/boman/system/common/DictConstant.java

@@ -1,11 +0,0 @@
-//package com.boman.system.common;
-//
-///**
-// * @author shiqian
-// * @date 2021年04月02日 14:52
-// **/
-//public class DictConstant {
-//
-//    public static final String DICT_LABEL = "dictLabel";
-//    public static final String DICT_VALUE = "dictValue";
-//}

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

@@ -1,134 +0,0 @@
-//package com.boman.system.common;
-//
-//import com.google.common.collect.Lists;
-//
-//import java.util.List;
-//
-///**
-// * @author shiqian
-// * @date 2021年03月26日 09:47
-// **/
-//public class FormDataConstant {
-//
-//    /**
-//     * 删除数据时,需要删除的业务表的主键
-//     */
-//    public static final String ID_LIST = "idList";
-//
-//    /**
-//     * id标识
-//     */
-//    public static final String ID = "id";
-//
-//    /**
-//     * 查询的条件
-//     */
-//    public static final String CONDITION = "condition";
-//
-//    /**
-//     * 查询后需要返回到前台的字段
-//     */
-//    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";
-//
-//    /**  根据表名查询表单时,返回给前台的查询字段   */
-//    public static final String QUERY_LIST = "queryList";
-//
-//    /**  根据表名查询表单时,返回给前台的按钮 (其实不是list而是 "AMDQSUE"的字符串 */
-//    public static final String BUTTON_LIST = "buttonList";
-//
-//    /**  根据表名查询表单时,返回给前台列表展示的列*/
-//    public static final String TABLE_HEAD_LIST = "tableHeadList";
-//
-//    /**  分页  总条数*/
-//    public static final String PAGE_TOTAL = "total";
-//
-//    /**  分页 总记录*/
-//    public static final String PAGE_ROWS = "rows";
-//
-//
-//    /**  数据库字段创建人*/
-//    public static final String UPDATE_BY = "UPDATE_BY";
-//
-//
-//    /**  数据库字段创建时间*/
-//    public static final String UPDATE_TIME = "UPDATE_TIME";
-//
-//    /**  数据库字段创建人*/
-//    public static final String CREATE_BY = "create_by";
-//
-//    /**  数据库字段创建时间*/
-//    public static final String CREATE_TIME = "create_time";
-//
-//
-//    /**  状态 */
-//    public static final String STATUS = "status";
-//
-//
-//    /**  单选框 */
-//    public static final String RADIO = "radio";
-//
-//
-//    /**  复选框 */
-//    public static final String CHECKBOX = "checkbox";
-//
-//
-//    /**  下拉框 */
-//    public static final String SELECT = "select";
-//
-//
-//    /**  需要查字典表的框框 */
-//    public static final List<String> NEED_QUERY_DICT_LIST = Lists.newArrayList(RADIO, CHECKBOX, SELECT);
-//
-//
-//
-//}

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

@@ -1,59 +0,0 @@
-//package com.boman.system.common;
-//
-//import com.alibaba.fastjson.JSONObject;
-//
-//
-//import com.boman.gen.domain.GenTable;
-//import com.google.common.collect.Maps;
-//import lombok.Data;
-//import lombok.Getter;
-//import lombok.Setter;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//
-//
-//import java.util.Map;
-//
-///**
-// * @author shiqian
-// * @description
-// * @date 2021年03月22日 10:04
-// **/
-//@Data
-//public class MainTableRecord {
-//
-//    private static final Logger LOGGER = LoggerFactory.getLogger(MainTableRecord.class);
-//
-//    private TableServiceContext context;
-//    private RowRecord mainData;
-//
-//    @Setter
-//    @Getter
-//    private RowResult result;
-//
-//
-//    public MainTableRecord(TableServiceContext context, GenTable genTable, Long id, JSONObject fixedData, JSONObject delTables) {
-//        this.context = context;
-//        this.mainData = new RowRecord(id, genTable, fixedData);
-//    }
-//
-//    public Long getId() {
-//        return mainData.getId();
-//    }
-//
-//    public void setId(Long value) {
-//        mainData.setId(value);
-//    }
-//
-//    public GenTable getTable() {
-//        return mainData.getGenTable();
-//    }
-//
-//    public JSONObject getCommitData() {
-//        return mainData.getCommitData();
-//    }
-//
-//    public JSONObject getOriginalData() {
-//        return mainData.getOriginalData();
-//    }
-//}

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

@@ -1,58 +0,0 @@
-//package com.boman.system.common;
-//
-//import com.alibaba.fastjson.JSONObject;
-//import com.boman.common.core.utils.SpringUtils;
-//import com.boman.gen.domain.GenTable;
-//import com.boman.system.mapper.StandardlyMapper;
-//import lombok.Data;
-//import lombok.Getter;
-//import lombok.Setter;
-//import lombok.extern.slf4j.Slf4j;
-//
-///**
-// * @author zc
-// * @date 2019/02/19
-// */
-//@Data
-//@Slf4j
-//public class RowRecord {
-//
-//    private GenTable genTable;
-//
-//    private Long id;
-//
-//    //提交过来的数据
-//    private JSONObject postData = new JSONObject();
-//
-//    //原数据
-//    private JSONObject originalData = new JSONObject();
-//
-//    //新数据
-//    private JSONObject newData;
-//
-//    //将要提交到数据库中的数据
-//    private JSONObject commitData = new JSONObject();
-//
-//    public RowRecord(Long id, GenTable genTable, JSONObject fixedData) {
-//        this.id = id;
-//        this.genTable = genTable;
-//
-//        if (fixedData == null) {
-//            fixedData = new JSONObject();
-//        }
-//
-//        fixedData.forEach((fieldName, fieldValue)->{
-//            postData.put(fieldName.toUpperCase(), fieldValue);
-//        });
-//
-//        for (String key : postData.keySet()) {
-//            commitData.put(key, postData.get(key));
-//        }
-//
-//        JSONObject jsonObject = new JSONObject();
-//        jsonObject.put("baseData", originalData);
-//        jsonObject.put("data", commitData);
-//        newData = new JSONObject(jsonObject);
-//    }
-//
-//}

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

@@ -1,72 +0,0 @@
-//package com.boman.system.common;
-//
-///**
-// * @author shiqian
-// * @description
-// * @date 2021年03月22日 10:59
-// **/
-//public class RowResult {
-//
-//    private Integer code;
-//    private String message;
-//    private Object data;
-//
-//    public RowResult() {
-//    }
-//
-//    public boolean isOk() {
-//        return this.code >= 0;
-//    }
-//
-//    public static RowResult ok(String message) {
-//        return create(0, message);
-//    }
-//
-//    public static RowResult ok(String message, Object data) {
-//        return create(0, message, data);
-//    }
-//
-//    public static RowResult error(String message) {
-//        return create(-1, message);
-//    }
-//
-//    public static RowResult error(String message, Object data) {
-//        return create(-1, message, data);
-//    }
-//
-//    public static RowResult create(Integer errorCode, String message) {
-//        return create(errorCode, message, (Object)null);
-//    }
-//
-//    public static RowResult create(Integer errorCode, String message, Object data) {
-//        RowResult result = new RowResult();
-//        result.code = errorCode;
-//        result.message = message;
-//        result.data = data;
-//        return result;
-//    }
-//
-//    public Integer getCode() {
-//        return this.code;
-//    }
-//
-//    public String getMessage() {
-//        return this.message;
-//    }
-//
-//    public Object getData() {
-//        return this.data;
-//    }
-//
-//    public void setData(final Object data) {
-//        this.data = data;
-//    }
-//
-//    public static boolean checkSuccess(RowResult rowResult){
-//        return null != rowResult && 0 == rowResult.getCode();
-//    }
-//
-//    public static boolean checkFail(RowResult rowResult){
-//        return !checkSuccess(rowResult);
-//    }
-//}

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

@@ -1,66 +0,0 @@
-//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";
-//}

+ 0 - 559
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceCmdService.java

@@ -1,559 +0,0 @@
-//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.DateUtils;
-//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;
-//import com.boman.common.redis.RedisKey;
-//import com.boman.common.redis.service.RedisService;
-//import com.boman.gen.api.RemoteGenTableService;
-//import com.boman.gen.controller.MyController;
-//import com.boman.gen.domain.GenTable;
-//import com.boman.gen.domain.GenTableColumn;
-//import com.boman.gen.domain.GenTableRelation;
-//import com.boman.system.domain.SysDictData;
-//import com.boman.system.service.*;
-//import com.boman.system.utils.IdUtils;
-//import com.google.common.base.Strings;
-//import com.google.common.collect.Lists;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.stereotype.Component;
-//import org.springframework.web.client.RestTemplate;
-//
-//import javax.annotation.Resource;
-//import java.sql.Timestamp;
-//import java.util.*;
-//import java.util.concurrent.TimeUnit;
-//import java.util.stream.Collectors;
-//
-//import static com.boman.common.core.utils.obj.ObjectUtils.*;
-//import static com.boman.system.common.FormDataConstant.CONDITION;
-//import static com.boman.system.common.FormDataConstant.SHOW_DATA;
-//
-///**
-// * @author shiqian
-// * @description
-// * @date 2021年03月22日 09:51
-// **/
-//@Component
-//public class TableServiceCmdService {
-//
-//    @Resource
-//    private IBaseDeleteService deleteService;
-//    @Resource
-//    private IBaseSaveService saveService;
-//    @Resource
-//    private RedisService redisService;
-//    @Resource
-//    private IBaseSelectService selectService;
-//    @Resource
-//    private IBaseSubmitService submitService;
-//    @Resource
-//    private IBaseUpdateService updateService;
-//    @Resource
-//    private  RestTemplate restTemplate;
-//    @Resource
-//    private  ISysDictTypeService dictTypeService;
-//    @Resource
-//    private RemoteGenTableService remoteGenTableService;
-//
-//    private static final Logger LOGGER = LoggerFactory.getLogger(TableServiceCmdService.class);
-//
-//    private BaseTableDTO packTableDTO(BaseTableSaveDTO baseTableSaveDTO) {
-//        BaseTableDTO baseTableDTO = new BaseTableDTO();
-//        baseTableDTO.setFixedData(baseTableSaveDTO.getFixedData());
-//        baseTableDTO.setObjId(baseTableSaveDTO.getObjId());
-//        baseTableDTO.setTable(baseTableSaveDTO.getTable());
-//        return baseTableDTO;
-//    }
-//
-//    public final AjaxResult objectSave(BaseTableSaveDTO baseTableSaveDTO) {
-//        AjaxResult result = AjaxResult.success();
-//        BaseTableDTO baseTableDTO = packTableDTO(baseTableSaveDTO);
-//        TableServiceContext context = TableServiceContext.createFrom(baseTableDTO);
-//        // 拿到pkName和maxId
-//        List<GenTableColumn> columns = context.getTable().getColumns();
-//        String pkName = IdUtils.getPkName(columns);
-//        requireNonNull(pkName, "主键名称为空");
-//
-//        //
-//        List<String> allColumnNameList = columns.stream()
-//                .map(GenTableColumn::getColumnName)
-//                .collect(Collectors.toList());
-//
-//        // 新增
-//        if (ObjectUtils.ltZero(baseTableDTO.getObjId())) {
-//            Long maxId = IdUtils.getMaxId(baseTableDTO.getTable(), pkName);
-//            RowResult rowResult = saveService.insertRow(context.getRealTableName(), pkName, maxId, context.getRows().get(0), allColumnNameList);
-//            if (RowResult.checkSuccess(rowResult)) {
-//                LOGGER.info("保存成功,封装到数据库的数据为: {}", JSON.toJSONString(rowResult.getData()));
-//            } else {
-//                LOGGER.error("保存失败,保持的原始数据为: {}", JSON.toJSONString(baseTableSaveDTO));
-//                result = AjaxResult.error();
-//            }
-//        }else {
-//            JSONObject commitData = context.getRows().get(0).getCommitData();
-//
-//            // 编辑
-//            int effective = updateService.updateByIdList(context, pkName
-//                    , Collections.singletonList(baseTableDTO.getObjId()), commitData);
-//            if (effective > 0) {
-//                LOGGER.info("修改成功,封装到数据库的数据为: {}", JSON.toJSONString(context.getRows().get(0).getCommitData()));
-//            } else {
-//                LOGGER.error("修改失败,前台传来的原始数据为: {}", JSON.toJSONString(context.getRows().get(0).getCommitData()));
-//                result = AjaxResult.error();
-//            }
-//        }
-//
-//        return result;
-//
-//    }
-//
-//    /**
-//     * 功能描述: 通用删除接口 (真的删除)
-//     *
-//     * @param dto 前台传过来的dto
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult objectDelete(BaseTableSaveDTO dto) {
-//        requireNonNull(dto.getTable());
-//        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-//        requireNonNull(idArr);
-//        // 拿到pkName
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
-//        String pkName = IdUtils.getPkName(genTable.getColumns());
-//
-//        List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
-//        for (Long id : idArr) {
-//            RowResult rowResult = deleteService.deleteById(dto.getTable(), pkName, id);
-//            result.add(rowResult);
-//            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
-//        }
-//
-//        // RowResult rowResult = deleteService.objectDelete(idArr, dto.getTable(), requireNonNull(pkName, "主键名称为空"));
-//
-//        return AjaxResult.success(result);
-//    }
-//
-//
-//    /**
-//     * 功能描述: 通用删除接口 (真的删除)
-//     *
-//     * @param dto 前台传过来的dto
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult objectLogicDelete(BaseTableSaveDTO dto) {
-//        requireNonNull(dto.getTable());
-//        Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
-//        requireNonNull(idArr);
-//
-//        // 拿到pkName
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
-//        String pkName = IdUtils.getPkName(genTable.getColumns());
-//
-//        List<RowResult> result = Lists.newArrayListWithCapacity(idArr.length);
-//        JSONObject jsonObject = new JSONObject();
-//        jsonObject.put(dto.getLogicDelName(), dto.getLogicDelValue());
-//        for (Long id : idArr) {
-//            RowResult rowResult = deleteService.objectLogicDelete(new Long[]{id}, dto.getTable(), pkName, jsonObject);
-//            result.add(rowResult);
-//            LOGGER.info(rowResult.getMessage() + ", id: {}", id);
-//        }
-//
-//        return AjaxResult.success(result);
-//    }
-//
-//    /**
-//     * 功能描述: 获取单表单数据
-//     *
-//     * @param dto condition
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult queryList(BaseTableSaveDTO dto) {
-//        requireNonNull(dto.getTable());
-//
-//        // 拿到每个字段对应的查询类型,=、 like、 >、 <
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
-//        JSONObject fixedData = dto.getFixedData();
-//        fixedData = ifNullSetEmpty(fixedData);
-//
-//        // 查询条件
-//        JSONObject condition = ifNullSetEmpty(fixedData.getJSONObject(CONDITION));
-//        List<GenTableColumn> columns = genTable.getColumns();
-//        // 封装好以后的查询条件
-//        JSONObject packCondition = ifNullSetEmpty(packColCondition(columns, condition));
-//        // 需要返回到前台的列
-//        JSONArray showData = ifNullSetEmpty(fixedData.getJSONArray(SHOW_DATA));
-//        JSONObject rows = new JSONObject();
-//        int total = selectService.countByCondition(genTable.getTableName(), condition, packCondition);
-//        rows.put(FormDataConstant.PAGE_TOTAL, total);
-//        if (total <= 0) {
-//            rows.put(FormDataConstant.PAGE_ROWS, null);
-//            return AjaxResult.success(rows);
-//        }
-//
-//        List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
-//                , showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
-//        handlerDate(result);
-//        result = isCustomized(dto.getTable(),result,"trigger_retrieve");
-//        rows.put(FormDataConstant.PAGE_ROWS, result);
-//        return AjaxResult.success(rows);
-//    }
-//
-//    /**
-//     * 功能描述: 把timeStamp转为string
-//     *
-//     * @param result 被转的数据
-//     */
-//    private void handlerDate(List<JSONObject> result) {
-//        if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
-//            return;
-//        }
-//        for (JSONObject jsonObject : result) {
-//            getStrByTimeStamp(jsonObject, FormDataConstant.CREATE_TIME);
-//            getStrByTimeStamp(jsonObject, FormDataConstant.UPDATE_TIME.toLowerCase());
-//        }
-//    }
-//
-//    /**
-//     * 功能描述: 把jsonObject中时间类型转为string,再放到jsonObject中,类型为: yyyy-mm-dd
-//     *
-//     * @param jsonObject jsonObject
-//     * @param columnType create_time update_time...
-//     */
-//    private void getStrByTimeStamp(JSONObject jsonObject, String columnType) {
-//        Date date = jsonObject.getTimestamp(columnType);
-//        if (null != date) {
-//
-//            jsonObject.put(columnType, DateUtils.dateTime(date));
-//        }
-//    }
-//
-//
-//    /**
-//     * 功能描述: 获取单表单数据
-//     *
-//     * @param dto condition
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult getObject(BaseTableSaveDTO dto) {
-//        requireNonNull(dto.getTable());
-//
-//        // 拿到每个字段对应的查询类型,=、 like、 >、 <
-//        // 拿到pkName
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
-//        String pkName = IdUtils.getPkName(genTable.getColumns());
-//
-//        JSONObject fixedData = dto.getFixedData();
-//        fixedData = ifNullSetEmpty(fixedData);
-//        Long id = fixedData.getLong(FormDataConstant.ID);
-//        requireNonNull(id);
-//
-//        // 默认查所有字段,不支持自定义
-//        JSONObject jsonObject = selectService.selectById(genTable.getTableName(), pkName, id);
-//        return AjaxResult.success(jsonObject);
-//    }
-//
-//    /**
-//     * 功能描述: 封装成查询条件 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, Lists.newArrayList(String.valueOf(value), column.getQueryType(), column.getColumnType()));
-//                    break;
-//                }
-//            }
-//        }
-//
-//        return result;
-//    }
-//
-//    /**
-//     * 功能描述: 获取表单查询字段、按钮、表头
-//     * 注意: 都是从redis中拿的,如果数据库和redis不一致,则需刷新一下redis
-//     * 刷新的入口为 {@link MyController#loadTable(com.boman.gen.domain.GenTable)}
-//     * <p>
-//     * eg:{
-//     * "table": "sys_config",
-//     * }
-//     *
-//     * @param condition condition
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult getTableQuery(BaseTableSaveDTO condition) {
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
-//
-//        List<GenTableColumn> columns = genTable.getColumns();
-//        JSONObject jsonObject = new JSONObject();
-//        // 查询字段
-//        ArrayList<GenTableColumn> queryList = Lists.newArrayListWithCapacity(16);
-//        for (GenTableColumn column : columns) {
-//            if (GenTableColumn.IS_QUERY.equalsIgnoreCase(column.getIsQuery())) {
-//                String dictType = column.getDictType();
-//                if (ObjectUtils.isNotEmpty(dictType)) {
-//                    List<SysDictData> sysDictData1 = dictTypeService.selectDictDataByType(dictType);
-//                    column.setSysDictData(coverSysDictDataToJSONObject(sysDictData1));
-//                }
-//
-//                queryList.add(column);
-//            }
-//        }
-//
-//        jsonObject.put(FormDataConstant.QUERY_LIST, queryList);
-//        // genTable.getMenuRole() 暂时数据库没有数据,
-//        jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
-//
-//        // 表头
-//        List<GenTableColumn> tableHeadList = columns.stream()
-//                .filter(genTableColumn -> GenTableColumn.IS_LIST.equals(genTableColumn.getIsList()))
-//                .collect(Collectors.toList());
-//        jsonObject.put(FormDataConstant.TABLE_HEAD_LIST, tableHeadList);
-//        return AjaxResult.success(jsonObject);
-//    }
-//
-//    /**
-//     * 功能描述: 获取表单子表
-//     *
-//     * @param condition condition
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult objectTab(BaseTableSaveDTO condition) {
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.RELATION, condition.getTable());
-//
-//        List<GenTable> childTableList = genTable.getRelationList();
-//        // 此表没有关联子表,查啥查
-//        requireNonNull(childTableList);
-//        // todo
-//        for (GenTable childTable : childTableList) {
-//            String childTableName = childTable.getTableName();
-//            Long childTableTableId = childTable.getTableId();
-//            List<GenTableColumn> childColumns = childTable.getColumns();
-//            //  column_name = 先根据tableName查到id,再用id到relation中查到relation_child_id, 在用这个值去到tableColumn中查到column_name
-//            // select * from childTableName where column_name = objId
-//
-//
-//        }
-//
-//
-//        return AjaxResult.success();
-//    }
-//
-//    public String getChildColumnNameByParentTableName(GenTable parentGenTable, Long childTableTableId){
-//        requireNonNull(parentGenTable.getTableName(), "主表名称为空");
-////        GenTable primaryTable = redisService.getCacheObject(RedisKey.TABLE_INFO + genTable.getTableName());
-//        Long parentTableId = parentGenTable.getTableId();
-//        List<GenTableRelation> relations = redisService.getCacheObject(RedisKey.RELATION_INFO);
-//        relations = relations.stream()
-//                .filter(relation -> relation.getRelationParentId().equals(parentTableId))
-//                .collect(Collectors.toList());
-//
-//        for (GenTableRelation relation : relations) {
-//            if (relation.getRelationChildId().equals(6L)) {
-//               // tableColumnService.selectGenTableColumnListByTableId(childTableTableId);
-////                return
-//            }
-//        }
-//
-//
-//        return "";
-//
-//    }
-//
-//    /**
-//     * 功能描述: 表单提交接口
-//     *
-//     * @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);
-//
-//        for (JSONObject commitDatum : commitData) {
-//            String dbStatus = getStatusFromFormData(commitDatum, beforeList);
-//            // 只能是未提交的状态下,才能调用提交
-//            if (isSubmit) {
-//                // 只能是未提交的状态下,才能调用提交, 下面是不允许
-//                if (!SubmitConstant.NOT_SUBMIT.equals(dbStatus)) {
-//                    commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
-//                } else {
-//                    handlerSubmit(tableName, pkName, commitDatum);
-//                }
-//            } else {
-//                // 只有在已提交的情况下才能反提交, 下面是不允许
-//                if (!SubmitConstant.SUBMITTED.equals(dbStatus)) {
-//                    commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
-//                } else {
-//                    handlerSubmit(tableName, pkName, commitDatum);
-//                }
-//            }
-//        }
-//        return AjaxResult.success(commitData);
-//    }
-//
-//    /**
-//     * 功能描述: 处理提交和反提交
-//     *
-//     * @param tableName   tableName
-//     * @param pkName      pkName
-//     * @param commitDatum 返回给前台的数据
-//     */
-//    private void handlerSubmit(String tableName, String pkName, JSONObject commitDatum) {
-//        commitDatum.put(FormDataConstant.CREATE_BY, SecurityUtils.getUserId());
-//        commitDatum.put(FormDataConstant.CREATE_TIME, new Timestamp(System.currentTimeMillis()));
-//        int effective = submitService.handlerSubmit(tableName, pkName, commitDatum, commitDatum.getLong(FormDataConstant.ID));
-//        if (effective > 0) {
-//            commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.SUCCESS);
-//        } else {
-//            commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.FAIL);
-//        }
-//    }
-//
-//    private String getStatusFromFormData(JSONObject next, List<JSONObject> commitData) {
-//        for (JSONObject jsonObject : commitData) {
-//            if (jsonObject.getLong(FormDataConstant.ID).equals(next.getLong(FormDataConstant.ID))) {
-//                return jsonObject.getString(FormDataConstant.STATUS);
-//            }
-//        }
-//        throw new IllegalArgumentException("不可能没有一个合适的");
-//    }
-//
-//
-//    /**
-//     * 是否定制
-//     * 判断是否需要转发到定制接口
-//     * @param tableName 表明
-//     * @param result 结果
-//     * @param action 动作
-//     * @return 结果
-//     */
-//    public List<JSONObject> isCustomized(String tableName, List<JSONObject> result, String action) {
-//        requireNonNull(tableName);
-//        requireNonNull(action);
-//        if (result != null && result.size() > 0){
-//            //获取到服务名称
-//            String triggerName = getTriggerName(tableName, action);
-//            if(triggerName != null){
-//                //组织请求 acos + RestTemplate
-//                return restTemplate.postForObject("http://" + triggerName, result, List.class);
-//            }
-//        }
-//        return result;
-//    }
-//
-//    /**
-//     * 判断是什么action
-//     * @param tableName 表明
-//     * @param action 动作
-//     * @return
-//     */
-//    private String getTriggerName(String tableName, String action){
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
-//        requireNonNull(genTable);
-//        if (action.equals(TriggerActionConstant.ACTION_CREATE)){
-//            return genTable.getTriggerCreate();
-//        }else if (action.equals(TriggerActionConstant.ACTION_RETRIEVE)){
-//            return genTable.getTriggerRetrieve();
-//        }else if (action.equals(TriggerActionConstant.ACTION_UPDATE)){
-//            return genTable.getTriggerUpdate();
-//        }else if (action.equals(TriggerActionConstant.ACTION_DELETE)){
-//            return genTable.getTriggerDelete();
-//        }else if (action.equals(TriggerActionConstant.ACTION_SUBMIT)){
-//            return genTable.getTriggerSubmit();
-//        }
-//        return null;
-//    }
-//
-//    /**
-//     * 功能描述: 查询表从redis中
-//     *
-//     * @param redisKeyPrefix 前缀
-//     * @param tableName      表名
-//     * @return com.boman.gen.domain.GenTable
-//     */
-//    private GenTable getTableFromRedisByTableName(String redisKeyPrefix, String tableName) {
-//        String key = requireNonNull(redisKeyPrefix) + requireNonNull(tableName);
-//        GenTable genTable = redisService.getCacheObject(key);
-//        if (ObjectUtils.isEmpty(genTable)) {
-//            genTable = remoteGenTableService.getByTableName(tableName);
-//            requireNonNull(genTable, "未找到表对应的信息");
-//            // {@link com.boman.gen.controller.MyController.packTableAndInsertToRedis} 失效时间
-//            redisService.setCacheObject(key, genTable, 12L, TimeUnit.DAYS);
-//        }
-//
-//        return genTable;
-//    }
-//
-//    /**
-//     * 功能描述: 反提交接口, 更改的字段类型和字段值都是一致的
-//     *                {
-//     *                    "table": "sys_config",
-//     *                }
-//     *
-//     *
-//     * @param condition condition
-//     * @return com.boman.common.core.web.domain.AjaxResult
-//     */
-//    public AjaxResult getByTableName(BaseTableSaveDTO condition) {
-//        requireNonNull(condition.getTable(), "表名为空");
-//        GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
-//        List<GenTableColumn> columns = genTable.getColumns();
-//        for (GenTableColumn column : columns) {
-//            String dictType = column.getDictType();
-//            if (ObjectUtils.isNotEmpty(dictType)) {
-//                List<SysDictData> sysDictData1 = dictTypeService.selectDictDataByType(dictType);
-//                column.setSysDictData(coverSysDictDataToJSONObject(sysDictData1));
-//            }
-//        }
-//
-//        return AjaxResult.success(genTable);
-//    }
-//
-//    public List<JSONObject> coverSysDictDataToJSONObject(List<SysDictData> sysDictData) {
-//        List<JSONObject> result = Lists.newArrayListWithCapacity(sysDictData.size());
-//        for (SysDictData data : sysDictData) {
-//            JSONObject jsonObject = new JSONObject();
-//            String dictLabel = data.getDictLabel();
-//            String dictValue = data.getDictValue();
-//            jsonObject.put(DictConstant.DICT_LABEL, dictLabel);
-//            jsonObject.put(DictConstant.DICT_VALUE, dictValue);
-//            result.add(jsonObject);
-//        }
-//
-//        return result;
-//
-//    }
-//}
-//

+ 0 - 184
boman-modules/boman-system/src/main/java/com/boman/system/common/TableServiceContext.java

@@ -1,184 +0,0 @@
-//package com.boman.system.common;
-//
-//import com.alibaba.fastjson.JSONObject;
-//import com.boman.common.core.utils.SpringUtils;
-//import com.boman.common.redis.RedisKey;
-//import com.boman.common.redis.service.RedisService;
-//import com.boman.gen.domain.GenTable;
-//import com.google.common.base.Strings;
-//import com.google.common.collect.Lists;
-//import com.google.common.collect.Maps;
-//import org.springframework.stereotype.Service;
-//import org.springframework.util.StringUtils;
-//
-//import javax.annotation.Resource;
-//import java.sql.Timestamp;
-//import java.util.*;
-//
-///**
-// * @author shiqian
-// * @description
-// * @date 2021年03月22日 09:58
-// **/
-//@Service
-//public class TableServiceContext {
-//
-//    private final static String PREFIX = "Controller:/event/do";
-//
-//    /**
-//     * 当前表
-//     */
-//    private GenTable table;
-//
-//    /**
-//     * 真实表名
-//     */
-//    private String realTableName;
-//
-//    /**
-//     * 动作名(ADD,SAVE,SUBMIT,VOID,UNSUBMIT)
-//     */
-//    private String actionName;   //Controller:/event/doAdd
-//
-//    /**
-//     * 业务发生的时间戳
-//     */
-//    private Timestamp currentTime;
-//
-//    /**
-//     * 上行的数据
-//     * 每个row对象对应到一条单据(如果存在事务,应该在这个级别上体现)
-//     */
-//    private List<MainTableRecord> rows;
-//
-//    /**
-//     * 本次请求存放的临时数据
-//     * !!慎用,最好不要在各个对象间传递
-//     */
-//    private Map<String, Object> values;
-//
-//    private boolean isDelMtable;
-//
-//    /**
-//     * 是否批量新增
-//     */
-//    private boolean isInsertBacth = false;
-//
-//    private TableServiceContext() {
-//        values = Maps.newHashMap();
-//    }
-//
-//
-//    @Resource
-//    private RedisService redisService;
-//
-//    public static TableServiceContext createFrom(BaseTableDTO baseTableDTO) {
-//        TableServiceContext result = new TableServiceContext();
-//        String tableName = baseTableDTO.getTable();
-//        if (StringUtils.isEmpty(tableName)) {
-//            throw new IllegalArgumentException("表名参数不能为空");
-//        }
-//
-//        //从redis中获取表信息
-//        RedisService redisService = SpringUtils.getBean(RedisService.class);
-//        result.table = redisService.getCacheObject(RedisKey.TABLE_INFO + tableName);
-//
-//        if (result.table == null) {
-//            throw new IllegalArgumentException(tableName + "表信息不存在");
-//        }
-//
-//        result.realTableName = result.table.getTableName();
-//        if (Strings.isNullOrEmpty(result.realTableName)) {
-//            throw new IllegalArgumentException(tableName + "表名不存在");
-//        }
-//
-//        // 前台传过来的数据
-//        JSONObject fixedData = baseTableDTO.getFixedData();
-//        //删除
-//        Boolean isdelmtable = baseTableDTO.getDelMTable();
-//        JSONObject tabItem = baseTableDTO.getTabItem();
-//        if (isdelmtable != null) {
-//            result.isDelMtable = isdelmtable;
-//        }
-//
-//        // 获取objid判断 新增或更新
-//        Long objid = baseTableDTO.getObjId();
-//        MainTableRecord mainRowData = new MainTableRecord(result, result.table, objid, fixedData, tabItem);
-//        result.rows = Lists.newArrayList();
-//        result.rows.add(mainRowData);
-//
-//        return result;
-//    }
-//
-//    public GenTable getTable() {
-//        return table;
-//    }
-//
-//    public void setTable(GenTable table) {
-//        this.table = table;
-//    }
-//
-//    public String getRealTableName() {
-//        return realTableName;
-//    }
-//
-//    public void setRealTableName(String realTableName) {
-//        this.realTableName = realTableName;
-//    }
-//
-//    public String getActionName() {
-//        return actionName;
-//    }
-//
-//    public void setActionName(String actionName) {
-//        this.actionName = actionName;
-//    }
-//
-//    public Timestamp getCurrentTime() {
-//        return currentTime;
-//    }
-//
-//    public void setCurrentTime(Timestamp currentTime) {
-//        this.currentTime = currentTime;
-//    }
-//
-//    public List<MainTableRecord> getRows() {
-//        return rows;
-//    }
-//
-//    public void setRows(List<MainTableRecord> rows) {
-//        this.rows = rows;
-//    }
-//
-//    public Map<String, Object> getValues() {
-//        return values;
-//    }
-//
-//    public void setValues(Map<String, Object> values) {
-//        this.values = values;
-//    }
-//
-//    public boolean isDelMtable() {
-//        return isDelMtable;
-//    }
-//
-//    public void setDelMtable(boolean delMtable) {
-//        isDelMtable = delMtable;
-//    }
-//
-//    public boolean isInsertBacth() {
-//        return isInsertBacth;
-//    }
-//
-//    public void setInsertBacth(boolean insertBacth) {
-//        isInsertBacth = insertBacth;
-//    }
-////
-////    public Collection<Filter> getFilters() {
-////        return filters;
-////    }
-////
-////    public void setFilters(Collection<Filter> filters) {
-////        this.filters = filters;
-////    }
-//}

+ 0 - 30
boman-modules/boman-system/src/main/java/com/boman/system/common/TriggerActionConstant.java

@@ -1,30 +0,0 @@
-//package com.boman.system.common;
-//
-///**
-// * @author tjf
-// * @Date: 2021/04/01/16:33
-// */
-//public class TriggerActionConstant {
-//
-//    /**
-//     * 新增
-//     */
-//    public static final String ACTION_CREATE = "trigger_create";
-//
-//    /**
-//     * 查询
-//     */
-//    public static final String ACTION_RETRIEVE = "trigger_retrieve";
-//    /**
-//     * 修改
-//     */
-//    public static final String ACTION_UPDATE = "trigger_update";
-//    /**
-//     * 删除
-//     */
-//    public static final String ACTION_DELETE = "trigger_delete";
-//    /**
-//     * 提交
-//     */
-//    public static final String ACTION_SUBMIT = "trigger_submit";
-//}