SopTaskCustomerController.java
3.58 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
package cn.com.glsx.stoassistant.controller.sop;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.stoassistant.request.sop.CustomerIdRopRequest;
import cn.com.glsx.stoassistant.request.sop.SaveSopTaskRopRequest;
import cn.com.glsx.stoassistant.request.sop.SopCustomerPageRopRequest;
import cn.com.glsx.stoassistant.request.sop.SopStageUpdateRopRequest;
import cn.com.glsx.stoassistant.response.sop.SopCustomerArchivesResponse;
import cn.com.glsx.stoassistant.response.sop.SopCustomerRopResponse;
import cn.com.glsx.stoassistant.service.sop.SopTaskCustomerService;
import cn.com.glsx.stoassistant.utils.Pagination;
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;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("Sop任务客户接口")
public class SopTaskCustomerController {
@Autowired
private SopTaskCustomerService sopTaskCustomerService;
@ApiOperation("保存sop任务客户")
@ServiceMethod(method = "scrm.api.sop.marketing.task.customer", needInSession = NeedInSessionType.NO)
public RopResponse<Boolean> saveSopTaskCustomer(SaveSopTaskRopRequest request){
try {
return RopResponse.success(sopTaskCustomerService.saveSopTaskCustomer(request));
}catch (RpcServiceException e){
log.info("=======SopTaskCustomerControllerr__invoke__saveSopTaskCustomer__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ApiOperation("sop任务客户列表")
@ServiceMethod(method = "scrm.api.sop.task.customer.page", needInSession = NeedInSessionType.NO)
public RopResponse<Pagination<SopCustomerRopResponse>> sopTaskCustomerPage(SopCustomerPageRopRequest request){
try {
return RopResponse.success(sopTaskCustomerService.sopTaskCustomerPage(request));
}catch (RpcServiceException e){
log.info("=======SopTaskCustomerControllerr__invoke__sopTaskCustomerPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ApiOperation("sop客户智能档案")
@ServiceMethod(method = "scrm.api.sop.task.customer.archives", needInSession = NeedInSessionType.NO)
public RopResponse<List<SopCustomerArchivesResponse>> getCustomerArchives(CustomerIdRopRequest request){
try {
return RopResponse.success(sopTaskCustomerService.getCustomerArchives(request));
}catch (RpcServiceException e){
log.info("=======SopTaskCustomerControllerr__invoke__getCustomerArchives__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ApiOperation("sop客户-更改旅程阶段")
@ServiceMethod(method = "scrm.api.sop.task.customer.stage.update", needInSession = NeedInSessionType.NO)
public RopResponse<Boolean> changeCustomerStage(SopStageUpdateRopRequest request){
try {
return RopResponse.success(sopTaskCustomerService.changeCustomerStage(request));
}catch (RpcServiceException e){
log.info("=======SopTaskCustomerControllerr__invoke__changeCustomerStage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}