Commit c787af15 by 吴博

feat: [1005883] 小睿消息优化

parent b46dd8e9
...@@ -107,11 +107,11 @@ public class TemplateConsr { ...@@ -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:{},", LOGGER.info("小睿宠物发送模板消息业务进度提醒keyword1:{},keyword2:{}, wechatUserId:{},pagepath:{},",
keyword1, keyword2,wechatUserId, pagepath); keyword1, keyword2,wechatUserId, pagepath);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "主人召回提醒"); temParam.put("first", first);
temParam.put("keyword1", keyword1); temParam.put("keyword1", keyword1);
temParam.put("keyword2", keyword2); temParam.put("keyword2", keyword2);
temParam.put("remark", "点击查看详情"); temParam.put("remark", "点击查看详情");
......
...@@ -539,6 +539,20 @@ public class ReaderConsr { ...@@ -539,6 +539,20 @@ public class ReaderConsr {
} }
return userGradeLabelIdDTO; 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 { ...@@ -242,6 +242,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
Map<String, String> tempMap = new HashMap<>(); Map<String, String> tempMap = new HashMap<>();
String text1 = "主人~我快要饿晕了"; String text1 = "主人~我快要饿晕了";
String text2 = "快来,还可以抢救下!"; String text2 = "快来,还可以抢救下!";
String first = "主人召回提醒";
if ("pro".equals(BookProps.getSystemEnv())) { if ("pro".equals(BookProps.getSystemEnv())) {
tempMap.put("thing3", text1); tempMap.put("thing3", text1);
tempMap.put("thing2", text2); tempMap.put("thing2", text2);
...@@ -253,7 +254,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz { ...@@ -253,7 +254,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
//发送小程序服务消息 //发送小程序服务消息
templateConsr.sendAppletMessageQueue(appletTemplateMessage); 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> { ...@@ -12,4 +12,8 @@ public interface CultivateNotifyItemDao extends BaseDao<CultivateNotifyItem> {
List<CultivateNotifyItem> getNotifyItemsByMessageId(Long messageId); List<CultivateNotifyItem> getNotifyItemsByMessageId(Long messageId);
List<CultivateNotifyItem> getByMessageIds(List<Long> messageIds); 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> ...@@ -24,4 +24,15 @@ public class CultivateNotifyItemDaoImpl extends BaseDaoImpl<CultivateNotifyItem>
map.put("messageIds",messageIds); map.put("messageIds",messageIds);
return super.getSqlSession().selectList(getStatement("getByMessageIds"), map); 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 { ...@@ -43,6 +43,10 @@ public class CultivateNotifyDTO {
@ApiModelProperty("发送内容") @ApiModelProperty("发送内容")
private List<CultivateNotifyItem> cultivateNotifyItems; private List<CultivateNotifyItem> cultivateNotifyItems;
@ApiModelProperty("跳转选择的应用作品")
private List<CultivateNotifyItem> jumpNotifyItems;
@ApiModelProperty("用户id") @ApiModelProperty("用户id")
private List<WechatUserDTO> wechatUserDTOS; private List<WechatUserDTO> wechatUserDTOS;
...@@ -64,4 +68,7 @@ public class CultivateNotifyDTO { ...@@ -64,4 +68,7 @@ public class CultivateNotifyDTO {
@ApiModelProperty("是否首页弹窗") @ApiModelProperty("是否首页弹窗")
private Integer showHome; private Integer showHome;
@ApiModelProperty("首页推图")
private String squareImg;
} }
...@@ -26,6 +26,10 @@ public class CultivateNotifyPageDTO { ...@@ -26,6 +26,10 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty("发送内容") @ApiModelProperty("发送内容")
private List<CultivateNotifyItem> cultivateNotifyItems; private List<CultivateNotifyItem> cultivateNotifyItems;
@ApiModelProperty("跳转选择的应用作品")
private List<CultivateNotifyItem> jumpNotifyItems;
@ApiModelProperty("发送时间") @ApiModelProperty("发送时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date sendTime; private Date sendTime;
...@@ -33,4 +37,6 @@ public class CultivateNotifyPageDTO { ...@@ -33,4 +37,6 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty("是否首页弹窗") @ApiModelProperty("是否首页弹窗")
private Integer showHome; private Integer showHome;
private String squareImg;
} }
...@@ -27,4 +27,7 @@ public class CultivateNotify extends BaseEntity { ...@@ -27,4 +27,7 @@ public class CultivateNotify extends BaseEntity {
@ApiModelProperty("是否首页弹窗") @ApiModelProperty("是否首页弹窗")
private Integer showHome; private Integer showHome;
@ApiModelProperty("首页推图")
private String squareImg;
} }
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<result column="send_type" property="sendType" jdbcType="INTEGER" /> <result column="send_type" property="sendType" jdbcType="INTEGER" />
<result column="agent_id" property="agentId" jdbcType="BIGINT" /> <result column="agent_id" property="agentId" jdbcType="BIGINT" />
<result column="show_home" property="showHome" jdbcType="TINYINT" /> <result column="show_home" property="showHome" jdbcType="TINYINT" />
<result column="square_img" property="squareImg" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <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> </sql>
<insert id="insert" parameterType="com.pcloud.book.cultivate.entity.CultivateNotify" useGeneratedKeys="true" keyProperty="messageId"> <insert id="insert" parameterType="com.pcloud.book.cultivate.entity.CultivateNotify" useGeneratedKeys="true" keyProperty="messageId">
...@@ -25,7 +26,8 @@ ...@@ -25,7 +26,8 @@
update_time, update_time,
send_type, send_type,
agent_id, agent_id,
show_home show_home,
square_img
) )
values ( values (
#{messageType}, #{messageType},
...@@ -34,7 +36,8 @@ ...@@ -34,7 +36,8 @@
NOW(), NOW(),
#{sendType}, #{sendType},
#{agentId}, #{agentId},
#{showHome} #{showHome},
#{squareImg}
) )
</insert> </insert>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</insert> </insert>
<select id="getNotifyItemsByMessageId" resultMap="BaseResultMap"> <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>
<select id="getByMessageIds" parameterType="map" resultMap="BaseResultMap"> <select id="getByMessageIds" parameterType="map" resultMap="BaseResultMap">
...@@ -77,6 +77,21 @@ ...@@ -77,6 +77,21 @@
<foreach collection="messageIds" open="(" close=")" separator="," item="item"> <foreach collection="messageIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </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> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -143,7 +143,8 @@ ...@@ -143,7 +143,8 @@
a.message_id messageId, a.message_id messageId,
a.create_time sendTime, a.create_time sendTime,
a.title title, a.title title,
a.show_home showHome a.show_home showHome,
a.square_img squareImg
from cultivate_notify a from cultivate_notify a
<if test="keyword !=null"> <if test="keyword !=null">
LEFT JOIN cultivate_notify_item b on a.message_id=b.message_id 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