BusinessCardController.java
17.6 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.businessCard.BusinessCardRecordRelationRpcResponse;
import cn.com.glsx.entmicro.request.card.*;
import cn.com.glsx.entmicro.response.card.*;
import cn.com.glsx.entmicro.service.card.BusinessCardService;
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.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @ClassName BusinessCardController
* @Description
* @Author lichongyuan
* @Date 2022/9/1
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("智能名片")
@Slf4j
public class BusinessCardController {
@Autowired
private BusinessCardService businessCardService;
@ServiceMethod(method = "entmicro.api.business.card.cardRecord", needInSession = NeedInSessionType.NO)
@ApiOperation("智能名片埋点")
public RopResponse<Boolean> cardRecord(SaveCardRecordRopRequest request) {
try {
businessCardService.cardRecord(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__cardRecord__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.listpage", needInSession = NeedInSessionType.YES)
@ApiOperation("智能名片分页列表")
public RopResponse<Pagination<BusinessCardPageRopResponse>> getCardListPage(BusinessCardPageRopRequest request) {
try {
Pagination<BusinessCardPageRopResponse> resultPage = businessCardService.listPage(request);
return RopResponse.success(resultPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getCardDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.cardDetail", needInSession = NeedInSessionType.YES)
@ApiOperation("智能名片详情")
public RopResponse<BusinessCardPageRopResponse> getBusinessCardDetail(DeleteCardRopRequest ropRequest){
try {
BusinessCardPageRopResponse businessCardDetail = businessCardService.getBusinessCardDetail(ropRequest);
return RopResponse.success(businessCardDetail);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__cardDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.save", needInSession = NeedInSessionType.YES)
@ApiOperation("新增名片")
public RopResponse<Integer> saveBusinessCard(SaveCardRopRequest ropRequest){
try {
Integer cardId = businessCardService.saveBusinessCard(ropRequest);
return RopResponse.success(cardId);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__saveCard__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.update", needInSession = NeedInSessionType.YES)
@ApiOperation("修改名片")
public RopResponse<Integer> updateBusinessCard(SaveCardRopRequest ropRequest){
try {
Integer cardId = businessCardService.updateBusinessCard(ropRequest);
return RopResponse.success(cardId);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__updateCard__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.delete", needInSession = NeedInSessionType.YES)
@ApiOperation("删除名片")
public RopResponse<Integer> updateBusinessCard(DeleteCardRopRequest ropRequest){
try {
Integer cardId = businessCardService.deleteBusinessCard(ropRequest);
return RopResponse.success(cardId);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__deleteCard__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.cardRecord.page", needInSession = NeedInSessionType.YES)
@ApiOperation("访客记录分页列表")
public RopResponse<Pagination<CardRecordPageRopResponse>> listCardRecordPage(CardRecordPageRopRequest ropRequest){
try {
Pagination<CardRecordPageRopResponse> responsePagination = businessCardService.listCardRecordPage(ropRequest);
return RopResponse.success(responsePagination);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__cardRecordPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.cardRecord.list", needInSession = NeedInSessionType.NO)
@ApiOperation("访客记录列表(无session)")
public RopResponse<Pagination<CardRecordPageRopResponse>> listCardRecord(CardRecordPageRopRequest ropRequest){
try {
if (ropRequest.getMerchant() != null) {
ropRequest.setMerchantId(ropRequest.getMerchant());
}
Pagination<CardRecordPageRopResponse> responsePagination = businessCardService.listCardRecordPage(ropRequest);
return RopResponse.success(responsePagination);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__cardRecordPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.apply", needInSession = NeedInSessionType.YES)
@ApiOperation("智能名片活动申请")
public RopResponse<Boolean> activityApply(BusinessCardActivityApplyRopRequest ropRequest){
try {
Boolean responses = businessCardService.activityApply(ropRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityApply__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.record", needInSession = NeedInSessionType.YES)
@ApiOperation("分页查询活动申请记录")
public RopResponse<Pagination<BusinessCardActvityRopResponse>> viewActivityApplyPage(BusinessCardActivityPageRopRequest ropRequest){
try {
Pagination<BusinessCardActvityRopResponse> responsePagination = businessCardService.viewActivityApplyPage(ropRequest);
return RopResponse.success(responsePagination);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__viewActivityApplyPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.record.list", needInSession = NeedInSessionType.NO)
@ApiOperation("查询活动申请记录(无session)")
public RopResponse<Pagination<BusinessCardActvityRopResponse>> viewActivityApplyList(BusinessCardActivityPageRopRequest ropRequest){
try {
if (ropRequest.getMerchant() != null) {
ropRequest.setMerchantId(ropRequest.getMerchant());
}
Pagination<BusinessCardActvityRopResponse> responsePagination = businessCardService.viewActivityApplyPage(ropRequest);
return RopResponse.success(responsePagination);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__viewActivityApplyPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.follow", needInSession = NeedInSessionType.NO)
@ApiOperation("智能名片活动跟进")
public RopResponse<Boolean> followActivity(BusinessCardActivityRopRequest ropRequest){
try {
Boolean responses = businessCardService.followActivity(ropRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__followActivity__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.pagerecord", needInSession = NeedInSessionType.NO)
@ApiOperation("智能名片活动页面访问记录")
public RopResponse<List<BusinessCardRecordRelationRpcResponse>> viewActivityAccessRecord(BusinessCardActivityRopRequest ropRequest){
try {
List<BusinessCardRecordRelationRpcResponse> responses = businessCardService.viewActivityAccessRecord(ropRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__viewActivityAccessRecord__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.export", needInSession = NeedInSessionType.YES)
@ApiOperation("导出智能名片分页列表")
public RopResponse<String> exportBusinessCard(BusinessCardPageRopRequest request){
try {
String resultPage = businessCardService.exportBusinessCard(request);
return RopResponse.success(resultPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__exportBusinessCard__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.card.activity.export", needInSession = NeedInSessionType.YES)
@ApiOperation("导出活动申请记录")
public RopResponse<String> exportActivityApply(BusinessCardActivityPageRopRequest ropRequest){
try {
String responsePagination = businessCardService.exportActivityApply(ropRequest);
return RopResponse.success(responsePagination);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__exportActivityApply__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.cardRecord.export", needInSession = NeedInSessionType.YES)
@ApiOperation("导出访客记录")
public RopResponse<String> exportBusinessCardRecord(CardRecordPageRopRequest ropRequest){
try {
String response = businessCardService.exportBusinessCardRecord(ropRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__exportBusinessCardRecord__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.page", needInSession = NeedInSessionType.NO)
@ApiOperation("分页查找活动记录列表")
public RopResponse<Pagination<BusinessCardActivityRecordRopResponse>> listActivityPage(ActivityRecordPageRopRequest ropRequest){
try {
Pagination<BusinessCardActivityRecordRopResponse> response = businessCardService.listActivityPage(ropRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.list", needInSession = NeedInSessionType.NO)
@ApiOperation("获取活动记录全集")
public RopResponse<List<BusinessCardActivityRecordRopResponse>> getActivityRecordList(ActivityRecordEmptyRopRequest ropRequest){
try {
List<BusinessCardActivityRecordRopResponse> response = businessCardService.getActivityRecordList();
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.add", needInSession = NeedInSessionType.YES)
@ApiOperation("新增活动记录")
public RopResponse<Boolean> addActivityRecord(BusinessCardActivityRecordRopRequest ropRequest){
try {
Boolean response = businessCardService.addActivityRecord(ropRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordAdd__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.update", needInSession = NeedInSessionType.YES)
@ApiOperation("更新活动记录")
public RopResponse<Boolean> updateActivityRecord(ActivityRecordUpdateRopRequest ropRequest){
try {
Boolean response = businessCardService.updateActivityRecord(ropRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordUpdate__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.detail", needInSession = NeedInSessionType.NO)
@ApiOperation("根据id查询活动记录详情")
public RopResponse<BusinessCardActivityRecordRopResponse> findActivityRecordDetail(ActivityRecordIdRopRequest ropRequest){
try {
BusinessCardActivityRecordRopResponse response = businessCardService.findActivityRecordDetail(ropRequest.getId());
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordDetail__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.delete", needInSession = NeedInSessionType.YES)
@ApiOperation("删除活动")
public RopResponse<Boolean> deleteActivityRecord(ActivityRecordIdRopRequest ropRequest){
try {
Boolean response = businessCardService.deleteActivityRecord(ropRequest);
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordDelete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.checkPhone", needInSession = NeedInSessionType.NO)
@ApiOperation("检查登录用户是否是滴加智慧云的员工")
public RopResponse<Boolean> checkPhone(ActivityRecordPhoneRopRequest ropRequest){
try {
Boolean response = businessCardService.checkPhone(ropRequest.getPhone());
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordCheckPhone__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.checkCooperate", needInSession = NeedInSessionType.NO)
@ApiOperation("是否显示门店助手、生意助手按钮")
public RopResponse<Boolean> checkCooperateByOpenId(ActivityRecordOpenIdRopRequest ropRequest){
try {
Boolean response = businessCardService.checkCooperateByOpenId(ropRequest.getOpenId());
return RopResponse.success(response);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordCheckCooperate__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.business.activityRecord.syn", needInSession = NeedInSessionType.YES)
@ApiOperation("同步众筹活动")
public RopResponse<BusinessCardActivityRecordRopResponse> synActivity(SynActivityRecordRopRequest ropRequest){
try {
return RopResponse.success(businessCardService.synActivity(ropRequest));
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__activityRecordsynActivity__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}