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

# Conflicts:
#	service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java
This commit is contained in:
hecan 2024-09-14 16:10:41 +08:00
commit 6a1fd93a41
79 changed files with 6535 additions and 43 deletions

View File

@ -66,9 +66,9 @@ public class CbsPluginServiceImpl implements ICbsPluginService {
@Autowired @Autowired
private RestUtil restUtil; private RestUtil restUtil;
@Value("${cbs8.elec_path}") @Value("${cbs8.elec_path:}")
private String elec_path; private String elec_path;
@Value("${OA.data_source_code}") @Value("${OA.data_source_code:}")
private String oa_data_source_code; private String oa_data_source_code;
/** /**
* 支付申请 * 支付申请

View File

@ -704,7 +704,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
continue; continue;
}else { }else {
//保存日志 //保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3");
continue; continue;
} }
} }
@ -885,7 +885,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
continue; continue;
}else { }else {
//保存日志 //保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2");
continue; continue;
} }
} }
@ -1124,7 +1124,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
continue; continue;
}else { }else {
//保存日志 //保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
continue; continue;
} }
} }

View File

@ -0,0 +1,7 @@
package com.hzya.frame.plugin.pushMessage.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public interface IPushMessageDao extends IBaseDao<PushMessageEntity, String> {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.plugin.pushMessage.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
public class PushMessageDaoImpl extends MybatisGenericDao<PushMessageEntity, String> implements IPushMessageDao {
}

View File

@ -0,0 +1,106 @@
package com.hzya.frame.plugin.pushMessage.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class PushMessageEntity extends BaseEntity {
private String pushMethod;
private String warningAppCode;
private String warningApiCode;
private String recipientIdList;
private String warningAppType;
private String sendAppName;
private String receiveAppName;
private String receiveApiName;
private String returnData;
private String receiveApiCode;
private String status;
public String getPushMethod() {
return pushMethod;
}
public void setPushMethod(String pushMethod) {
this.pushMethod = pushMethod;
}
public String getWarningAppCode() {
return warningAppCode;
}
public void setWarningAppCode(String warningAppCode) {
this.warningAppCode = warningAppCode;
}
public String getWarningApiCode() {
return warningApiCode;
}
public void setWarningApiCode(String warningApiCode) {
this.warningApiCode = warningApiCode;
}
public String getRecipientIdList() {
return recipientIdList;
}
public void setRecipientIdList(String recipientIdList) {
this.recipientIdList = recipientIdList;
}
public String getWarningAppType() {
return warningAppType;
}
public void setWarningAppType(String warningAppType) {
this.warningAppType = warningAppType;
}
public String getSendAppName() {
return sendAppName;
}
public void setSendAppName(String sendAppName) {
this.sendAppName = sendAppName;
}
public String getReceiveAppName() {
return receiveAppName;
}
public void setReceiveAppName(String receiveAppName) {
this.receiveAppName = receiveAppName;
}
public String getReceiveApiName() {
return receiveApiName;
}
public void setReceiveApiName(String receiveApiName) {
this.receiveApiName = receiveApiName;
}
public String getReturnData() {
return returnData;
}
public void setReturnData(String returnData) {
this.returnData = returnData;
}
public String getReceiveApiCode() {
return receiveApiCode;
}
public void setReceiveApiCode(String receiveApiCode) {
this.receiveApiCode = receiveApiCode;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -0,0 +1,43 @@
<?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.plugin.pushMessage.dao.impl.PushMessageDaoImpl">
<resultMap id="get-PushMessageEntity-result" type="com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity" >
<result property="pushMessage" column="push_message" jdbcType="VARCHAR"/>
<result property="warningAppCode" column="warning_app_code" jdbcType="VARCHAR"/>
<result property="warningApiCode" column="warning_api_code" jdbcType="VARCHAR"/>
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
<result property="receiveApiCode" column="receive_api_code" jdbcType="VARCHAR"/>
<result property="returnData" column="return_data" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-PushMessageEntity-result" parameterType = "com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity">
SELECT
warning_config.push_method,
warning_config.sendAppid AS warning_app_code,
warning_config.endApiCode AS warning_api_code,
warning_config.app_type,
warning_config.recipient_id AS recipient_id_list,
log.send_app_name,
log.receive_app_name,
receive_api_name,
log.receive_api_code,
log.return_data,
log.STATUS
FROM
v_hzya_sys_warning warning_config
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
WHERE
log.STATUS = '4'
AND warning_config.push_method = '定时'
</select>
</mapper>

View File

@ -0,0 +1,77 @@
package com.hzya.frame.plugin.pushMessage.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService;
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("PushMessagePluginInitializer")
public class PushMessagePluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(PushMessagePluginInitializer.class);
@Autowired
private ISysPushMessageDao sysPushMessageDao;
@Resource
public ISysSendMessageLogService sysSendMessageLogService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "PushMessagePlugin";
}
@Override
public String getPluginName() {
return "PushMessagePlugin插件";
}
@Override
public String getPluginLabel() {
return "PushMessagePlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行定时消息推送========");
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
for(SysPushMessageEntity entity : list){
sysSendMessageLogService.sendMessage(entity);
}
return BaseResult.getSuccessMessageEntity("定时推送消息成功");
}catch (Exception e){
logger.info("======执行定时消息推送失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,10 @@
package com.hzya.frame.plugin.pushMessage.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface IPushMessageService extends IBaseService<PushMessageEntity, String> {
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.plugin.pushMessage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
import com.hzya.frame.plugin.pushMessage.service.IPushMessageService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
public class PushMessageServiceImpl extends BaseService<PushMessageEntity, String> implements IPushMessageService {
private IPushMessageDao pushMessageDao;
@Autowired
public void setPushMessageDao(IPushMessageDao dao) {
this.pushMessageDao = dao;
this.dao = dao;
}
}

View File

@ -23,24 +23,27 @@ spring:
dynamic: dynamic:
druid: druid:
filters: stat,log4j2 filters: stat,log4j2
validationQuery: SELECT 1 # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL
datasource: datasource:
master: master:
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true # username: hzyazt
# username: root
# password: 62e4295b615a30dbf3b8ee96f41c820b # password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 # driver-class-name: dm.jdbc.driver.DmDriver
# type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:sqlserver://192.168.2.247:9433;DatabaseName=businesscenter;encrypt=false;trustServerCertificate=true url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
username: sa username: root
password: 62e4295b615a30dbf3b8ee96f41c820b password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
# username: hzyazt
# password: 62e4295b615a30dbf3b8ee96f41c820b
# driver-class-name: dm.jdbc.driver.DmDriver
savefile: savefile:
# 文件保存路径 # 文件保存路径
path: /Users/apple/Desktop/log/local path: /Users/apple/Desktop/log/local
pluginpath: tomcatpath: /Users/apple/Desktop/log/local
tomcatpath: pluginpath: /Users/apple/Desktop/log/local
zt: zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
cbs8: cbs8:

View File

@ -6,7 +6,7 @@ logging:
encodings: UTF-8 encodings: UTF-8
file: file:
# 日志保存路径 # 日志保存路径
path: /Users/xiangerlin/work/app/logs/ydc path: /Users/xiangerlin/work/app/logs/dev
spring: spring:
datasource: datasource:
dynamic: dynamic:
@ -18,7 +18,7 @@ spring:
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
savefile: savefile:
# 文件保存路径 # 文件保存路径
path: /Users/xiangerlin/work/app/logs/ydc path: /Users/xiangerlin/work/app/file/dev
cbs8: cbs8:
appId: 1P4AGrpz appId: 1P4AGrpz
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a

View File

@ -2,7 +2,7 @@
logging: logging:
#日志级别 指定目录级别 #日志级别 指定目录级别
level: level:
root: warn root: info
encodings: UTF-8 encodings: UTF-8
file: file:
# 日志保存路径 # 日志保存路径

View File

@ -66,6 +66,8 @@ public class temButtom {
@Autowired @Autowired
private PayResultPluginInitializer payResultPluginInitializer; private PayResultPluginInitializer payResultPluginInitializer;
@Test @Test
public void cbs8PluginTest(){ public void cbs8PluginTest(){
try { try {

18
pom.xml
View File

@ -62,7 +62,8 @@
<minio.version>8.0.3</minio.version> <minio.version>8.0.3</minio.version>
<postgresql.version>42.2.6</postgresql.version> <postgresql.version>42.2.6</postgresql.version>
<jimureport.version>1.7.4</jimureport.version> <jimureport.version>1.7.4</jimureport.version>
<dingtalk-stream-sdk.version>1.3.7</dingtalk-stream-sdk.version>
<dingtalk-sdk.version>2.1.46</dingtalk-sdk.version>
<!-- <groovy.version>4.0.15</groovy.version>--> <!-- <groovy.version>4.0.15</groovy.version>-->
</properties> </properties>
<parent> <parent>
@ -383,6 +384,21 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId> <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-client</artifactId>
<version>${dingtalk-stream-sdk.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dingtalk</artifactId>
<version>${dingtalk-sdk.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -87,21 +87,21 @@ public class CBSUtil {
/** /**
* 财资管理云公钥(平台公钥) * 财资管理云公钥(平台公钥)
*/ */
@Value("${cbs8.cbs_public_key}") @Value("${cbs8.cbs_public_key:}")
public void setBodyEncryptionKey(String bodyEncryptionKey) { public void setBodyEncryptionKey(String bodyEncryptionKey) {
CBSUtil.bodyEncryptionKey = bodyEncryptionKey; CBSUtil.bodyEncryptionKey = bodyEncryptionKey;
} }
/** /**
* 企业私钥解密 * 企业私钥解密
*/ */
@Value("${cbs8.ya_private_key}") @Value("${cbs8.ya_private_key:}")
public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) { public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) {
CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey; CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey;
} }
/** /**
* 企业私钥解密 * 企业私钥解密
*/ */
@Value("${cbs8.ya_private_key}") @Value("${cbs8.ya_private_key:}")
public void setBodyDecryptionKey(String bodyDecryptionKey) { public void setBodyDecryptionKey(String bodyDecryptionKey) {
CBSUtil.bodyDecryptionKey = bodyDecryptionKey; CBSUtil.bodyDecryptionKey = bodyDecryptionKey;
} }

View File

@ -24,11 +24,11 @@ import java.util.Map;
public class CbsAccessToken { public class CbsAccessToken {
private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class); private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class);
@Value("${cbs8.appId}") @Value("${cbs8.appId:}")
private String app_id; private String app_id;
@Value("${cbs8.appSecret}") @Value("${cbs8.appSecret:}")
private String app_secret; private String app_secret;
@Value("${cbs8.url}") @Value("${cbs8.url:}")
private String app_url; private String app_url;
private static String appId; private static String appId;

View File

@ -0,0 +1,48 @@
package com.hzya.frame.dingtalk.enums;
/**
* @Description 通讯录事件类型
* @Author xiangerlin
* @Date 2024/8/27 15:58
**/
public enum OrgEventEnum {
USER_ADD_ORG("user_add_org","通讯录用户新增"),
USER_MODIFY_ORG("user_modify_org","通讯录用户更改"),
USER_LEAVE_ORG("user_leave_org","通讯录用户离职"),
USER_ACTIVE_ORG("user_active_org","加入企业后用户激活"),
ORG_DEPT_CREATE("org_dept_create","通讯录企业部门创建"),
ORG_DEPT_MODIFY("org_dept_modify","通讯录企业部门更改"),
ORG_DEPT_REMOVE("org_dept_remove","通讯录企业部门删除"),
;
private String code;
private String explain;
OrgEventEnum(String code, String explain) {
this.code = code;
this.explain = explain;
}
public String getCode() {
return code;
}
public String getExplain() {
return explain;
}
/**
* 根据code获取事件类型
* @param code
* @return
*/
public static OrgEventEnum getByCode(String code){
for (OrgEventEnum org : OrgEventEnum.values()) {
if (org.getCode().equals(code)){
return org;
}
}
return null;
}
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.dingtalk.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
public interface IDingTalkExtService {
/**
* 调用这个方法初始化钉钉参数
* @param entity
* @return
*/
SysExtensionApiEntity init(SysExtensionApiEntity entity);
/**
* 查询配置在应用上的钉钉参数
* @param sysApplication
* @return
*/
JSONObject getDingTalkConfig(SysApplicationEntity sysApplication);
/**
* 清空配置缓存
*/
void clearDingTalkConfigCatch();
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.dingtalk.service;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
public interface IDingTalkService {
/**
* 根据userid获取用户详情
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId,String appKey,String appSecret);
/**
* 根据userid获取用户详情
* @param userId
* @return
*/
OapiV2UserGetResponse.UserGetResponse getUserById(String userId);
/**
* 获取部门用户列表
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId,String appKey,String appSecret);
/**
* 根据部门id获取部门详情
* @param deptId
* @return
*/
OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId);
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId,String appKey,String appSecret);
}

View File

@ -0,0 +1,100 @@
package com.hzya.frame.dingtalk.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.dingtalk.service.IDingTalkExtService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
import com.hzya.frame.sysnew.application.apiPara.service.ISysApplicationApiParaService;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description 钉钉集成扩展类
* @Author xiangerlin
* @Date 2024/8/28 14:25
**/
@Service(value = "dingTalkExtService")
public class DingTalkExtServiceImpl implements IDingTalkExtService {
@Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao;
private final ConcurrentHashMap<String, JSONObject> dingTalkMap = new ConcurrentHashMap<>();
/**
* 调用这个方法初始化钉钉参数
*
* @param entity
* @return
*/
@Override
public SysExtensionApiEntity init(SysExtensionApiEntity entity) {
Map<String, String> headers = entity.getHeaders();
if (null == headers){
headers = new HashMap<>();
}
SysApplicationEntity receiveApp = entity.getReceiveApp();
//查询应用上配置的参数
JSONObject dingTalkConfig = getDingTalkConfig(receiveApp);
//给token赋值
entity.setQuerys("access_token="+DingTalkAccessToken.getAccessToken(dingTalkConfig.getString("appKey"),dingTalkConfig.getString("appSecret")));
return entity;
}
/**
* 查询配置在应用上的钉钉参数
*
* @param sysApplication
* @return
*/
@Override
public JSONObject getDingTalkConfig(SysApplicationEntity sysApplication) {
if (null != sysApplication && StrUtil.isNotEmpty(sysApplication.getId()) && null != sysApplication.getAppId()){
JSONObject jsonObject = new JSONObject();
String key = sysApplication.getAppId()+"dingTalk";
if (null != dingTalkMap.get(key)){
return dingTalkMap.get(key);
}else {
//查询应用上配置的参数
SysApplicationApiParaEntity paraEntity = new SysApplicationApiParaEntity();
paraEntity.setAppId(sysApplication.getId());
List<SysApplicationApiParaEntity> paraList = sysApplicationApiParaDao.query(paraEntity);
if (CollectionUtils.isNotEmpty(paraList)) {
List<SysApplicationApiParaEntity> appKeyList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appKey")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appKeyList)) {
jsonObject.put("appKey", appKeyList.get(0).getInterfaceValue());
}
List<SysApplicationApiParaEntity> appSecretList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appSecret")).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(appSecretList)) {
jsonObject.put("appSecret", appSecretList.get(0).getInterfaceValue());
}
dingTalkMap.put(key,jsonObject);
return dingTalkMap.get(key);
}
}
}
return null;
}
/**
* 清空配置缓存
*/
@Override
public void clearDingTalkConfigCatch() {
dingTalkMap.clear();
}
}

View File

@ -0,0 +1,164 @@
package com.hzya.frame.dingtalk.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiV2DepartmentGetRequest;
import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
import com.dingtalk.api.request.OapiV2UserGetRequest;
import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;
import com.hzya.frame.dingtalk.service.IDingTalkService;
import com.hzya.frame.dingtalk.util.DingTalkAccessToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 钉钉service
* @Author xiangerlin
* @Date 2024/8/27 16:17
**/
@Service
public class DingTalkServiceImpl implements IDingTalkService {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${dingtalk.appKey:}")
private String dAppKey;
@Value("${dingtalk.appSecret:}")
private String dAppSecret;
/**
* 根据userid获取用户详情
*
* @param userId 钉钉userid
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
req.setUserid(userId);
req.setLanguage("zh_CN");
try {
OapiV2UserGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2UserGetResponse.UserGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("人员详情信息:{}",s);
return result;
}
}catch (Exception e){
logger.error("根据部门id获取钉钉用户详情出错{}",e);
}
return null;
}
/**
* 根据userid获取用户详情
*
* @param userId
* @return
*/
@Override
public OapiV2UserGetResponse.UserGetResponse getUserById(String userId) {
return getUserById(userId,dAppKey,dAppSecret);
}
/**
* 获取部门用户列表
*
* @param req 请求参数
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/list");
req.setSize(100L);//每页最大只能查100条
req.setOrderField("modify_desc");
req.setContainAccessLimit(false);
req.setLanguage("zh_CN");
OapiV2UserListResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
OapiV2UserListResponse.PageResult result = rsp.getResult();
return result;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId 钉钉部门id
* @param appKey
* @param appSecret
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret) {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get");
OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
try {
OapiV2DepartmentGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
OapiV2DepartmentGetResponse.DeptGetResponse result = rsp.getResult();
String s = JSONObject.toJSONString(result);
logger.info("部门详情信息:{}",s);
return result;
}
}catch(Exception e){
logger.error("根据部门id获取钉钉部门出错{}",e);
}
return null;
}
/**
* 根据部门id获取部门详情
*
* @param deptId
* @return
*/
@Override
public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId) {
return getDeptById(deptId,dAppKey,dAppSecret);
}
/**
* 获取部门列表此接口只会返回下一级部门信息
* @param deptId 部门id如果不传则查询一级部门
* @param appKey
* @param appSecret
* @return
*/
@Override
public List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId,String appKey,String appSecret) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest();
req.setDeptId(deptId);
req.setLanguage("zh_CN");
OapiV2DepartmentListsubResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret));
if (rsp.isSuccess()){
List<OapiV2DepartmentListsubResponse.DeptBaseResponse> result = rsp.getResult();
return result;
}
}catch (Exception e){
logger.error("获取部门列表接口出错:{}",e);
}
return null;
}
}

View File

@ -0,0 +1,103 @@
package com.hzya.frame.dingtalk.util;
import cn.hutool.core.util.StrUtil;
import com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenResponse;
import com.aliyun.tea.TeaException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.time.Instant;
/**
* @Description 钉钉获取accessToken
* @Author xiangerlin
* @Date 2024/8/27 14:05
**/
public class DingTalkAccessToken {
static Logger logger = LoggerFactory.getLogger(DingTalkAccessToken.class);
//token
private static String accessToken;
//过期时间
private static Instant expireTime;
private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间
//应用key
private static String appKey;
//应用密钥
private static String appSecret;
@Value("${dingtalk.appKey:}")
public static void setAppKey(String appKey) {
DingTalkAccessToken.appKey = appKey;
}
@Value("${dingtalk.appSecret:}")
public static void setAppSecret(String appSecret) {
DingTalkAccessToken.appSecret = appSecret;
}
/**
* 获取token
* @return
*/
public static String getAccessToken(){
return getAccessToken(appKey,appSecret);
}
/**
* 获取accessToken
*
* @param appKey
* @param appSecret
* @return
*/
public static String getAccessToken(String appKey,String appSecret) {
//判断是否过期 如果没过期直接返回
if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) {
return accessToken;
}
//获取新的accessToken
accessToken = fetchNewAccessToken(appKey,appSecret);
//过期时间设置成当前事件+7000s预留200s的时间
expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME);
return accessToken;
}
/**
* 获取新的accessToken
*
* @return
*/
private static String fetchNewAccessToken(String appKey,String appSecret) {
try {
//查询应用上配置的钉钉信息
if (StrUtil.isNotEmpty(appKey) && StrUtil.isNotEmpty(appSecret)) {
//查询应用上的信息
com.aliyun.dingtalkoauth2_1_0.Client client = DingTalkAccessToken.createClient();
com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest getAccessTokenRequest = new com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest()
.setAppKey(appKey)
.setAppSecret(appSecret);
GetAccessTokenResponse accessToken = client.getAccessToken(getAccessTokenRequest);
String accessToken1 = accessToken.getBody().getAccessToken();
return accessToken1;
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code message 属性可帮助开发定位问题
}
logger.error("获取钉钉token出错:{}", _err);
}
return null;
}
/**
* 使用 Token 初始化账号Client
*
* @return Client
* @throws Exception
*/
private static com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkoauth2_1_0.Client(config);
}
}

View File

@ -49,7 +49,7 @@ public class OerDjmlExtServiceImpl implements IOerDjmlExtService {
Logger logger = LoggerFactory.getLogger(getClass()); Logger logger = LoggerFactory.getLogger(getClass());
@Autowired @Autowired
private RestUtil restUtil; private RestUtil restUtil;
@Value("${savefile.path}") @Value("${savefile.path:}")
public String DSK; public String DSK;
@Autowired @Autowired
private ISysApplicationDatabaseService sysApplicationDatabaseService; private ISysApplicationDatabaseService sysApplicationDatabaseService;

View File

@ -346,6 +346,7 @@ where id = #{id}
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
`data_id` varchar(100) DEFAULT NULL COMMENT 'data_id', `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id',
`mdm_up_id` varchar(100) DEFAULT NULL COMMENT 'mdm_up_id',
</when> </when>
<when test="tableType == '2'.toString()"> <when test="tableType == '2'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码', `id` varchar(50) NOT NULL COMMENT '唯一标识码',
@ -378,7 +379,7 @@ where id = #{id}
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
`data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败', `data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败',
`remark` varchar(255) DEFAULT NULL COMMENT '备注', `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注',
</when> </when>
<when test="tableType == '4'.toString()"> <when test="tableType == '4'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码', `id` varchar(50) NOT NULL COMMENT '唯一标识码',
@ -396,7 +397,7 @@ where id = #{id}
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
`data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败', `data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败',
`remark` varchar(255) DEFAULT NULL COMMENT '备注', `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注',
`distribute_id` varchar(50) DEFAULT NULL COMMENT 'distribute_id', `distribute_id` varchar(50) DEFAULT NULL COMMENT 'distribute_id',
`api_id` varchar(50) DEFAULT NULL COMMENT 'apiid', `api_id` varchar(50) DEFAULT NULL COMMENT 'apiid',
`app_id` varchar(50) DEFAULT NULL COMMENT 'app_id', `app_id` varchar(50) DEFAULT NULL COMMENT 'app_id',
@ -961,19 +962,25 @@ where id = #{id}
${item.leftBracket} ${item.filedId} ${item.leftBracket} ${item.filedId}
<choose> <choose>
<when test="item.compareType == '1'.toString() "> <when test="item.compareType == '1'.toString() ">
= = #{item.filedVaule}
</when> </when>
<when test="item.compareType == '2'.toString() "> <when test="item.compareType == '2'.toString() ">
!= != #{item.filedVaule}
</when> </when>
<when test="item.compareType == '3'.toString() "> <when test="item.compareType == '3'.toString() ">
&gt; &gt; #{item.filedVaule}
</when> </when>
<when test="item.compareType == '4'.toString() "> <when test="item.compareType == '4'.toString() ">
&lt; &lt; #{item.filedVaule}
</when>
<when test="item.compareType == '5'.toString() ">
like concat('%',#{item.filedVaule},'%')
</when>
<when test="item.compareType == '6'.toString() ">
not like concat('%',#{item.filedVaule},'%')
</when> </when>
</choose> </choose>
#{item.filedVaule}
<choose> <choose>
<when test="item.connectionSymbol == '1'.toString() "> <when test="item.connectionSymbol == '1'.toString() ">
<choose> <choose>

View File

@ -1935,7 +1935,7 @@ public class MdmServiceImpl implements IMdmService {
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("新增返回脚本解析保存三方id错误" + jsonResultEntity.getAttribute()); logger.error("新增返回脚本解析保存三方id错误" + jsonResultEntity.getAttribute());
saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败:"+jsonResultEntity.getAttribute(), dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type);
return BaseResult.getFailureMessageEntity("发送错误:新增返回脚本解析保存三方id错误"); return BaseResult.getFailureMessageEntity("发送错误:新增返回脚本解析保存三方id错误");
} }
} }
@ -1943,7 +1943,7 @@ public class MdmServiceImpl implements IMdmService {
saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "1", "发送成功", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "1", "发送成功", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type);
return BaseResult.getSuccessMessageEntity("发送成功"); return BaseResult.getSuccessMessageEntity("发送成功");
} else { } else {
saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败:"+jsonResultEntity.getAttribute(), dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type);
return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getAttribute()); return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getAttribute());
} }
} }

View File

@ -39,7 +39,7 @@ public class CbsLogServiceImpl extends BaseService<CbsLogEntity,String> implemen
Logger log = LoggerFactory.getLogger(getClass()); Logger log = LoggerFactory.getLogger(getClass());
private ICbsLogDao cbsLogDao; private ICbsLogDao cbsLogDao;
@Value("${OA.data_source_code}") @Value("${OA.data_source_code:}")
private String oa_data_source_code; private String oa_data_source_code;
@Autowired @Autowired
public void setCbsLogDao(ICbsLogDao cbsLogDao) { public void setCbsLogDao(ICbsLogDao cbsLogDao) {

View File

@ -0,0 +1,51 @@
package com.hzya.frame.seeyon.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.entity.CtpFileEntity;
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
import java.util.List;
/**
*
* @content OA字段配置表DAO
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:00
*
*/
public interface ICapFormDefinitionDao extends IBaseDao<CapFormDefinitionEntity,String> {
/**
*
* @content 通过模版编号获取无流程表单配置信息
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:02
*
*/
List<CapFormDefinitionEntity> getFormFiled(CapFormDefinitionEntity fieldInfo);
/**
*
* @content 通过主键删除单据数据
* @className: Administrator
* @author laborer
* @date 2024-09-09 17:04
*
*/
int deleteByKey(CapFormDefinitionEntity fieldInfo);
/**
*
* @content 通过客户传递的数据值查询古河条件的数据
* @className: Administrator
* @author laborer
* @date 2024-09-09 17:05
*
*/
List<CapFormDefinitionEntity> getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo);
}

View File

@ -0,0 +1,39 @@
package com.hzya.frame.seeyon.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao;
import com.hzya.frame.seeyon.dao.ICtpFileDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.entity.CtpFileEntity;
import com.hzya.frame.seeyon.paybill.entity.PayBillEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
*
* @content OA字段配置表DAO
* @className: Administrator
* @author laborer
* @date 2024-09-09 16:00
*
*/
@Repository(value = "CapFormDefinitionDaoImpl")
public class CapFormDefinitionDaoImpl extends MybatisGenericDao<CapFormDefinitionEntity,String> implements ICapFormDefinitionDao {
@DS("#fieldInfo.dataSourceCode")
@Override
public List<CapFormDefinitionEntity> getFormFiled(CapFormDefinitionEntity fieldInfo) {
return (List<CapFormDefinitionEntity>) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_base",fieldInfo);
}
@DS("#fieldInfo.dataSourceCode")
@Override
public int deleteByKey(CapFormDefinitionEntity fieldInfo) {
return super.delete("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_delete",fieldInfo);
}
@DS("#fieldInfo.dataSourceCode")
@Override
public List<CapFormDefinitionEntity> getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo) {
return (List<CapFormDefinitionEntity>) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_table_info",fieldInfo);
}
}

View File

@ -0,0 +1,71 @@
package com.hzya.frame.seeyon.entity;
import com.hzya.frame.web.entity.BaseEntity;
import java.io.File;
/**
*
* @content OA字段配置表
* @className: Administrator
* @author laborer
* @date 2024-09-09 15:48
*
*/
public class CapFormDefinitionEntity extends BaseEntity {
private String fieldInfo;//字段属性定义
private String viewInfo;//视图权限定义
private String appbindInfo;//应用绑定定义
private String tableName;//表名
private String fieldName;//字段名称
private String fieldValue;//字段值
public String getFieldValue() {
return fieldValue;
}
public void setFieldValue(String fieldValue) {
this.fieldValue = fieldValue;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldInfo() {
return fieldInfo;
}
public void setFieldInfo(String fieldInfo) {
this.fieldInfo = fieldInfo;
}
public String getViewInfo() {
return viewInfo;
}
public void setViewInfo(String viewInfo) {
this.viewInfo = viewInfo;
}
public String getAppbindInfo() {
return appbindInfo;
}
public void setAppbindInfo(String appbindInfo) {
this.appbindInfo = appbindInfo;
}
}

View File

@ -0,0 +1,41 @@
<?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.seeyon.entity.CapFormDefinitionEntity">
<resultMap id="get-CapFormDefinitionEntity-result" type="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
<!--主键 -->
<result property="id" column="id" />
<result property="fieldInfo" column="field_info" />
<result property="viewInfo" column="view_info" />
<result property="appbindInfo" column="appbind_info" />
</resultMap>
<sql id="CapFormDefinitionEntity_sql">
id,
field_info,
view_info,
appbind_info
</sql>
<!-- 查询 采用==查询 -->
<select id="CapFormDefinitionEntity_list_base" resultMap="get-CapFormDefinitionEntity-result" parameterType="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
select
<include refid="CapFormDefinitionEntity_sql"/>
from
cap_form_definition
<trim prefix="where" prefixOverrides="and">
<if test="appbindInfo != null and appbindInfo != ''">and APPBIND_INFO like '%${appbindInfo}%'</if>
</trim>
</select>
<!-- 查询 采用==查询 -->
<select id="CapFormDefinitionEntity_list_table_info" resultMap="get-CapFormDefinitionEntity-result" parameterType="com.hzya.frame.seeyon.entity.CapFormDefinitionEntity">
select id from ${tableName} where ${fieldName} = #{fieldValue}
</select>
<delete id="CapFormDefinitionEntity_delete" parameterType="com.hzya.frame.basedao.entity.RequestDisposeEntity">
delete from ${tableName} where ${fieldName} = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,26 @@
package com.hzya.frame.seeyon.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
*
* @content 无流程表单公用service
* @className: Administrator
* @author laborer
* @date 2024-09-09 14:53
*
*/
public interface INoProcessService {
/**
*
* @content 无流程删除通用接口
* @className: Administrator
* @author laborer
* @date 2024-09-09 15:08
*
*/
JsonResultEntity DeleteProcessField(JSONObject requestData);
}

View File

@ -0,0 +1,119 @@
package com.hzya.frame.seeyon.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao;
import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity;
import com.hzya.frame.seeyon.service.INoProcessService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
/**
*
* @content 无流程表单公用service
* @className: Administrator
* @author laborer
* @date 2024-09-09 14:53
*
*/
@Service(value = "NoProcessServiceImpl")
public class NoProcessServiceImpl implements INoProcessService {
private static final Logger logger = LoggerFactory.getLogger(NoProcessServiceImpl.class);
@Autowired
private ICapFormDefinitionDao capFormDefinitionDao;
@Override
public JsonResultEntity DeleteProcessField(JSONObject requestData) {
List<String>count =new ArrayList<>();
JSONObject jsonStrObj = requestData.getJSONObject("jsonStr");
String formCode = jsonStrObj.getString("formCode");
String fieldName = jsonStrObj.getString("fieldName");
String fieldValue = jsonStrObj.getString("fieldValue");
if(StrUtil.isEmpty(formCode)){
return new JsonResultEntity("表单编码不能为空formCode",false);
}
if(StrUtil.isEmpty(fieldName)){
return new JsonResultEntity("字段名称不能为空fieldName",false);
}
if(StrUtil.isEmpty(fieldValue)){
return new JsonResultEntity("字段值不能为空fieldValue",false);
}
//通过表单编号获取表单字段信息
CapFormDefinitionEntity fieldInfo = new CapFormDefinitionEntity();
fieldInfo.setAppbindInfo(formCode);
fieldInfo.setDataSourceCode("djoatest");
List<CapFormDefinitionEntity>capFormDefinitionEntityList = capFormDefinitionDao.getFormFiled(fieldInfo);
if(CollectionUtils.isEmpty(capFormDefinitionEntityList)){
return new JsonResultEntity("通过表单编号查询表单有误,请检查表单编号:"+formCode,false);
}
try {
capFormDefinitionEntityList.forEach(item->{
String appbindInfo = item.getAppbindInfo();
//格式化字段信息
JSONObject jsonObject = JSONObject.parseObject(appbindInfo);
boolean queryFlag = false;
//如果模版编号相同则继续删除反正跳过
if(formCode.equals(jsonObject.getString("formCode"))){
JSONObject field = JSONObject.parseObject(item.getFieldInfo());
JSONObject frontFormmain = field.getJSONObject("front_formmain");
JSONArray formsons = field.getJSONArray("formsons");
JSONArray fieldInfoTable = frontFormmain.getJSONArray("fieldInfo");
//验证需要删除的条件字段在表单属性中是否存在
for (int i = 0; i < fieldInfoTable.size(); i++) {
JSONObject fieldInfoTableObj = fieldInfoTable.getJSONObject(i);
String name = fieldInfoTableObj.getString("name");
//如果表单属性中存在该字段则验证通过如果不存在直接返回错误
if(name.equals(fieldName)){
queryFlag = true;
}
}
//验证通过获取数据库表名称进行数据删除
if(queryFlag){
String tableName = frontFormmain.getString("tableName");
//如果主表名称获取主表的主键进行数据删除
fieldInfo.setTableName(tableName);
fieldInfo.setFieldName(fieldName);
fieldInfo.setFieldValue(fieldValue);
List<CapFormDefinitionEntity>dataFormList = capFormDefinitionDao.getFormFiledByFileValue(fieldInfo);
if(CollectionUtils.isNotEmpty(dataFormList)){
dataFormList.forEach(item1->{
String id = item1.getId();
count.add(id);
fieldInfo.setFieldName("id");
fieldInfo.setId(id);
capFormDefinitionDao.deleteByKey(fieldInfo);
//循环该表单下面的所有子表信息进行子表删除
if(CollectionUtils.isNotEmpty(formsons)){
formsons.forEach(formsonsItem->{
JSONObject jsonObjectBoddy = JSONObject.parseObject(formsonsItem.toString());
String bodyTableName = jsonObjectBoddy.getString("tableName");
fieldInfo.setTableName(bodyTableName);
fieldInfo.setFieldName("formmain_id");
fieldInfo.setId(id);
capFormDefinitionDao.deleteByKey(fieldInfo);
});
}
});
}
}
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}
return new JsonResultEntity("删除成功,删除的数据ID"+ JSON.toJSONString(count),true);
}
}

View File

@ -46,6 +46,8 @@ import com.hzya.frame.sysnew.messageManageDetail.entity.SysMessageManageDetailEn
import com.hzya.frame.sysnew.messageManageLog.dao.ISysMessageManageLogDao; import com.hzya.frame.sysnew.messageManageLog.dao.ISysMessageManageLogDao;
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogPageVo; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogPageVo;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
import com.hzya.frame.util.AESUtil; import com.hzya.frame.util.AESUtil;
import com.hzya.frame.util.IPHelper; import com.hzya.frame.util.IPHelper;
import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.uuid.UUIDUtils;
@ -90,6 +92,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
@Resource @Resource
private ISysApplicationApiDao sysApplicationApiDao; private ISysApplicationApiDao sysApplicationApiDao;
@Resource @Resource
private ISysSendMessageLogService sysSendMessageLogService;
@Resource
private ISysMessageManageLogDao sysMessageManageLogDao; private ISysMessageManageLogDao sysMessageManageLogDao;
@Resource @Resource
private DsDataSourceUtil dsDataSourceUtil; private DsDataSourceUtil dsDataSourceUtil;
@ -119,7 +123,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
private TaskExecutor taskExecutor; private TaskExecutor taskExecutor;
// //
@Resource @Resource
private com.hzya.frame.sysnew.application.service.impl.ApplicationCache applicationCache; private ApplicationCache applicationCache;
@Value("${savefile.tomcatpath}") @Value("${savefile.tomcatpath}")
public String TOMCATPATH; public String TOMCATPATH;
@ -2638,9 +2642,21 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
sysMessageManageLogEntity.setModify_time(new Date()); sysMessageManageLogEntity.setModify_time(new Date());
sysMessageManageLogEntity.setSts("Y"); sysMessageManageLogEntity.setSts("Y");
taskExecutor.execute(() -> doEsbTask(sysMessageManageLogEntity)); taskExecutor.execute(() -> doEsbTask(sysMessageManageLogEntity));
SysPushMessageEntity sysPushMessageEntity = new SysPushMessageEntity();
sysPushMessageEntity.setSendAppName(sendApp.getName());
sysPushMessageEntity.setReceiveAppName(receiveApp.getName());
sysPushMessageEntity.setReceiveApiName(receiveApi.getApiName());
sysPushMessageEntity.setReceiveApiCode(receiveApi.getApiCode());
sysPushMessageEntity.setReturnData(sysMessageManageLogEntity.getReturnData());
sysPushMessageEntity.setStatus(sysMessageManageLogEntity.getStatus());
//taskExecutor.execute(() -> sendMssage(sysPushMessageEntity));
return sysMessageManageLogEntity; return sysMessageManageLogEntity;
} }
private void sendMssage(SysPushMessageEntity sysPushMessageEntity) {
sysSendMessageLogService.sendMessage(sysPushMessageEntity);
}
private SysMessageManageLogEntity updateLog(SysApplicationEntity sendApp, SysApplicationEntity receiveApp, SysApplicationApiEntity receiveApi, private SysMessageManageLogEntity updateLog(SysApplicationEntity sendApp, SysApplicationEntity receiveApp, SysApplicationApiEntity receiveApi,
String oldbodys,String bodys, String oldbodys,String bodys,
Map<String, String> oldheaderMap,Map<String, String> headerMap, Map<String, String> oldheaderMap,Map<String, String> headerMap,
@ -2793,6 +2809,9 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
sysMessageManageLogEntity.setModify_time(new Date()); sysMessageManageLogEntity.setModify_time(new Date());
sysMessageManageLogEntity.setSts("Y"); sysMessageManageLogEntity.setSts("Y");
taskExecutor.execute(() -> doEsbTaskNew(sysMessageManageLogEntity)); taskExecutor.execute(() -> doEsbTaskNew(sysMessageManageLogEntity));
return sysMessageManageLogEntity; return sysMessageManageLogEntity;
} }
@ -2805,6 +2824,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
**/ **/
private void doEsbTask(SysMessageManageLogEntity manageLogEntities) { private void doEsbTask(SysMessageManageLogEntity manageLogEntities) {
sysMessageManageLogDao.save(manageLogEntities); sysMessageManageLogDao.save(manageLogEntities);
} }
private void doEsbTaskNew(SysMessageManageLogEntity manageLogEntities) { private void doEsbTaskNew(SysMessageManageLogEntity manageLogEntities) {
sysMessageManageLogDao.update(manageLogEntities); sysMessageManageLogDao.update(manageLogEntities);

View File

@ -52,6 +52,27 @@ public class ComparisonEntity extends BaseEntity {
private List<String> fields; private List<String> fields;
private List<String> returnField; private List<String> returnField;
/** 显示类型 1、树2、列表*/
private String viewName;
//下级结构树
private List<ComparisonEntity> comparisonEntities;
public List<ComparisonEntity> getComparisonEntities() {
return comparisonEntities;
}
public void setComparisonEntities(List<ComparisonEntity> comparisonEntities) {
this.comparisonEntities = comparisonEntities;
}
public String getViewName() {
return viewName;
}
public void setViewName(String viewName) {
this.viewName = viewName;
}
public List<String> getReturnField() { public List<String> getReturnField() {
return returnField; return returnField;
} }

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sysnew.message.dao;
import com.hzya.frame.sysnew.message.entity.SysMessageEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (sys_message: table)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:17:11
*/
public interface ISysMessageDao extends IBaseDao<SysMessageEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sysnew.message.dao.impl;
import com.hzya.frame.sysnew.message.entity.SysMessageEntity;
import com.hzya.frame.sysnew.message.dao.ISysMessageDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (SysMessage)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:17:11
*/
@Repository(value = "SysMessageDaoImpl")
public class SysMessageDaoImpl extends MybatisGenericDao<SysMessageEntity, String> implements ISysMessageDao{
}

View File

@ -0,0 +1,136 @@
package com.hzya.frame.sysnew.message.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (SysMessage)实体类
*
* @author makejava
* @since 2024-08-30 14:17:11
*/
public class SysMessageEntity extends BaseEntity {
/** 公司id */
private String companyId;
/** 调用单据类型 */
private Integer billKindId;
/** 来源业务单据id */
private String billId;
/** 模版id */
private String templateId;
/** 1文本消息 2 卡片消息 */
private String messageType;
/** 消息标题 */
private String title;
/** 消息内容 */
private String content;
/** 消息操作区域 */
private String btns;
/** 发送时间 */
private Date pushTime;
/** 发送者 */
private String sendPersonId;
/** 接受者 */
private String sendToPersonId;
/** 状态 */
private Integer state;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public Integer getBillKindId() {
return billKindId;
}
public void setBillKindId(Integer billKindId) {
this.billKindId = billKindId;
}
public String getBillId() {
return billId;
}
public void setBillId(String billId) {
this.billId = billId;
}
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getBtns() {
return btns;
}
public void setBtns(String btns) {
this.btns = btns;
}
public Date getPushTime() {
return pushTime;
}
public void setPushTime(Date pushTime) {
this.pushTime = pushTime;
}
public String getSendPersonId() {
return sendPersonId;
}
public void setSendPersonId(String sendPersonId) {
this.sendPersonId = sendPersonId;
}
public String getSendToPersonId() {
return sendToPersonId;
}
public void setSendToPersonId(String sendToPersonId) {
this.sendToPersonId = sendToPersonId;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
}

View File

@ -0,0 +1,327 @@
<?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.message.dao.impl.SysMessageDaoImpl">
<resultMap id="get-SysMessageEntity-result" type="com.hzya.frame.sysnew.message.entity.SysMessageEntity" >
<result property="id" column="id" 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="billKindId" column="bill_kind_id" jdbcType="INTEGER"/>
<result property="billId" column="bill_id" jdbcType="VARCHAR"/>
<result property="templateId" column="template_id" jdbcType="VARCHAR"/>
<result property="messageType" column="message_type" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="content" column="content" jdbcType="VARCHAR"/>
<result property="btns" column="btns" jdbcType="VARCHAR"/>
<result property="pushTime" column="push_time" jdbcType="TIMESTAMP"/>
<result property="sendPersonId" column="send_person_id" jdbcType="VARCHAR"/>
<result property="sendToPersonId" column="send_to_person_id" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="INTEGER"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysMessageEntity_Base_Column_List">
id
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,bill_kind_id
,bill_id
,template_id
,message_type
,title
,content
,btns
,push_time
,send_person_id
,send_to_person_id
,state
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysMessageEntity-result">
select
<include refid="SysMessageEntity_Base_Column_List" />
from sys_message where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysMessageEntity-result" parameterType = "com.hzya.frame.sysnew.message.entity.SysMessageEntity">
select
<include refid="SysMessageEntity_Base_Column_List" />
from sys_message
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billKindId != null"> and bill_kind_id = #{billKindId} </if>
<if test="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId} </if>
<if test="messageType != null and messageType != ''"> and message_type = #{messageType} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="content != null and content != ''"> and content = #{content} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="pushTime != null"> and push_time = #{pushTime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="state != null"> and state = #{state} </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.message.entity.SysMessageEntity">
select count(1) from sys_message
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billKindId != null"> and bill_kind_id = #{billKindId} </if>
<if test="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId} </if>
<if test="messageType != null and messageType != ''"> and message_type = #{messageType} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="content != null and content != ''"> and content = #{content} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="pushTime != null"> and push_time = #{pushTime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="state != null"> and state = #{state} </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-SysMessageEntity-result" parameterType = "com.hzya.frame.sysnew.message.entity.SysMessageEntity">
select
<include refid="SysMessageEntity_Base_Column_List" />
from sys_message
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="billKindId != null"> and bill_kind_id like concat('%',#{billKindId},'%') </if>
<if test="billId != null and billId != ''"> and bill_id like concat('%',#{billId},'%') </if>
<if test="templateId != null and templateId != ''"> and template_id like concat('%',#{templateId},'%') </if>
<if test="messageType != null and messageType != ''"> and message_type like concat('%',#{messageType},'%') </if>
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
<if test="content != null and content != ''"> and content like concat('%',#{content},'%') </if>
<if test="btns != null and btns != ''"> and btns like concat('%',#{btns},'%') </if>
<if test="pushTime != null"> and push_time like concat('%',#{pushTime},'%') </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id like concat('%',#{sendPersonId},'%') </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id like concat('%',#{sendToPersonId},'%') </if>
<if test="state != null"> and state like concat('%',#{state},'%') </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="SysMessageentity_list_or" resultMap="get-SysMessageEntity-result" parameterType = "com.hzya.frame.sysnew.message.entity.SysMessageEntity">
select
<include refid="SysMessageEntity_Base_Column_List" />
from sys_message
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="billKindId != null"> or bill_kind_id = #{billKindId} </if>
<if test="billId != null and billId != ''"> or bill_id = #{billId} </if>
<if test="templateId != null and templateId != ''"> or template_id = #{templateId} </if>
<if test="messageType != null and messageType != ''"> or message_type = #{messageType} </if>
<if test="title != null and title != ''"> or title = #{title} </if>
<if test="content != null and content != ''"> or content = #{content} </if>
<if test="btns != null and btns != ''"> or btns = #{btns} </if>
<if test="pushTime != null"> or push_time = #{pushTime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> or send_person_id = #{sendPersonId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> or send_to_person_id = #{sendToPersonId} </if>
<if test="state != null"> or state = #{state} </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.message.entity.SysMessageEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_message(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="billKindId != null"> bill_kind_id , </if>
<if test="billId != null and billId != ''"> bill_id , </if>
<if test="templateId != null and templateId != ''"> template_id , </if>
<if test="messageType != null and messageType != ''"> message_type , </if>
<if test="title != null and title != ''"> title , </if>
<if test="content != null and content != ''"> content , </if>
<if test="btns != null and btns != ''"> btns , </if>
<if test="pushTime != null"> push_time , </if>
<if test="sendPersonId != null and sendPersonId != ''"> send_person_id , </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> send_to_person_id , </if>
<if test="state != null"> state , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="billKindId != null"> #{billKindId} ,</if>
<if test="billId != null and billId != ''"> #{billId} ,</if>
<if test="templateId != null and templateId != ''"> #{templateId} ,</if>
<if test="messageType != null and messageType != ''"> #{messageType} ,</if>
<if test="title != null and title != ''"> #{title} ,</if>
<if test="content != null and content != ''"> #{content} ,</if>
<if test="btns != null and btns != ''"> #{btns} ,</if>
<if test="pushTime != null"> #{pushTime} ,</if>
<if test="sendPersonId != null and sendPersonId != ''"> #{sendPersonId} ,</if>
<if test="sendToPersonId != null and sendToPersonId != ''"> #{sendToPersonId} ,</if>
<if test="state != null"> #{state} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_message(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, bill_id, template_id, message_type, title, content, btns, push_time, send_person_id, send_to_person_id, state, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.billId},#{entity.templateId},#{entity.messageType},#{entity.title},#{entity.content},#{entity.btns},#{entity.pushTime},#{entity.sendPersonId},#{entity.sendToPersonId},#{entity.state}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_message(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, bill_id, template_id, message_type, title, content, btns, push_time, send_person_id, send_to_person_id, state)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.billId},#{entity.templateId},#{entity.messageType},#{entity.title},#{entity.content},#{entity.btns},#{entity.pushTime},#{entity.sendPersonId},#{entity.sendToPersonId},#{entity.state})
</foreach>
on duplicate key update
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),
bill_kind_id = values(bill_kind_id),
bill_id = values(bill_id),
template_id = values(template_id),
message_type = values(message_type),
title = values(title),
content = values(content),
btns = values(btns),
push_time = values(push_time),
send_person_id = values(send_person_id),
send_to_person_id = values(send_to_person_id),
state = values(state)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.message.entity.SysMessageEntity" >
update sys_message set
<trim suffix="" suffixOverrides=",">
<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="billKindId != null"> bill_kind_id = #{billKindId},</if>
<if test="billId != null and billId != ''"> bill_id = #{billId},</if>
<if test="templateId != null and templateId != ''"> template_id = #{templateId},</if>
<if test="messageType != null and messageType != ''"> message_type = #{messageType},</if>
<if test="title != null and title != ''"> title = #{title},</if>
<if test="content != null and content != ''"> content = #{content},</if>
<if test="btns != null and btns != ''"> btns = #{btns},</if>
<if test="pushTime != null"> push_time = #{pushTime},</if>
<if test="sendPersonId != null and sendPersonId != ''"> send_person_id = #{sendPersonId},</if>
<if test="sendToPersonId != null and sendToPersonId != ''"> send_to_person_id = #{sendToPersonId},</if>
<if test="state != null"> state = #{state},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.message.entity.SysMessageEntity" >
update sys_message 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.message.entity.SysMessageEntity" >
update sys_message 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="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="billKindId != null"> and bill_kind_id = #{billKindId} </if>
<if test="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="templateId != null and templateId != ''"> and template_id = #{templateId} </if>
<if test="messageType != null and messageType != ''"> and message_type = #{messageType} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="content != null and content != ''"> and content = #{content} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="pushTime != null"> and push_time = #{pushTime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="state != null"> and state = #{state} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_message where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,26 @@
package com.hzya.frame.sysnew.message.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.message.entity.SysMessageEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* (SysMessage)表服务接口
*
* @author makejava
* @since 2024-08-30 14:17:11
*/
public interface ISysMessageService extends IBaseService<SysMessageEntity, String>{
JsonResultEntity queryEntityPage(JSONObject jsonObject);
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity saveEntity(JSONObject jsonObject);
JsonResultEntity getEntity(JSONObject jsonObject);
JsonResultEntity updateEntity(JSONObject jsonObject);
JsonResultEntity deleteEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,112 @@
package com.hzya.frame.sysnew.message.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.message.entity.SysMessageEntity;
import com.hzya.frame.sysnew.message.dao.ISysMessageDao;
import com.hzya.frame.sysnew.message.service.ISysMessageService;
import com.hzya.frame.sysnew.organ.entity.SysOrganEntity;
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;
/**
* (SysMessage)表服务实现类
*
* @author makejava
* @since 2024-08-30 14:17:11
*/
@Service(value = "sysMessageService")
public class SysMessageServiceImpl extends BaseService<SysMessageEntity, String> implements ISysMessageService {
private ISysMessageDao sysMessageDao;
@Autowired
public void setSysMessageDao(ISysMessageDao dao) {
this.sysMessageDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject){
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysMessageEntity> list = sysMessageDao.queryByLike(entity);
PageInfo<SysMessageEntity> pageInfo = new PageInfo<>(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject){
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if(entity == null){
entity = new SysMessageEntity();
}
List<SysMessageEntity> list = sysMessageDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
@Override
public JsonResultEntity getEntity(JSONObject jsonObject){
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysMessageDao.get(entity.getId());
if(entity == null){
return BaseResult.getFailureMessageEntity("获取站内消息失败");
}
return BaseResult.getSuccessMessageEntity("获取站内消息成功", entity);
}
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject) {
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
entity.setCreate();
//保存
sysMessageDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存消息成功", entity);
}
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject) {
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
sysMessageDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改站内消息成功", entity);
}
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
sysMessageDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除站内消息成功");
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sysnew.messageTemplate.dao;
import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (sys_message_template: table)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:21:15
*/
public interface ISysMessageTemplateDao extends IBaseDao<SysMessageTemplateEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sysnew.messageTemplate.dao.impl;
import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity;
import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (SysMessageTemplate)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:21:15
*/
@Repository(value = "SysMessageTemplateDaoImpl")
public class SysMessageTemplateDaoImpl extends MybatisGenericDao<SysMessageTemplateEntity, String> implements ISysMessageTemplateDao{
}

View File

@ -0,0 +1,136 @@
package com.hzya.frame.sysnew.messageTemplate.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (SysMessageTemplate)实体类
*
* @author makejava
* @since 2024-08-30 14:21:15
*/
public class SysMessageTemplateEntity extends BaseEntity {
/** 公司id */
private String companyId;
/** 调用单据类型 */
private String billKindId;
/** 模版类型 */
private String templateType;
/** 模版名称 */
private String templateName;
/** 消息标题 */
private String messageTitle;
/** 消息内容 */
private String messageContents;
/** 消息操作区域 */
private String btns;
/** 数据源 */
private String dataSource;
/** 创建时间 */
private Date createDate;
/** 创建人 */
private String createPersonId;
/** 状态 */
private String state;
/** 删除标志 */
private Integer isdelete;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getBillKindId() {
return billKindId;
}
public void setBillKindId(String billKindId) {
this.billKindId = billKindId;
}
public String getTemplateType() {
return templateType;
}
public void setTemplateType(String templateType) {
this.templateType = templateType;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getMessageTitle() {
return messageTitle;
}
public void setMessageTitle(String messageTitle) {
this.messageTitle = messageTitle;
}
public String getMessageContents() {
return messageContents;
}
public void setMessageContents(String messageContents) {
this.messageContents = messageContents;
}
public String getBtns() {
return btns;
}
public void setBtns(String btns) {
this.btns = btns;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getCreatePersonId() {
return createPersonId;
}
public void setCreatePersonId(String createPersonId) {
this.createPersonId = createPersonId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Integer getIsdelete() {
return isdelete;
}
public void setIsdelete(Integer isdelete) {
this.isdelete = isdelete;
}
}

View File

@ -0,0 +1,328 @@
<?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.messageTemplate.dao.impl.SysMessageTemplateDaoImpl">
<resultMap id="get-SysMessageTemplateEntity-result" type="com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity" >
<result property="id" column="id" 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="billKindId" column="bill_kind_id" jdbcType="VARCHAR"/>
<result property="templateType" column="template_type" jdbcType="VARCHAR"/>
<result property="templateName" column="template_name" jdbcType="VARCHAR"/>
<result property="messageTitle" column="message_title" jdbcType="VARCHAR"/>
<result property="messageContents" column="message_contents" jdbcType="VARCHAR"/>
<result property="btns" column="btns" jdbcType="VARCHAR"/>
<result property="dataSource" column="data_source" jdbcType="VARCHAR"/>
<result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
<result property="createPersonId" column="create_person_id" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="isdelete" column="isdelete" jdbcType="INTEGER"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysMessageTemplateEntity_Base_Column_List">
id
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,bill_kind_id
,template_type
,template_name
,message_title
,message_contents
,btns
,data_source
,create_date
,create_person_id
,state
,isdelete
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysMessageTemplateEntity-result">
select
<include refid="SysMessageTemplateEntity_Base_Column_List" />
from sys_message_template where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysMessageTemplateEntity-result" parameterType = "com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity">
select
<include refid="SysMessageTemplateEntity_Base_Column_List" />
from sys_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
<if test="templateType != null and templateType != ''"> and template_type = #{templateType} </if>
<if test="templateName != null and templateName != ''"> and template_name = #{templateName} </if>
<if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle} </if>
<if test="messageContents != null and messageContents != ''"> and message_contents = #{messageContents} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource} </if>
<if test="createDate != null"> and create_date = #{createDate} </if>
<if test="createPersonId != null and createPersonId != ''"> and create_person_id = #{createPersonId} </if>
<if test="state != null and state != ''"> and state = #{state} </if>
<if test="isdelete != null"> and isdelete = #{isdelete} </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.messageTemplate.entity.SysMessageTemplateEntity">
select count(1) from sys_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
<if test="templateType != null and templateType != ''"> and template_type = #{templateType} </if>
<if test="templateName != null and templateName != ''"> and template_name = #{templateName} </if>
<if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle} </if>
<if test="messageContents != null and messageContents != ''"> and message_contents = #{messageContents} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource} </if>
<if test="createDate != null"> and create_date = #{createDate} </if>
<if test="createPersonId != null and createPersonId != ''"> and create_person_id = #{createPersonId} </if>
<if test="state != null and state != ''"> and state = #{state} </if>
<if test="isdelete != null"> and isdelete = #{isdelete} </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-SysMessageTemplateEntity-result" parameterType = "com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity">
select
<include refid="SysMessageTemplateEntity_Base_Column_List" />
from sys_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="billKindId != null and billKindId != ''"> and bill_kind_id like concat('%',#{billKindId},'%') </if>
<if test="templateType != null and templateType != ''"> and template_type like concat('%',#{templateType},'%') </if>
<if test="templateName != null and templateName != ''"> and template_name like concat('%',#{templateName},'%') </if>
<if test="messageTitle != null and messageTitle != ''"> and message_title like concat('%',#{messageTitle},'%') </if>
<if test="messageContents != null and messageContents != ''"> and message_contents like concat('%',#{messageContents},'%') </if>
<if test="btns != null and btns != ''"> and btns like concat('%',#{btns},'%') </if>
<if test="dataSource != null and dataSource != ''"> and data_source like concat('%',#{dataSource},'%') </if>
<if test="createDate != null"> and create_date like concat('%',#{createDate},'%') </if>
<if test="createPersonId != null and createPersonId != ''"> and create_person_id like concat('%',#{createPersonId},'%') </if>
<if test="state != null and state != ''"> and state like concat('%',#{state},'%') </if>
<if test="isdelete != null"> and isdelete like concat('%',#{isdelete},'%') </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="SysMessageTemplateentity_list_or" resultMap="get-SysMessageTemplateEntity-result" parameterType = "com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity">
select
<include refid="SysMessageTemplateEntity_Base_Column_List" />
from sys_message_template
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="billKindId != null and billKindId != ''"> or bill_kind_id = #{billKindId} </if>
<if test="templateType != null and templateType != ''"> or template_type = #{templateType} </if>
<if test="templateName != null and templateName != ''"> or template_name = #{templateName} </if>
<if test="messageTitle != null and messageTitle != ''"> or message_title = #{messageTitle} </if>
<if test="messageContents != null and messageContents != ''"> or message_contents = #{messageContents} </if>
<if test="btns != null and btns != ''"> or btns = #{btns} </if>
<if test="dataSource != null and dataSource != ''"> or data_source = #{dataSource} </if>
<if test="createDate != null"> or create_date = #{createDate} </if>
<if test="createPersonId != null and createPersonId != ''"> or create_person_id = #{createPersonId} </if>
<if test="state != null and state != ''"> or state = #{state} </if>
<if test="isdelete != null"> or isdelete = #{isdelete} </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.messageTemplate.entity.SysMessageTemplateEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_message_template(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="billKindId != null and billKindId != ''"> bill_kind_id , </if>
<if test="templateType != null and templateType != ''"> template_type , </if>
<if test="templateName != null and templateName != ''"> template_name , </if>
<if test="messageTitle != null and messageTitle != ''"> message_title , </if>
<if test="messageContents != null and messageContents != ''"> message_contents , </if>
<if test="btns != null and btns != ''"> btns , </if>
<if test="dataSource != null and dataSource != ''"> data_source , </if>
<if test="createDate != null"> create_date , </if>
<if test="createPersonId != null and createPersonId != ''"> create_person_id , </if>
<if test="state != null and state != ''"> state , </if>
<if test="isdelete != null"> isdelete , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="billKindId != null and billKindId != ''"> #{billKindId} ,</if>
<if test="templateType != null and templateType != ''"> #{templateType} ,</if>
<if test="templateName != null and templateName != ''"> #{templateName} ,</if>
<if test="messageTitle != null and messageTitle != ''"> #{messageTitle} ,</if>
<if test="messageContents != null and messageContents != ''"> #{messageContents} ,</if>
<if test="btns != null and btns != ''"> #{btns} ,</if>
<if test="dataSource != null and dataSource != ''"> #{dataSource} ,</if>
<if test="createDate != null"> #{createDate} ,</if>
<if test="createPersonId != null and createPersonId != ''"> #{createPersonId} ,</if>
<if test="state != null and state !=''"> #{state} ,</if>
<if test="isdelete != null"> #{isdelete} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_message_template(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, template_type, template_name, message_title, message_contents, btns, data_source, create_date, create_person_id, state, isdelete, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.templateType},#{entity.templateName},#{entity.messageTitle},#{entity.messageContents},#{entity.btns},#{entity.dataSource},#{entity.createDate},#{entity.createPersonId},#{entity.state},#{entity.isdelete}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_message_template(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, template_type, template_name, message_title, message_contents, btns, data_source, create_date, create_person_id, state, isdelete)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.templateType},#{entity.templateName},#{entity.messageTitle},#{entity.messageContents},#{entity.btns},#{entity.dataSource},#{entity.createDate},#{entity.createPersonId},#{entity.state},#{entity.isdelete})
</foreach>
on duplicate key update
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),
bill_kind_id = values(bill_kind_id),
template_type = values(template_type),
template_name = values(template_name),
message_title = values(message_title),
message_contents = values(message_contents),
btns = values(btns),
data_source = values(data_source),
create_date = values(create_date),
create_person_id = values(create_person_id),
state = values(state),
isdelete = values(isdelete)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity" >
update sys_message_template set
<trim suffix="" suffixOverrides=",">
<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="billKindId != null and billKindId != ''"> bill_kind_id = #{billKindId},</if>
<if test="templateType != null and templateType != ''"> template_type = #{templateType},</if>
<if test="templateName != null and templateName != ''"> template_name = #{templateName},</if>
<if test="messageTitle != null and messageTitle != ''"> message_title = #{messageTitle},</if>
<if test="messageContents != null and messageContents != ''"> message_contents = #{messageContents},</if>
<if test="btns != null and btns != ''"> btns = #{btns},</if>
<if test="dataSource != null and dataSource != ''"> data_source = #{dataSource},</if>
<if test="createDate != null"> create_date = #{createDate},</if>
<if test="createPersonId != null and createPersonId != ''"> create_person_id = #{createPersonId},</if>
<if test="state != null and state !=''"> state = #{state},</if>
<if test="isdelete != null"> isdelete = #{isdelete},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity" >
update sys_message_template 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.messageTemplate.entity.SysMessageTemplateEntity" >
update sys_message_template 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="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="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
<if test="templateType != null and templateType != ''"> and template_type = #{templateType} </if>
<if test="templateName != null and templateName != ''"> and template_name = #{templateName} </if>
<if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle} </if>
<if test="messageContents != null and messageContents != ''"> and message_contents = #{messageContents} </if>
<if test="btns != null and btns != ''"> and btns = #{btns} </if>
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource} </if>
<if test="createDate != null"> and create_date = #{createDate} </if>
<if test="createPersonId != null and createPersonId != ''"> and create_person_id = #{createPersonId} </if>
<if test="state != null"> and state = #{state} </if>
<if test="isdelete != null"> and isdelete = #{isdelete} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_message_template where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,36 @@
package com.hzya.frame.sysnew.messageTemplate.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.ibatis.annotations.Select;
import java.sql.SQLException;
/**
* (SysMessageTemplate)表服务接口
*
* @author makejava
* @since 2024-08-30 14:21:15
*/
public interface ISysMessageTemplateService extends IBaseService<SysMessageTemplateEntity, String>{
JsonResultEntity queryEntityPage(JSONObject jsonObject);
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity saveEntity(JSONObject jsonObject);
JsonResultEntity getEntity(JSONObject jsonObject);
JsonResultEntity updateEntity(JSONObject jsonObject);
JsonResultEntity deleteEntity(JSONObject jsonObject);
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
JsonResultEntity checkSql(JSONObject jsonObject)throws Exception;
JsonResultEntity spliceMessage(JSONObject jsonObject);
}

View File

@ -0,0 +1,205 @@
package com.hzya.frame.sysnew.messageTemplate.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity;
import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao;
import com.hzya.frame.sysnew.messageTemplate.service.ISysMessageTemplateService;
import com.hzya.frame.sysnew.person.dao.ISysPersonDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
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.sql.*;
import java.util.HashMap;
import java.util.List;
/**
* (SysMessageTemplate)表服务实现类
*
* @author makejava
* @since 2024-08-30 14:21:15
*/
@Service(value = "sysMessageTemplateService")
public class SysMessageTemplateServiceImpl extends BaseService<SysMessageTemplateEntity, String> implements ISysMessageTemplateService {
private ISysMessageTemplateDao sysMessageTemplateDao;
@Resource
public IExecSqlService execSqlService;
@Autowired
public void setSysMessageTemplateDao(ISysMessageTemplateDao dao) {
this.sysMessageTemplateDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
//判断分页
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysMessageTemplateEntity> list = sysMessageTemplateDao.queryByLike(entity);
PageInfo<SysMessageTemplateEntity> pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if(entity == null){
entity = new SysMessageTemplateEntity();
}
List<SysMessageTemplateEntity> list = sysMessageTemplateDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
@Override
public JsonResultEntity getEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysMessageTemplateDao.get(entity.getId());
if(entity == null){
return BaseResult.getFailureMessageEntity("获取消息模版失败");
}
return BaseResult.getSuccessMessageEntity("获取消息模版成功", entity);
}
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getBillKindId() == null || "".equals(entity.getBillKindId())){
return BaseResult.getFailureMessageEntity("调用单据类型不允许为空");
}
if(entity.getTemplateType() == null || "".equals(entity.getTemplateType())){
return BaseResult.getFailureMessageEntity("模版类型不允许为空");
}
if(entity.getTemplateName() == null || "".equals(entity.getTemplateName())){
return BaseResult.getFailureMessageEntity("模版名称不允许为空");
}
if(entity.getMessageContents() == null || "".equals(entity.getMessageContents())){
return BaseResult.getFailureMessageEntity("消息内容不允许为空");
}
if(entity.getDataSource() == null || "".equals(entity.getDataSource())){
return BaseResult.getFailureMessageEntity("数据源不允许为空");
}
if(entity.getCreateDate() == null){
return BaseResult.getFailureMessageEntity("创建时间不允许为空");
}
if(entity.getCreatePersonId() == null || "".equals(entity.getCreatePersonId())){
return BaseResult.getFailureMessageEntity("创建人不允许为空");
}
entity.setCreate();
sysMessageTemplateDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存消息模版成功",entity);
}
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if(entity.getBillKindId() == null || "".equals(entity.getBillKindId())){
return BaseResult.getFailureMessageEntity("调用单据类型不允许为空");
}
if(entity.getTemplateType() == null || "".equals(entity.getTemplateType())){
return BaseResult.getFailureMessageEntity("模版类型不允许为空");
}
if(entity.getTemplateName() == null || "".equals(entity.getTemplateName())){
return BaseResult.getFailureMessageEntity("模版名称不允许为空");
}
if(entity.getMessageContents() == null || "".equals(entity.getMessageContents())){
return BaseResult.getFailureMessageEntity("消息内容不允许为空");
}
if(entity.getDataSource() == null || "".equals(entity.getDataSource())){
return BaseResult.getFailureMessageEntity("数据源不允许为空");
}
if(entity.getCreateDate() == null){
return BaseResult.getFailureMessageEntity("创建时间不允许为空");
}
if(entity.getCreatePersonId() == null || "".equals(entity.getCreatePersonId())){
return BaseResult.getFailureMessageEntity("创建人不允许为空");
}
entity.setUpdate();
sysMessageTemplateDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改消息模版成功",entity);
}
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
//1判断这个模版有没有被使用过使用过就不能删除待完成
//将模版id去预警配置表里查一下如果有匹配的数据代表有人正在使用不能删除
sysMessageTemplateDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除消息模版成功");
}
@Override
public JsonResultEntity enableDisableEntity(JSONObject jsonObject){
SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getState() == null || "".equals(entity.getState())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//0启用1禁用
if("0".equals(entity.getState())){
entity.setUpdate();
sysMessageTemplateDao.update(entity);
return BaseResult.getSuccessMessageEntity("启用模版成功");
}else{
//停用消息模版
entity.setUpdate();
sysMessageTemplateDao.update(entity);
return BaseResult.getSuccessMessageEntity("停用模版成功");
}
}
@Override
public JsonResultEntity checkSql(JSONObject jsonObject) throws Exception {
try {
String sql = JSONObject.parseObject(jsonObject.getString("jsonStr")).getString("sql");
List<HashMap<String, Object>> result = execSqlService.execSelectSql(sql, "master");
return BaseResult.getSuccessMessageEntity("SQL检查成功", result);
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("SQL检查失败原因" + e.getMessage());
}
}
@Override
public JsonResultEntity spliceMessage(JSONObject jsonObject){
return BaseResult.getSuccessMessageEntity("消息拼接成功");
}
}

View File

@ -0,0 +1,7 @@
package com.hzya.frame.sysnew.pushMessage.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
public interface ISysPushMessageDao extends IBaseDao<SysPushMessageEntity,String>{
}

View File

@ -0,0 +1,10 @@
package com.hzya.frame.sysnew.pushMessage.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import org.springframework.stereotype.Repository;
@Repository("sysPushMessageDaoImpl")
public class SysPushMessageDaoImpl extends MybatisGenericDao<SysPushMessageEntity,String> implements ISysPushMessageDao {
}

View File

@ -0,0 +1,117 @@
package com.hzya.frame.sysnew.pushMessage.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class SysPushMessageEntity extends BaseEntity {
/** 推送方式 “一次”、“定时” */
private String pushMethod;
/** 预警应用编码 */
private Long warningAppCode;
/** 预警接口编码 */
private Long warningApiCode;
/** 接收者ID列表*/
private String recipientIdList;
/** 预警应用类型 */
private String warningAppType;
/** 发送应用名称 */
private String sendAppName;
/** 接收应用名称 */
private String receiveAppName;
/** 接收接口名称 */
private String receiveApiName;
/** 返回信息 */
private String returnData;
/** 接收接口编码 */
private Long receiveApiCode;
/** 状态1、待发送2、发送中3、发送成功4、发送失败 */
private String status;
public String getPushMethod() {
return pushMethod;
}
public void setPushMethod(String pushMethod) {
this.pushMethod = pushMethod;
}
public Long getWarningAppCode() {
return warningAppCode;
}
public void setWarningAppCode(Long warningAppCode) {
this.warningAppCode = warningAppCode;
}
public Long getWarningApiCode() {
return warningApiCode;
}
public void setWarningApiCode(Long warningApiCode) {
this.warningApiCode = warningApiCode;
}
public Long getReceiveApiCode() {
return receiveApiCode;
}
public void setReceiveApiCode(Long receiveApiCode) {
this.receiveApiCode = receiveApiCode;
}
public String getRecipientIdList() {
return recipientIdList;
}
public void setRecipientIdList(String recipientIdList) {
this.recipientIdList = recipientIdList;
}
public String getWarningAppType() {
return warningAppType;
}
public void setWarningAppType(String warningAppType) {
this.warningAppType = warningAppType;
}
public String getSendAppName() {
return sendAppName;
}
public void setSendAppName(String sendAppName) {
this.sendAppName = sendAppName;
}
public String getReceiveAppName() {
return receiveAppName;
}
public void setReceiveAppName(String receiveAppName) {
this.receiveAppName = receiveAppName;
}
public String getReceiveApiName() {
return receiveApiName;
}
public void setReceiveApiName(String receiveApiName) {
this.receiveApiName = receiveApiName;
}
public String getReturnData() {
return returnData;
}
public void setReturnData(String returnData) {
this.returnData = returnData;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -0,0 +1,42 @@
<?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.pushMessage.dao.impl.SysPushMessageDaoImpl">
<resultMap id="get-SysPushMessageEntity-result" type="com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity" >
<result property="pushMethod" column="push_method" jdbcType="VARCHAR"/>
<result property="warningAppCode" column="warning_app_code" jdbcType="INTEGER"/>
<result property="warningApiCode" column="warning_api_code" jdbcType="INTEGER"/>
<result property="warningAppType" column="warning_app_type" jdbcType="VARCHAR"/>
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
<result property="receiveApiCode" column="receive_api_code" jdbcType="INTEGER"/>
<result property="returnData" column="return_data" jdbcType="LONGVARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysPushMessageEntity-result" parameterType = "com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity">
SELECT
warning_config.push_method,
warning_config.sendAppid AS warning_app_code,
warning_config.endApiCode AS warning_api_code,
warning_config.app_type AS warning_app_type,
warning_config.recipient_id AS recipient_id_list,
log.send_app_name,
log.receive_app_name,
receive_api_name,
log.receive_api_code,
log.return_data,
log.STATUS
FROM
v_hzya_sys_warning warning_config
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
WHERE
log.STATUS = '4'
AND warning_config.push_method = '定时'
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package com.hzya.frame.sysnew.pushMessage.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface ISysPushMessageService extends IBaseService<SysPushMessageEntity,String>{
JsonResultEntity queryEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,33 @@
package com.hzya.frame.sysnew.pushMessage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
import com.hzya.frame.sysnew.pushMessage.dao.impl.SysPushMessageDaoImpl;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService;
import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("sysPushMessageService")
public class SysPushMessageServiceImpl extends BaseService<SysPushMessageEntity,String> implements ISysPushMessageService {
private ISysPushMessageDao sysPushMessageDao;
@Autowired
public void setSysPushMessageDao(ISysPushMessageDao dao) {
this.sysPushMessageDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject){
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
return BaseResult.getSuccessMessageEntity("success");
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sysnew.sendMessageLog.dao;
import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (sys_send_message_log: table)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:19:30
*/
public interface ISysSendMessageLogDao extends IBaseDao<SysSendMessageLogEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sysnew.sendMessageLog.dao.impl;
import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity;
import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (SysSendMessageLog)表数据库访问层
*
* @author makejava
* @since 2024-08-30 14:19:30
*/
@Repository(value = "SysSendMessageLogDaoImpl")
public class SysSendMessageLogDaoImpl extends MybatisGenericDao<SysSendMessageLogEntity, String> implements ISysSendMessageLogDao{
}

View File

@ -0,0 +1,126 @@
package com.hzya.frame.sysnew.sendMessageLog.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (SysSendMessageLog)实体类
*
* @author makejava
* @since 2024-08-30 14:19:30
*/
public class SysSendMessageLogEntity extends BaseEntity {
/** 公司id */
private String companyId;
/** 来源业务单据 */
private String billId;
/** 消息类型1、系统消息、2、单据消息、3、钉钉、4微信、5短信、6、邮件 */
private String type;
/** 发送给谁三方系统userID 钉钉微信、邮箱、手机号) */
private String sendToUserId;
/** 发送给系统内部人员ID */
private String sendToPersonId;
/** 消息内容 */
private String sendCount;
/** 发送时间 */
private Date sendDatetime;
/** 发送人Id */
private String sendPersonId;
/** 消息发送来源模块 */
private String sourceModelName;
/** 消息状态0未读1已读 */
private Integer state;
/** 三方系统消息结果 */
private String resultMessage;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getBillId() {
return billId;
}
public void setBillId(String billId) {
this.billId = billId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getSendToUserId() {
return sendToUserId;
}
public void setSendToUserId(String sendToUserId) {
this.sendToUserId = sendToUserId;
}
public String getSendToPersonId() {
return sendToPersonId;
}
public void setSendToPersonId(String sendToPersonId) {
this.sendToPersonId = sendToPersonId;
}
public String getSendCount() {
return sendCount;
}
public void setSendCount(String sendCount) {
this.sendCount = sendCount;
}
public Date getSendDatetime() {
return sendDatetime;
}
public void setSendDatetime(Date sendDatetime) {
this.sendDatetime = sendDatetime;
}
public String getSendPersonId() {
return sendPersonId;
}
public void setSendPersonId(String sendPersonId) {
this.sendPersonId = sendPersonId;
}
public String getSourceModelName() {
return sourceModelName;
}
public void setSourceModelName(String sourceModelName) {
this.sourceModelName = sourceModelName;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getResultMessage() {
return resultMessage;
}
public void setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
}
}

View File

@ -0,0 +1,353 @@
<?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.sendMessageLog.dao.impl.SysSendMessageLogDaoImpl">
<resultMap id="get-SysSendMessageLogEntity-result" type="com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity" >
<result property="id" column="id" 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="billId" column="bill_id" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="sendToUserId" column="send_to_user_id" jdbcType="VARCHAR"/>
<result property="sendToPersonId" column="send_to_person_id" jdbcType="VARCHAR"/>
<result property="sendCount" column="send_count" jdbcType="VARCHAR"/>
<result property="sendDatetime" column="send_datetime" jdbcType="TIMESTAMP"/>
<result property="sendPersonId" column="send_person_id" jdbcType="VARCHAR"/>
<result property="sourceModelName" column="source_model_name" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="INTEGER"/>
<result property="resultMessage" column="result_message" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="get-PushMessageEntity-result" type="com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity" >
<result property="pushMessage" column="push_message" jdbcType="VARCHAR"/>
<result property="warningAppCode" column="warning_app_code" jdbcType="VARCHAR"/>
<result property="warningApiCode" column="warning_api_code" jdbcType="VARCHAR"/>
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
<result property="receiveApiCode" column="receive_api_code" jdbcType="VARCHAR"/>
<result property="returnData" column="return_data" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysSendMessageLogEntity_Base_Column_List">
id
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,bill_id
,type
,send_to_user_id
,send_to_person_id
,send_count
,send_datetime
,send_person_id
,source_model_name
,state
,result_message
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysSendMessageLogEntity-result">
select
<include refid="SysSendMessageLogEntity_Base_Column_List" />
from sys_send_message_log where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysSendMessageLogEntity-result" parameterType = "com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity">
select
<include refid="SysSendMessageLogEntity_Base_Column_List" />
from sys_send_message_log
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="sendToUserId != null and sendToUserId != ''"> and send_to_user_id = #{sendToUserId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="sendCount != null and sendCount != ''"> and send_count = #{sendCount} </if>
<if test="sendDatetime != null"> and send_datetime = #{sendDatetime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sourceModelName != null and sourceModelName != ''"> and source_model_name = #{sourceModelName} </if>
<if test="state != null"> and state = #{state} </if>
<if test="resultMessage != null and resultMessage != ''"> and result_message = #{resultMessage} </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.sendMessageLog.entity.SysSendMessageLogEntity">
select count(1) from sys_send_message_log
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="sendToUserId != null and sendToUserId != ''"> and send_to_user_id = #{sendToUserId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="sendCount != null and sendCount != ''"> and send_count = #{sendCount} </if>
<if test="sendDatetime != null"> and send_datetime = #{sendDatetime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sourceModelName != null and sourceModelName != ''"> and source_model_name = #{sourceModelName} </if>
<if test="state != null"> and state = #{state} </if>
<if test="resultMessage != null and resultMessage != ''"> and result_message = #{resultMessage} </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-SysSendMessageLogEntity-result" parameterType = "com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity">
select
<include refid="SysSendMessageLogEntity_Base_Column_List" />
from sys_send_message_log
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="billId != null and billId != ''"> and bill_id like concat('%',#{billId},'%') </if>
<if test="type != null and type != ''"> and type like concat('%',#{type},'%') </if>
<if test="sendToUserId != null and sendToUserId != ''"> and send_to_user_id like concat('%',#{sendToUserId},'%') </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id like concat('%',#{sendToPersonId},'%') </if>
<if test="sendCount != null and sendCount != ''"> and send_count like concat('%',#{sendCount},'%') </if>
<if test="sendDatetime != null"> and send_datetime like concat('%',#{sendDatetime},'%') </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id like concat('%',#{sendPersonId},'%') </if>
<if test="sourceModelName != null and sourceModelName != ''"> and source_model_name like concat('%',#{sourceModelName},'%') </if>
<if test="state != null"> and state like concat('%',#{state},'%') </if>
<if test="resultMessage != null and resultMessage != ''"> and result_message like concat('%',#{resultMessage},'%') </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="SysSendMessageLogentity_list_or" resultMap="get-SysSendMessageLogEntity-result" parameterType = "com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity">
select
<include refid="SysSendMessageLogEntity_Base_Column_List" />
from sys_send_message_log
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="billId != null and billId != ''"> or bill_id = #{billId} </if>
<if test="type != null and type != ''"> or type = #{type} </if>
<if test="sendToUserId != null and sendToUserId != ''"> or send_to_user_id = #{sendToUserId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> or send_to_person_id = #{sendToPersonId} </if>
<if test="sendCount != null and sendCount != ''"> or send_count = #{sendCount} </if>
<if test="sendDatetime != null"> or send_datetime = #{sendDatetime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> or send_person_id = #{sendPersonId} </if>
<if test="sourceModelName != null and sourceModelName != ''"> or source_model_name = #{sourceModelName} </if>
<if test="state != null"> or state = #{state} </if>
<if test="resultMessage != null and resultMessage != ''"> or result_message = #{resultMessage} </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.sendMessageLog.entity.SysSendMessageLogEntity">
insert into sys_send_message_log(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="billId != null and billId != ''"> bill_id , </if>
<if test="type != null and type != ''"> type , </if>
<if test="sendToUserId != null and sendToUserId != ''"> send_to_user_id , </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> send_to_person_id , </if>
<if test="sendCount != null and sendCount != ''"> send_count , </if>
<if test="sendDatetime != null"> send_datetime , </if>
<if test="sendPersonId != null and sendPersonId != ''"> send_person_id , </if>
<if test="sourceModelName != null and sourceModelName != ''"> source_model_name , </if>
<if test="state != null"> state , </if>
<if test="resultMessage != null and resultMessage != ''"> result_message , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="billId != null and billId != ''"> #{billId} ,</if>
<if test="type != null and type != ''"> #{type} ,</if>
<if test="sendToUserId != null and sendToUserId != ''"> #{sendToUserId} ,</if>
<if test="sendToPersonId != null and sendToPersonId != ''"> #{sendToPersonId} ,</if>
<if test="sendCount != null and sendCount != ''"> #{sendCount} ,</if>
<if test="sendDatetime != null"> #{sendDatetime} ,</if>
<if test="sendPersonId != null and sendPersonId != ''"> #{sendPersonId} ,</if>
<if test="sourceModelName != null and sourceModelName != ''"> #{sourceModelName} ,</if>
<if test="state != null"> #{state} ,</if>
<if test="resultMessage != null and resultMessage != ''"> #{resultMessage} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, send_to_user_id, send_to_person_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.sendToUserId},#{entity.sendToPersonId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, send_to_user_id, send_to_person_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.sendToUserId},#{entity.sendToPersonId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage})
</foreach>
on duplicate key update
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),
bill_id = values(bill_id),
type = values(type),
send_to_user_id = values(send_to_user_id),
send_to_person_id = values(send_to_person_id),
send_count = values(send_count),
send_datetime = values(send_datetime),
send_person_id = values(send_person_id),
source_model_name = values(source_model_name),
state = values(state),
result_message = values(result_message)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity" >
update sys_send_message_log set
<trim suffix="" suffixOverrides=",">
<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="billId != null and billId != ''"> bill_id = #{billId},</if>
<if test="type != null and type != ''"> type = #{type},</if>
<if test="sendToUserId != null and sendToUserId != ''"> send_to_user_id = #{sendToUserId},</if>
<if test="sendToPersonId != null and sendToPersonId != ''"> send_to_person_id = #{sendToPersonId},</if>
<if test="sendCount != null and sendCount != ''"> send_count = #{sendCount},</if>
<if test="sendDatetime != null"> send_datetime = #{sendDatetime},</if>
<if test="sendPersonId != null and sendPersonId != ''"> send_person_id = #{sendPersonId},</if>
<if test="sourceModelName != null and sourceModelName != ''"> source_model_name = #{sourceModelName},</if>
<if test="state != null"> state = #{state},</if>
<if test="resultMessage != null and resultMessage != ''"> result_message = #{resultMessage},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity" >
update sys_send_message_log 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.sendMessageLog.entity.SysSendMessageLogEntity" >
update sys_send_message_log 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="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="billId != null and billId != ''"> and bill_id = #{billId} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="sendToUserId != null and sendToUserId != ''"> and send_to_user_id = #{sendToUserId} </if>
<if test="sendToPersonId != null and sendToPersonId != ''"> and send_to_person_id = #{sendToPersonId} </if>
<if test="sendCount != null and sendCount != ''"> and send_count = #{sendCount} </if>
<if test="sendDatetime != null"> and send_datetime = #{sendDatetime} </if>
<if test="sendPersonId != null and sendPersonId != ''"> and send_person_id = #{sendPersonId} </if>
<if test="sourceModelName != null and sourceModelName != ''"> and source_model_name = #{sourceModelName} </if>
<if test="state != null"> and state = #{state} </if>
<if test="resultMessage != null and resultMessage != ''"> and result_message = #{resultMessage} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_send_message_log where id = #{id}
</delete>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-PushMessageEntity-result" parameterType = "com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity">
SELECT
warning_config.push_method,
warning_config.sendAppid AS warning_app_code,
warning_config.endApiCode AS warning_api_code,
warning_config.app_type,
warning_config.recipient_id AS recipient_id_list,
log.send_app_name,
log.receive_app_name,
receive_api_name,
log.receive_api_code,
log.return_data,
log.STATUS
FROM
v_hzya_sys_warning warning_config
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
WHERE
log.STATUS = '4'
AND warning_config.push_method = '定时'
</select>
</mapper>

View File

@ -0,0 +1,34 @@
package com.hzya.frame.sysnew.sendMessageLog.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* (SysSendMessageLog)表服务接口
*
* @author makejava
* @since 2024-08-30 14:19:30
*/
public interface ISysSendMessageLogService extends IBaseService<SysSendMessageLogEntity, String>{
JsonResultEntity queryEntityPage(JSONObject jsonObject);
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity getEntity(JSONObject jsonObject);
JsonResultEntity saveEntity(JSONObject jsonObject);
JsonResultEntity updateEntity(JSONObject jsonObject);
JsonResultEntity deleteEntity(JSONObject jsonObject);
boolean sendMessage(SysPushMessageEntity entity);
}

View File

@ -0,0 +1,410 @@
package com.hzya.frame.sysnew.sendMessageLog.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao;
import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity;
import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao;
import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity;
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity;
import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao;
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
import com.hzya.frame.sysnew.user.dao.ISysUserDao;
import com.hzya.frame.sysnew.user.entity.SysUserEntity;
import com.hzya.frame.sysnew.warningConfig.dao.ISysWarningConfigDao;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao;
import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.uuid.UUIDUtils;
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.ArrayList;
import java.util.Date;
import java.util.List;
/**
* (SysSendMessageLog)表服务实现类
*
* @author makejava
* @since 2024-08-30 14:19:30
*/
@Service(value = "sysSendMessageLogService")
public class SysSendMessageLogServiceImpl extends BaseService<SysSendMessageLogEntity, String> implements ISysSendMessageLogService {
@Resource
private ISysWarningInterfaceDao sysWarningInterfaceDao;
@Resource
private ISysWarningConfigDao sysWarningConfigDao;
@Resource
private ISysMessageTemplateDao sysMessageTemplateDao;
@Resource
private ISysUserDao sysUserDao;
@Resource
private ISysApplicationApiDao sysApplicationApiDao;
@Resource
private ISysApplicationApiParaDao sysApplicationApiParaDao;
private ISysSendMessageLogDao sysSendMessageLogDao;
@Autowired
public void setSysSendMessageLogDao(ISysSendMessageLogDao dao) {
this.sysSendMessageLogDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysSendMessageLogEntity> list = sysSendMessageLogDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject) {
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if (entity == null) {
entity = new SysSendMessageLogEntity();
}
List<SysSendMessageLogEntity> list = sysSendMessageLogDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
}
@Override
public JsonResultEntity getEntity(JSONObject jsonObject) {
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不能为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysSendMessageLogDao.get(entity.getId());
if (entity == null) {
return BaseResult.getFailureMessageEntity("获取发送消息日志失败");
}
return BaseResult.getSuccessMessageEntity("获取发送消息日志成功", entity);
}
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject) {
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不能为空");
}
if (entity.getBillId() == null || "".equals(entity.getBillId())) {
return BaseResult.getFailureMessageEntity("来源业务单据不能为空");
}
entity.setCreate();
sysSendMessageLogDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存发送消息日志成功", entity);
}
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject){
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不能为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getBillId() == null || "".equals(entity.getBillId())) {
return BaseResult.getFailureMessageEntity("来源业务单据不能为空");
}
entity.setUpdate();
sysSendMessageLogDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改发送消息日志成功", entity);
}
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject){
SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不能为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();;
sysSendMessageLogDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除发送消息日志成功", entity);
}
/**
* sendMessage方法根据请求错误消息组装成消息模版推送到三方业务系统
* 1先获取接口调用的日志数据
* 2如果日志状态为失败且该接口预警状态为启用则进行消息推送
* 3根据预警配置找到消息模版并生成消息内容
* 4根据预警配置找到预警应用并推送消息
* 5保存消息推送日志
* */
@Override
public boolean sendMessage(SysPushMessageEntity entity){
String status = entity.getStatus();
Long receiveApiCode = entity.getReceiveApiCode();
String sendAppName = entity.getSendAppName();
String receiveApiName = entity.getReceiveApiName();
String recieveAppName = entity.getReceiveAppName();
String returnData = entity.getReturnData();
String warningAppType = entity.getWarningAppType();
Long warningAppCode = entity.getWarningAppCode();
Long warningApiCode = entity.getWarningApiCode();
String sendMsgContent = "";
SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity();
SysWarningConfigEntity configEntity = new SysWarningConfigEntity();
SysMessageTemplateEntity templateEntity = new SysMessageTemplateEntity();
SysApplicationApiParaEntity sysApplicationApiParaEntity = new SysApplicationApiParaEntity();
interfaceEntity.setApiCode(receiveApiCode);
if(status == null){
logger.error("日志状态为空");
return false;
}
//只有发送失败的日志才会推送消息成功的日志不推送消息
if ("4".equals(status)) {
interfaceEntity = sysWarningInterfaceDao.queryOne(interfaceEntity);
if(interfaceEntity == null){
logger.error("未找到API接口预警信息");
return false;
}
//只有预警接口状态为启用才会进行消息推送
if(interfaceEntity.getStatus() == null || interfaceEntity.getStatus().equals("1") == false){
logger.error("API接口未启用推送");
return false;
}
//根据主表id找到主表记录中的消息模版id
String warningConfigId = interfaceEntity.getWarningConfigId();
if(warningConfigId == null || "".equals(warningConfigId)){
logger.error("未找到该接口预警配置信息的主表id");
return false;
}
configEntity = sysWarningConfigDao.get(warningConfigId);
if(configEntity == null){
logger.error("未找到该接口预警配置信息");
return false;
}
String messageTemplateId = configEntity.getMessageTemplateId();
if(messageTemplateId == null || "".equals(messageTemplateId)){
logger.error("未找到该接口预警配置信息的消息模版id");
return false;
}
templateEntity = sysMessageTemplateDao.get(messageTemplateId);
if(templateEntity == null){
logger.error("未找到该接口预警配置信息的消息模版信息");
return false;
}
String messageContent = templateEntity.getMessageContents();
if(messageContent == null || "".equals(messageContent)){
logger.error("未找到该接口预警配置信息的消息模版内容");
return false;
}
//推送消息内容拼接
sendMsgContent = messageContent.replace("${reciecveAppName}",recieveAppName);
sendMsgContent = sendMsgContent.replace("${sendAppName}",sendAppName);
sendMsgContent = sendMsgContent.replace("${receiveApiName}",receiveApiName);
sendMsgContent = sendMsgContent.replace("${returnData}",returnData);
//消息模版名称
String templateName = templateEntity.getTemplateName();
String type = "";
String bodyParams = "";
String warningAppId = configEntity.getWarningAppId();
//查询预警人员id列表
String recipientIdList = configEntity.getRecipientId();
//根据预警人员id列表获取预警应用人员id列表
String warningAppReceiverIdList = getWarningAppReceiverIdList(warningAppType,recipientIdList);
switch (warningAppType){
case "6WX":
//调用微信推送消息
break;
case "5DD":
//消息类型3表示钉钉
type = "3";
//获取钉钉发送消息时使用的微应用的AgentID
sysApplicationApiParaEntity.setAppId(warningAppId);
sysApplicationApiParaEntity.setInterfaceKey("agentId");
String agentId = sysApplicationApiParaDao.queryOne(sysApplicationApiParaEntity).getInterfaceValue();
//拼接调用钉钉接口的body参数
bodyParams = splicingDDBody(sendMsgContent,agentId,warningAppReceiverIdList).toString();
break;
default:
logger.error("未找到该应用类型");
break;
}
String result = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").
header("appId",warningAppCode.toString()).
header("apiCode",warningApiCode.toString()).
header("publicKey","ZJYA7v6DubGMm8EdBPGo+Jj9wCpUeCGJEpfBRLiInq4dvDlCe7eDIk+3zDUT+v578prj").
header("secretKey","bsAMm6tvJs/BV1SO/9ZzjlW+OQaK0mwyv6rLvktyNy/OdltLuG2zze9bT7ttfAA9j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
body(bodyParams).
execute().
body();
JSONObject resultJson = JSONObject.parseObject(result);
String body = resultJson.getString("attribute");
SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity();
sysApplicationApiEntity.setApiCode(warningApiCode);
SysApplicationApiEntity warningApiEntity = sysApplicationApiDao.queryOne(sysApplicationApiEntity);
//根据预警接口编码以及返回数据判断消息推送是否成功
if(warningApiEntity.getReturnSuccessField() != null && !"".equals(warningApiEntity.getReturnSuccessField())
&& warningApiEntity.getReturnSuccessValue() != null && !"".equals(warningApiEntity.getReturnSuccessValue())){
//先判断返回值是否为JSON格式
if (JSONUtil.isTypeJSON(body)){
JSONObject cheackdatas = JSONObject.parseObject(body);
JSONObject datas = JSONObject.parseObject(body);
String checkdata = cheackdatas.getString(warningApiEntity.getReturnSuccessField());
//判断返回值是否为预警接口预期的返回值(1返回值匹配2返回值配置的就是not null3返回值带.)
if (checkdata != null && warningApiEntity.getReturnSuccessValue().equals(checkdata)) {
logger.info("推送消息成功,开始保存日志");
}else if(warningApiEntity.getReturnSuccessValue().equals("not null") && checkdata != null){
logger.info("推送消息成功,开始保存日志");
}else {
String fieldname = warningApiEntity.getReturnSuccessField();
if(fieldname.contains(".")){
String[] fileds = fieldname.split("\\.");
boolean flags = false;
for (int i = 0; i < fileds.length; i++) {
if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) {
datas = datas.getJSONObject(fileds[i]);
if(fileds.length-2 == i ){
String a = datas.getString(fileds[i+1]);
if (a != null && warningApiEntity.getReturnSuccessValue().equals(a)) {
flags = true;
break;
}else if(warningApiEntity.getReturnSuccessValue().equals("not null") && a != null){
flags = true;
break;
}else {
break;
}
}
}
}
if(flags){
logger.info("推送消息成功,开始保存日志");
}else {
logger.error("推送消息失败,返回值错误");
}
}else {
logger.error("推送消息失败,返回值错误");
}
}
}else{
logger.error("接口调用失败,返回格式错误不是JSON");
}
}else{
logger.error("api返回信息字段未配置开始保存日志");
}
saveLog(sendMsgContent,type,resultJson.toString(),templateName,recipientIdList,warningAppReceiverIdList);
logger.info("保存日志成功");
}else{
logger.error("日志状态为成功,不需要推送消息");
return false;
}
return true;
}
/**保存推送消息日志时需要循环预警应用人员id列表*/
public void saveLog(String sendMsgContent,String type,String resultMessage,String templateName,String recipientIdList,String warningAppReceiverIdList){
SysSendMessageLogEntity logEntity = new SysSendMessageLogEntity();
logEntity.setSendCount(sendMsgContent);
logEntity.setType(type);
logEntity.setBillId("test1411");
logEntity.setSendDatetime(new Date());
logEntity.setSts("Y");
logEntity.setCreate_user_id("1");
logEntity.setModify_user_id("1");
logEntity.setCreate_time(new Date());
logEntity.setModify_time(new Date());
logEntity.setOrg_id("0");
logEntity.setCompanyId("0");
logEntity.setSendPersonId("1");
logEntity.setResultMessage(resultMessage);
logEntity.setSourceModelName(templateName);
String[] personIdList = warningAppReceiverIdList.split(",");
String[] userIdList = recipientIdList.split(",");
for(int i=0;i<personIdList.length;i++){
logEntity.setSendToPersonId(personIdList[i]);
logEntity.setSendToUserId(userIdList[i]);
logEntity.setId(UUIDUtils.getUUID());
sysSendMessageLogDao.save(logEntity);
}
}
/**拼接调用钉钉接口的body参数*/
public JSONObject splicingDDBody(String sendMsgContent,String agentId,String userid_list){
JSONObject bodyJson = new JSONObject();
JSONObject msg = new JSONObject();
JSONObject text = new JSONObject();
text.put("content",sendMsgContent);
msg.put("msgtype","text");
msg.put("text",text);
bodyJson.put("msg",msg);
bodyJson.put("to_all_user","false");
bodyJson.put("agent_id",agentId);
bodyJson.put("userid_list",userid_list);
return bodyJson;
}
/**根据预警应用类型和预警人员id列表,获取预警应用人员id列表*/
public String getWarningAppReceiverIdList(String warningAppType,String userIdList){
String[] userIdArray = userIdList.split(",");
String warningAppReceiverIdList = "";
//根据预警人员id列表查表sys_user中匹配的数据记录
List<SysUserEntity> sysUserList = new ArrayList<>();
for(String userId : userIdArray){
sysUserList.add(sysUserDao.get(userId));
}
switch (warningAppType){
case "6WX":
//获取微信预警人员id列表
break;
case "5DD":
//获取钉钉预警人员id列表
for(SysUserEntity sysUser : sysUserList){
if(sysUser.getDdUserId()!= null && !"".equals(sysUser.getDdUserId())){
if(!warningAppReceiverIdList.isEmpty()){
warningAppReceiverIdList += ",";
}
warningAppReceiverIdList += sysUser.getDdUserId();
}
}
break;
default:
logger.error("未找到该应用类型");
break;
}
return warningAppReceiverIdList;
}
}

View File

@ -82,6 +82,26 @@ public class SysUserEntity extends BaseEntity {
*/ */
private String mobilePhone; private String mobilePhone;
private String ddUserId;
private String wxUserId;
public String getDdUserId() {
return ddUserId;
}
public void setDdUserId(String ddUserId) {
this.ddUserId = ddUserId;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getPersonId() { public String getPersonId() {
return personId; return personId;
} }

View File

@ -24,6 +24,8 @@
<result property="personName" column="person_Name" jdbcType="VARCHAR"/> <result property="personName" column="person_Name" jdbcType="VARCHAR"/>
<result property="organName" column="organ_name" jdbcType="VARCHAR"/> <result property="organName" column="organ_name" jdbcType="VARCHAR"/>
<result property="mobilePhone" column="mobile_phone" jdbcType="VARCHAR"/> <result property="mobilePhone" column="mobile_phone" jdbcType="VARCHAR"/>
<result property="ddUserId" column="dd_user_id" jdbcType="VARCHAR"/>
<result property="wxUserId" column="wx_user_id" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 查询的字段--> <!-- 查询的字段-->
<sql id="SysUserEntity_Base_Column_List"> <sql id="SysUserEntity_Base_Column_List">
@ -45,6 +47,8 @@
,sts ,sts
,org_id ,org_id
,company_id ,company_id
,dd_user_id
,wx_user_id
</sql> </sql>
<!--通过ID获取数据 --> <!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysUserEntity-result"> <select id="entity_get" resultMap="get-SysUserEntity-result">
@ -68,6 +72,8 @@
,a.org_id ,a.org_id
,a.company_id ,a.company_id
,p.person_Name ,p.person_Name
,a.wx_user_id
,a.dd_user_id
from from
sys_user a sys_user a
LEFT JOIN sys_person p on p.id = a.person_id and p.sts = 'Y' LEFT JOIN sys_person p on p.id = a.person_id and p.sts = 'Y'
@ -148,6 +154,7 @@
<if test="lastLoginIp != null and lastLoginIp != ''">and last_login_ip like concat('%',#{lastLoginIp},'%') <if test="lastLoginIp != null and lastLoginIp != ''">and last_login_ip like concat('%',#{lastLoginIp},'%')
</if> </if>
<if test="state != null and state != ''">and state like concat('%',#{state},'%')</if> <if test="state != null and state != ''">and state like concat('%',#{state},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if> <if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</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 <if test="create_user_id != null and create_user_id != ''">and create_user_id like

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sysnew.warningConfig.dao;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 预警配置表(sys_warning_config: table)表数据库访问层
*
* @author makejava
* @since 2024-09-03 09:28:23
*/
public interface ISysWarningConfigDao extends IBaseDao<SysWarningConfigEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sysnew.warningConfig.dao.impl;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.sysnew.warningConfig.dao.ISysWarningConfigDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 预警配置表(SysWarningConfig)表数据库访问层
*
* @author makejava
* @since 2024-09-03 09:28:23
*/
@Repository(value = "SysWarningConfigDaoImpl")
public class SysWarningConfigDaoImpl extends MybatisGenericDao<SysWarningConfigEntity, String> implements ISysWarningConfigDao{
}

View File

@ -0,0 +1,96 @@
package com.hzya.frame.sysnew.warningConfig.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 预警配置表(SysWarningConfig)实体类
*
* @author makejava
* @since 2024-09-03 09:28:23
*/
public class SysWarningConfigEntity extends BaseEntity {
/** 公司id */
private String companyId;
/** 消息模版id */
private String messageTemplateId;
/** 应用id */
private String appId;
/** 预警应用id */
private String warningAppId;
/** 接收推送消息的api编码 */
private Long acceptMessageApiCode;
/** 备注 */
private String remark;
/** 是否启用0停用、1启用 */
private String status;
/** 接收人id存表sys_user的id */
private String recipientId;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getMessageTemplateId() {
return messageTemplateId;
}
public void setMessageTemplateId(String messageTemplateId) {
this.messageTemplateId = messageTemplateId;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getWarningAppId() {
return warningAppId;
}
public void setWarningAppId(String warningAppId) {
this.warningAppId = warningAppId;
}
public Long getAcceptMessageApiCode() {
return acceptMessageApiCode;
}
public void setAcceptMessageApiCode(Long acceptMessageApiCode) {
this.acceptMessageApiCode = acceptMessageApiCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRecipientId() {
return recipientId;
}
public void setRecipientId(String recipientId) {
this.recipientId = recipientId;
}
}

View File

@ -0,0 +1,283 @@
<?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.warningConfig.dao.impl.SysWarningConfigDaoImpl">
<resultMap id="get-SysWarningConfigEntity-result" type="com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity" >
<result property="id" column="id" 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="messageTemplateId" column="message_template_id" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="warningAppId" column="warning_app_id" jdbcType="VARCHAR"/>
<result property="acceptMessageApiCode" column="accept_message_api_code" jdbcType="INTEGER"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="recipientId" column="recipient_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysWarningConfigEntity_Base_Column_List">
id
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,message_template_id
,app_id
,warning_app_id
,accept_message_api_code
,remark
,status
,recipient_id
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysWarningConfigEntity-result">
select
<include refid="SysWarningConfigEntity_Base_Column_List" />
from sys_warning_config where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysWarningConfigEntity-result" parameterType = "com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity">
select
<include refid="SysWarningConfigEntity_Base_Column_List" />
from sys_warning_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="messageTemplateId != null and messageTemplateId != ''"> and message_template_id = #{messageTemplateId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="warningAppId != null and warningAppId != ''"> and warning_app_id = #{warningAppId} </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> and accept_message_api_code = #{acceptMessageApiCode} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="recipientId != null and recipientId != ''"> and recipient_id = #{recipientId} </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.warningConfig.entity.SysWarningConfigEntity">
select count(1) from sys_warning_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="messageTemplateId != null and messageTemplateId != ''"> and message_template_id = #{messageTemplateId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="warningAppId != null and warningAppId != ''"> and warning_app_id = #{warningAppId} </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> and accept_message_api_code = #{acceptMessageApiCode} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="recipientId != null and recipientId != ''"> and recipient_id = #{recipientId} </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-SysWarningConfigEntity-result" parameterType = "com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity">
select
<include refid="SysWarningConfigEntity_Base_Column_List" />
from sys_warning_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="messageTemplateId != null and messageTemplateId != ''"> and message_template_id like concat('%',#{messageTemplateId},'%') </if>
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
<if test="warningAppId != null and warningAppId != ''"> and warning_app_id like concat('%',#{warningAppId},'%') </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> and accept_message_api_code like concat('%',#{acceptMessageApiCode},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="recipientId != null and recipientId != ''"> and recipient_id like concat('%',#{recipientId},'%') </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="SysWarningConfigentity_list_or" resultMap="get-SysWarningConfigEntity-result" parameterType = "com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity">
select
<include refid="SysWarningConfigEntity_Base_Column_List" />
from sys_warning_config
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="messageTemplateId != null and messageTemplateId != ''"> or message_template_id = #{messageTemplateId} </if>
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
<if test="warningAppId != null and warningAppId != ''"> or warning_app_id = #{warningAppId} </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> or accept_message_api_code = #{acceptMessageApiCode} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="recipientId != null and recipientId != ''"> or recipient_id = #{recipientId} </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.warningConfig.entity.SysWarningConfigEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_config(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="messageTemplateId != null and messageTemplateId != ''"> message_template_id , </if>
<if test="appId != null and appId != ''"> app_id , </if>
<if test="warningAppId != null and warningAppId != ''"> warning_app_id , </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> accept_message_api_code , </if>
<if test="remark != null and remark != ''"> remark , </if>
<if test="status != null and status != ''"> status , </if>
<if test="recipientId != null and recipientId != ''"> recipient_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="messageTemplateId != null and messageTemplateId != ''"> #{messageTemplateId} ,</if>
<if test="appId != null and appId != ''"> #{appId} ,</if>
<if test="warningAppId != null and warningAppId != ''"> #{warningAppId} ,</if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> #{acceptMessageApiCode} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
<if test="status != null and status != ''"> #{status} ,</if>
<if test="recipientId != null and recipientId != ''"> #{recipientId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id, warning_app_id, accept_message_api_code, remark, status, recipient_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appId},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id, warning_app_id, accept_message_api_code, remark, status, recipient_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appId},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientId})
</foreach>
on duplicate key update
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),
message_template_id = values(message_template_id),
app_id = values(app_id),
warning_app_id = values(warning_app_id),
accept_message_api_code = values(accept_message_api_code),
remark = values(remark),
status = values(status),
recipient_id = values(recipient_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity" >
update sys_warning_config set
<trim suffix="" suffixOverrides=",">
<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="messageTemplateId != null and messageTemplateId != ''"> message_template_id = #{messageTemplateId},</if>
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
<if test="warningAppId != null and warningAppId != ''"> warning_app_id = #{warningAppId},</if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> accept_message_api_code = #{acceptMessageApiCode},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="recipientId != null and recipientId != ''"> recipient_id = #{recipientId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity" >
update sys_warning_config 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.warningConfig.entity.SysWarningConfigEntity" >
update sys_warning_config 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="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="messageTemplateId != null and messageTemplateId != ''"> and message_template_id = #{messageTemplateId} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="warningAppId != null and warningAppId != ''"> and warning_app_id = #{warningAppId} </if>
<if test="acceptMessageApiCode != null and acceptMessageApiCode != ''"> and accept_message_api_code = #{acceptMessageApiCode} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="recipientId != null and recipientId != ''"> and recipient_id = #{recipientId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_warning_config where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,29 @@
package com.hzya.frame.sysnew.warningConfig.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 预警配置表(SysWarningConfig)表服务接口
*
* @author makejava
* @since 2024-09-03 09:28:23
*/
public interface ISysWarningConfigService extends IBaseService<SysWarningConfigEntity, String>{
JsonResultEntity queryEntityPage(JSONObject jsonObject);
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity saveEntity(JSONObject jsonObject);
JsonResultEntity getEntity(JSONObject jsonObject);
JsonResultEntity updateEntity(JSONObject jsonObject);
JsonResultEntity deleteEntity(JSONObject jsonObject);
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,167 @@
package com.hzya.frame.sysnew.warningConfig.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.sysnew.warningConfig.dao.ISysWarningConfigDao;
import com.hzya.frame.sysnew.warningConfig.service.ISysWarningConfigService;
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;
/**
* 预警配置表(SysWarningConfig)表服务实现类
*
* @author makejava
* @since 2024-09-03 09:28:23
*/
@Service(value = "sysWarningConfigService")
public class SysWarningConfigServiceImpl extends BaseService<SysWarningConfigEntity, String> implements ISysWarningConfigService {
private ISysWarningConfigDao sysWarningConfigDao;
@Autowired
public void setSysWarningConfigDao(ISysWarningConfigDao dao) {
this.sysWarningConfigDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if(entity == null || entity.getPageSize() == null || entity.getPageNum() == null){
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysWarningConfigEntity> list = sysWarningConfigDao.queryByLike(entity);
PageInfo pageInfo = new PageInfo(list);
return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo);
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if(entity == null){
entity = new SysWarningConfigEntity();
}
List<SysWarningConfigEntity> list = sysWarningConfigDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功",list);
}
@Override
public JsonResultEntity getEntity(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysWarningConfigDao.get(entity.getId());
if(entity == null){
return BaseResult.getFailureMessageEntity("获取预警配置失败");
}
return BaseResult.getSuccessMessageEntity("获取预警配置成功",entity);
}
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getMessageTemplateId() == null || "".equals(entity.getMessageTemplateId())){
return BaseResult.getFailureMessageEntity("消息模版不允许为空");
}
if(entity.getAppId() == null || "".equals(entity.getAppId())){
return BaseResult.getFailureMessageEntity("应用ID不允许为空");
}
if(entity.getWarningAppId() == null || "".equals(entity.getWarningAppId())){
return BaseResult.getFailureMessageEntity("预警应用类型不允许为空");
}
if(entity.getStatus() == null || "".equals(entity.getStatus())){
return BaseResult.getFailureMessageEntity("状态不允许为空");
}
if(entity.getRecipientId() == null || "".equals(entity.getRecipientId())){
return BaseResult.getFailureMessageEntity("接收者ID不允许为空");
}
entity.setCreate();
sysWarningConfigDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存预警配置成功",entity);
}
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if(entity.getMessageTemplateId() == null || "".equals(entity.getMessageTemplateId())){
return BaseResult.getFailureMessageEntity("消息模版不允许为空");
}
if(entity.getAppId() == null || "".equals(entity.getAppId())){
return BaseResult.getFailureMessageEntity("应用ID不允许为空");
}
if(entity.getWarningAppId() == null || "".equals(entity.getWarningAppId())){
return BaseResult.getFailureMessageEntity("预警应用类型不允许为空");
}
if(entity.getStatus() == null || "".equals(entity.getStatus())){
return BaseResult.getFailureMessageEntity("状态不允许为空");
}
if(entity.getRecipientId() == null || "".equals(entity.getRecipientId())){
return BaseResult.getFailureMessageEntity("接收者ID不允许为空");
}
entity.setUpdate();
sysWarningConfigDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改预警配置成功",entity);
}
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
sysWarningConfigDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除预警配置成功");
}
@Override
public JsonResultEntity enableDisableEntity(JSONObject jsonObject){
SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getStatus() == null || "".equals(entity.getStatus())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//0启用1禁用
if("0".equals(entity.getStatus())){
entity.setUpdate();
sysWarningConfigDao.update(entity);
return BaseResult.getSuccessMessageEntity("启用模版成功");
}else{
//停用消息模版
entity.setUpdate();
sysWarningConfigDao.update(entity);
return BaseResult.getSuccessMessageEntity("停用模版成功");
}
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.sysnew.warningInterface.dao;
import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 预警接口表(sys_warning_interface: table)表数据库访问层
*
* @author makejava
* @since 2024-09-03 10:06:18
*/
public interface ISysWarningInterfaceDao extends IBaseDao<SysWarningInterfaceEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.sysnew.warningInterface.dao.impl;
import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 预警接口表(SysWarningInterface)表数据库访问层
*
* @author makejava
* @since 2024-09-03 10:06:19
*/
@Repository(value = "SysWarningInterfaceDaoImpl")
public class SysWarningInterfaceDaoImpl extends MybatisGenericDao<SysWarningInterfaceEntity, String> implements ISysWarningInterfaceDao{
}

View File

@ -0,0 +1,76 @@
package com.hzya.frame.sysnew.warningInterface.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 预警接口表(SysWarningInterface)实体类
*
* @author makejava
* @since 2024-09-03 10:06:19
*/
public class SysWarningInterfaceEntity extends BaseEntity {
/** 公司id */
private String companyId;
/** api名称 */
private String apiName;
/** api编码 */
private Long apiCode;
/** 推送方式1推送一次、2定时 */
private String pushMethod;
/** 状态0停用、1启用 */
private String status;
/** 主表id预警配置表id */
private String warningConfigId;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public Long getApiCode() {
return apiCode;
}
public void setApiCode(Long apiCode) {
this.apiCode = apiCode;
}
public String getPushMethod() {
return pushMethod;
}
public void setPushMethod(String pushMethod) {
this.pushMethod = pushMethod;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getWarningConfigId() {
return warningConfigId;
}
public void setWarningConfigId(String warningConfigId) {
this.warningConfigId = warningConfigId;
}
}

View File

@ -0,0 +1,254 @@
<?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.warningInterface.dao.impl.SysWarningInterfaceDaoImpl">
<resultMap id="get-SysWarningInterfaceEntity-result" type="com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity" >
<result property="id" column="id" 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="apiName" column="api_name" jdbcType="VARCHAR"/>
<result property="apiCode" column="api_code" jdbcType="INTEGER"/>
<result property="pushMethod" column="push_method" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="warningConfigId" column="warning_config_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysWarningInterfaceEntity_Base_Column_List">
id
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
,api_name
,api_code
,push_method
,status
,warning_config_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysWarningInterfaceEntity-result" parameterType = "com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity">
select
<include refid="SysWarningInterfaceEntity_Base_Column_List" />
from sys_warning_interface
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="apiName != null and apiName != ''"> and api_name = #{apiName} </if>
<if test="apiCode != null and apiCode != ''"> and api_code = #{apiCode} </if>
<if test="pushMethod != null and pushMethod != ''"> and push_method = #{pushMethod} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="warningConfigId != null and warningConfigId != ''"> and warning_config_id = #{warningConfigId} </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.warningInterface.entity.SysWarningInterfaceEntity">
select count(1) from sys_warning_interface
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </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="apiName != null and apiName != ''"> and api_name = #{apiName} </if>
<if test="apiCode != null and apiCode != ''"> and api_code = #{apiCode} </if>
<if test="pushMethod != null and pushMethod != ''"> and push_method = #{pushMethod} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="warningConfigId != null and warningConfigId != ''"> and warning_config_id = #{warningConfigId} </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-SysWarningInterfaceEntity-result" parameterType = "com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity">
select
<include refid="SysWarningInterfaceEntity_Base_Column_List" />
from sys_warning_interface
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </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="apiName != null and apiName != ''"> and api_name like concat('%',#{apiName},'%') </if>
<if test="apiCode != null and apiCode != ''"> and api_code like concat('%',#{apiCode},'%') </if>
<if test="pushMethod != null and pushMethod != ''"> and push_method like concat('%',#{pushMethod},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="warningConfigId != null and warningConfigId != ''"> and warning_config_id like concat('%',#{warningConfigId},'%') </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="SysWarningInterfaceentity_list_or" resultMap="get-SysWarningInterfaceEntity-result" parameterType = "com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity">
select
<include refid="SysWarningInterfaceEntity_Base_Column_List" />
from sys_warning_interface
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </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="apiName != null and apiName != ''"> or api_name = #{apiName} </if>
<if test="apiCode != null and apiCode != ''"> or api_code = #{apiCode} </if>
<if test="pushMethod != null and pushMethod != ''"> or push_method = #{pushMethod} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="warningConfigId != null and warningConfigId != ''"> or warning_config_id = #{warningConfigId} </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.warningInterface.entity.SysWarningInterfaceEntity" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_interface(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </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="apiName != null and apiName != ''"> api_name , </if>
<if test="apiCode != null and apiCode != ''"> api_code , </if>
<if test="pushMethod != null and pushMethod != ''"> push_method , </if>
<if test="status != null and status != ''"> status , </if>
<if test="warningConfigId != null and warningConfigId != ''"> warning_config_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</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="apiName != null and apiName != ''"> #{apiName} ,</if>
<if test="apiCode != null and apiCode != ''"> #{apiCode} ,</if>
<if test="pushMethod != null and pushMethod != ''"> #{pushMethod} ,</if>
<if test="status != null and status != ''"> #{status} ,</if>
<if test="warningConfigId != null and warningConfigId != ''"> #{warningConfigId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_interface(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, api_name, api_code, push_method, status, warning_config_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.apiName},#{entity.apiCode},#{entity.pushMethod},#{entity.status},#{entity.warningConfigId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_warning_interface(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, api_name, api_code, push_method, status, warning_config_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.apiName},#{entity.apiCode},#{entity.pushMethod},#{entity.status},#{entity.warningConfigId})
</foreach>
on duplicate key update
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),
api_name = values(api_name),
api_code = values(api_code),
push_method = values(push_method),
status = values(status),
warning_config_id = values(warning_config_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity" >
update sys_warning_interface set
<trim suffix="" suffixOverrides=",">
<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="apiName != null and apiName != ''"> api_name = #{apiName},</if>
<if test="apiCode != null and apiCode != ''"> api_code = #{apiCode},</if>
<if test="pushMethod != null and pushMethod != ''"> push_method = #{pushMethod},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="warningConfigId != null and warningConfigId != ''"> warning_config_id = #{warningConfigId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity" >
update sys_warning_interface 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.warningInterface.entity.SysWarningInterfaceEntity" >
update sys_warning_interface 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="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="apiName != null and apiName != ''"> and api_name = #{apiName} </if>
<if test="apiCode != null and apiCode != ''"> and api_code = #{apiCode} </if>
<if test="pushMethod != null and pushMethod != ''"> and push_method = #{pushMethod} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="warningConfigId != null and warningConfigId != ''"> and warning_config_id = #{warningConfigId} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_warning_interface where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,29 @@
package com.hzya.frame.sysnew.warningInterface.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.ibatis.annotations.Select;
/**
* 预警接口表(SysWarningInterface)表服务接口
*
* @author makejava
* @since 2024-09-03 10:06:19
*/
public interface ISysWarningInterfaceService extends IBaseService<SysWarningInterfaceEntity, String>{
JsonResultEntity queryEntityPage(JSONObject jsonObject);
JsonResultEntity queryEntity(JSONObject jsonObject);
JsonResultEntity saveEntity(JSONObject jsonObject);
JsonResultEntity getEntity(JSONObject jsonObject);
JsonResultEntity updateEntity(JSONObject jsonObject);
JsonResultEntity deleteEntity(JSONObject jsonObject);
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
}

View File

@ -0,0 +1,167 @@
package com.hzya.frame.sysnew.warningInterface.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity;
import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity;
import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao;
import com.hzya.frame.sysnew.warningInterface.service.ISysWarningInterfaceService;
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;
/**
* 预警接口表(SysWarningInterface)表服务实现类
*
* @author makejava
* @since 2024-09-03 10:06:19
*/
@Service(value = "sysWarningInterfaceService")
public class SysWarningInterfaceServiceImpl extends BaseService<SysWarningInterfaceEntity, String> implements ISysWarningInterfaceService {
private ISysWarningInterfaceDao sysWarningInterfaceDao;
@Autowired
public void setSysWarningInterfaceDao(ISysWarningInterfaceDao dao) {
this.sysWarningInterfaceDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryEntityPage(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysWarningInterfaceEntity> list = sysWarningInterfaceDao.queryByLike(entity);
PageInfo<SysWarningInterfaceEntity> pageInfo = new PageInfo<>(list);
return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo);
}
@Override
public JsonResultEntity queryEntity(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null){
entity = new SysWarningInterfaceEntity();
}
List<SysWarningInterfaceEntity> list = sysWarningInterfaceDao.queryByLike(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功",list);
}
@Override
public JsonResultEntity getEntity(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("查询参数不存在");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity = sysWarningInterfaceDao.get(entity.getId());
if(entity == null){
return BaseResult.getFailureMessageEntity("获取预警接口失败");
}
return BaseResult.getSuccessMessageEntity("获取预警接口成功",entity);
}
@Override
public JsonResultEntity saveEntity(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("查询参数不存在");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
if(entity.getApiCode() == null || "".equals(entity.getApiCode())){
return BaseResult.getFailureMessageEntity("接口编码不能为空");
}
if(entity.getPushMethod() == null || "".equals(entity.getPushMethod())){
return BaseResult.getFailureMessageEntity("推送方式不能为空");
}
if(entity.getStatus() == null || "".equals(entity.getStatus())){
return BaseResult.getFailureMessageEntity("状态不能为空");
}
if(entity.getWarningConfigId() == null || "".equals(entity.getWarningConfigId())){
return BaseResult.getFailureMessageEntity("预警配置id不能为空");
}
entity.setCreate();
sysWarningInterfaceDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存预警接口成功",entity);
}
@Override
public JsonResultEntity updateEntity(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("查询参数不存在");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
if(entity.getApiCode() == null || "".equals(entity.getApiCode())){
return BaseResult.getFailureMessageEntity("接口编码不能为空");
}
if(entity.getPushMethod() == null || "".equals(entity.getPushMethod())){
return BaseResult.getFailureMessageEntity("推送方式不能为空");
}
if(entity.getStatus() == null || "".equals(entity.getStatus())){
return BaseResult.getFailureMessageEntity("状态不能为空");
}
if(entity.getWarningConfigId() == null || "".equals(entity.getWarningConfigId())){
return BaseResult.getFailureMessageEntity("预警配置id不能为空");
}
entity.setUpdate();
sysWarningInterfaceDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改预警接口成功",entity);
}
@Override
public JsonResultEntity deleteEntity(JSONObject jsonObject){
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("查询参数不存在");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
entity.setUpdate();
sysWarningInterfaceDao.logicRemove(entity);
return BaseResult.getSuccessMessageEntity("删除预警接口成功");
}
@Override
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (entity.getStatus() == null || "".equals(entity.getStatus())) {
return BaseResult.getFailureMessageEntity("系统错误");
}
//0启用1禁用
if("0".equals(entity.getStatus())){
entity.setUpdate();
sysWarningInterfaceDao.update(entity);
return BaseResult.getSuccessMessageEntity("启用模版成功");
}else{
//停用消息模版
entity.setUpdate();
sysWarningInterfaceDao.update(entity);
return BaseResult.getSuccessMessageEntity("停用模版成功");
}
}
}

View File

@ -0,0 +1,19 @@
package com.hzya.frame.u8c.Encapsulation.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
import java.util.List;
/**
* (bd_corp: table)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
public interface IEncapsulationDao extends IBaseDao<EncapsulationEntity, String> {
List<EncapsulationEntity> queryCgrkddh(EncapsulationEntity encapsulationEntity);
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.u8c.Encapsulation.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity;
import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntityVo;
import com.hzya.frame.u8c.Encapsulation.dao.IEncapsulationDao;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* (BdCorp)表数据库访问层
*
* @author makejava
* @since 2023-09-06 14:47:17
*/
@Repository("encapsulationDaoImpl")
public class EncapsulationDaoImpl extends MybatisGenericDao<EncapsulationEntity, String> implements IEncapsulationDao {
@DS("#entity.dataSourceCode")
@Override
public List<EncapsulationEntity> queryCgrkddh(EncapsulationEntity entity) {
List<EncapsulationEntity> o = (List<EncapsulationEntity>) super.selectList(getSqlIdPrifx() + "queryCgrkddh", entity);
return o;
}
}

View File

@ -0,0 +1,53 @@
package com.hzya.frame.u8c.Encapsulation.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (BdCorp)实体类
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public class EncapsulationEntity extends BaseEntity {
//单据号
private String code;
//来源单据类型
private String type;
//公司
private String unitcode;
//单据类型
private String cbilltypecode;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCbilltypecode() {
return cbilltypecode;
}
public void setCbilltypecode(String cbilltypecode) {
this.cbilltypecode = cbilltypecode;
}
public String getUnitcode() {
return unitcode;
}
public void setUnitcode(String unitcode) {
this.unitcode = unitcode;
}
}

View File

@ -0,0 +1,23 @@
<?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.u8c.Encapsulation.dao.impl.EncapsulationDaoImpl">
<select id="queryCgrkddh" resultType="com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity" parameterType = "com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity">
SELECT
h.vbillcode as code,
a.unitcode
FROM
ic_general_h h
LEFT JOIN bd_corp a on a.pk_corp = h.pk_corp
WHERE
h.cgeneralhid in (
SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code}
<if test="type != null and type != ''"> and csourcetype = #{type} </if>
)
<if test="cbilltypecode != null and cbilltypecode != ''"> and h.cbilltypecode = #{cbilltypecode} </if>
</select>
</mapper>

View File

@ -0,0 +1,104 @@
package com.hzya.frame.u8c.Encapsulation.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity;
/**
* (BdCorp)表服务接口
*
* @author makejava
* @since 2023-09-06 14:47:18
*/
public interface IEncapsulationService extends IBaseService<EncapsulationEntity, String> {
/**
* @Author lvleigang
* @Description 采购订单删除接口
* 0根据采购订单号查询入库单号,1库存采购入库单取消签字2库存采购入库单删除,3采购订单弃审,4采购订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object purchaseOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addPurchaseOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 采购入库单删除接口
* 1库存采购入库单取消签字2库存采购入库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object purchaseWarehousingDelete(JSONObject jsonObject);
SysExtensionApiEntity addPurchaseWarehousingDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 销售订单删除接口
* 0根据销售钉订单号查询出销售出库单号1库存销售出库单取消签字,2库存销售出库单删除,3销售订单取消审批,4销售订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object salesOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addSalesOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 调拨订单删除接口
* 0根据调拨订单号查询调拨入库调拨出库单据1库存调拨出库取消签字 2库存调拨出库删除 3调拨入库取消签字 4调拨入库删除 5调拨订单弃审 6调拨订单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object transferOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addTransferOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 产成品入库删除接口
* 1库存产成品入库单取消签字 2库存产成品入库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object finishedProductsAreStoredDelete(JSONObject jsonObject);
SysExtensionApiEntity addFinishedProductsAreStoredDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 材料出库删除接口
* 1库存材料出库取消签字 2库存材料出库单删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object materialDeliveryDelete(JSONObject jsonObject);
SysExtensionApiEntity addMaterialDeliveryDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 其他出库单删除接口
* 1库存其他出库取消签字 2库存其他出库删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object otherWarehouseOrdersDelete(JSONObject jsonObject);
SysExtensionApiEntity addOtherWarehouseOrdersDelete(SysExtensionApiEntity jsonObject);
/**
* @Author lvleigang
* @Description 其他入库单删除接口
* 1库存其他入库单取消签字. 2库存其他入库删除
* @Date 9:44 上午 2024/9/4
* @param jsonObject
* @return java.lang.Object
**/
Object otherWarehouseReceiptDelete(JSONObject jsonObject);
SysExtensionApiEntity addOtherWarehouseReceiptDelete(SysExtensionApiEntity jsonObject);
}

View File

@ -183,10 +183,10 @@ public class EntranceServiceImpl implements IEntranceService {
Method[] methods = object.getClass().getMethods(); Method[] methods = object.getClass().getMethods();
logger.info("methodsLength:" + methods.length); logger.info("methodsLength:" + methods.length);
if (methods == null || methods.length == 0) { if (methods == null || methods.length == 0) {
logger.info("当前methods:" + methods + "methodsLength = " + methods.length); logger.error("当前methods:" + methods + "methodsLength = " + methods.length);
throw new BaseSystemException(service + "未找到" + serviceMethod + "方法"); throw new BaseSystemException(service + "未找到" + serviceMethod + "方法");
} else { } else {
logger.info("当前methods222222:" + methods + "methodsLength = " + methods.length); logger.info("当前methods:" + methods + "methodsLength = " + methods.length);
} }
for (Method m : methods) { for (Method m : methods) {
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim()); //logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());
@ -271,10 +271,10 @@ public class EntranceServiceImpl implements IEntranceService {
Method[] methods = object.getClass().getMethods(); Method[] methods = object.getClass().getMethods();
logger.info("methodsLength:" + methods.length); logger.info("methodsLength:" + methods.length);
if (methods == null || methods.length == 0) { if (methods == null || methods.length == 0) {
logger.info("当前methods:" + methods + "methodsLength = " + methods.length); logger.error("当前methods:" + methods + "methodsLength = " + methods.length);
return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法"); return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法");
} else { } else {
logger.error("当前methods2:" + methods + "methodsLength = " + methods.length); logger.info("当前methods:" + methods + "methodsLength = " + methods.length);
} }
for (Method m : methods) { for (Method m : methods) {
//logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim()); //logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim());