CustomerReportController.java
4.85 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
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.response.CustomerReportVO;
import cn.com.glsx.entmicro.model.response.GroupCustomerReportVO;
import cn.com.glsx.entmicro.request.customer.CustomerReportSearchRopRequest;
import cn.com.glsx.entmicro.service.CustomerReportService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
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.web.bind.annotation.CrossOrigin;
import javax.annotation.Resource;
/**
* @Description
* @author chizw
* @create 2022/1/11 11:04
*/
@Slf4j
@Api("客户报告接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CustomerReportController {
@Resource
private CustomerReportService customerReportService;
/**
* 集团客户报告获取数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.group.report")
@ApiOperation("集团客户报告获取数据接口")
public RopResponse<RpcResponse<GroupCustomerReportVO>> getGroupCustomerReport(CustomerReportSearchRopRequest request) {
try {
return RopResponse.success(customerReportService.getGroupCustomerReport(request));
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__getGroupCustomerReport__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 门店客户报告获取数据接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.merchant.report")
@ApiOperation("门店客户报告获取数据接口")
public RopResponse<RpcResponse<CustomerReportVO>> getMerchantCustomerReport(CustomerReportSearchRopRequest request) {
try {
return RopResponse.success(customerReportService.getMerchantCustomerReport(request));
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__getMerchantCustomerReport__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动统计指定商户所有日期客户报告
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.merchant.report.script")
@ApiOperation("手动统计指定商户所有日期客户报告")
public RopResponse<RpcResponse<Boolean>> handleStatisticsCustomerReportByAllDays(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handleStatisticsCustomerReportByAllDays(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllDays__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动统计所有商户所有日期客户报告
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.all.report.script")
@ApiOperation("手动统计所有商户所有日期客户报告")
public RopResponse<RpcResponse<Boolean>> handleStatisticsCustomerReportByAllMerchant(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handleStatisticsCustomerReportByAllMerchant(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 脚本 - 手动推送特定日期的周报/月报
*
* @return
*/
@ServiceMethod(method = "entmicro.api.customer.report.push")
@ApiOperation("手动推送特定日期的周报/月报")
public RopResponse<RpcResponse<Boolean>> handlePushWeeklyOrMonthlyReport(CustomerReportSearchRopRequest request) {
try {
RpcResponse<Boolean> flag = customerReportService.handlePushWeeklyOrMonthlyReport(request);
return RopResponse.success(flag);
} catch (RpcServiceException e) {
log.info("=======CustomerReportController__invoke__handleStatisticsCustomerReportByAllMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}