Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
This commit is contained in:
commit
7af6143514
|
@ -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> {
|
||||
}
|
|
@ -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 {
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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> {
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
logging:
|
||||
#日志级别 指定目录级别
|
||||
level:
|
||||
root: warn
|
||||
root: info
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.stream.Stream;
|
|||
* @Author xiangerlin
|
||||
* @Date 2024/8/28 14:25
|
||||
**/
|
||||
@Service
|
||||
@Service(value = "dingTalkExtService")
|
||||
public class DingTalkExtServiceImpl implements IDingTalkExtService {
|
||||
|
||||
|
||||
|
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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("删除站内消息成功");
|
||||
}
|
||||
}
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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("消息拼接成功");
|
||||
}
|
||||
}
|
|
@ -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>{
|
||||
}
|
|
@ -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 {
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -82,6 +82,26 @@ public class SysUserEntity extends BaseEntity {
|
|||
*/
|
||||
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() {
|
||||
return personId;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
<result property="personName" column="person_Name" jdbcType="VARCHAR"/>
|
||||
<result property="organName" column="organ_name" 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>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysUserEntity_Base_Column_List">
|
||||
|
@ -45,6 +47,8 @@
|
|||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
,dd_user_id
|
||||
,wx_user_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysUserEntity-result">
|
||||
|
@ -68,6 +72,8 @@
|
|||
,a.org_id
|
||||
,a.company_id
|
||||
,p.person_Name
|
||||
,a.wx_user_id
|
||||
,a.dd_user_id
|
||||
from
|
||||
sys_user a
|
||||
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>
|
||||
<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="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
|
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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("停用模版成功");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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("停用模版成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue