BusiAssistantActivityRemoteImpl.java
10.7 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
package cn.com.glsx.busassistant.remote;
import cn.com.glsx.busassistant.model.request.activity.*;
import cn.com.glsx.busassistant.model.request.product.BusiAssistantBaseRequest;
import cn.com.glsx.busassistant.model.request.product.QcCodeRequest;
import cn.com.glsx.busassistant.model.response.activity.*;
import cn.com.glsx.busassistant.model.response.product.OpenedProductRpcResponse;
import cn.com.glsx.busassistant.model.response.product.SceneProductRpcResponse;
import cn.com.glsx.busassistant.service.activity.BusiAssistantActivityService;
import cn.com.glsx.busassistant.service.product.BusiAssistantProductService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Author xiongzs
* @date 2022/10/12 14:49
* @Version 1.0
*/
@Slf4j
@DubboService(validation = "true",version = "1.0.0",protocol = "dubbo",timeout = 10000)
public class BusiAssistantActivityRemoteImpl implements BusiAssistantActivityRemote {
@Autowired
private BusiAssistantActivityService activityService;
@Autowired
private BusiAssistantProductService productService;
@Override
public RpcResponse<Boolean> addBusiAssistantActivity(ActivityApplyRpcRequest rpcRequest) {
try {
activityService.addBusiAssistantActivity(rpcRequest);
return RpcResponse.success(true);
} catch (RpcServiceException e) {
log.error("申请开通活动异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> confirmOpenActivity(ActivityConfirmRpcRequest rpcRequest) {
try {
return RpcResponse.success(activityService.confirmOpenActivity(rpcRequest));
} catch (RpcServiceException e) {
log.error("确认开通活动异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("确认开通活动异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ActivityRpcResponse>> findActivityPage(ActivityRpcPageRequest pageRequest) {
try {
Page<ActivityRpcResponse> page = activityService.findActivityPage(pageRequest);
return RpcResponse.success(RpcPagination.copyPage(page));
} catch (RpcServiceException e) {
log.error("分页查询活动申请列表异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("分页查询活动申请列表异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<SceneProductRpcResponse>> findOpenedProductRecord(BusiAssistantBaseRequest request) {
try {
return RpcResponse.success(activityService.findOpenedProductRecord(request));
} catch (RpcServiceException e) {
log.error("查询已开通场景、产品记录异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("查询已开通场景、产品记录异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<ActivityOpenedByMerchantRpcResponse>> findOpenedActivityByMerchantIds(ActivityMerchantRpcRequest request) {
try {
List<ActivityOpenedByMerchantRpcResponse> responseList = activityService.findOpenedActivityByMerchantIds(request);
return RpcResponse.success(responseList);
} catch (RpcServiceException e) {
log.error("通过商户号集合查询已开通场景异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("通过商户号集合查询已开通场景异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<SceneProductModelRpcResponse>> findProductsBySceneCode(String sceneCode) {
try {
return RpcResponse.success(productService.findProductsBySceneCode(sceneCode));
} catch (RpcServiceException e) {
log.error("根据场景编码查询产品异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("根据场景编码查询产品异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<SceneProductModelRpcResponse>> findSceneAndProductOpened(SceneAndProductOpenedRpcRequest request) {
try {
return RpcResponse.success(activityService.findSceneAndProductOpened(request));
} catch (RpcServiceException e) {
log.error("服务商+门店查询所有场景和产品的开通状态异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("服务商+门店查询所有场景和产品的开通状态异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<String> createQrCode(QcCodeRequest rpcRequest) {
try {
return RpcResponse.success(productService.createQrCode(rpcRequest));
} catch (RpcServiceException e) {
log.error("获取员工活动链接异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("获取员工活动链接异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> openActivityForExternal(OpenActivityForExternalRpcRequest rpcRequest) {
try {
return RpcResponse.success(activityService.openActivityForExternal(rpcRequest));
} catch (RpcServiceException e) {
log.error("转化加、众筹活动直接开通活动异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("转化加、众筹活动直接开通活动异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<SceneOpenStatus>> findSceneOpenStatus(ActivityOpenStatusForStoAssRpcRequest rpcRequest) {
try {
return RpcResponse.success(activityService.findSceneOpenStatus(rpcRequest));
} catch (RpcServiceException e) {
log.error("查看所有场景的开通状态--门店助手异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("查看所有场景的开通状态--门店助手异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<ProductStatus>> findProductOpenStatus(ActivityOpenStatusForStoAssRpcRequest rpcRequest) {
try {
return RpcResponse.success(activityService.findProductOpenStatus(rpcRequest));
} catch (RpcServiceException e) {
log.error("根据场景查看产品的开通状态--门店助手异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("根据场景查看产品的开通状态--门店助手异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> finishActivityByCrowdFundActId(Integer crowdFundActId) {
try {
return RpcResponse.success(activityService.finishActivityByCrowdFundActId(crowdFundActId));
} catch (RpcServiceException e) {
log.error("结束众筹活动异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("结束众筹活动异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<String> findSceneCodeByProductCode(String productCode) {
try {
return RpcResponse.success(productService.getSceneCodeByProductCode(productCode));
} catch (RpcServiceException e) {
log.error("根据产品编码查询场景异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("根据产品编码查询场景异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> lightScene(Integer actId) {
try {
return RpcResponse.success(activityService.lightScene(actId));
} catch (RpcServiceException e) {
log.error("手动点亮场景异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("手动点亮场景异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<String> getActivityUrl() {
try {
return RpcResponse.success(activityService.getActivityUrl());
} catch (RpcServiceException e) {
log.error("获取活动链接配置:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("获取活动链接配置:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> lightSceneByMerchantNo(LightSceneRpcRequest request) {
try {
return RpcResponse.success(activityService.lightSceneByMerchantNo(request));
} catch (RpcServiceException e) {
log.error("根据商户号点亮对应场景:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("根据商户号点亮对应场景:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> openProductList(MerchantProductsRpcRequest rpcRequest) {
try {
return RpcResponse.success(activityService.openProductList(rpcRequest));
} catch (RpcServiceException e) {
log.error("开通产品集合异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("开通产品集合异常:{}",e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<SceneProductStatusResponse>> findSceneProductStatus(ActivityMerchantRpcRequest request) {
try {
return RpcResponse.success(activityService.findSceneProductStatus(request));
} catch (RpcServiceException e) {
log.error("开通产品集合异常:{}",e);
return RpcResponse.error(e);
}catch (Exception e){
log.error("开通产品集合异常:{}",e);
return RpcResponse.error(e);
}
}
}