admin
2019-02-27 7d294e1e04095eb4f1c0807406d1ccb8461850cb
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package com.yeshi.fanli.util.factory.msg;
 
import java.math.BigDecimal;
import java.util.Date;
 
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.util.TimeUtil;
 
public class MsgOtherCouponContentDTOFactory {
 
    private static MsgOtherCouponContentDTO getGeneral(Integer leftDay, String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = new MsgOtherCouponContentDTO();
        if (endTime != null)
            dto.setEndTime(TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd"));
        if (startTime != null)
            dto.setStartTime(TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd"));
        dto.setLeftDay(leftDay);
        dto.setSource(source);
        return dto;
    }
 
    // 福利奖励券
 
    public static MsgOtherCouponContentDTO createWelfareCouponGet(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("成功获得");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createWelfareCouponActive(Integer leftDay, String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("已被激活");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createWelfareCouponUsing(String orderId,BigDecimal money, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, null, startTime, endTime);
        dto.setOrderId(orderId);
        dto.setState("已经使用");
        dto.setFanLiMoney(money);
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createWelfareCouponUsed(Integer leftDay,String desc, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, null, startTime, endTime);
        dto.setState("完成免单");
        dto.setDesc(desc);
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createWelfareCouponWillOutOfDate(Integer leftDay, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, "成功邀请1个队员", startTime, endTime);
        dto.setState("即将过期");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createWelfareCouponAlreadyOutOfDate(Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(0, "成功邀请1个队员", startTime, endTime);
        dto.setState("已经过期");
        return dto;
    }
 
    // 免单券
 
    public static MsgOtherCouponContentDTO createCouponGet(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("成功获得");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createCouponActive(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("已被激活");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createCouponUsing(String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, source, startTime, endTime);
        dto.setState("使用中,等待系统同步订单");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createCouponUsed(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, source, startTime, endTime);
        dto.setState("已被使用");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createCouponWillOutOfDate(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("即将过期");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createCouponAlreadyOutOfDate(String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(0, source, startTime, endTime);
        dto.setState("已经过期");
        return dto;
    }
 
    // 奖励券
 
    public static MsgOtherCouponContentDTO createRewardCouponGet(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("成功获得");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createRewardCouponActive(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("已被激活");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createRewardCouponUsed(Integer leftDay, String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, source, startTime, endTime);
        dto.setState("已被使用");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createRewardCouponWillOutOfDate(Integer leftDay, String source,
            Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("即将过期");
        return dto;
    }
 
    public static MsgOtherCouponContentDTO createRewardCouponAlreadyOutOfDate(String source, Date startTime,
            Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(0, source, startTime, endTime);
        dto.setState("已经过期");
        return dto;
    }
 
}