待阅功能

This commit is contained in:
yss
2023-04-18 17:20:23 +08:00
parent ab730ad2c5
commit 984cab3089
6 changed files with 47 additions and 16 deletions

View File

@ -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")

View File

@ -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);
} }

View File

@ -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);
} }
} }

View File

@ -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("待阅信息的编号")

View File

@ -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);
} }

View File

@ -12,6 +12,7 @@ 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
@ -26,8 +27,7 @@ public class BizReadingServiceImpl implements BizReadingService {
private IBaseCacheUserService cacheUserService; private IBaseCacheUserService cacheUserService;
@Override @Override
public BaseResponse sendPending(NoticeReadingPO noticeReadingPO) { public BaseResponse sendReading(NoticeReadingPO noticeReadingPO) {
// noticeReadingPO.setSendCenter("na134");
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 +37,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;
} }
} }