增加数据类别字段

This commit is contained in:
zhangqinbin
2021-08-04 11:13:49 +08:00
parent 5a941b83ad
commit 2318de6deb
5 changed files with 9 additions and 3 deletions

View File

@ -3,15 +3,18 @@
<mapper namespace="com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper"> <mapper namespace="com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageMapper">
<select id="findMessage" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage"> <select id="findMessage" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage">
SELECT * SELECT *,biz_message_template.type as templatetype
FROM biz_message FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
WHERE authorize = 0 WHERE authorize = 0
<if test="userId!=null and userId!=''"> <if test="userId!=null and userId!=''">
UNION ALL UNION ALL
SELECT a.* SELECT a.*
FROM ( SELECT * FROM biz_message WHERE authorize = 1) a FROM ( SELECT *,biz_message_template.type templatetype FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
WHERE authorize = 1) a
INNER JOIN INNER JOIN
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id ( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
</if> </if>

View File

@ -16,6 +16,7 @@ public class BizMessage {
private String url; private String url;
private String params; private String params;
private Timestamp createtime; private Timestamp createtime;
private String templatecode;
private String templatetype; private String templatetype;
/* 该值为1则标识开启授权控制只有授权列表( biz_message_authorize )内的用户可见 */ /* 该值为1则标识开启授权控制只有授权列表( biz_message_authorize )内的用户可见 */

View File

@ -48,6 +48,7 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
result.setRecords(pageEntity.getRecords().stream().map(source -> { result.setRecords(pageEntity.getRecords().stream().map(source -> {
DescribeSiteMsgVO vo = new DescribeSiteMsgVO(); DescribeSiteMsgVO vo = new DescribeSiteMsgVO();
vo.setMsgId(source.getId()); vo.setMsgId(source.getId());
vo.setTemplatetype(source.getTemplatetype());
BeanUtils.copyProperties(source, vo); BeanUtils.copyProperties(source, vo);
return vo; return vo;

View File

@ -85,7 +85,7 @@ public class BizMessageProducerServiceImpl implements BizMessageProducerService
bizmessage.setContent(fill(dao.getBody(), messageRaw.getBody())); bizmessage.setContent(fill(dao.getBody(), messageRaw.getBody()));
bizmessage.setUrl(fill(dao.getRouter(), messageRaw.getExtra())); bizmessage.setUrl(fill(dao.getRouter(), messageRaw.getExtra()));
bizmessage.setParams(toJson(messageRaw.getExtra())); bizmessage.setParams(toJson(messageRaw.getExtra()));
bizmessage.setTemplatetype(dao.getType()); bizmessage.setTemplatecode(messageRaw.getTemplateCode());
Optional.ofNullable(messageRaw.getUsers()).ifPresent(users -> { Optional.ofNullable(messageRaw.getUsers()).ifPresent(users -> {
log.debug("if user list {} is not emtpy, then grant current message to them.", users); log.debug("if user list {} is not emtpy, then grant current message to them.", users);

View File

@ -16,6 +16,7 @@ public class DescribeSiteMsgVO {
private String msgId; private String msgId;
private String title; private String title;
private String category; private String category;
private String templatetype;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createtime; private Timestamp createtime;