小程序消息订阅通知代码生成
This commit is contained in:
parent
2da3f2d6d8
commit
2655be7e39
@ -0,0 +1,43 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Description 消息推送枚举
|
||||
* @Author 纪寒
|
||||
* @Date 2024-03-19 10:12:39
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Getter
|
||||
public enum MessageTypeEnum {
|
||||
/**
|
||||
* 电话外呼
|
||||
*/
|
||||
PHONE_OUTBOUND("PHONE_OUTBOUND"),
|
||||
|
||||
/**
|
||||
* 问卷量表
|
||||
*/
|
||||
QUESTIONNAIRE_SCALE("QUESTIONNAIRE_SCALE"),
|
||||
|
||||
/**
|
||||
* 宣教文章
|
||||
*/
|
||||
PROPAGANDA_ARTICLE("QUESTIONNAIRE_SCALE"),
|
||||
|
||||
/**
|
||||
* 文字提醒
|
||||
*/
|
||||
TEXT_REMIND("TEXT_REMIND"),
|
||||
|
||||
/**
|
||||
* 人工随访
|
||||
*/
|
||||
ARTIFICIAL_FOLLOW_UP("ARTIFICIAL_FOLLOW_UP"),
|
||||
;
|
||||
final private String value;
|
||||
|
||||
MessageTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Description 订阅状态枚举
|
||||
* @Author 纪寒
|
||||
* @Date 2024-03-19 10:20:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Getter
|
||||
public enum SubscribeStatusEnum {
|
||||
/**
|
||||
* 接受
|
||||
*/
|
||||
ACCEPT("ACCEPT"),
|
||||
|
||||
/**
|
||||
* 拒绝
|
||||
*/
|
||||
REJECT("REJECT");
|
||||
final private String value;
|
||||
|
||||
SubscribeStatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
||||
@ -167,7 +167,7 @@ public class GenUtils {
|
||||
*
|
||||
* @param replacementm 替换值
|
||||
* @param searchList 替换列表
|
||||
* @return
|
||||
* @return 文本结果
|
||||
*/
|
||||
public static String replaceFirst(String replacementm, String[] searchList) {
|
||||
String text = replacementm;
|
||||
|
||||
@ -125,7 +125,7 @@ public class VelocityUtils {
|
||||
* @return 模板列表
|
||||
*/
|
||||
public static List<String> getTemplateList(String tplCategory) {
|
||||
List<String> templates = new ArrayList<String>();
|
||||
List<String> templates = new ArrayList<>();
|
||||
templates.add("vm/java/domain.java.vm");
|
||||
templates.add("vm/java/mapper.java.vm");
|
||||
templates.add("vm/java/service.java.vm");
|
||||
|
||||
@ -20,7 +20,7 @@ public interface ${ClassName}Mapper {
|
||||
* @param ${pkColumn.javaField} ${functionName}主键
|
||||
* @return ${functionName}
|
||||
*/
|
||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
|
||||
/**
|
||||
* 查询${functionName}列表
|
||||
|
||||
@ -17,7 +17,7 @@ public interface I${ClassName}Service {
|
||||
* @param ${pkColumn.javaField} ${functionName}主键
|
||||
* @return ${functionName}
|
||||
*/
|
||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
|
||||
/**
|
||||
* 查询${functionName}列表
|
||||
|
||||
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 微信小程序订阅消息记录对象 subscribe_message_record
|
||||
@ -93,15 +93,15 @@ public class SubscribeMessageRecord extends BaseEntity {
|
||||
* 订阅时间
|
||||
*/
|
||||
@ApiModelProperty(value = "订阅时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "订阅时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date subscribeTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "订阅时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime subscribeTime;
|
||||
|
||||
/**
|
||||
* 订阅状态,accept:接受,reject:拒绝
|
||||
*/
|
||||
@ApiModelProperty(value = "订阅状态,accept:接受,reject:拒绝")
|
||||
@Excel(name = "订阅状态,accept:接受,reject:拒绝")
|
||||
@ApiModelProperty(value = "订阅状态,ACCEPT:接受,REJECT:拒绝")
|
||||
@Excel(name = "订阅状态,ACCEPT:接受,REJECT:拒绝")
|
||||
private String subscribeStatus;
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.mapper.subscribemessagerecord;
|
||||
|
||||
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信小程序订阅消息记录Mapper接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-03-19
|
||||
*/
|
||||
public interface SubscribeMessageRecordMapper {
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 微信小程序订阅消息记录
|
||||
*/
|
||||
SubscribeMessageRecord selectSubscribeMessageRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录列表
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 微信小程序订阅消息记录集合
|
||||
*/
|
||||
List<SubscribeMessageRecord> selectSubscribeMessageRecordList(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 新增微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 修改微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 删除微信小程序订阅消息记录
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSubscribeMessageRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除微信小程序订阅消息记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSubscribeMessageRecordByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.service.subscribemessagerecord;
|
||||
|
||||
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信小程序订阅消息记录Service接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-03-19
|
||||
*/
|
||||
public interface ISubscribeMessageRecordService {
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 微信小程序订阅消息记录
|
||||
*/
|
||||
SubscribeMessageRecord selectSubscribeMessageRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录列表
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 微信小程序订阅消息记录集合
|
||||
*/
|
||||
List<SubscribeMessageRecord> selectSubscribeMessageRecordList(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 新增微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 修改微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord);
|
||||
|
||||
/**
|
||||
* 批量删除微信小程序订阅消息记录
|
||||
*
|
||||
* @param ids 需要删除的微信小程序订阅消息记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSubscribeMessageRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除微信小程序订阅消息记录信息
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteSubscribeMessageRecordById(Long id);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.xinelu.manage.service.subscribemessagerecord.impl;
|
||||
|
||||
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
|
||||
import com.xinelu.manage.service.subscribemessagerecord.ISubscribeMessageRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信小程序订阅消息记录Service业务层处理
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-03-19
|
||||
*/
|
||||
@Service
|
||||
public class SubscribeMessageRecordServiceImpl implements ISubscribeMessageRecordService {
|
||||
@Resource
|
||||
private SubscribeMessageRecordMapper subscribeMessageRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 微信小程序订阅消息记录
|
||||
*/
|
||||
@Override
|
||||
public SubscribeMessageRecord selectSubscribeMessageRecordById(Long id) {
|
||||
return subscribeMessageRecordMapper.selectSubscribeMessageRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询微信小程序订阅消息记录列表
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 微信小程序订阅消息记录
|
||||
*/
|
||||
@Override
|
||||
public List<SubscribeMessageRecord> selectSubscribeMessageRecordList(SubscribeMessageRecord subscribeMessageRecord) {
|
||||
return subscribeMessageRecordMapper.selectSubscribeMessageRecordList(subscribeMessageRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord) {
|
||||
subscribeMessageRecord.setCreateTime(LocalDateTime.now());
|
||||
return subscribeMessageRecordMapper.insertSubscribeMessageRecord(subscribeMessageRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信小程序订阅消息记录
|
||||
*
|
||||
* @param subscribeMessageRecord 微信小程序订阅消息记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSubscribeMessageRecord(SubscribeMessageRecord subscribeMessageRecord) {
|
||||
subscribeMessageRecord.setUpdateTime(LocalDateTime.now());
|
||||
return subscribeMessageRecordMapper.updateSubscribeMessageRecord(subscribeMessageRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除微信小程序订阅消息记录
|
||||
*
|
||||
* @param ids 需要删除的微信小程序订阅消息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSubscribeMessageRecordByIds(Long[] ids) {
|
||||
return subscribeMessageRecordMapper.deleteSubscribeMessageRecordByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信小程序订阅消息记录信息
|
||||
*
|
||||
* @param id 微信小程序订阅消息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSubscribeMessageRecordById(Long id) {
|
||||
return subscribeMessageRecordMapper.deleteSubscribeMessageRecordById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,196 @@
|
||||
<?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.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper">
|
||||
|
||||
<resultMap type="SubscribeMessageRecord" id="SubscribeMessageRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="patientId" column="patient_id"/>
|
||||
<result property="manageRouteNodeId" column="manage_route_node_id"/>
|
||||
<result property="unionid" column="unionid"/>
|
||||
<result property="openid" column="openid"/>
|
||||
<result property="appletId" column="applet_id"/>
|
||||
<result property="templateId" column="template_id"/>
|
||||
<result property="messageType" column="message_type"/>
|
||||
<result property="subscribeCount" column="subscribe_count"/>
|
||||
<result property="subscribeTime" column="subscribe_time"/>
|
||||
<result property="subscribeStatus" column="subscribe_status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSubscribeMessageRecordVo">
|
||||
select id, patient_id, manage_route_node_id, unionid, openid, applet_id, template_id, message_type, subscribe_count, subscribe_time, subscribe_status, create_by, create_time, update_by, update_time from subscribe_message_record
|
||||
</sql>
|
||||
|
||||
<select id="selectSubscribeMessageRecordList" parameterType="SubscribeMessageRecord"
|
||||
resultMap="SubscribeMessageRecordResult">
|
||||
<include refid="selectSubscribeMessageRecordVo"/>
|
||||
<where>
|
||||
<if test="patientId != null ">
|
||||
and patient_id = #{patientId}
|
||||
</if>
|
||||
<if test="manageRouteNodeId != null ">
|
||||
and manage_route_node_id = #{manageRouteNodeId}
|
||||
</if>
|
||||
<if test="unionid != null and unionid != ''">
|
||||
and unionid = #{unionid}
|
||||
</if>
|
||||
<if test="openid != null and openid != ''">
|
||||
and openid = #{openid}
|
||||
</if>
|
||||
<if test="appletId != null and appletId != ''">
|
||||
and applet_id = #{appletId}
|
||||
</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="subscribeCount != null ">
|
||||
and subscribe_count = #{subscribeCount}
|
||||
</if>
|
||||
<if test="subscribeTime != null ">
|
||||
and subscribe_time = #{subscribeTime}
|
||||
</if>
|
||||
<if test="subscribeStatus != null and subscribeStatus != ''">
|
||||
and subscribe_status = #{subscribeStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSubscribeMessageRecordById" parameterType="Long"
|
||||
resultMap="SubscribeMessageRecordResult">
|
||||
<include refid="selectSubscribeMessageRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSubscribeMessageRecord" parameterType="SubscribeMessageRecord" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into subscribe_message_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="patientId != null">patient_id,
|
||||
</if>
|
||||
<if test="manageRouteNodeId != null">manage_route_node_id,
|
||||
</if>
|
||||
<if test="unionid != null">unionid,
|
||||
</if>
|
||||
<if test="openid != null">openid,
|
||||
</if>
|
||||
<if test="appletId != null">applet_id,
|
||||
</if>
|
||||
<if test="templateId != null">template_id,
|
||||
</if>
|
||||
<if test="messageType != null">message_type,
|
||||
</if>
|
||||
<if test="subscribeCount != null">subscribe_count,
|
||||
</if>
|
||||
<if test="subscribeTime != null">subscribe_time,
|
||||
</if>
|
||||
<if test="subscribeStatus != null">subscribe_status,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="patientId != null">#{patientId},
|
||||
</if>
|
||||
<if test="manageRouteNodeId != null">#{manageRouteNodeId},
|
||||
</if>
|
||||
<if test="unionid != null">#{unionid},
|
||||
</if>
|
||||
<if test="openid != null">#{openid},
|
||||
</if>
|
||||
<if test="appletId != null">#{appletId},
|
||||
</if>
|
||||
<if test="templateId != null">#{templateId},
|
||||
</if>
|
||||
<if test="messageType != null">#{messageType},
|
||||
</if>
|
||||
<if test="subscribeCount != null">#{subscribeCount},
|
||||
</if>
|
||||
<if test="subscribeTime != null">#{subscribeTime},
|
||||
</if>
|
||||
<if test="subscribeStatus != null">#{subscribeStatus},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSubscribeMessageRecord" parameterType="SubscribeMessageRecord">
|
||||
update subscribe_message_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="patientId != null">patient_id =
|
||||
#{patientId},
|
||||
</if>
|
||||
<if test="manageRouteNodeId != null">manage_route_node_id =
|
||||
#{manageRouteNodeId},
|
||||
</if>
|
||||
<if test="unionid != null">unionid =
|
||||
#{unionid},
|
||||
</if>
|
||||
<if test="openid != null">openid =
|
||||
#{openid},
|
||||
</if>
|
||||
<if test="appletId != null">applet_id =
|
||||
#{appletId},
|
||||
</if>
|
||||
<if test="templateId != null">template_id =
|
||||
#{templateId},
|
||||
</if>
|
||||
<if test="messageType != null">message_type =
|
||||
#{messageType},
|
||||
</if>
|
||||
<if test="subscribeCount != null">subscribe_count =
|
||||
#{subscribeCount},
|
||||
</if>
|
||||
<if test="subscribeTime != null">subscribe_time =
|
||||
#{subscribeTime},
|
||||
</if>
|
||||
<if test="subscribeStatus != null">subscribe_status =
|
||||
#{subscribeStatus},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSubscribeMessageRecordById" parameterType="Long">
|
||||
delete from subscribe_message_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSubscribeMessageRecordByIds" parameterType="String">
|
||||
delete from subscribe_message_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user