Merge branch 'master-云门户待阅' into 'uat_code'

待阅功能

See merge request eshop/biz_service_ebtp_extend!7
This commit is contained in:
jlyanss
2023-04-18 03:11:29 +00:00
7 changed files with 378 additions and 0 deletions

View File

@ -2,13 +2,20 @@ package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.client;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopMailPendingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopSmsPendingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid;
@FeignClient(value = "${mconfig.feign.name.notification}", fallbackFactory = NotificationFeignFallbackFactory.class)
public interface NotificationFeignClient {
@ -20,4 +27,14 @@ public interface NotificationFeignClient {
@PostMapping("/v1/notification/sendMail")
BaseResponse sendMail(@RequestBody EshopMailPendingPO eshopMailPendingPO);
@ApiOperation(value = "新增待阅", tags = "新增待阅", notes = "新增待阅")
@PostMapping("/v1/notification/sendReading")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "待阅-新增")
BaseResponse sendPending(@Valid @RequestBody NoticeReadingPO noticeReadingPO);
@ApiOperation(value = "待阅更新或删除", tags = "待阅更新或删除", notes = "待阅更新或删除")
@PostMapping("/v1/notification/updateReading")
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "待阅-更新或删除")
BaseResponse updateReading(@Valid @RequestBody NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody);
}

View File

@ -4,10 +4,14 @@ import cn.hutool.core.exceptions.ExceptionUtil;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopMailPendingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopSmsPendingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.validation.Valid;
@Component
@Slf4j
public class NotificationFeignFallbackFactory implements FallbackFactory<NotificationFeignClient> {
@ -26,6 +30,16 @@ public class NotificationFeignFallbackFactory implements FallbackFactory<Notific
log.error(eshopMailPendingPO.toString());
return new BaseResponse();
}
@Override
public BaseResponse sendPending(@Valid NoticeReadingPO noticeReadingPO) {
return BaseResponse.fail("云门户-新增待阅失败:" + ExceptionUtil.stacktraceToString(throwable), noticeReadingPO);
}
@Override
public BaseResponse updateReading(@Valid NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
return BaseResponse.fail("云门户-待阅更新或删除失败:" + ExceptionUtil.stacktraceToString(throwable), noticeReadingUpdateRequestBody);
}
};
log.error(ExceptionUtil.stacktraceToString(throwable));
return back;

View File

@ -0,0 +1,37 @@
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.controller;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendMsgInfoVO;
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.bizshortmessageemail.service.BizSendMsgTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
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;
@RestController
@Api(tags = "待阅")
@RequestMapping("/v1/send/reading")
public class BizReadingController {
@Resource
private BizReadingService readingService;
@ApiOperation("发送待阅")
@PostMapping("save")
public BaseResponse sendPending(@RequestBody NoticeReadingPO noticeReadingPO) {
return BaseResponse.success(readingService.sendPending(noticeReadingPO));
}
@ApiOperation("待阅更新或删除-readingStatus:0:待阅 1:已阅 d:待阅删除")
@PostMapping("update")
public BaseResponse updateReading(@RequestBody NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
return BaseResponse.success(readingService.updateReading(noticeReadingUpdateRequestBody));
}
}

View File

@ -0,0 +1,204 @@
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "EshopBpmReading对象",description = "待阅表信息实体")
public class NoticeReadingPO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("发送中心标识")
@NotBlank(message = "发送中心标识不能为空")
@Length(message = "发送中心标识不能超过{max}个字符",max = 36)
private String sendCenter;
@ApiModelProperty("发送业务模块标识")
@NotBlank(message = "发送业务模块标识不能为空")
@Length(message = "发送业务模块标识不能超过{max}个字符",max = 36)
private String sendModule;
@ApiModelProperty("待阅信息的编号")
@NotBlank(message = "待阅信息的编号不能为空")
@Length(message = "待阅信息的编号不能超过{max}个字符",max = 100)
private String readingCode;
@ApiModelProperty("待阅标题")
@NotBlank(message = "待阅标题不能为空")
@Length(message = "待阅标题不能超过{max}个字符",max = 500)
private String readingTitle;
@ApiModelProperty("待阅产生时间")
private String readingDate;
@ApiModelProperty("待阅人用户标识,门户待办为邮箱前缀;非门户待办为用户账号")
@NotBlank(message = "待阅人用户标识不能为空")
@Length(message = "待阅人用户标识不能超过{max}个字符",max = 128)
private String readingUserId;
@ApiModelProperty("待阅人名")
@NotBlank(message = "待阅人名不能为空")
@Length(message = "待阅人名不能超过{max}个字符",max = 50)
private String readingUserCn;
@ApiModelProperty("待阅信息URL")
@NotBlank(message = "待阅信息URL不能为空")
@Length(message = "待阅信息URL不能超过{max}个字符",max = 4000)
private String readingUrl;
@ApiModelProperty("待阅状态 0:待阅 1:以阅")
@NotBlank(message = "待阅状态不能为空")
@Length(message = "待阅状态不能超过{max}个字符",max = 1)
private String readingStatus;
@ApiModelProperty("待阅等级 0.普通1.重要2加急")
@NotNull(message = "待阅等级不能为空")
private Integer readingLevel;
@ApiModelProperty("省分代码")
@Length(message = "省分代码不能超过{max}个字符",max = 10)
private String readingCityCode;
@ApiModelProperty("待阅类型 1:门户待阅 2门户流程待阅 3:商城待阅")
@NotBlank(message = "待阅类型不能为空")
@Length(message = "待阅类型不能超过{max}个字符",max = 1)
private String readingType;
@ApiModelProperty("待阅信息上一步处理人邮件前缀 上一步处理人的帐号,若为发起待办则填发起人的账号")
@NotBlank(message = "上一步处理人的帐号不能为空")
@Length(message = "上一步处理人的帐号不能超过{max}个字符",max = 128)
private String readingSourceUserId;
@ApiModelProperty("上一步处理人的姓名")
@NotBlank(message = "上一步处理人的姓名不能为空")
@Length(message = "上一步处理人的姓名不能超过{max}个字符",max = 50)
private String readingSourceUserCn;
@ApiModelProperty("a:新增待阅 u:更新待阅 t:更新待阅标题 d:删除待阅")
@NotBlank(message = "操作类型不能为空")
@Length(message = "操作类型不能超过{max}个字符",max = 1)
private String operatorType;
@ApiModelProperty("省ou")
@Length(message = "省ou不能超过{max}个字符",max = 20)
private String provinceOu;
@ApiModelProperty("省ou名")
@Length(message = "省ou名不能超过{max}个字符",max = 100)
private String provinceOuName;
@ApiModelProperty("市ou")
@Length(message = "市ou不能超过{max}个字符",max = 20)
private String cityOu;
@ApiModelProperty("市ou名")
@Length(message = "市ou名不能超过{max}个字符",max = 100)
private String cityOuName;
@ApiModelProperty("待办所属系统简称")
private String readingNote;
@ApiModelProperty("待阅接口入参信息")
private String inputMessage;
@ApiModelProperty("待阅接口返回结果")
private String returnResult;
@ApiModelProperty("创建人uid")
private String createBy;
@ApiModelProperty("更新人uid")
private String updateBy;
@ApiModelProperty("表插入生成时间")
private LocalDateTime createDate;
@ApiModelProperty("待办生成时间")
private LocalDateTime launchDate;
@ApiModelProperty("更新时间")
private LocalDateTime updateDate;
@ApiModelProperty("租户标识")
private String tenantId;
@ApiModelProperty("逻辑删除normal表示正常默认deleted表示删除")
private String deleteFlag;
@ApiModelProperty("乐观锁")
private Integer versions;
@ApiModelProperty("云门户预留字段")
private String dbReserved1;
@ApiModelProperty("云门户预留字段")
private String dbReserved2;
@ApiModelProperty("云门户预留字段")
private String dbReserved3;
@ApiModelProperty("云门户预留字段")
private String dbReserved4;
@ApiModelProperty("云门户预留字段")
private String dbReserved5;
@ApiModelProperty("云门户预留字段")
private String dbReserved6;
@ApiModelProperty("云门户预留字段")
private String dbReserved7;
@ApiModelProperty("云门户预留字段")
private String dbReserved8;
@ApiModelProperty("云门户预留字段")
private String dbReserved9;
@ApiModelProperty("云门户预留字段")
private String dbReserved10;
@ApiModelProperty("云门户预留字段")
private String dbReserved11;
@ApiModelProperty("云门户预留字段")
private String dbReserved12;
@ApiModelProperty("云门户预留字段")
private String dbReserved13;
@ApiModelProperty("云门户预留字段")
private String dbReserved14;
@ApiModelProperty("云门户预留字段")
private String dbReserved15;
@ApiModelProperty("最后一次更新时间")
private LocalDateTime lastUpdateTime;
}

View File

@ -0,0 +1,50 @@
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class NoticeReadingUpdateRequestBody {
@ApiModelProperty("待阅信息的编号")
@NotBlank(message = "待阅编号不能为空" )
@Length(message = "待阅编号不能超过{max}个字符",max = 100 )
private String readingCode;
@ApiModelProperty("待阅状态 0:待阅 1:已阅 d:待阅删除")
@NotBlank(message = "待阅状态不能为空" )
@Length(message = "待阅状态不能超过{max}个字符",max = 1 )
private String readingStatus;
@ApiModelProperty("待阅状态更新时间")
@Length(message = "待阅更新时间不能超过{max}个字符",max = 20 )
private String lastUpdateDate;
@ApiModelProperty("待办类型1 门户待阅 2 门户流程待办 3 商城待阅")
@NotBlank(message = "待阅类型不能为空" )
@Length(message = "待阅类型不能超过{max}个字符",max = 1 )
private String readingType;
@ApiModelProperty("待阅产生时间")
private String readingDate;
@ApiModelProperty("待阅接口入参信息")
private String inputMessage;
@ApiModelProperty("待阅接口返回结果:100为成功")
private String returnCode;
@ApiModelProperty("待阅接口返回信息")
private String returnMessage;
}

View File

@ -0,0 +1,21 @@
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendEmailVO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendMsgVO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingPO;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.NoticeReadingUpdateRequestBody;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid;
import java.io.IOException;
@Component
public interface BizReadingService {
BaseResponse sendPending(NoticeReadingPO noticeReadingPO);
BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody);
}

View File

@ -0,0 +1,35 @@
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.impl;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.client.NotificationFeignClient;
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 lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author yanss
*/
@Service
@Slf4j
public class BizReadingServiceImpl implements BizReadingService {
@Resource
private NotificationFeignClient notificationFeignClient;
@Override
public BaseResponse sendPending(NoticeReadingPO noticeReadingPO) {
// noticeReadingPO.setSendCenter("na134");
noticeReadingPO.setSendCenter("ebtp");
noticeReadingPO.setSendModule("biz-service-ebtp-extend");
return notificationFeignClient.sendPending(noticeReadingPO);
}
@Override
public BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
return notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
}
}