Merge remote-tracking branch 'origin/lvleigang' into lvleigang

This commit is contained in:
xiang2lin 2024-05-30 15:21:21 +08:00
commit 21a81cde5e
17 changed files with 1354 additions and 82 deletions

View File

@ -0,0 +1,3 @@
ALTER TABLE sys_data_source ADD COLUMN data_state char(1) DEFAULT NULL COMMENT '数据源状态 0校验失败 1校验成功';
UPDATE sys_data_source SET data_state = '1';
COMMIT;

View File

@ -736,7 +736,7 @@ public class MdmServiceImpl implements IMdmService {
maps.put("tableName", mainMdmModuleDb.getDbName());//表名
maps.put("tableRemark", mainMdmModuleDb.getRemark());//表备注
maps.put("databaseFields", dbFiledsDtos);//字段
//mdmModuleDao.alterTable(maps);
mdmModuleDao.alterTable(maps);
}
}

View File

@ -30,7 +30,8 @@ public class SysDataSourceEntity extends BaseEntity {
private String serviceName;
/** 使用状态1启用0锁定 */
private Integer useState;
/** 数据源状态 1校验成功0校验失败 */
private String dataState;
public String getSourceCode() {
return sourceCode;
@ -155,5 +156,13 @@ public class SysDataSourceEntity extends BaseEntity {
return sourceTypeName;
}
public String getDataState() {
return dataState;
}
public void setDataState(String dataState) {
this.dataState = dataState;
}
}

View File

@ -14,6 +14,7 @@
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="serviceName" column="service_name" jdbcType="VARCHAR"/>
<result property="useState" column="use_state" jdbcType="INTEGER"/>
<result property="dataState" column="data_state" jdbcType="INTEGER"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
@ -35,7 +36,8 @@
,password
,service_name
,use_state
,sorts
,data_state
,sorts
,create_user_id
,create_time
,modify_user_id
@ -61,6 +63,7 @@
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
@ -92,6 +95,7 @@
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
@ -119,6 +123,7 @@
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
@ -151,6 +156,7 @@
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
@ -183,7 +189,8 @@
login_name as loginName,
password as password,
service_name as serviceName,
use_state as useState
use_state as useState,
data_state as dataState
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
@ -198,6 +205,7 @@
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
@ -227,7 +235,8 @@
login_name as loginName,
password as password,
service_name as serviceName,
use_state as useState
use_state as useState,
data_state as dataState
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
@ -241,6 +250,7 @@
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
@ -271,6 +281,7 @@
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
@ -304,6 +315,7 @@
<if test="password != null and password != ''">or password = #{password}</if>
<if test="serviceName != null and serviceName != ''">or service_name = #{serviceName}</if>
<if test="useState != null">or use_state = #{useState}</if>
<if test="dataState != null">or data_state = #{dataState}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
@ -333,6 +345,7 @@
<if test="password != null and password != ''">password ,</if>
<if test="serviceName != null and serviceName != ''">service_name ,</if>
<if test="useState != null">use_state ,</if>
<if test="dataState != null">data_state ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
@ -356,6 +369,7 @@
<if test="password != null and password != ''">#{password} ,</if>
<if test="serviceName != null and serviceName != ''">#{serviceName} ,</if>
<if test="useState != null">#{useState} ,</if>
<if test="dataState != null">#{dataState} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
@ -373,21 +387,21 @@
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
password, service_name, use_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
password, service_name, use_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
</foreach>
on duplicate key update
source_code = values(source_code),
@ -400,6 +414,7 @@
password = values(password),
service_name = values(service_name),
use_state = values(use_state),
data_state = values(data_state),
sorts = values(sorts),
create_user_id = values(create_user_id),
create_time = values(create_time),
@ -422,6 +437,7 @@
<if test="password != null and password != ''">password = #{password},</if>
<if test="serviceName != null and serviceName != ''">service_name = #{serviceName},</if>
<if test="useState != null">use_state = #{useState},</if>
<if test="dataState != null">data_state = #{dataState},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
@ -453,6 +469,7 @@ where id = #{id}
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'

View File

@ -63,5 +63,12 @@ public interface ISysDataSourceService extends IBaseService<SysDataSourceEntity,
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 数据源测试接口 测试当前页面数据源是否配置正确
* @Date 2:08 下午 2023/9/23
* @param jsonObject
* @return
**/
JsonResultEntity testDatabase(JSONObject jsonObject);
}

View File

@ -9,6 +9,7 @@ import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo;
import com.hzya.frame.sys.dataSource.service.ISysDataSourceService;
import com.hzya.frame.sysnew.application.entity.SysApplicationDatasourceDto;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
@ -127,8 +128,10 @@ public class SysDataSourceServiceImpl extends BaseService<SysDataSourceEntity, S
if(entity.getUseState() == 1){
try {
dsDataSourceUtil.addDataSource(entity);
entity.setDataState("1");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确");
entity.setDataState("0");
//return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确");
}
}
entity.setPassword(AESUtil.encrypt(entity.getPassword()));
@ -180,7 +183,7 @@ public class SysDataSourceServiceImpl extends BaseService<SysDataSourceEntity, S
try {
dsDataSourceUtil.editDataSource(entity);
} catch (Exception e) {
return BaseResult.getSuccessMessageEntity("修改数据源失败,请检查数据源配置是否正确");
//return BaseResult.getSuccessMessageEntity("修改数据源失败,请检查数据源配置是否正确");
}
}else {
try {
@ -196,7 +199,30 @@ public class SysDataSourceServiceImpl extends BaseService<SysDataSourceEntity, S
return BaseResult.getSuccessMessageEntity("修改数据源成功",entity.getId());
}
/**
* @param object
* @return
* @Author lvleigang
* @Description 数据源测试接口 测试当前页面数据源是否配置正确
* @Date 2:08 下午 2023/9/23
**/
@Override
public JsonResultEntity testDatabase(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
SysApplicationDatasourceDto sysApplicationDatasourceDto = new SysApplicationDatasourceDto();
sysApplicationDatasourceDto.setSourceType(entity.getSourceType());
sysApplicationDatasourceDto.setSourceUrl(entity.getSourceUrl());
sysApplicationDatasourceDto.setLoginName(entity.getLoginName());
sysApplicationDatasourceDto.setPassword(entity.getPassword());
if (dsDataSourceUtil.testConnection(sysApplicationDatasourceDto)) {
return BaseResult.getSuccessMessageEntity("测试连接数据源成功",true);
} else {
return BaseResult.getSuccessMessageEntity("测试连接数据源失败",false);
}
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity

View File

@ -234,7 +234,6 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
entity.setSecretKey(AESUtil.encipher(entity.getPublicKey()));
entity.setAppId(null);
sysApplicationDao.save(entity);
applicationCache.reloadData("1");
//接口环境参数表 sys_application_api_para
saveApiPara(entity, olderAppId);
@ -254,6 +253,10 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
//应用api关联三方调用系统表 sys_application_api_auth_detail
Map<String, String> apiAuthDetail = saveCopyApiAuthDetail(entity, olderAppId, apiType, apiAuth, api);
applicationCache.reloadData("1");
applicationCache.reloadData("2");
applicationCache.reloadData("3");
applicationCache.reloadData("4");
return BaseResult.getSuccessMessageEntity("复制应用成功", entity.getId());
}
@ -284,8 +287,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
list.get(i).setTripartiteSystemId(apiAuth.get(list.get(i).getTripartiteSystemId()));//转换三方调用系统表id
sysApplicationApiAuthDetailDao.save(list.get(i));
}
applicationCache.reloadData("4");
}
applicationCache.reloadData("4");
return ids;
}
@ -316,8 +319,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
apilist.get(i).setCatalogueId(apiType.get(apilist.get(i).getCatalogueId()));//转换目录
sysApplicationApiDao.save(apilist.get(i));
}
applicationCache.reloadData("2");
}
applicationCache.reloadData("2");
return apiIds;
}
@ -341,8 +344,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
list.get(i).setAppId(entity.getId());
sysApplicationApiAuthDao.save(list.get(i));
}
applicationCache.reloadData("3");
}
applicationCache.reloadData("3");
return ids;
}
@ -532,6 +535,10 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
doUpdateApiPara(entity);//api接口参数
doUpdateDatabase(entity);//数据源
}
applicationCache.reloadData("1");
applicationCache.reloadData("2");
applicationCache.reloadData("3");
applicationCache.reloadData("4");
return BaseResult.getSuccessMessageEntity("修改应用成功");
}
@ -1179,7 +1186,6 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
sysApplicationApiAuthEntity.setModify_time(new Date());
sysApplicationApiAuthEntity.setSts("Y");
sysApplicationApiAuthDao.logicRemoveMultiCondition(sysApplicationApiAuthEntity);
applicationCache.reloadData("3");
List<String> tripartiteSystemIds = new ArrayList<>();
//添加
List<SysApplicationApiAuthEntity> apiAuths = entity.getApiAuths();
@ -1201,7 +1207,6 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
tripartiteSystemIds.add(apiAuths.get(i).getId());
sysApplicationApiAuthDao.save(apiAuths.get(i));
}
applicationCache.reloadData("3");
}
}
//删除三方系统关联表
@ -1209,6 +1214,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
sysApplicationApiAuthDetailEntity.setAppId(entity.getAppId());
sysApplicationApiAuthDetailEntity.setTripartiteSystemIds(tripartiteSystemIds);
sysApplicationApiAuthDetailDao.updateDeleteTripartiteSystem(sysApplicationApiAuthDetailEntity);
applicationCache.reloadData("3");
applicationCache.reloadData("4");
return BaseResult.getSuccessMessageEntity("保存成功");
}
@ -1696,12 +1702,38 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
return BaseResult.getFailureMessageEntity(receiveApi.getApiName() + "未授权给" + sendApp.getName() + ",请联系管理员");
}
SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity();
sysExtensionApiEntity.setHeaders(oldheaderMap);
List<String> a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"});
Map<String, String> headers = new HashMap<>();
if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) {
JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn());
if (jsonArray != null && jsonArray.size() > 0) {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject object1 = jsonArray.getJSONObject(i);
headers.put(object1.getString("parameterName"), object1.getString("example"));
}
}
}
if (oldheaderMap != null && oldheaderMap.size() > 0) {
for (Map.Entry<String, String> entry : oldheaderMap.entrySet()) {
if (!a.contains(entry.getKey())) {
headers.put(entry.getKey(), entry.getValue());
}
}
}
sysExtensionApiEntity.setHeaders(headers);
sysExtensionApiEntity.setQuerys(oldquerys);
sysExtensionApiEntity.setBodys(oldbodys);
Method[] methods = null;
Object object = null;
// 判断是否有内部api 是否扩展api 1启用 2停用
if (receiveApi.getExtensionApi() != null && "1".equals(receiveApi.getExtensionApi())
&& receiveApi.getBeanName() != null && !"".equals(receiveApi.getBeanName())
@ -1734,7 +1766,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
}
}
Map<String, String> headerMap = sysExtensionApiEntity.getHeaders();
headers = sysExtensionApiEntity.getHeaders();
String querys = sysExtensionApiEntity.getQuerys();
String bodys = sysExtensionApiEntity.getBodys();
//设置参数获取参数
@ -1754,24 +1786,24 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
if ("2".equals(receiveApi.getRequestMethod())) {
method = "GET";
}
List<String> a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"});
Map<String, String> headers = new HashMap<>();
if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) {
JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn());
if (jsonArray != null && jsonArray.size() > 0) {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject object1 = jsonArray.getJSONObject(i);
headers.put(object1.getString("parameterName"), object1.getString("example"));
}
}
}
if (headerMap != null && headerMap.size() > 0) {
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
if (!a.contains(entry.getKey())) {
headers.put(entry.getKey(), entry.getValue());
}
}
}
//List<String> a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"});
//Map<String, String> headers = new HashMap<>();
//if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) {
// JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn());
// if (jsonArray != null && jsonArray.size() > 0) {
// for (int i = 0; i < jsonArray.size(); i++) {
// JSONObject object1 = jsonArray.getJSONObject(i);
// headers.put(object1.getString("parameterName"), object1.getString("example"));
// }
// }
//}
//if (headerMap != null && headerMap.size() > 0) {
// for (Map.Entry<String, String> entry : headerMap.entrySet()) {
// if (!a.contains(entry.getKey())) {
// headers.put(entry.getKey(), entry.getValue());
// }
// }
//}
if ("POST".equals(method)) {
@ -1801,7 +1833,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
HttpEntity entity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(entity));
body.append(EntityUtils.toString(entity,"UTF-8"));
}
flag = true;
logger.info("返回结果:" + body);
@ -1825,7 +1857,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
}
logger.info("保存日志开始");
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headerMap, headers, oldquerys,querys, body.toString(),true,null);
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null);
if (methods != null && methods.length > 0) {
for (Method m : methods) {
if (null != m) {
@ -1883,7 +1915,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
response = closeableHttpClient.execute(get);
HttpEntity entity = response.getEntity();
synchronized (lock) {
body.append(EntityUtils.toString(entity));
body.append(EntityUtils.toString(entity,"UTF-8"));
}
flag = true;
logger.info("返回结果:" + body);
@ -1906,7 +1938,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
}
}
logger.info("保存日志开始");
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headerMap, headers, oldquerys,querys, body.toString(), true,null);
SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null);
if (methods != null && methods.length > 0) {
for (Method m : methods) {
if (null != m) {
@ -2016,7 +2048,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
//sendApp
sysMessageManageLogEntity.setSendApp(sendApp.getId());//发送者应用
//sendApi 发送者
sysMessageManageLogEntity.setReceiveCode(receiveApi.getApiCode().toString());//接收者编码
sysMessageManageLogEntity.setReceiveCode(receiveApi.getApiCode() != null ? receiveApi.getApiCode().toString() : null);//接收者编码
sysMessageManageLogEntity.setReceiveApp(receiveApp.getId());//接收者应用
sysMessageManageLogEntity.setReceiveApi(receiveApi.getId());//接收者
JSONObject jsonObject = new JSONObject();

View File

@ -0,0 +1,16 @@
package com.hzya.frame.sysnew.archivesContrast.dao;
import com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 档案对照表数据库访问层
*
* @author makejava
* @since 2024-05-27 16:21:36
*/
public interface ISysArchivesContrastDao extends IBaseDao<SysArchivesContrastEntity, String> {
SysArchivesContrastEntity getEntity(SysArchivesContrastEntity entity);
}

View File

@ -0,0 +1,22 @@
package com.hzya.frame.sysnew.archivesContrast.dao.impl;
import com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity;
import com.hzya.frame.sysnew.archivesContrast.dao.ISysArchivesContrastDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 档案对照表数据库访问层
*
* @author makejava
* @since 2024-05-27 16:21:36
*/
@Repository(value = "SysArchivesContrastDaoImpl")
public class SysArchivesContrastDaoImpl extends MybatisGenericDao<SysArchivesContrastEntity, String> implements ISysArchivesContrastDao{
@Override
public SysArchivesContrastEntity getEntity(SysArchivesContrastEntity entity) {
SysArchivesContrastEntity o = (SysArchivesContrastEntity) super.selectOne(getSqlIdPrifx() + "getEntity", entity);
return o;
}
}

View File

@ -0,0 +1,245 @@
package com.hzya.frame.sysnew.archivesContrast.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 档案对照实体类
*
* @author makejava
* @since 2024-05-27 16:21:36
*/
public class SysArchivesContrastEntity extends BaseEntity {
/** 左应用id */
private String leftAppId;
/** 左应用编码 */
private String leftAppCode;
/** 左应用名称 */
private String leftAppName;
/** 左接口ID */
private String leftApiId;
/** 左id */
private String leftId;
/** 左编码 */
private String leftCode;
/** 左名称 */
private String leftName;
/** 左手机号 */
private String leftTel;
/** 左身份证号 */
private String leftIc;
/** 右应用id */
private String rightAppId;
/** 右应用编码 */
private String rightAppCode;
/** 右应用名称 */
private String rightAppName;
/** 右接口ID */
private String rightApiId;
/** 右id */
private String rightId;
/** 右编码 */
private String rightCode;
/** 右名称 */
private String rightName;
/** 右手机号 */
private String rightTel;
/** 右身份证号 */
private String rightIc;
/** 公司id */
private String companyId;
/** 左公司 */
private String leftOrg;
/** 右公司 */
private String rightOrg;
/* 类型
1sys_personnel_control 人员对照
2sys_org_control 部门档案
3sys_stock_control 存货对照
4sys_merchant_control 客商辅助核算
5sys_taxrate_control 税率
6sys_project_control 项目辅助核算
7sys_bank_control 银行类别
8sys_bankaccount_control 银行账户
9sys_assets_control 资产类别
*/
private String type;
public String getLeftAppId() {
return leftAppId;
}
public void setLeftAppId(String leftAppId) {
this.leftAppId = leftAppId;
}
public String getLeftAppCode() {
return leftAppCode;
}
public void setLeftAppCode(String leftAppCode) {
this.leftAppCode = leftAppCode;
}
public String getLeftAppName() {
return leftAppName;
}
public void setLeftAppName(String leftAppName) {
this.leftAppName = leftAppName;
}
public String getLeftApiId() {
return leftApiId;
}
public void setLeftApiId(String leftApiId) {
this.leftApiId = leftApiId;
}
public String getLeftId() {
return leftId;
}
public void setLeftId(String leftId) {
this.leftId = leftId;
}
public String getLeftCode() {
return leftCode;
}
public void setLeftCode(String leftCode) {
this.leftCode = leftCode;
}
public String getLeftName() {
return leftName;
}
public void setLeftName(String leftName) {
this.leftName = leftName;
}
public String getLeftTel() {
return leftTel;
}
public void setLeftTel(String leftTel) {
this.leftTel = leftTel;
}
public String getLeftIc() {
return leftIc;
}
public void setLeftIc(String leftIc) {
this.leftIc = leftIc;
}
public String getRightAppId() {
return rightAppId;
}
public void setRightAppId(String rightAppId) {
this.rightAppId = rightAppId;
}
public String getRightAppCode() {
return rightAppCode;
}
public void setRightAppCode(String rightAppCode) {
this.rightAppCode = rightAppCode;
}
public String getRightAppName() {
return rightAppName;
}
public void setRightAppName(String rightAppName) {
this.rightAppName = rightAppName;
}
public String getRightApiId() {
return rightApiId;
}
public void setRightApiId(String rightApiId) {
this.rightApiId = rightApiId;
}
public String getRightId() {
return rightId;
}
public void setRightId(String rightId) {
this.rightId = rightId;
}
public String getRightCode() {
return rightCode;
}
public void setRightCode(String rightCode) {
this.rightCode = rightCode;
}
public String getRightName() {
return rightName;
}
public void setRightName(String rightName) {
this.rightName = rightName;
}
public String getRightTel() {
return rightTel;
}
public void setRightTel(String rightTel) {
this.rightTel = rightTel;
}
public String getRightIc() {
return rightIc;
}
public void setRightIc(String rightIc) {
this.rightIc = rightIc;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getLeftOrg() {
return leftOrg;
}
public void setLeftOrg(String leftOrg) {
this.leftOrg = leftOrg;
}
public String getRightOrg() {
return rightOrg;
}
public void setRightOrg(String rightOrg) {
this.rightOrg = rightOrg;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -0,0 +1,634 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.sysnew.archivesContrast.dao.impl.SysArchivesContrastDaoImpl">
<resultMap id="get-SysArchivesContrastEntity-result" type="com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="leftAppId" column="left_app_id" jdbcType="VARCHAR"/>
<result property="leftAppCode" column="left_app_code" jdbcType="VARCHAR"/>
<result property="leftAppName" column="left_app_name" jdbcType="VARCHAR"/>
<result property="leftApiId" column="left_api_id" jdbcType="VARCHAR"/>
<result property="leftId" column="left_id" jdbcType="VARCHAR"/>
<result property="leftCode" column="left_code" jdbcType="VARCHAR"/>
<result property="leftName" column="left_name" jdbcType="VARCHAR"/>
<result property="leftTel" column="left_tel" jdbcType="VARCHAR"/>
<result property="leftIc" column="left_ic" jdbcType="VARCHAR"/>
<result property="rightAppId" column="right_app_id" jdbcType="VARCHAR"/>
<result property="rightAppCode" column="right_app_code" jdbcType="VARCHAR"/>
<result property="rightAppName" column="right_app_name" jdbcType="VARCHAR"/>
<result property="rightApiId" column="right_api_id" jdbcType="VARCHAR"/>
<result property="rightId" column="right_id" jdbcType="VARCHAR"/>
<result property="rightCode" column="right_code" jdbcType="VARCHAR"/>
<result property="rightName" column="right_name" jdbcType="VARCHAR"/>
<result property="rightTel" column="right_tel" jdbcType="VARCHAR"/>
<result property="rightIc" column="right_ic" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="leftOrg" column="left_org" jdbcType="VARCHAR"/>
<result property="rightOrg" column="right_org" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysArchivesContrastEntity_Base_Column_List_personnel">
id
,left_app_id
,left_app_code
,left_app_name
,left_api_id
,left_id
,left_code
,left_name
,left_tel
,left_ic
,right_app_id
,right_app_code
,right_app_name
,right_api_id
,right_id
,right_code
,right_name
,right_tel
,right_ic
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,left_org
,right_org
</sql>
<sql id = "SysArchivesContrastEntity_Base_Column_List">
id
,left_app_id
,left_app_code
,left_app_name
,left_api_id
,left_id
,left_code
,left_name
,right_app_id
,right_app_code
,right_app_name
,right_api_id
,right_id
,right_code
,right_name
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,left_org
,right_org
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysArchivesContrastEntity-result">
select
<choose>
<when test="type == '1'.toString()">
<include refid="SysArchivesContrastEntity_Base_Column_List_personnel" />
</when>
<otherwise>
<include refid="SysArchivesContrastEntity_Base_Column_List" />
</otherwise>
</choose>
from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
where sts = 'Y' and id = #{id}
</select>
<!--通过ID获取数据 -->
<select id="getEntity" resultMap="get-SysArchivesContrastEntity-result" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity">
select
<choose>
<when test="type == '1'.toString()">
<include refid="SysArchivesContrastEntity_Base_Column_List_personnel" />
</when>
<otherwise>
<include refid="SysArchivesContrastEntity_Base_Column_List" />
</otherwise>
</choose>
from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
where sts = 'Y' and id = #{id}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysArchivesContrastEntity-result" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity">
select
<choose>
<when test="type == '1'.toString()">
<include refid="SysArchivesContrastEntity_Base_Column_List_personnel" />
</when>
<otherwise>
<include refid="SysArchivesContrastEntity_Base_Column_List" />
</otherwise>
</choose>
from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="leftAppId != null and leftAppId != ''"> and left_app_id = #{leftAppId} </if>
<if test="leftAppCode != null and leftAppCode != ''"> and left_app_code = #{leftAppCode} </if>
<if test="leftAppName != null and leftAppName != ''"> and left_app_name = #{leftAppName} </if>
<if test="leftApiId != null and leftApiId != ''"> and left_api_id = #{leftApiId} </if>
<if test="leftId != null and leftId != ''"> and left_id = #{leftId} </if>
<if test="leftCode != null and leftCode != ''"> and left_code = #{leftCode} </if>
<if test="leftName != null and leftName != ''"> and left_name = #{leftName} </if>
<if test="leftTel != null and leftTel != ''"> and left_tel = #{leftTel} </if>
<if test="leftIc != null and leftIc != ''"> and left_ic = #{leftIc} </if>
<if test="rightAppId != null and rightAppId != ''"> and right_app_id = #{rightAppId} </if>
<if test="rightAppCode != null and rightAppCode != ''"> and right_app_code = #{rightAppCode} </if>
<if test="rightAppName != null and rightAppName != ''"> and right_app_name = #{rightAppName} </if>
<if test="rightApiId != null and rightApiId != ''"> and right_api_id = #{rightApiId} </if>
<if test="rightId != null and rightId != ''"> and right_id = #{rightId} </if>
<if test="rightCode != null and rightCode != ''"> and right_code = #{rightCode} </if>
<if test="rightName != null and rightName != ''"> and right_name = #{rightName} </if>
<if test="rightTel != null and rightTel != ''"> and right_tel = #{rightTel} </if>
<if test="rightIc != null and rightIc != ''"> and right_ic = #{rightIc} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<if test="leftOrg != null and leftOrg != ''"> and left_org = #{leftOrg} </if>
<if test="rightOrg != null and rightOrg != ''"> and right_org = #{rightOrg} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity">
select count(1) from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="leftAppId != null and leftAppId != ''"> and left_app_id = #{leftAppId} </if>
<if test="leftAppCode != null and leftAppCode != ''"> and left_app_code = #{leftAppCode} </if>
<if test="leftAppName != null and leftAppName != ''"> and left_app_name = #{leftAppName} </if>
<if test="leftApiId != null and leftApiId != ''"> and left_api_id = #{leftApiId} </if>
<if test="leftId != null and leftId != ''"> and left_id = #{leftId} </if>
<if test="leftCode != null and leftCode != ''"> and left_code = #{leftCode} </if>
<if test="leftName != null and leftName != ''"> and left_name = #{leftName} </if>
<if test="leftTel != null and leftTel != ''"> and left_tel = #{leftTel} </if>
<if test="leftIc != null and leftIc != ''"> and left_ic = #{leftIc} </if>
<if test="rightAppId != null and rightAppId != ''"> and right_app_id = #{rightAppId} </if>
<if test="rightAppCode != null and rightAppCode != ''"> and right_app_code = #{rightAppCode} </if>
<if test="rightAppName != null and rightAppName != ''"> and right_app_name = #{rightAppName} </if>
<if test="rightApiId != null and rightApiId != ''"> and right_api_id = #{rightApiId} </if>
<if test="rightId != null and rightId != ''"> and right_id = #{rightId} </if>
<if test="rightCode != null and rightCode != ''"> and right_code = #{rightCode} </if>
<if test="rightName != null and rightName != ''"> and right_name = #{rightName} </if>
<if test="rightTel != null and rightTel != ''"> and right_tel = #{rightTel} </if>
<if test="rightIc != null and rightIc != ''"> and right_ic = #{rightIc} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<if test="leftOrg != null and leftOrg != ''"> and left_org = #{leftOrg} </if>
<if test="rightOrg != null and rightOrg != ''"> and right_org = #{rightOrg} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysArchivesContrastEntity-result" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity">
select
<choose>
<when test="type == '1'.toString()">
<include refid="SysArchivesContrastEntity_Base_Column_List_personnel" />
</when>
<otherwise>
<include refid="SysArchivesContrastEntity_Base_Column_List" />
</otherwise>
</choose>
from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="leftAppId != null and leftAppId != ''"> and left_app_id like concat('%',#{leftAppId},'%') </if>
<if test="leftAppCode != null and leftAppCode != ''"> and left_app_code like concat('%',#{leftAppCode},'%') </if>
<if test="leftAppName != null and leftAppName != ''"> and left_app_name like concat('%',#{leftAppName},'%') </if>
<if test="leftApiId != null and leftApiId != ''"> and left_api_id like concat('%',#{leftApiId},'%') </if>
<if test="leftId != null and leftId != ''"> and left_id like concat('%',#{leftId},'%') </if>
<if test="leftCode != null and leftCode != ''"> and left_code like concat('%',#{leftCode},'%') </if>
<if test="leftName != null and leftName != ''"> and left_name like concat('%',#{leftName},'%') </if>
<if test="leftTel != null and leftTel != ''"> and left_tel like concat('%',#{leftTel},'%') </if>
<if test="leftIc != null and leftIc != ''"> and left_ic like concat('%',#{leftIc},'%') </if>
<if test="rightAppId != null and rightAppId != ''"> and right_app_id like concat('%',#{rightAppId},'%') </if>
<if test="rightAppCode != null and rightAppCode != ''"> and right_app_code like concat('%',#{rightAppCode},'%') </if>
<if test="rightAppName != null and rightAppName != ''"> and right_app_name like concat('%',#{rightAppName},'%') </if>
<if test="rightApiId != null and rightApiId != ''"> and right_api_id like concat('%',#{rightApiId},'%') </if>
<if test="rightId != null and rightId != ''"> and right_id like concat('%',#{rightId},'%') </if>
<if test="rightCode != null and rightCode != ''"> and right_code like concat('%',#{rightCode},'%') </if>
<if test="rightName != null and rightName != ''"> and right_name like concat('%',#{rightName},'%') </if>
<if test="rightTel != null and rightTel != ''"> and right_tel like concat('%',#{rightTel},'%') </if>
<if test="rightIc != null and rightIc != ''"> and right_ic like concat('%',#{rightIc},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
<if test="leftOrg != null and leftOrg != ''"> and left_org like concat('%',#{leftOrg},'%') </if>
<if test="rightOrg != null and rightOrg != ''"> and right_org like concat('%',#{rightOrg},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysArchivesContrastentity_list_or" resultMap="get-SysArchivesContrastEntity-result" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity">
select
<choose>
<when test="type == '1'.toString()">
<include refid="SysArchivesContrastEntity_Base_Column_List_personnel" />
</when>
<otherwise>
<include refid="SysArchivesContrastEntity_Base_Column_List" />
</otherwise>
</choose>
from
<choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="leftAppId != null and leftAppId != ''"> or left_app_id = #{leftAppId} </if>
<if test="leftAppCode != null and leftAppCode != ''"> or left_app_code = #{leftAppCode} </if>
<if test="leftAppName != null and leftAppName != ''"> or left_app_name = #{leftAppName} </if>
<if test="leftApiId != null and leftApiId != ''"> or left_api_id = #{leftApiId} </if>
<if test="leftId != null and leftId != ''"> or left_id = #{leftId} </if>
<if test="leftCode != null and leftCode != ''"> or left_code = #{leftCode} </if>
<if test="leftName != null and leftName != ''"> or left_name = #{leftName} </if>
<if test="leftTel != null and leftTel != ''"> or left_tel = #{leftTel} </if>
<if test="leftIc != null and leftIc != ''"> or left_ic = #{leftIc} </if>
<if test="rightAppId != null and rightAppId != ''"> or right_app_id = #{rightAppId} </if>
<if test="rightAppCode != null and rightAppCode != ''"> or right_app_code = #{rightAppCode} </if>
<if test="rightAppName != null and rightAppName != ''"> or right_app_name = #{rightAppName} </if>
<if test="rightApiId != null and rightApiId != ''"> or right_api_id = #{rightApiId} </if>
<if test="rightId != null and rightId != ''"> or right_id = #{rightId} </if>
<if test="rightCode != null and rightCode != ''"> or right_code = #{rightCode} </if>
<if test="rightName != null and rightName != ''"> or right_name = #{rightName} </if>
<if test="rightTel != null and rightTel != ''"> or right_tel = #{rightTel} </if>
<if test="rightIc != null and rightIc != ''"> or right_ic = #{rightIc} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
<if test="leftOrg != null and leftOrg != ''"> or left_org = #{leftOrg} </if>
<if test="rightOrg != null and rightOrg != ''"> or right_org = #{rightOrg} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity" >
insert into <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose>
(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="leftAppId != null and leftAppId != ''"> left_app_id , </if>
<if test="leftAppCode != null and leftAppCode != ''"> left_app_code , </if>
<if test="leftAppName != null and leftAppName != ''"> left_app_name , </if>
<if test="leftApiId != null and leftApiId != ''"> left_api_id , </if>
<if test="leftId != null and leftId != ''"> left_id , </if>
<if test="leftCode != null and leftCode != ''"> left_code , </if>
<if test="leftName != null and leftName != ''"> left_name , </if>
<if test="leftTel != null and leftTel != ''"> left_tel , </if>
<if test="leftIc != null and leftIc != ''"> left_ic , </if>
<if test="rightAppId != null and rightAppId != ''"> right_app_id , </if>
<if test="rightAppCode != null and rightAppCode != ''"> right_app_code , </if>
<if test="rightAppName != null and rightAppName != ''"> right_app_name , </if>
<if test="rightApiId != null and rightApiId != ''"> right_api_id , </if>
<if test="rightId != null and rightId != ''"> right_id , </if>
<if test="rightCode != null and rightCode != ''"> right_code , </if>
<if test="rightName != null and rightName != ''"> right_name , </if>
<if test="rightTel != null and rightTel != ''"> right_tel , </if>
<if test="rightIc != null and rightIc != ''"> right_ic , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<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="companyId != null and companyId != ''"> company_id , </if>
<if test="leftOrg != null and leftOrg != ''"> left_org , </if>
<if test="rightOrg != null and rightOrg != ''"> right_org , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="leftAppId != null and leftAppId != ''"> #{leftAppId} ,</if>
<if test="leftAppCode != null and leftAppCode != ''"> #{leftAppCode} ,</if>
<if test="leftAppName != null and leftAppName != ''"> #{leftAppName} ,</if>
<if test="leftApiId != null and leftApiId != ''"> #{leftApiId} ,</if>
<if test="leftId != null and leftId != ''"> #{leftId} ,</if>
<if test="leftCode != null and leftCode != ''"> #{leftCode} ,</if>
<if test="leftName != null and leftName != ''"> #{leftName} ,</if>
<if test="leftTel != null and leftTel != ''"> #{leftTel} ,</if>
<if test="leftIc != null and leftIc != ''"> #{leftIc} ,</if>
<if test="rightAppId != null and rightAppId != ''"> #{rightAppId} ,</if>
<if test="rightAppCode != null and rightAppCode != ''"> #{rightAppCode} ,</if>
<if test="rightAppName != null and rightAppName != ''"> #{rightAppName} ,</if>
<if test="rightApiId != null and rightApiId != ''"> #{rightApiId} ,</if>
<if test="rightId != null and rightId != ''"> #{rightId} ,</if>
<if test="rightCode != null and rightCode != ''"> #{rightCode} ,</if>
<if test="rightName != null and rightName != ''"> #{rightName} ,</if>
<if test="rightTel != null and rightTel != ''"> #{rightTel} ,</if>
<if test="rightIc != null and rightIc != ''"> #{rightIc} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<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="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="leftOrg != null and leftOrg != ''"> #{leftOrg} ,</if>
<if test="rightOrg != null and rightOrg != ''"> #{rightOrg} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> (left_app_id, left_app_code, left_app_name, left_api_id, left_id, left_code, left_name, left_tel, left_ic, right_app_id, right_app_code, right_app_name, right_api_id, right_id, right_code, right_name, right_tel, right_ic, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, left_org, right_org, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.leftAppId},#{entity.leftAppCode},#{entity.leftAppName},#{entity.leftApiId},#{entity.leftId},#{entity.leftCode},#{entity.leftName},#{entity.leftTel},#{entity.leftIc},#{entity.rightAppId},#{entity.rightAppCode},#{entity.rightAppName},#{entity.rightApiId},#{entity.rightId},#{entity.rightCode},#{entity.rightName},#{entity.rightTel},#{entity.rightIc},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.leftOrg},#{entity.rightOrg}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> (left_app_id, left_app_code, left_app_name, left_api_id, left_id, left_code, left_name, left_tel, left_ic, right_app_id, right_app_code, right_app_name, right_api_id, right_id, right_code, right_name, right_tel, right_ic, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, left_org, right_org)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.leftAppId},#{entity.leftAppCode},#{entity.leftAppName},#{entity.leftApiId},#{entity.leftId},#{entity.leftCode},#{entity.leftName},#{entity.leftTel},#{entity.leftIc},#{entity.rightAppId},#{entity.rightAppCode},#{entity.rightAppName},#{entity.rightApiId},#{entity.rightId},#{entity.rightCode},#{entity.rightName},#{entity.rightTel},#{entity.rightIc},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.leftOrg},#{entity.rightOrg})
</foreach>
on duplicate key update
left_app_id = values(left_app_id),
left_app_code = values(left_app_code),
left_app_name = values(left_app_name),
left_api_id = values(left_api_id),
left_id = values(left_id),
left_code = values(left_code),
left_name = values(left_name),
left_tel = values(left_tel),
left_ic = values(left_ic),
right_app_id = values(right_app_id),
right_app_code = values(right_app_code),
right_app_name = values(right_app_name),
right_api_id = values(right_api_id),
right_id = values(right_id),
right_code = values(right_code),
right_name = values(right_name),
right_tel = values(right_tel),
right_ic = values(right_ic),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id),
left_org = values(left_org),
right_org = values(right_org)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity" >
update <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> set
<trim suffix="" suffixOverrides=",">
<if test="leftAppId != null and leftAppId != ''"> left_app_id = #{leftAppId},</if>
<if test="leftAppCode != null and leftAppCode != ''"> left_app_code = #{leftAppCode},</if>
<if test="leftAppName != null and leftAppName != ''"> left_app_name = #{leftAppName},</if>
<if test="leftApiId != null and leftApiId != ''"> left_api_id = #{leftApiId},</if>
<if test="leftId != null and leftId != ''"> left_id = #{leftId},</if>
<if test="leftCode != null and leftCode != ''"> left_code = #{leftCode},</if>
<if test="leftName != null and leftName != ''"> left_name = #{leftName},</if>
<if test="leftTel != null and leftTel != ''"> left_tel = #{leftTel},</if>
<if test="leftIc != null and leftIc != ''"> left_ic = #{leftIc},</if>
<if test="rightAppId != null and rightAppId != ''"> right_app_id = #{rightAppId},</if>
<if test="rightAppCode != null and rightAppCode != ''"> right_app_code = #{rightAppCode},</if>
<if test="rightAppName != null and rightAppName != ''"> right_app_name = #{rightAppName},</if>
<if test="rightApiId != null and rightApiId != ''"> right_api_id = #{rightApiId},</if>
<if test="rightId != null and rightId != ''"> right_id = #{rightId},</if>
<if test="rightCode != null and rightCode != ''"> right_code = #{rightCode},</if>
<if test="rightName != null and rightName != ''"> right_name = #{rightName},</if>
<if test="rightTel != null and rightTel != ''"> right_tel = #{rightTel},</if>
<if test="rightIc != null and rightIc != ''"> right_ic = #{rightIc},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
<if test="leftOrg != null and leftOrg != ''"> left_org = #{leftOrg},</if>
<if test="rightOrg != null and rightOrg != ''"> right_org = #{rightOrg},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity" >
update <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity" >
update <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="leftAppId != null and leftAppId != ''"> and left_app_id = #{leftAppId} </if>
<if test="leftAppCode != null and leftAppCode != ''"> and left_app_code = #{leftAppCode} </if>
<if test="leftAppName != null and leftAppName != ''"> and left_app_name = #{leftAppName} </if>
<if test="leftApiId != null and leftApiId != ''"> and left_api_id = #{leftApiId} </if>
<if test="leftId != null and leftId != ''"> and left_id = #{leftId} </if>
<if test="leftCode != null and leftCode != ''"> and left_code = #{leftCode} </if>
<if test="leftName != null and leftName != ''"> and left_name = #{leftName} </if>
<if test="leftTel != null and leftTel != ''"> and left_tel = #{leftTel} </if>
<if test="leftIc != null and leftIc != ''"> and left_ic = #{leftIc} </if>
<if test="rightAppId != null and rightAppId != ''"> and right_app_id = #{rightAppId} </if>
<if test="rightAppCode != null and rightAppCode != ''"> and right_app_code = #{rightAppCode} </if>
<if test="rightAppName != null and rightAppName != ''"> and right_app_name = #{rightAppName} </if>
<if test="rightApiId != null and rightApiId != ''"> and right_api_id = #{rightApiId} </if>
<if test="rightId != null and rightId != ''"> and right_id = #{rightId} </if>
<if test="rightCode != null and rightCode != ''"> and right_code = #{rightCode} </if>
<if test="rightName != null and rightName != ''"> and right_name = #{rightName} </if>
<if test="rightTel != null and rightTel != ''"> and right_tel = #{rightTel} </if>
<if test="rightIc != null and rightIc != ''"> and right_ic = #{rightIc} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<if test="leftOrg != null and leftOrg != ''"> and left_org = #{leftOrg} </if>
<if test="rightOrg != null and rightOrg != ''"> and right_org = #{rightOrg} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from <choose>
<when test="type == '1'.toString()"> sys_personnel_control </when>
<when test="type == '2'.toString()"> sys_org_control </when>
<when test="type == '3'.toString()"> sys_stock_control </when>
<when test="type == '4'.toString()"> sys_merchant_control </when>
<when test="type == '5'.toString()"> sys_taxrate_control </when>
<when test="type == '6'.toString()"> sys_project_control </when>
<when test="type == '7'.toString()"> sys_bank_control </when>
<when test="type == '8'.toString()"> sys_bankaccount_control </when>
<when test="type == '9'.toString()"> sys_assets_control </when>
</choose> where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,70 @@
package com.hzya.frame.sysnew.archivesContrast.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 档案对照服务接口
*
* @author makejava
* @since 2024-05-27 16:21:36
*/
public interface ISysArchivesContrastService extends IBaseService<SysArchivesContrastEntity, String>{
/**
* @Author lvleigang
* @Description 查询档案列表分页
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryEntityPage(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 查询档案列表
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 保存档案
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 获取档案
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity getEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 修改档案
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 删除档案
* @Date 4:25 下午 2024/5/27
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,189 @@
package com.hzya.frame.sysnew.archivesContrast.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.archivesContrast.entity.SysArchivesContrastEntity;
import com.hzya.frame.sysnew.archivesContrast.dao.ISysArchivesContrastDao;
import com.hzya.frame.sysnew.archivesContrast.service.ISysArchivesContrastService;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.sysnew.userCompany.entity.SysUserCompanyEntity;
import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 档案对照表服务实现类
*
* @author makejava
* @since 2024-05-27 16:21:36
*/
@Service(value = "sysArchivesContrastService")
public class SysArchivesContrastServiceImpl extends BaseService<SysArchivesContrastEntity, String> implements ISysArchivesContrastService {
private ISysArchivesContrastDao sysArchivesContrastDao;
@Autowired
public void setSysArchivesContrastDao(ISysArchivesContrastDao dao) {
this.sysArchivesContrastDao = dao;
this.dao = dao;
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询档案列表分页
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
//判断分页
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
if(entity.getType() == null || "".equals(entity.getType()) ){
return BaseResult.getFailureMessageEntity("系统错误");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysArchivesContrastEntity> list = sysArchivesContrastDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询档案列表
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
if (entity == null || entity.getType() == null || "".equals(entity.getType())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
List<SysArchivesContrastEntity> list = sysArchivesContrastDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 保存档案
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getType() == null || "".equals(entity.getType())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getLeftCode() == null || "".equals(entity.getLeftCode())) {
return BaseResult.getFailureMessageEntity("请先输入左编码");
}
if (entity.getRightCode() == null || "".equals(entity.getRightCode())) {
return BaseResult.getFailureMessageEntity("请先输入右编码");
}
entity.setCreate();
entity.setSts("Y");
//保存
sysArchivesContrastDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存档案成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取档案
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getType() == null || "".equals(entity.getType())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysArchivesContrastDao.getEntity(entity);
if (entity == null) {
return BaseResult.getFailureMessageEntity("获取档案失败");
}
return BaseResult.getSuccessMessageEntity("获取档案成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改档案
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getType() == null || "".equals(entity.getType())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getLeftCode() == null || "".equals(entity.getLeftCode())) {
return BaseResult.getFailureMessageEntity("请先输入左编码");
}
if (entity.getRightCode() == null || "".equals(entity.getRightCode())) {
return BaseResult.getFailureMessageEntity("请先输入右编码");
}
entity.setUpdate();
//保存
sysArchivesContrastDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改档案成功", entity);
}
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除档案
* @Date 4:25 下午 2024/5/27
**/
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
SysArchivesContrastEntity entity = getData("jsonStr", jsonObject, SysArchivesContrastEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getType() == null || "".equals(entity.getType())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
//删除
sysArchivesContrastDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity(" 删除档案成功", entity);
}
}

View File

@ -60,7 +60,7 @@ public class LoginServiceImpl implements ILoginService {
}
entity.setPassword(AESUtil.encrypt(entity.getLoginCode() + "-" + entity.getPassword()));
SysUserEntity sysUserEntity = sysUserDao.queryOne(entity);
if (sysUserEntity.getId() == null || "".equals(sysUserEntity.getId())) {
if (sysUserEntity == null || sysUserEntity.getId() == null || "".equals(sysUserEntity.getId())) {
return BaseResult.getFailureMessageEntity("用户名或密码错误");
}
if (sysUserEntity.getState() == null || !"0".equals(sysUserEntity.getState())) {

View File

@ -63,10 +63,11 @@ public class QuartzJobFactory implements Job {
if(integrationTaskLivingEntity.getOldStartTime() != null ){
oldStartTime = integrationTaskLivingEntity.getOldStartTime();
}
//判断任务是否启用存在不启用情况需要手动把任务关闭
if(integrationTaskEntity.getTaskStatus() != null && !"1".equals(integrationTaskEntity.getTaskStatus())){
saveLivingAndDetail(integrationTaskLivingEntity,null,
"4","4","当前任务已停止,不执行任务",integrationTaskLivingEntity.getOldStartTime(),integrationTaskLivingEntity.getStartTime(),integrationTaskLivingEntity.getEndTime());
"4","4","当前任务已停止,不执行任务",startTime,startTime,new Date());
JSONObject stopJson = new JSONObject();
stopJson.put("jobName",integrationTaskEntity.getTaskName());
stopJson.put("jobCode",integrationTaskEntity.getTaskCode());
@ -99,14 +100,14 @@ public class QuartzJobFactory implements Job {
SysApplicationPluginEntity sysApplicationPluginEntity = iIntegrationTaskCacheableService.getSysApplicationPluginEntity(integrationTaskEntity.getTaskPlugin());
if(sysApplicationPluginEntity == null || sysApplicationPluginEntity.getPluginCode() == null || !"1".equals(sysApplicationPluginEntity.getPluginStatus())){
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"2","3","插件未启用,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
"2","3","插件未启用,不执行任务",startTime,startTime,new Date());
return;
}
//查找插件
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(sysApplicationPluginEntity.getPluginCode());
if(pluginBaseEntity == null ){
saveLivingAndDetail(integrationTaskLivingEntity, integrationTaskLogEntity,
"2","3","插件未找到,不执行任务",integrationTaskLivingEntity.getOldStartTime(),startTime,new Date());
"2","3","插件未找到,不执行任务",startTime,startTime,new Date());
return;
}
//调用插件

View File

@ -88,40 +88,40 @@ public class EntranceServiceImpl implements IEntranceService {
try {
StpUtil.checkLogin();
//校验当前登陆人是否有权限
boolean flag = false;
String userId = StpUtil.getLoginIdAsString();
//获取接口
SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanName"+service+"interfacName"+serviceMethod);
if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){
//todo 接口权限验证
return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
}
//查询用户权限
if(!flag){
SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+userId+"interfaceId"+sysInterfaceEntity.getId());
if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){
flag = true;
}
}
//查询用户角色的权限
if(!flag){
List<SysUserRolesEntity> userRoleMap = (List<SysUserRolesEntity>) interfaceCache.get("3",null);
if(userRoleMap != null && userRoleMap.size() > 0){
for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) {
if(sysUserRolesEntity.getUserId().equals(userId)){
SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId());
if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){
flag = true;
break;
}
}
}
}
}
if(!flag){
//todo 接口权限验证
return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
}
// 接口权限验证 开始
//boolean flag = false;
//String userId = StpUtil.getLoginIdAsString();
////获取接口
//SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanName"+service+"interfacName"+serviceMethod);
//if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){
// return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
//}
////查询用户权限
//if(!flag){
// SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+userId+"interfaceId"+sysInterfaceEntity.getId());
// if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){
// flag = true;
// }
//}
////查询用户角色的权限
//if(!flag){
// List<SysUserRolesEntity> userRoleMap = (List<SysUserRolesEntity>) interfaceCache.get("3",null);
// if(userRoleMap != null && userRoleMap.size() > 0){
// for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) {
// if(sysUserRolesEntity.getUserId().equals(userId)){
// SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId());
// if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){
// flag = true;
// break;
// }
// }
// }
// }
//}
//if(!flag){
// return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
//}
// 接口权限验证 结束
} catch (NotLoginException e) {
logger.error("token无效");
return BaseResult.getFailureMessageEntity("token无效");

View File

@ -67,6 +67,7 @@ public class AopDynamicRoutingDataSourceInit {
SysDataSourceEntity entity = new SysDataSourceEntity();
entity.setSts("Y");
entity.setUseState(1);
entity.setDataState("1");
entity.setSourceCode(dsValue);
List<SysDataSourceVo> sysDataSourceEntities = sysDataSourceDao.queryDSBase(entity);
//logger.info("beforeDynamicRoutingDataSourceInitMethod:根据dsValue获取数据源信息查询结果 sysDataSourceEntities.size:" + sysDataSourceEntities.size());