DracImServiceTest.java
8.78 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
package cn.com.glsx.entmicro.service;
import cn.com.glsx.entmicro.Main;
import cn.com.glsx.entmicro.constants.Constants;
import cn.com.glsx.entmicro.entity.DracRescueCardConfigDTO;
import cn.com.glsx.entmicro.entity.DracRescueFollowRecordDTO;
import cn.com.glsx.entmicro.kafka.model.DracImMessageModel;
import cn.com.glsx.entmicro.mapper.CustomerMapper;
import cn.com.glsx.entmicro.mapper.CustomerMergeMapper;
import cn.com.glsx.entmicro.mapper.DracRescueFollowRecordMapper;
import cn.com.glsx.entmicro.model.CustomerReceiptModel;
import cn.com.glsx.entmicro.model.DefaultRequest;
import cn.com.glsx.entmicro.model.DracCustomerErrorExport;
import cn.com.glsx.entmicro.model.request.*;
import cn.com.glsx.entmicro.model.request.drainage.MessageListRequest;
import cn.com.glsx.entmicro.model.response.*;
import cn.com.glsx.entmicro.service.drainage.DracImService;
import cn.com.glsx.entmicro.service.drainage.DracRescueConfigService;
import cn.com.glsx.entmicro.service.drainage.DracScrmWorkService;
import cn.com.glsx.entmicro.service.drainage.DracStaffScrmWorkFollowService;
import cn.com.glsx.entmicro.util.BeanConverUtil;
import cn.com.glsx.entmicro.util.UserLocalUtils;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.github.pagehelper.Page;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author zhouhaibao
* @version 1.0
* @description: 营销服务测试
* @date 2021/11/16 11:21
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class DracImServiceTest {
@Autowired
private DracImService dracImService;
@Autowired
private DracStaffScrmWorkFollowService dracStaffScrmWorkFollowService;
@Autowired
private DracScrmWorkService dracScrmWorkService;
@Test
public void exportAdd() {
DracImInfoRequest dracImInfoRequest = new DracImInfoRequest();
dracImInfoRequest.setImType(1);
dracImInfoRequest.setUserType(1);
dracImInfoRequest.setMerchantId(44209846);
/* List<TagSearchRequest> tagLists = new ArrayList<>();
TagSearchRequest tagSearchRequest = new TagSearchRequest();
tagSearchRequest.setGroupId(67);
tagSearchRequest.setGroupName("是否企微客户");
tagSearchRequest.setGroupType("企业标签");
tagSearchRequest.setLabelName("非企微客户");
tagSearchRequest.setLabelId("134");
tagLists.add(tagSearchRequest);
dracImInfoRequest.setFilterTagging(JSONObject.toJSONString(tagLists));*/
dracImInfoRequest.setImName("测试名称");
dracImInfoRequest.setGroupIds(Arrays.asList(524));
/* List<DracImFollowStaffRequest> dracImFollowStaffRequestList = new ArrayList<>();
DracImFollowStaffRequest dracImFollowStaffRequest = new DracImFollowStaffRequest();
dracImFollowStaffRequest.setStaffId(366);
dracImFollowStaffRequest.setStaffName("fddfdf");
dracImFollowStaffRequestList.add(dracImFollowStaffRequest);
DracImFollowStaffRequest dracImFollowStaffReques1 = new DracImFollowStaffRequest();
dracImFollowStaffReques1.setStaffId(367);
dracImFollowStaffReques1.setStaffName("fddfdf4545");
dracImFollowStaffRequestList.add(dracImFollowStaffReques1);
DracImMessageConfigRequest dracImMessageConfigRequest = new DracImMessageConfigRequest();
dracImMessageConfigRequest.setMarketingId(1);
dracImMessageConfigRequest.setContent("测试短信");
dracImMessageConfigRequest.setStartTime("08:00:00");
dracImMessageConfigRequest.setEndTime("11:00:00");
dracImInfoRequest.setDracImFollowStaffRequestList(dracImFollowStaffRequestList);*/
/* dracImInfoRequest.setDracImMessageConfigRequest(dracImMessageConfigRequest);*//**/
DefaultRequest defaultRequest = new DefaultRequest();
defaultRequest.setCreatedBy(58);
defaultRequest.setMerchantId(44209846);
UserLocalUtils.setUserLocal(defaultRequest);
/* List<DracChannelCodeWelcomeInfoRequest> dracChannelCodeWelcomeInfoRequestList = new ArrayList<>();
DracChannelCodeWelcomeInfoRequest dracChannelCodeWelcomeInfoRequest = new DracChannelCodeWelcomeInfoRequest();
dracChannelCodeWelcomeInfoRequest.setAttType(1);
dracChannelCodeWelcomeInfoRequest.setAttContent("测试文本");*/
System.out.println(dracImService.exportAdd(dracImInfoRequest));
}
@Test
public void exportUpdate() {
DracImInfoRequest dracImInfoRequest = new DracImInfoRequest();
dracImInfoRequest.setExportUrl("https://wx.glsx.com.cn/upload/biz/9cb5f6d8-2dab-45db-81a7-261d333dce91.xlsx");
dracImInfoRequest.setId(202);
DefaultRequest defaultRequest = new DefaultRequest();
defaultRequest.setCreatedBy(58);
defaultRequest.setMerchantId(44210790);
UserLocalUtils.setUserLocal(defaultRequest);
dracImService.exportUpdate(dracImInfoRequest);
}
@Test
public void find() {
RpcPagination rpcPagination = new RpcPagination();
rpcPagination.setPageNum(1);
rpcPagination.setPageSize(10);
DracImInfoRequest dracImInfoRequest = new DracImInfoRequest();
dracImInfoRequest.setMerchantId(44210688);
rpcPagination.setCondition(dracImInfoRequest);
System.out.println(dracImService.findAllByPage(rpcPagination));
}
@Test
public void findById() {
System.out.println(dracImService.findById(221));
}
@Test
public void processMessage() {
dracImService.processMessage(new DracImMessageModel("drac_fbfd1f2edbe7495fb77db018099ff346"));
}
@Test
public void syncDarc() {
List<String> phones = new ArrayList<>();
phones.add("13810769158");
dracImService.syncDarc(phones, 44209572, null, 2);
}
@Test
public void findFirstNotAddEntmicroImCustomer() {
System.out.println(dracImService.findFirstNotAddEntmicroImCustomer(44209572));
}
@Test
public void findSecondNotAddEntmicroImCustomer() {
System.out.println(dracImService.findSecondNotAddEntmicroImCustomer(44209572));
}
@Test
public void processIncompleteReminder() {
dracStaffScrmWorkFollowService.processIncompleteReminder();
}
@Test
public void findAllMessageByPage() {
RpcPagination rpcPagination = new RpcPagination();
rpcPagination.setPageNum(1);
rpcPagination.setPageSize(10);
MessageListRequest dracImInfoRequest = new MessageListRequest();
dracImInfoRequest.setMerchantId(44209846);
rpcPagination.setCondition(dracImInfoRequest);
System.out.println(dracImService.findAllMessageByPage(rpcPagination));
}
@Test
public void addCustomerReceipt() {
CustomerReceiptModel customerReceiptModel = new CustomerReceiptModel();
customerReceiptModel.setId(125510);
customerReceiptModel.setMerchantId(44210685);
dracScrmWorkService.addCustomerReceipt(customerReceiptModel);
}
@Test
public void addCustomerReceiptD() {
CustomerReceiptModel customerReceiptModel = new CustomerReceiptModel();
customerReceiptModel.setMerchantId(44210685);
customerReceiptModel.setStaffUserIds(Arrays.asList("QiaoNing"));
customerReceiptModel.setId(125515);
customerReceiptModel.setUserId("wm_pmOEQAA0Bt0ZAUT9u5HjklP9ZlSgQ");
customerReceiptModel.setState("DARC-181");
customerReceiptModel.setWelcomeCode("mM6uVafLt5-UWA2kya0MkJ8Bav6biwox-H9DdZCln-g");
customerReceiptModel.setPhone("");
dracImService.addCustomerReceipt(customerReceiptModel);
}
@Test
public void findByImIdAndPhone() {
System.out.println(dracImService.findByImIdAndPhone(221, "13510709443"));
}
@Test
public void findMessageStatic() {
MessageListRequest customerReceiptModel = new MessageListRequest();
customerReceiptModel.setMerchantId(44210845);
System.out.println(dracImService.findMessageStatic(customerReceiptModel));
}
@Test
public void testExceport() {
List<DracCustomerErrorExport> customerReceiptModel = new ArrayList<>();
DracCustomerErrorExport dracCustomerErrorExport = new DracCustomerErrorExport();
dracCustomerErrorExport.setCustomerPhone("13476670746");
dracCustomerErrorExport.setCustomerName("13476670746");
customerReceiptModel.add(dracCustomerErrorExport);
}
@Test
public void generateURL() {
System.out.println(dracImService.generateURL("drac_4c1873cc7be847a4b029618d9731d3c0"));
}
}