package com.orangeforms.common.core.base.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.hutool.core.util.ReflectUtil;
import com.alibaba.fastjson.JSONObject;
import com.orangeforms.common.core.annotation.*;
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
import com.orangeforms.common.core.base.client.BaseClient;
import com.orangeforms.common.core.constant.AggregationKind;
import com.orangeforms.common.core.constant.AggregationType;
import com.orangeforms.common.core.constant.GlobalDeletedFlag;
import com.orangeforms.common.core.exception.InvalidDataFieldException;
import com.orangeforms.common.core.exception.MyRuntimeException;
import com.orangeforms.common.core.exception.RemoteDataBuildException;
import com.orangeforms.common.core.object.*;
import com.orangeforms.common.core.util.AopTargetUtil;
import com.orangeforms.common.core.util.ApplicationContextHolder;
import com.orangeforms.common.core.util.MyModelUtil;
import com.orangeforms.common.core.util.LogMessageUtil;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import static java.util.stream.Collectors.*;
/**
* 所有Service的基类。
*
* @param <M> Model对象的类型。
* @param <K> Model对象主键的类型。
* @author Jerry
* @date 2020-08-08
*/
@Slf4j
public abstract class BaseService<M, K extends Serializable> extends ServiceImpl<BaseDaoMapper<M>, M> implements IBaseService<M, K> {
/**
* 当前Service关联的主Model实体对象的Class。
*/
@Getter
protected final Class<M> modelClass;
/**
* 当前Service关联的主Model实体对象主键字段的Class。
*/
protected final Class<K> idFieldClass;
/**
* 当前Service关联的主Model对象的实际表名称。
*/
protected final String tableName;
/**
* 当前Service关联的主Model对象主键字段名称。
*/
protected String idFieldName;
/**
* 当前Service关联的主数据表中主键列名称。
*/
protected String idColumnName;
/**
* 当前Service关联的主Model对象逻辑删除字段名称。
*/
protected String deletedFlagFieldName;
/**
* 当前Service关联的主数据表中逻辑删除字段名称。
*/
protected String deletedFlagColumnName;
/**
* 当前Service关联的主Model对象租户Id字段。
*/
protected Field tenantIdField;
/**
* 当前Service关联的主Model对象租户Id字段名称。
*/
protected String tenantIdFieldName;
/**
* 当前Service关联的主数据表中租户Id列名称。
*/
protected String tenantIdColumnName;
/**
* 当前Job服务源主表Model对象的最后更新时间字段名称。
*/
protected String jobUpdateTimeFieldName;
/**
* 当前Job服务源主表Model对象的最后更新时间列名称。
*/
protected String jobUpdateTimeColumnName;
/**
* 当前业务服务源主表Model对象最后更新时间字段名称。
*/
protected String updateTimeFieldName;
/**
* 当前业务服务源主表Model对象最后更新时间列名称。
*/
protected String updateTimeColumnName;
/**
* 当前业务服务源主表Model对象最后更新用户Id字段名称。
*/
protected String updateUserIdFieldName;
/**
* 当前业务服务源主表Model对象最后更新用户Id列名称。
*/
protected String updateUserIdColumnName;
/**
* 当前Service关联的主Model对象主键字段赋值方法的反射对象。
*/
protected Method setIdFieldMethod;
/**
* 当前Service关联的主Model对象主键字段访问方法的反射对象。
*/
protected Method getIdFieldMethod;
/**
* 当前Service关联的主Model对象逻辑删除字段赋值方法的反射对象。
*/
protected Method setDeletedFlagMethod;
/**
* 当前Service关联的主Model对象的所有本地服务常量字典关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> relationConstDictStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有本地服务字典关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationDictStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有本地服务一对一关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationOneToOneStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有本地服务一对多关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationOneToManyStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有多对多关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationManyToManyStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有本地服务一对多聚合关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationOneToManyAggrStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有本地服务多对多聚合关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<LocalRelationStruct> localRelationManyToManyAggrStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有远程字典关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<RemoteRelationStruct> remoteRelationDictStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有远程一对一关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<RemoteRelationStruct> remoteRelationOneToOneStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有远程一对多聚合关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<RemoteRelationStruct> remoteRelationOneToManyAggrStructList = new LinkedList<>();
/**
* 当前Service关联的主Model对象的所有远程多对多聚合关联的结构列表,该字段在系统启动阶段一次性预加载,提升运行时效率。
*/
private final List<RemoteRelationStruct> remoteRelationManyToManyAggrStructList = new LinkedList<>();
/**
* 基础表的实体对象及表信息。
*/
p
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
橙单中台化低代码生成器。可完整支持多应用、多租户、多渠道、工作流 (Flowable & Activiti)、在线表单、自定义数据同步、自定义Job、多表关联、跨服务多表关联、框架技术栈自由组合等。支持钉钉风格流程编辑器,目前已同时支持两种高颜值流程编辑器。流程工单编号字段,升级为高可靠性的自动编码规则计算处理方式。修复工单打印接口的处理机制问题 (前端也有修改)。修复打印接口的处理机制问题 (前端也有修改)。支持动态多数据源。数据同步服务优化后合并。在线表单、工作流和报表打印等编辑器的 UI 做了进一步的优化和统一。工程 pom.xml 支持环境变量。升级自动编码规则计算的高可靠性处理。支持可生成 common-flow-online 和 common-report 位于独立的服务。
资源推荐
资源详情
资源评论
收起资源包目录
橙单中台化低代码生成器 (4772个子文件)
.browserslistrc 21B
.browserslistrc 21B
.browserslistrc 21B
.browserslistrc 21B
.browserslistrc 21B
.browserslistrc 21B
.browserslistrc 21B
com.anji.captcha.service.CaptchaCacheService 62B
com.anji.captcha.service.CaptchaCacheService 62B
com.anji.captcha.service.CaptchaCacheService 62B
com.anji.captcha.service.CaptchaCacheService 61B
com.anji.captcha.service.CaptchaCacheService 61B
redis.conf 57KB
redis.conf 57KB
redis.conf 57KB
redis.conf 57KB
redis.conf 57KB
redis.conf 57KB
trogdor.conf 1KB
trogdor.conf 1KB
kafka.conf 260B
kafka.conf 260B
index.css 1.28MB
index.css 1.28MB
index.css 1.28MB
index.css 1.28MB
index.css 1.28MB
index.css 1.28MB
index.css 227KB
date-picker.css 83KB
date-picker.css 83KB
date-picker.css 83KB
date-picker.css 83KB
date-picker.css 83KB
date-picker.css 83KB
cascader.css 81KB
cascader.css 81KB
cascader.css 81KB
cascader.css 81KB
cascader.css 81KB
cascader.css 81KB
pagination.css 73KB
pagination.css 73KB
pagination.css 73KB
pagination.css 73KB
pagination.css 73KB
pagination.css 73KB
select.css 63KB
select.css 63KB
select.css 63KB
select.css 63KB
select.css 63KB
select.css 63KB
transfer.css 60KB
transfer.css 60KB
transfer.css 60KB
transfer.css 60KB
transfer.css 60KB
transfer.css 60KB
time-picker.css 58KB
time-picker.css 58KB
time-picker.css 58KB
time-picker.css 58KB
time-picker.css 58KB
time-picker.css 58KB
table.css 51KB
table.css 51KB
table.css 51KB
table.css 51KB
table.css 51KB
table.css 51KB
message-box.css 50KB
message-box.css 50KB
message-box.css 50KB
message-box.css 50KB
message-box.css 50KB
message-box.css 50KB
time-select.css 42KB
time-select.css 42KB
time-select.css 42KB
time-select.css 42KB
time-select.css 42KB
time-select.css 42KB
slider.css 42KB
slider.css 42KB
slider.css 42KB
slider.css 42KB
slider.css 42KB
slider.css 42KB
cascader-panel.css 41KB
cascader-panel.css 41KB
cascader-panel.css 41KB
cascader-panel.css 41KB
cascader-panel.css 41KB
cascader-panel.css 41KB
col.css 38KB
col.css 38KB
col.css 38KB
col.css 38KB
col.css 38KB
共 4772 条
- 1
- 2
- 3
- 4
- 5
- 6
- 48
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6649
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Q1.py
- 企业政府灵智电子政务网站系统-lingzhi.rar
- Thinkphp内核开发Lsky Pro兰空图床网站源码.rar
- 基于FPGA(XC6SLX9)+SDRAM+AD7829多通道数据采集板硬件(原理图+PCB)工程文件.zip
- 阿里巴巴精准测试体系:基于代码链路分析的性能优化方案
- mmexport1714217773503.jpg
- 【图片网盘外链系统5.0】全新前端UI界面设计 支持图片违规检测网站自适应H5源码.rar
- jsp+sql的BBS论坛系统.zip
- 网盘外链PHP开发彩虹网盘外链程序源码.rar
- 2023年最新文件快递柜系统网站源码 保护用户隐私的匿名口令分享和临时文件分享功能.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页