DracImController.java
9.9 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
package cn.com.glsx.entmicro.controller.drainage;
import cn.com.glsx.entmicro.model.request.DracImMessageConfigRequest;
import cn.com.glsx.entmicro.model.response.DracImInfoResponse;
import cn.com.glsx.entmicro.model.response.DracImMessageConResponse;
import cn.com.glsx.entmicro.model.response.ExportDracImResponse;
import cn.com.glsx.entmicro.model.response.drainage.MessageStaticResponse;
import cn.com.glsx.entmicro.model.response.drainage.MiniProgramImResponse;
import cn.com.glsx.entmicro.request.drainage.*;
import cn.com.glsx.entmicro.response.drainage.DracImCustomerCollectionRopResponse;
import cn.com.glsx.entmicro.response.drainage.DracImInfoRopResponse;
import cn.com.glsx.entmicro.service.drainage.DracImService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author zhouhaibao
* @version 1.0
* @description: 智能营销配置服务
* @date 2021/11/15 18:14
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("智能营销")
@Slf4j
public class DracImController {
@Autowired
private DracImService dracImService;
/**
* 智能营销列表
*
* @param dracImSearchRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findAllByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销列表")
public RopResponse<Pagination<DracImInfoRopResponse>> findAllByPage(DracImSearchRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.findAllByPage(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询短信列表
*
* @param messageListRopRequest 智能营销入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findAllMessageByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("查询短信列表")
public RopResponse<Pagination<DracImCustomerCollectionRopResponse>> findAllMessageByPage(MessageListRopRequest messageListRopRequest) {
try {
return RopResponse.success(dracImService.findAllMessageByPage(messageListRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询智能营销详情
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findById", needInSession = NeedInSessionType.YES)
@ApiOperation("查询智能营销详情")
public RopResponse<DracImInfoResponse> findById(DracImDetailRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.findById(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询智能营销详情
*
* @param messageStaticRopRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.findMessageStatic", needInSession = NeedInSessionType.YES)
@ApiOperation("查询智能营销详情")
public RopResponse<MessageStaticResponse> findMessageStatic(MessageStaticRopRequest messageStaticRopRequest) {
try {
return RopResponse.success(dracImService.findMessageStatic(messageStaticRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 新增智能营销
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.exportAdd", needInSession = NeedInSessionType.YES)
@ApiOperation("新增智能营销")
public RopResponse<ExportDracImResponse> exportAdd(DracImAddRequest dracImSearchRequest) {
try {
DracImMessageConfigRequest dracImMessageConfigRequest = dracImSearchRequest.getDracImMessageConfigRequest();
if (dracImMessageConfigRequest != null) {
String content = dracImMessageConfigRequest.getContent();
if (!StringUtils.isEmpty(content) && content.contains("XXX门店")) {
return RopResponse.error("", "请修改短信中的门店签名,将XXX替换为实际的门店名称");
}
}
return RopResponse.success(dracImService.exportAdd(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 更新智能营销
*
* @param dracImSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.exportUpdate", needInSession = NeedInSessionType.YES)
@ApiOperation("更新智能营销")
public RopResponse<ExportDracImResponse> exportUpdate(DracImUpdateRequest dracImSearchRequest) {
try {
return RopResponse.success(dracImService.exportUpdate(dracImSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__getCustomerBasePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询渠道活码链接
*
* @param dracImMiniProgramRequest 入参
* @return
*/
@ServiceMethod(method = "dracIm.api.entmicro.findMiniProgramIm", needInSession = NeedInSessionType.YES)
@ApiOperation("查询渠道活码链接")
public RopResponse<MiniProgramImResponse> findMiniProgramIm(DracImMiniProgramRequest dracImMiniProgramRequest) {
try {
return RopResponse.success(dracImService.findMiniProgramIm(dracImMiniProgramRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findMiniProgramIm__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 短信详情
*
* @param dracImMessageDetailRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.dracMessage.detail", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销短信详情")
public RopResponse<DracImMessageConResponse> dracMassageDetailById(DracImMessageDetailRequest dracImMessageDetailRequest) {
try {
return RopResponse.success(dracImService.dracMassageDetailById(dracImMessageDetailRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__dracMassageDetailById__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 智能营销-客户列表分页条件查询
*
* @param dracImCustomerPageSearchRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.customer.search.page", needInSession = NeedInSessionType.YES)
@ApiOperation("智能营销-客户列表分页条件查询")
public RopResponse<Pagination<DracImCustomerCollectionRopResponse>> dracCustomerConditionPageSearch(DracImCustomerPageSearchRequest dracImCustomerPageSearchRequest) {
try {
return RopResponse.success(dracImService.dracCustomerConditionPageSearch(dracImCustomerPageSearchRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__dracCustomerConditionPageSearch__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 动态生成短链
*
* @param dracImRopRequest 入参
* @return
*/
@ServiceMethod(method = "entmicro.api.dracIm.dracMessage.generateURL", needInSession = NeedInSessionType.NO)
@ApiOperation("动态生成短链")
public RopResponse<String> generateURL(DracImRopRequest dracImRopRequest) {
try {
return RopResponse.success(dracImService.generateURL(dracImRopRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__generateURL__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取业务活动的code
*
* @param addEntmicroCommonRequest 入参
* @return
*/
@ServiceMethod(method = "dracIm.api.entmicro.findByActivityIdAndPhone", needInSession = NeedInSessionType.NO)
@ApiOperation("获取业务活动的code")
public RopResponse<MiniProgramImResponse> findByActivityIdAndPhone(AddEntmicroCommonRopRequest addEntmicroCommonRequest) {
try {
return RopResponse.success(dracImService.findByActivityIdAndPhone(addEntmicroCommonRequest));
} catch (RpcServiceException e) {
log.info("=======CustomerBaseController__invoke__findByActivityIdAndPhone__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}