SyncController.java
6.34 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
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.synchronization.SyncCustomerBaseRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncCustomerRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncDepartmentRequest;
import cn.com.glsx.entmicro.request.synchronization.SyncStaffRequest;
import cn.com.glsx.entmicro.service.SycService;
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;
/**
* @author Lichongyuan
* @Description: 同步服务
* @date 2021/10/19 16:00
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("同步服务")
@Slf4j
public class SyncController {
@Autowired
private SycService sycService;
/**
* 同步部门
*
* @param syncDepartmentRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncDepartment", needInSession = NeedInSessionType.YES)
@ApiOperation("同步部门")
public RopResponse<Boolean> syncDepartment(SyncDepartmentRequest syncDepartmentRequest) {
try {
sycService.sycDepartment(syncDepartmentRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncDepartment__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步员工
*
* @param syncStaffRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.synStaff", needInSession = NeedInSessionType.YES)
@ApiOperation("同步员工")
public RopResponse<Boolean> synStaff(SyncStaffRequest syncStaffRequest) {
try {
sycService.sycStaff(syncStaffRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__synStaff__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户
*
* @param syncCustomerRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomer", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户")
public RopResponse<Boolean> syncCustomer(SyncCustomerRequest syncCustomerRequest) {
try {
sycService.sycCustomer(syncCustomerRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomer__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户群
*
* @param syncCustomerBaseRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerBase", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户群")
public RopResponse<Boolean> syncCustomerBase(SyncCustomerBaseRequest syncCustomerBaseRequest) {
try {
sycService.sycCustomerBase(syncCustomerBaseRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerBase__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步标签
*
* @param syncCustomerBaseRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncTag", needInSession = NeedInSessionType.YES)
@ApiOperation("同步客户群")
public RopResponse<Boolean> syncTag(SyncCustomerBaseRequest syncCustomerBaseRequest) {
try {
sycService.syncTag(syncCustomerBaseRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerBase__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 维格表同步指定门店企微客户
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomer2Vika", needInSession = NeedInSessionType.YES)
@ApiOperation("维格表同步指定门店企微客户")
public RopResponse<Boolean> syncCustomer2Vika(SyncDepartmentRequest request) {
try {
return RopResponse.success(sycService.syncCustomer2Vika(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomer2Vika__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户企微类型标签
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerTypeTagHandle", needInSession = NeedInSessionType.NO)
@ApiOperation("同步客户企微类型标签")
public RopResponse<Boolean> syncCustomerTypeTagHandle(SyncCustomerRequest request) {
try {
return RopResponse.success(sycService.syncCustomerTypeTagHandle(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerTypeTagHandle__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 同步客户备注数据到cdp
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.synchro.syncCustomerRemarkToCdp", needInSession = NeedInSessionType.NO)
@ApiOperation("同步客户备注数据到cdp")
public RopResponse<Boolean> syncCustomerRemarkToCdp(SyncCustomerRequest request) {
try {
return RopResponse.success(sycService.syncCustomerRemarkToCdp(request));
} catch (RpcServiceException e) {
log.info("=======SyncController__invoke__syncCustomerRemarkToCdp__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}