admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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)+"");
    }
}