待阅功能
This commit is contained in:
@ -201,4 +201,7 @@ public class NoticeReadingPO implements Serializable {
|
||||
@ApiModelProperty("最后一次更新时间")
|
||||
private LocalDateTime lastUpdateTime;
|
||||
|
||||
@ApiModelProperty("功能标识:字典中包含才发送,所以要在字典中配置")
|
||||
private String functionFlag;
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.client.Notification
|
||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingPO;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizReadingService;
|
||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.dao.BizFuncSwitchConfigMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -25,9 +26,15 @@ public class BizReadingServiceImpl implements BizReadingService {
|
||||
private NotificationFeignClient notificationFeignClient;
|
||||
@Autowired
|
||||
private IBaseCacheUserService cacheUserService;
|
||||
@Autowired
|
||||
private BizFuncSwitchConfigMapper funcSwitchConfigMapper;
|
||||
|
||||
@Override
|
||||
public BaseResponse sendReading(NoticeReadingPO noticeReadingPO) {
|
||||
String active =funcSwitchConfigMapper.getValueByKey("sendReading");
|
||||
if(StringUtils.isBlank(active) || !active.contains(noticeReadingPO.getFunctionFlag())){
|
||||
return BaseResponse.fail("字典中未配置此功能");
|
||||
}
|
||||
noticeReadingPO.setSendCenter("ebtp");
|
||||
noticeReadingPO.setSendModule("biz-service-ebtp-extend");
|
||||
if(StringUtils.isBlank(noticeReadingPO.getOperatorType())){
|
||||
|
@ -3,10 +3,13 @@ package com.chinaunicom.mall.ebtp.extend.funcswitch.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.entity.BizFuncSwitchConfig;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface BizFuncSwitchConfigMapper extends BaseMapper<BizFuncSwitchConfig> {
|
||||
|
||||
Integer selectByType(String type);
|
||||
|
||||
String getValueByKey(@Param("key")String key);
|
||||
}
|
||||
|
@ -13,4 +13,9 @@
|
||||
resultType="java.lang.Integer">
|
||||
SELECT active FROM biz_func_switch_config WHERE `type` = #{type}
|
||||
</select>
|
||||
<select id="getValueByKey" resultType="java.lang.String" >
|
||||
select
|
||||
value
|
||||
from biz_extend_dict where `key`=#{key }
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user