DracScrmStatisticController.java
8.02 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
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.drainage.CustomerStatisticCodeTrendResponse;
import cn.com.glsx.entmicro.request.drainage.DracCodeSearchRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDefaultRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDetailPageRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticCodeDetailRequest;
import cn.com.glsx.entmicro.request.qystatistic.DracScrmStatisticRequest;
import cn.com.glsx.entmicro.response.qystatistic.*;
import cn.com.glsx.entmicro.service.drainage.DracScrmStatisticService;
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.ArrayList;
import java.util.List;
/**
* @author wangxw
* @version 1.0.0
* @ClassName DracScrmStatisticController.java
* @description: SCRM-客户统计数据接口
* @createTime 2021年11月15日 19:51:00
*/
@Slf4j
@Api("SCRM-客户统计数据接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class DracScrmStatisticController {
@Autowired(required = false)
private DracScrmStatisticService dracScrmStatisticService;
@ServiceMethod(method = "entmicro.api.drac.statistic.getCustomerStatisticCodeTrend")
@ApiOperation("引流企微 - 概览页")
public RopResponse<CustomerStatisticCodeTrendResponse> getCustomerStatisticCodeTrend(DracScrmStatisticRequest request) {
try {
CustomerStatisticCodeTrendResponse customerStatisticCodeTrendResponse=dracScrmStatisticService.getCustomerStatisticCodeTrend(request);
return RopResponse.success(customerStatisticCodeTrendResponse);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getCustomerStatisticCodeTrend__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.day.trend")
@ApiOperation("引流企微 - 每日新增趋势")
public RopResponse<List<DracStatisticCodeTrend>> getDracStatisticDayTrend(DracScrmStatisticRequest request) {
try {
List<DracStatisticCodeTrend> resultList = new ArrayList<>();
DracStatisticCodeTrend trend = new DracStatisticCodeTrend();
trend.setLineX("未加企微客户");
trend.setTrendItemList(initTrend(1));
DracStatisticCodeTrend trend2 = new DracStatisticCodeTrend();
trend2.setLineX("已加企微客户");
trend2.setTrendItemList(initTrend(5));
resultList.add(trend);
resultList.add(trend2);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
private List<DracStatisticCodeTrendItem> initTrend(int step) {
List<DracStatisticCodeTrendItem> trendItemList = new ArrayList<>();
trendItemList.add(new DracStatisticCodeTrendItem("8-5", 100 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-6", 120 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-7", 140 + step));
trendItemList.add(new DracStatisticCodeTrendItem("8-8", 150 + step));
return trendItemList;
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.default")
@ApiOperation("引流企微 - 活码统计默认返回列表")
public RopResponse<List<DracStatisticCodeDefaultVo>> getDracStatisticCodeDefault(DracScrmStatisticCodeDefaultRequest request) {
try {
List<DracStatisticCodeDefaultVo> resultList = new ArrayList<>();
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.trend")
@ApiOperation("引流企微 - 活码统计统计数据趋势图")
public RopResponse<List<DracStatisticCodeTrend>> getDracStatisticCodeTrend(DracScrmStatisticCodeDefaultRequest request) {
try {
List<DracStatisticCodeTrend> dracStatisticCodeTrend = dracScrmStatisticService.getDracStatisticCodeTrend(request);
return RopResponse.success(dracStatisticCodeTrend);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.search")
@ApiOperation("引流企微 - 活码统计列表数据返回")
public RopResponse<Pagination<DracStatisticCodeSearchResponse>> getDracStatisticCodeSearch(DracCodeSearchRequest dracCodeSearchRequest) {
try {
Pagination<DracStatisticCodeSearchResponse> dracStatisticCodeDefault = dracScrmStatisticService.getDracStatisticCodeDefault(dracCodeSearchRequest);
return RopResponse.success(dracStatisticCodeDefault);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.total")
@ApiOperation("引流企微 - 活码详情页统计数据总览")
public RopResponse<DracScrmStatisticCodeDetailTotalResponse> getDracStatisticCodeDetailTotal(DracScrmStatisticCodeDetailRequest request) {
try {
return RopResponse.success(new DracScrmStatisticCodeDetailTotalResponse(10, 999, 555));
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.list.time")
@ApiOperation("引流企微 - 活码详情页按时间查看")
public RopResponse<List<DracScrmStatisticCodeDetailTimeListResponse>> getDracStatisticCodeDetailListByTime(DracScrmStatisticCodeDetailRequest request) {
try {
List<DracScrmStatisticCodeDetailTimeListResponse> resultList=dracScrmStatisticService.getDracStatisticCodeDetailListByTime(request);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.drac.statistic.code.detail.list.staff")
@ApiOperation("引流企微 - 活码详情页按员工查看")
public RopResponse<Pagination<DracScrmStatisticCodeDetailStaffListResponse>> getDracStatisticCodeDetailListByStaff(DracScrmStatisticCodeDetailPageRequest request) {
try {
Pagination<DracScrmStatisticCodeDetailStaffListResponse> resultList=dracScrmStatisticService.getDracStatisticCodeDetailListByStaff(request);
return RopResponse.success(resultList);
} catch (RpcServiceException e) {
log.info("=======GroupOneTemplateController__invoke__getGroupOnePage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}