Commit e5768a8b by gaopeng

C904

parent ddd71fb1
package com.pcloud.common.core.biz;
import com.pcloud.common.core.dto.BacklogQueueDto;
import com.pcloud.common.exceptions.BizException;
/**
* @描述:待办事项统计队列
* @作者:zhuyajie
* @创建时间:10:33 2018/10/31
* @版本:1.0
*/
public interface BacklogQueueBiz {
/**
* 发送待办事项
* @param backlogQueueDto
*/
public void sendBacklogQueue(BacklogQueueDto backlogQueueDto)throws BizException;
}
package com.pcloud.common.core.biz;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.constant.MQQueueConstant;
import com.pcloud.common.core.dto.BacklogQueueDto;
import com.pcloud.common.exceptions.BizException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @描述:待办事务统计
* @作者:zhuyajie
* @创建时间:10:46 2018/10/31
* @版本:1.0
*/
@Component("backlogQueueBiz")
public class BacklogQueueBizImpl implements BacklogQueueBiz {
private final static Logger logger = LoggerFactory.getLogger(BacklogQueueBizImpl.class);
@Autowired
private AmqpTemplate amqpTemplate;
@Override
@ParamLog("发送待办事务通知")
public void sendBacklogQueue(BacklogQueueDto backlogQueueDto) throws BizException{
if (backlogQueueDto == null) {
throw BizException.PARAM_IS_NULL;
}
try {
amqpTemplate.convertAndSend(MQQueueConstant.BACKLOG, backlogQueueDto);
} catch (Exception e) {
logger.error("发送失败," + e.getMessage() + "," + backlogQueueDto.toString(), e);
throw BizException.SEND_QUEUE_FAIL;
}
}
}
...@@ -150,4 +150,9 @@ public class MQQueueConstant { ...@@ -150,4 +150,9 @@ public class MQQueueConstant {
*/ */
public static final String DEAD = "rays.dlq"; public static final String DEAD = "rays.dlq";
/**
* 待办事项数量统计
*/
public static final String BACKLOG = "backlogQueue";
} }
package com.pcloud.common.core.dto;
import java.io.Serializable;
/**
* @描述:待办事务统计
* @作者:zhuyajie
* @创建时间:10:36 2018/10/31
* @版本:1.0
*/
public class BacklogQueueDto implements Serializable{
/**
* 编辑id
*/
private Long adviserId;
/**
* 应用id或商品id
*/
private Long targetId;
/**
*类型(APP/PRODUCT)
*/
private String targetType;
/**
*封面图
*/
private String coverImg;
/**
*标题
*/
private String title;
/**
*待审核/确认数量
*/
private Integer waitCount;
/**
*新动态数量
*/
private Integer newCount;
/**
*应用/商品类型编码
*/
private String typeCode;
public Long getAdviserId() {
return adviserId;
}
public void setAdviserId(Long adviserId) {
this.adviserId = adviserId;
}
public Long getTargetId() {
return targetId;
}
public void setTargetId(Long targetId) {
this.targetId = targetId;
}
public String getTargetType() {
return targetType;
}
public void setTargetType(String targetType) {
this.targetType = targetType;
}
public String getCoverImg() {
return coverImg;
}
public void setCoverImg(String coverImg) {
this.coverImg = coverImg;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getWaitCount() {
return waitCount;
}
public void setWaitCount(Integer waitCount) {
this.waitCount = waitCount;
}
public Integer getNewCount() {
return newCount;
}
public void setNewCount(Integer newCount) {
this.newCount = newCount;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
@Override
public String toString() {
return "BacklogQueueDto{" +
"adviserId=" + adviserId +
", targetId=" + targetId +
", targetType='" + targetType + '\'' +
", coverImg='" + coverImg + '\'' +
", title='" + title + '\'' +
", waitCount=" + waitCount +
", newCount=" + newCount +
", typeCode='" + typeCode + '\'' +
'}';
}
}
package com.pcloud.common.core.enums;
/**
* @描述:代办事务类型
* @作者:zhuyajie
* @创建时间:10:54 2018/10/31
* @版本:1.0
*/
public enum BacklogTypeEnum {
/**
* 应用
*/
APP("APP"),
/**
* 作品
*/
PRODUCT("PRODUCT");
private String value;
public String getValue() {
return value;
}
BacklogTypeEnum(String value) {
this.value = value;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment