增加业务参数
This commit is contained in:
@ -19,16 +19,16 @@
|
||||
</select>
|
||||
|
||||
<select id="findMessageVo" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessageVo">
|
||||
SELECT biz_message.*,'1' as authorizestate
|
||||
SELECT biz_message.*,biz_message_template.type as templatetype,'1' as authorizestate
|
||||
FROM biz_message
|
||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||
WHERE authorize = 0
|
||||
|
||||
<if test="userId!=null and userId!=''">
|
||||
UNION ALL
|
||||
|
||||
SELECT a.*,IFNULL(b.state,1) as authorizestate
|
||||
FROM ( SELECT biz_message.*
|
||||
FROM ( SELECT biz_message.*,biz_message_template.type as templatetype
|
||||
FROM biz_message
|
||||
left join biz_message_template on biz_message.templatecode = biz_message_template.code
|
||||
WHERE authorize = 1) a
|
||||
INNER JOIN
|
||||
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
|
||||
|
@ -18,6 +18,7 @@ public class BizMessage {
|
||||
private String params;
|
||||
private Timestamp createtime;
|
||||
private String servicecode;
|
||||
private String templatecode;
|
||||
|
||||
/* 该值为1则标识开启授权控制,只有授权列表( biz_message_authorize )内的用户可见 */
|
||||
private Integer authorize;
|
||||
|
@ -6,5 +6,6 @@ import lombok.Data;
|
||||
public class BizMessageVo extends BizMessage{
|
||||
|
||||
private String authorizestate;
|
||||
private String templatetype;
|
||||
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
|
||||
vo.setMsgId(source.getId());
|
||||
vo.setServicecode(source.getServicecode());
|
||||
vo.setAuthorizestate(source.getAuthorizestate());
|
||||
vo.setTemplatetype(source.getTemplatetype());
|
||||
BeanUtils.copyProperties(source, vo);
|
||||
return vo;
|
||||
}).collect(Collectors.toList()));
|
||||
|
@ -86,6 +86,7 @@ public class BizMessageProducerServiceImpl implements BizMessageProducerService
|
||||
bizmessage.setUrl(fill(dao.getRouter(), messageRaw.getExtra()));
|
||||
bizmessage.setParams(toJson(messageRaw.getExtra()));
|
||||
bizmessage.setServicecode(toJson(messageRaw.getServicecode()));
|
||||
bizmessage.setTemplatecode(dao.getCode());
|
||||
|
||||
Optional.ofNullable(messageRaw.getUsers()).ifPresent(users -> {
|
||||
log.debug("if user list {} is not emtpy, then grant current message to them.", users);
|
||||
|
@ -18,6 +18,7 @@ public class DescribeSiteMsgVO {
|
||||
private String category;
|
||||
private String servicecode;
|
||||
private String authorizestate;
|
||||
private String templatetype;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp createtime;
|
||||
|
||||
|
Reference in New Issue
Block a user