主数据代码调整

This commit is contained in:
lvleigang 2024-05-09 11:10:33 +08:00
parent abfbf06a69
commit f3a8e43aaf
22 changed files with 99 additions and 71 deletions
service/src/main/java/com/hzya/frame
mdm
mdmModule/entity
mdmModuleDb/entity
mdmModuleDbFileds/entity
mdmModuleDbFiledsRule/entity
mdmModuleDbFiledsRuleFiles/entity
mdmModuleDistribute/entity
mdmModuleDistributeDetail/entity
mdmModuleRole/entity
mdmModuleRoleButton/entity
mdmModuleUserView/entity
mdmModuleView/entity
mdmModuleViewDetail/entity
mdmTableCodeRule/entity
service
sysnew
webapp/src/main/java/com/hzya/frame/webapp

View File

@ -163,7 +163,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -182,7 +181,6 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
@ -267,22 +265,24 @@ where id = #{id}
<!-- 分页查询列表 采用like格式 -->
<select id="queryMdm" resultType="com.hzya.frame.mdm.entity.MdmVo" parameterType="com.hzya.frame.mdm.entity.MdmDto">
select
a.id as id,
a.mdm_name as mdmName,
a.mdm_logo as mdmLogo,
a.mdm_code as mdmCode,
a.mdm_type as mdmType,
sd.column_content as mdmTypeName,
a.remark as remark,
a.create_time as createTime,
a.modify_time as modifyTime,
c.view_name as createUserId,
m.view_name as modifyUserId
a.id as id,
a.mdm_name as mdmName,
a.mdm_logo as mdmLogo,
a.mdm_code as mdmCode,
a.mdm_type as mdmType,
sd.column_content as mdmTypeName,
a.remark as remark,
a.create_time as createTime,
a.modify_time as modifyTime,
d.person_name as createUserId,
n.person_name as modifyUserId
from
mdm_module a
mdm_module a
LEFT JOIN sys_dictionaryshop_new sd on sd.column_value = a.mdm_type and sd.tab_name = 'mdm' and sd.column_name = 'mdm_type' and sd.used_sts = '1'
LEFT JOIN sys_user c on c.id = a.create_user_id and c.sts = 'Y'
LEFT JOIN sys_person d on d.id = c.person_id and d.sts = 'Y'
LEFT JOIN sys_user m on m.id = a.modify_user_id and m.sts = 'Y'
LEFT JOIN sys_person n on n.id = m.person_id and n.sts = 'Y'
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and a.id like concat('%',#{id},'%')</if>
<if test="mdmName != null and mdmName != ''">and a.mdm_name like concat('%',#{mdmName},'%')</if>

View File

@ -150,7 +150,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -167,9 +166,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db a WHERE a.sts =
'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -174,7 +174,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -193,9 +192,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds a WHERE
a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -169,7 +169,6 @@
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -190,7 +189,6 @@
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds_rule a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -152,7 +152,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -169,9 +168,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from
mdm_module_db_fileds_rule_files a WHERE a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -169,7 +169,6 @@
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="addPlug != null and addPlug != ''"> add_plug , </if>
<if test="deletePlug != null and deletePlug != ''"> delete_plug , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -190,7 +189,6 @@
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="addPlug != null and addPlug != ''"> #{addPlug} ,</if>
<if test="deletePlug != null and deletePlug != ''"> #{deletePlug} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -204,7 +204,6 @@
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="coordinate != null and coordinate != ''"> coordinate , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -230,7 +229,6 @@
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="coordinate != null and coordinate != ''"> #{coordinate} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -136,7 +136,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -151,9 +150,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_role a WHERE a.sts
= 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -167,7 +167,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -185,9 +184,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_role_button a
WHERE a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -146,7 +146,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -162,9 +161,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_user_view a WHERE
a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -150,7 +150,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -167,9 +166,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view a WHERE a.sts
= 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -151,7 +151,6 @@
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -168,9 +167,7 @@
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_view_detail a
WHERE a.sts = 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -155,7 +155,6 @@
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="dbValue != null and dbValue != ''"> db_value , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -174,7 +173,6 @@
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="dbValue != null and dbValue != ''"> #{dbValue} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_table_code_rule a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)

View File

@ -67,7 +67,7 @@ public interface IMdmService {
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询数据源的服务
* @Description 主数据设置查询数据源字段的服务
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject);
@ -164,7 +164,7 @@ public interface IMdmService {
JsonResultEntity queryMdmShowAll(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 查询数据list 或者 分页
* @Description 查询模版数据list 或者 分页
* @Date 1:33 下午 2023/7/12
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
@ -183,7 +183,7 @@ public interface IMdmService {
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据列表显示 业务数据
* @Description 主数据业务数据
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject);

View File

@ -23,4 +23,12 @@ public interface IIntegrationTaskLivingService extends IBaseService<IntegrationT
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取任务
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getEntity(JSONObject jsonObject);
}

View File

@ -3,6 +3,7 @@ package com.hzya.frame.sysnew.integtationTaskLiving.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.integtationTask.IIntegrationTaskCacheableService;
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
import com.hzya.frame.sysnew.integtationTaskLiving.entity.IntegrationTaskLivingEntity;
import com.hzya.frame.sysnew.integtationTaskLiving.dao.IIntegrationTaskLivingDao;
@ -26,7 +27,9 @@ import java.util.List;
public class IntegrationTaskLivingServiceImpl extends BaseService<IntegrationTaskLivingEntity, String> implements IIntegrationTaskLivingService {
private IIntegrationTaskLivingDao integrationTaskLivingDao;
@Resource
private IIntegrationTaskCacheableService iIntegrationTaskCacheableService;
@Autowired
public void setIntegrationTaskLivingDao(IIntegrationTaskLivingDao dao) {
this.integrationTaskLivingDao = dao;
@ -52,4 +55,27 @@ public class IntegrationTaskLivingServiceImpl extends BaseService<IntegrationTas
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取任务实例
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
IntegrationTaskLivingEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLivingEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = iIntegrationTaskCacheableService.getIntegrationTaskLivingEntity(entity.getId());
if (entity == null) {
return BaseResult.getFailureMessageEntity("获取任务实例失败");
}
return BaseResult.getSuccessMessageEntity("获取任务实例成功", entity);
}
}

View File

@ -22,4 +22,12 @@ public interface IIntegrationTaskLivingDetailsService extends IBaseService<Integ
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取任务
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getEntity(JSONObject jsonObject);
}

View File

@ -52,4 +52,28 @@ public class IntegrationTaskLivingDetailsServiceImpl extends BaseService<Integra
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取任务日志
* @Date 2:36 下午 2024/3/27
**/
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
IntegrationTaskLivingDetailsEntity entity = getData("jsonStr", jsonObject, IntegrationTaskLivingDetailsEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = integrationTaskLivingDetailsDao.get(entity.getId());
if (entity == null) {
return BaseResult.getFailureMessageEntity("获取任务日志失败");
}
return BaseResult.getSuccessMessageEntity("获取任务日志成功", entity);
}
}

View File

@ -75,15 +75,11 @@ public class EntranceServiceImpl implements IEntranceService {
}
//获取类下面的方法
Method[] methods = object.getClass().getMethods();
logger.info("methodsLength:" + methods.length);
if (methods == null || methods.length == 0) {
logger.info("当前methods:" + methods + "methodsLength = " + methods.length);
logger.error("当前service:" + service + "serviceMethod = " + serviceMethod+"未找到");
return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法");
} else {
logger.error("当前methods1:" + methods + "methodsLength = " + methods.length);
}
for (Method m : methods) {
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
if (null != m) {
if (m.getName().equals(serviceMethod.trim())) {
if (m.getName().startsWith("thirdInterface")) {//TODO 后续可能要加强校验规则
@ -131,15 +127,13 @@ public class EntranceServiceImpl implements IEntranceService {
return BaseResult.getFailureMessageEntity("token无效");
}
}
logger.info("m.getNameEquals成功");
JSONObject jsonObject = new JSONObject();
if (!ObjectUtils.isEmpty(body)) {
jsonObject.put("jsonStr", body);
}
JsonResultEntity jsonResultEntity;
try {
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
logger.info("请求的参数jsonObject" + jsonObject.toJSONString());
logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>请求的参数jsonObject" + jsonObject.toJSONString());
jsonResultEntity = (JsonResultEntity) m.invoke(object, jsonObject);
logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
return jsonResultEntity;

View File

@ -43,7 +43,7 @@ public class AopDynamicRoutingDataSourceInit {
@Before("@annotation(dsAnnotation)")
public void beforeDynamicRoutingDataSourceInitMethod(JoinPoint joinPoint, DS dsAnnotation) {
logger.info("beforeDynamicRoutingDataSourceInitMethod:拦截所有使用ds注解的方法根据ds的value值初始化数据源");
//logger.info("beforeDynamicRoutingDataSourceInitMethod:拦截所有使用ds注解的方法根据ds的value值初始化数据源");
String dsValue = dsAnnotation.value();
if (dsValue != null && !"".equals(dsValue) && dsValue.contains("#")) {
Object[] args = joinPoint.getArgs();
@ -63,13 +63,13 @@ public class AopDynamicRoutingDataSourceInit {
try {
dsDatasource = ds.getDataSource(dsValue);
} catch (CannotFindDataSourceException exception) {
logger.info("beforeDynamicRoutingDataSourceInitMethod:根据ds获取dsDatasource失败异常信息" + "exception.getMessage()" + " 执行初始化数据源:" + dsValue);
//logger.info("beforeDynamicRoutingDataSourceInitMethod:根据ds获取dsDatasource失败异常信息" + "exception.getMessage()" + " 执行初始化数据源:" + dsValue);
SysDataSourceEntity entity = new SysDataSourceEntity();
entity.setSts("Y");
entity.setUseState(1);
entity.setSourceCode(dsValue);
List<SysDataSourceVo> sysDataSourceEntities = sysDataSourceDao.queryDSBase(entity);
logger.info("beforeDynamicRoutingDataSourceInitMethod:根据dsValue获取数据源信息查询结果 sysDataSourceEntities.size:" + sysDataSourceEntities.size());
//logger.info("beforeDynamicRoutingDataSourceInitMethod:根据dsValue获取数据源信息查询结果 sysDataSourceEntities.size:" + sysDataSourceEntities.size());
if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) {
for (int i = 0; i < sysDataSourceEntities.size(); i++) {
JSONObject defaultDataSourceProperties = new JSONObject();

View File

@ -42,7 +42,7 @@ public class BaseFilter implements Filter {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
logger.info("第二过滤器:验证权限");
//logger.info("第二过滤器:验证权限");
HttpServletResponseWrapper wrapper = new HttpServletResponseWrapper((HttpServletResponse) servletResponse);
HttpServletRequest request = (HttpServletRequest) servletRequest;
String requestURI = request.getRequestURI();

View File

@ -24,7 +24,7 @@ public class ExceptionOptionFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
try {
LOGGER.info("第一过滤器处理异常Filter");
//LOGGER.info("第一过滤器处理异常Filter");
filterChain.doFilter(request, response);
} catch (Exception e) {
e.printStackTrace();