package com.yeshi.fanli.util.mq.cmq.order;
|
|
import com.google.gson.Gson;
|
import com.yeshi.fanli.dto.mq.UidDateDTO;
|
import com.yeshi.fanli.util.Constant;
|
import com.yeshi.fanli.util.mq.rabbit.RabbitmqSenderUtil;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
|
@Component
|
public class TeamOrderCMQManager {
|
|
@Resource
|
private RabbitTemplate rabbitTemplate;
|
|
|
// 团队分红
|
public static String TEAM_DIVIDENTS_PRE = "team_dividents_pre";
|
// 团队收益
|
public static String FANLI_TEAM_INCOME_ORDER_PRE = "fanli-team-income-order-pre";
|
|
// 团队分红
|
public static String TEAM_DIVIDENTS = "team_dividents";
|
// 团队收益
|
public static String FANLI_TEAM_INCOME_ORDER = "fanli-team-income-order";
|
|
static {
|
|
TEAM_DIVIDENTS_PRE += "-" + Constant.systemCommonConfig.getProjectName();
|
FANLI_TEAM_INCOME_ORDER_PRE += "-" + Constant.systemCommonConfig.getProjectName();
|
TEAM_DIVIDENTS += "-" + Constant.systemCommonConfig.getProjectName();
|
FANLI_TEAM_INCOME_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
}
|
|
// 团队分红预到账
|
public void addTeamDividentsPreMsg(UidDateDTO dto) {
|
RabbitmqSenderUtil.sendQueueMsg(rabbitTemplate, TEAM_DIVIDENTS_PRE, new Gson().toJson(dto));
|
}
|
|
// 团队收益预到账
|
public void addFanLiTeamIncomePreMsg(UidDateDTO dto) {
|
RabbitmqSenderUtil.sendQueueMsg(rabbitTemplate, FANLI_TEAM_INCOME_ORDER_PRE, new Gson().toJson(dto) + "");
|
}
|
|
|
// 团队分红到账
|
public void addTeamDividentsMsg(UidDateDTO dto) {
|
RabbitmqSenderUtil.sendQueueMsg(rabbitTemplate, TEAM_DIVIDENTS, new Gson().toJson(dto));
|
}
|
|
// 团队收益到账
|
public void addFanLiTeamIncomeMsg(UidDateDTO dto) {
|
RabbitmqSenderUtil.sendQueueMsg(rabbitTemplate, FANLI_TEAM_INCOME_ORDER, new Gson().toJson(dto)+"");
|
}
|
}
|