Commit c787af15 by 吴博

feat: [1005883] 小睿消息优化

parent b46dd8e9
......@@ -107,11 +107,11 @@ public class TemplateConsr {
}
}
public void sendTempletMessage4Project(String keyword1, String keyword2, Long wechatUserId, String pagepath) {
public void sendTempletMessage4Project(String keyword1, String keyword2, Long wechatUserId, String pagepath, String first) {
LOGGER.info("小睿宠物发送模板消息业务进度提醒keyword1:{},keyword2:{}, wechatUserId:{},pagepath:{},",
keyword1, keyword2,wechatUserId, pagepath);
Map<String, String> temParam = new HashMap<>();
temParam.put("first", "主人召回提醒");
temParam.put("first", first);
temParam.put("keyword1", keyword1);
temParam.put("keyword2", keyword2);
temParam.put("remark", "点击查看详情");
......
......@@ -539,6 +539,20 @@ public class ReaderConsr {
}
return userGradeLabelIdDTO;
}
public List<Long> getAllRelateUnionUsers(List<Long> subList, Long operateOfficalId) {
LOGGER.info("【获取指定用户的关联公众号用户id ,<START>.[subList]");
List<Long> wechatUserIds = new ArrayList<>();
try {
wechatUserIds = ResponseHandleUtil.parseList(raysUnionUserService.getAllRelateUnionUsers(subList, operateOfficalId), Long.class);
} catch (Exception e) {
LOGGER.warn("raysUnionUserService.getAllRelateUnionUsers" + e.getMessage(), e);
}
return wechatUserIds;
}
}
......@@ -242,6 +242,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
Map<String, String> tempMap = new HashMap<>();
String text1 = "主人~我快要饿晕了";
String text2 = "快来,还可以抢救下!";
String first = "主人召回提醒";
if ("pro".equals(BookProps.getSystemEnv())) {
tempMap.put("thing3", text1);
tempMap.put("thing2", text2);
......@@ -253,7 +254,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
//发送小程序服务消息
templateConsr.sendAppletMessageQueue(appletTemplateMessage);
//发送公众号模板消息
templateConsr.sendTempletMessage4Project(text1, text2, wechatUserId, appletTemplateMessage.getPage());
templateConsr.sendTempletMessage4Project(text1, text2, wechatUserId, appletTemplateMessage.getPage(),first);
}
/**
......
......@@ -12,4 +12,8 @@ public interface CultivateNotifyItemDao extends BaseDao<CultivateNotifyItem> {
List<CultivateNotifyItem> getNotifyItemsByMessageId(Long messageId);
List<CultivateNotifyItem> getByMessageIds(List<Long> messageIds);
List<CultivateNotifyItem> getNotifyItemsByMessageId4Jump(Long messageId);
List<CultivateNotifyItem> getNotifyItemsByMessageIds4Jump(List<Long> messageIds);
}
......@@ -24,4 +24,15 @@ public class CultivateNotifyItemDaoImpl extends BaseDaoImpl<CultivateNotifyItem>
map.put("messageIds",messageIds);
return super.getSqlSession().selectList(getStatement("getByMessageIds"), map);
}
@Override
public List<CultivateNotifyItem> getNotifyItemsByMessageId4Jump(Long messageId) {
return super.getSessionTemplate().selectList(getStatement("getNotifyItemsByMessageId4Jump"),messageId);
}
@Override
public List<CultivateNotifyItem> getNotifyItemsByMessageIds4Jump(List<Long> messageIds) {
return super.getSessionTemplate().selectList(getStatement("getNotifyItemsByMessageIds4Jump"),messageIds);
}
}
\ No newline at end of file
......@@ -43,6 +43,10 @@ public class CultivateNotifyDTO {
@ApiModelProperty("发送内容")
private List<CultivateNotifyItem> cultivateNotifyItems;
@ApiModelProperty("跳转选择的应用作品")
private List<CultivateNotifyItem> jumpNotifyItems;
@ApiModelProperty("用户id")
private List<WechatUserDTO> wechatUserDTOS;
......@@ -64,4 +68,7 @@ public class CultivateNotifyDTO {
@ApiModelProperty("是否首页弹窗")
private Integer showHome;
@ApiModelProperty("首页推图")
private String squareImg;
}
......@@ -26,6 +26,10 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty("发送内容")
private List<CultivateNotifyItem> cultivateNotifyItems;
@ApiModelProperty("跳转选择的应用作品")
private List<CultivateNotifyItem> jumpNotifyItems;
@ApiModelProperty("发送时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date sendTime;
......@@ -33,4 +37,6 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty("是否首页弹窗")
private Integer showHome;
private String squareImg;
}
......@@ -27,4 +27,7 @@ public class CultivateNotify extends BaseEntity {
@ApiModelProperty("是否首页弹窗")
private Integer showHome;
@ApiModelProperty("首页推图")
private String squareImg;
}
......@@ -10,10 +10,11 @@
<result column="send_type" property="sendType" jdbcType="INTEGER" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" />
<result column="show_home" property="showHome" jdbcType="TINYINT" />
<result column="square_img" property="squareImg" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
message_id, message_type, title, create_time,update_time,send_type,agent_id, show_home
message_id, message_type, title, create_time,update_time,send_type,agent_id, show_home,square_img
</sql>
<insert id="insert" parameterType="com.pcloud.book.cultivate.entity.CultivateNotify" useGeneratedKeys="true" keyProperty="messageId">
......@@ -25,7 +26,8 @@
update_time,
send_type,
agent_id,
show_home
show_home,
square_img
)
values (
#{messageType},
......@@ -34,7 +36,8 @@
NOW(),
#{sendType},
#{agentId},
#{showHome}
#{showHome},
#{squareImg}
)
</insert>
......
......@@ -66,7 +66,7 @@
</insert>
<select id="getNotifyItemsByMessageId" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from cultivate_notify_item where message_id=#{messageId}
select <include refid="Base_Column_List"/> from cultivate_notify_item where message_id=#{messageId} and jump_type is null
</select>
<select id="getByMessageIds" parameterType="map" resultMap="BaseResultMap">
......@@ -77,6 +77,21 @@
<foreach collection="messageIds" open="(" close=")" separator="," item="item">
#{item}
</foreach>
and content_type &lt; 4
</select>
<select id="getNotifyItemsByMessageId4Jump" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from cultivate_notify_item where message_id=#{messageId} and jump_type is not null
</select>
<select id="getNotifyItemsByMessageIds4Jump" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from cultivate_notify_item
where
message_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and jump_type is not null
</select>
</mapper>
\ No newline at end of file
......@@ -143,7 +143,8 @@
a.message_id messageId,
a.create_time sendTime,
a.title title,
a.show_home showHome
a.show_home showHome,
a.square_img squareImg
from cultivate_notify a
<if test="keyword !=null">
LEFT JOIN cultivate_notify_item b on a.message_id=b.message_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment