Merge branch 'master-云门户待阅' into 'uat_code'
Master 云门户待阅 See merge request eshop/biz_service_ebtp_extend!10
This commit is contained in:
@ -30,7 +30,7 @@ public interface NotificationFeignClient {
|
|||||||
@ApiOperation(value = "新增待阅", tags = "新增待阅", notes = "新增待阅")
|
@ApiOperation(value = "新增待阅", tags = "新增待阅", notes = "新增待阅")
|
||||||
@PostMapping("/v1/notification/sendReading")
|
@PostMapping("/v1/notification/sendReading")
|
||||||
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "待阅-新增")
|
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "待阅-新增")
|
||||||
BaseResponse sendPending(@Valid @RequestBody NoticeReadingPO noticeReadingPO);
|
BaseResponse sendReading(@Valid @RequestBody NoticeReadingPO noticeReadingPO);
|
||||||
|
|
||||||
@ApiOperation(value = "待阅更新或删除", tags = "待阅更新或删除", notes = "待阅更新或删除")
|
@ApiOperation(value = "待阅更新或删除", tags = "待阅更新或删除", notes = "待阅更新或删除")
|
||||||
@PostMapping("/v1/notification/updateReading")
|
@PostMapping("/v1/notification/updateReading")
|
||||||
|
@ -32,7 +32,7 @@ public class NotificationFeignFallbackFactory implements FallbackFactory<Notific
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseResponse sendPending(@Valid NoticeReadingPO noticeReadingPO) {
|
public BaseResponse sendReading(@Valid NoticeReadingPO noticeReadingPO) {
|
||||||
return BaseResponse.fail("云门户-新增待阅失败:" + ExceptionUtil.stacktraceToString(throwable), noticeReadingPO);
|
return BaseResponse.fail("云门户-新增待阅失败:" + ExceptionUtil.stacktraceToString(throwable), noticeReadingPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,16 +8,13 @@ import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizReadingS
|
|||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgTemplateService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgTemplateService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "待阅")
|
@Api(tags = "待阅")
|
||||||
@RequestMapping("/v1/send/reading")
|
@RequestMapping("/v1/reading")
|
||||||
public class BizReadingController {
|
public class BizReadingController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@ -25,13 +22,19 @@ public class BizReadingController {
|
|||||||
|
|
||||||
@ApiOperation("发送待阅")
|
@ApiOperation("发送待阅")
|
||||||
@PostMapping("save")
|
@PostMapping("save")
|
||||||
public BaseResponse sendPending(@RequestBody NoticeReadingPO noticeReadingPO) {
|
public BaseResponse sendReading(@RequestBody NoticeReadingPO noticeReadingPO) {
|
||||||
return BaseResponse.success(readingService.sendPending(noticeReadingPO));
|
return readingService.sendReading(noticeReadingPO);
|
||||||
}
|
}
|
||||||
@ApiOperation("待阅更新或删除-readingStatus:0:待阅 1:已阅 d:待阅删除")
|
@ApiOperation("待阅更新或删除-readingStatus:0:待阅 1:已阅 d:待阅删除")
|
||||||
@PostMapping("update")
|
@PostMapping("update")
|
||||||
public BaseResponse updateReading(@RequestBody NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
public BaseResponse updateReading(@RequestBody NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
||||||
return BaseResponse.success(readingService.updateReading(noticeReadingUpdateRequestBody));
|
return readingService.updateReading(noticeReadingUpdateRequestBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("待阅更新1:已阅")
|
||||||
|
@PostMapping("updateReaded")
|
||||||
|
public BaseResponse updateReaded(@RequestParam String readingCode) {
|
||||||
|
return readingService.updateReaded(readingCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -201,4 +201,7 @@ public class NoticeReadingPO implements Serializable {
|
|||||||
@ApiModelProperty("最后一次更新时间")
|
@ApiModelProperty("最后一次更新时间")
|
||||||
private LocalDateTime lastUpdateTime;
|
private LocalDateTime lastUpdateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("功能标识:字典中包含才发送,所以要在字典中配置")
|
||||||
|
private String functionFlag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,15 @@ package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity;
|
|||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
public class NoticeReadingUpdateRequestBody {
|
public class NoticeReadingUpdateRequestBody {
|
||||||
|
|
||||||
@ApiModelProperty("待阅信息的编号")
|
@ApiModelProperty("待阅信息的编号")
|
||||||
|
@ -15,7 +15,9 @@ import java.io.IOException;
|
|||||||
@Component
|
@Component
|
||||||
public interface BizReadingService {
|
public interface BizReadingService {
|
||||||
|
|
||||||
BaseResponse sendPending(NoticeReadingPO noticeReadingPO);
|
BaseResponse sendReading(NoticeReadingPO noticeReadingPO);
|
||||||
|
|
||||||
BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody);
|
BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody);
|
||||||
|
|
||||||
|
BaseResponse updateReaded(String readingCode);
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,14 @@ 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.NoticeReadingPO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizReadingService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizReadingService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.funcswitch.dao.BizFuncSwitchConfigMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author yanss
|
* @author yanss
|
||||||
@ -24,10 +26,15 @@ public class BizReadingServiceImpl implements BizReadingService {
|
|||||||
private NotificationFeignClient notificationFeignClient;
|
private NotificationFeignClient notificationFeignClient;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBaseCacheUserService cacheUserService;
|
private IBaseCacheUserService cacheUserService;
|
||||||
|
@Autowired
|
||||||
|
private BizFuncSwitchConfigMapper funcSwitchConfigMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseResponse sendPending(NoticeReadingPO noticeReadingPO) {
|
public BaseResponse sendReading(NoticeReadingPO noticeReadingPO) {
|
||||||
// noticeReadingPO.setSendCenter("na134");
|
String active =funcSwitchConfigMapper.getValueByKey("sendReading");
|
||||||
|
if(StringUtils.isBlank(active) || !active.contains(noticeReadingPO.getFunctionFlag())){
|
||||||
|
return BaseResponse.fail("字典中未配置此功能");
|
||||||
|
}
|
||||||
noticeReadingPO.setSendCenter("ebtp");
|
noticeReadingPO.setSendCenter("ebtp");
|
||||||
noticeReadingPO.setSendModule("biz-service-ebtp-extend");
|
noticeReadingPO.setSendModule("biz-service-ebtp-extend");
|
||||||
if(StringUtils.isBlank(noticeReadingPO.getOperatorType())){
|
if(StringUtils.isBlank(noticeReadingPO.getOperatorType())){
|
||||||
@ -37,11 +44,32 @@ public class BizReadingServiceImpl implements BizReadingService {
|
|||||||
noticeReadingPO.setReadingSourceUserId(cacheUserService.getCacheUser().getUserId());
|
noticeReadingPO.setReadingSourceUserId(cacheUserService.getCacheUser().getUserId());
|
||||||
noticeReadingPO.setReadingSourceUserCn(cacheUserService.getCacheUser().getFullName());
|
noticeReadingPO.setReadingSourceUserCn(cacheUserService.getCacheUser().getFullName());
|
||||||
}
|
}
|
||||||
return notificationFeignClient.sendPending(noticeReadingPO);
|
BaseResponse baseResponse=notificationFeignClient.sendReading(noticeReadingPO);
|
||||||
|
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||||
|
BaseResponse.success(baseResponse.getMessage(),null);
|
||||||
|
}
|
||||||
|
return baseResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
public BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
||||||
return notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
BaseResponse baseResponse=notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
||||||
|
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||||
|
BaseResponse.success(baseResponse.getMessage(),null);
|
||||||
|
}
|
||||||
|
return baseResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseResponse updateReaded(String readingCode) {
|
||||||
|
NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody=new NoticeReadingUpdateRequestBody();
|
||||||
|
noticeReadingUpdateRequestBody.setReadingCode(readingCode);
|
||||||
|
noticeReadingUpdateRequestBody.setReadingStatus("1");
|
||||||
|
noticeReadingUpdateRequestBody.setReadingType("1");
|
||||||
|
BaseResponse baseResponse=notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
||||||
|
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||||
|
BaseResponse.success(baseResponse.getMessage(),null);
|
||||||
|
}
|
||||||
|
return baseResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,13 @@ package com.chinaunicom.mall.ebtp.extend.funcswitch.dao;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.entity.BizFuncSwitchConfig;
|
import com.chinaunicom.mall.ebtp.extend.funcswitch.entity.BizFuncSwitchConfig;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface BizFuncSwitchConfigMapper extends BaseMapper<BizFuncSwitchConfig> {
|
public interface BizFuncSwitchConfigMapper extends BaseMapper<BizFuncSwitchConfig> {
|
||||||
|
|
||||||
Integer selectByType(String type);
|
Integer selectByType(String type);
|
||||||
|
|
||||||
|
String getValueByKey(@Param("key")String key);
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,9 @@
|
|||||||
resultType="java.lang.Integer">
|
resultType="java.lang.Integer">
|
||||||
SELECT active FROM biz_func_switch_config WHERE `type` = #{type}
|
SELECT active FROM biz_func_switch_config WHERE `type` = #{type}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getValueByKey" resultType="java.lang.String" >
|
||||||
|
select
|
||||||
|
value
|
||||||
|
from biz_extend_dict where `key`=#{key }
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user