MerchantController.java
8.19 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
package com.glsk.controller2;
import com.glsk.service.BoutiqueService;
import com.glsk.service.BusinessAnalysisService2;
import com.glsk.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Jinglf
* @create 2023-07-02 10:46
*/
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/merchant")
@Api(value = "经营分析--门店", tags = {"经营分析--门店"})
public class MerchantController {
protected final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private BusinessAnalysisService2 businessAnalysisService;
@Autowired
private BoutiqueService boutiqueService;
@GetMapping("/getMerchantList")
@ApiOperation("获取门店列表")
public RopResponse<ReqRet.MerchantListRet> getMerchantList(BusinessType business_type,String merchantname,String ids) {
logger.info("getMerchantList:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.MerchantListRet ret = boutiqueService.getMerchantList(business_type,merchantname,ids);
return RopResponse.success(ret);
}else {
ReqRet.MerchantListRet ret = businessAnalysisService.getMerchantList(business_type,merchantname,ids);
return RopResponse.success(ret);
}
}
@GetMapping("/getMerchantWeekList")
@ApiOperation("获取门店周列表")
public RopResponse<ReqRet.WeekListRet> getMerchantWeekList(BusinessType business_type,String merchantid) {
logger.info("getWeekList:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.WeekListRet ret = boutiqueService.getMerchantWeekList(business_type,merchantid);
return RopResponse.success(ret);
}else {
ReqRet.WeekListRet ret = businessAnalysisService.getMerchantWeekList(business_type,merchantid);
return RopResponse.success(ret);
}
}
@GetMapping("/queryMerchantOutputAndAtv")
@ApiOperation("查询门店总产值和客单价")
public RopResponse<ReqRet.MerchantOutputAndAtvRet> queryMerchantOutputAndAtv(String merchantid,BusinessType business_type,
QueryType queryType , String startDay,String endDay) {
logger.info("查询门店总产值和客单价:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.MerchantOutputAndAtvRet ret = boutiqueService.queryMerchantOutputAndAtv(merchantid, business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}else {
ReqRet.MerchantOutputAndAtvRet ret = businessAnalysisService.queryMerchantOutputAndAtv(merchantid, business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}
}
@GetMapping("/queryMerchantOutputTrend")
@ApiOperation("查询门店产值趋势")
public RopResponse<ReqRet.OutputTrendRet> queryMerchantOutputTrend(String merchantid, BusinessType business_type,
QueryType queryType , String startDay,String endDay) {
logger.info("查询门店产值趋势:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.OutputTrendRet ret = boutiqueService.queryMerchantOutputTrend(merchantid,business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}else {
ReqRet.OutputTrendRet ret = businessAnalysisService.queryMerchantOutputTrend(merchantid,business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}
}
@GetMapping("/queryMerchantBuyAndTostore")
@ApiOperation("查询门店新车交付数、新车到店流量、售后到店流量、成交量")
public RopResponse<ReqRet.MerchantBuyAndTostoreRet> queryMerchantBuyAndTostore(String merchantid,BusinessType business_type,
QueryType queryType , String startDay,String endDay) {
logger.info("queryMerchantBuyAndTostore:req=" );
System.out.println(business_type);
if(business_type.equals(BusinessType.qinggai)){
ReqRet.MerchantBuyAndTostoreRet ret = boutiqueService.queryMerchantBuyAndTostore(merchantid, business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}else {
ReqRet.MerchantBuyAndTostoreRet ret = businessAnalysisService.queryMerchantBuyAndTostore(merchantid, business_type,queryType,startDay,endDay);
return RopResponse.success(ret);
}
}
@GetMapping("/queryStaffRanking")
@ApiOperation("查询员工排名")
public RopResponse<ReqRet.StaffRankingRet> queryStaffRanking(String merchantid, BusinessType business_type,
QueryType queryType , String startDay,String endDay,Rankfield rankfield,RankType rankType) {
logger.info("queryStaffRanking:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.StaffRankingRet ret = boutiqueService.queryStaffRanking(merchantid,business_type,queryType,startDay,endDay,rankfield,rankType);
return RopResponse.success(ret);
}else {
ReqRet.StaffRankingRet ret = businessAnalysisService.queryStaffRanking(merchantid,business_type,queryType,startDay,endDay,rankfield,rankType);
return RopResponse.success(ret);
}
}
@GetMapping("/queryFlowContributeRanking")
@ApiOperation("查询流量贡献排行")
public RopResponse<ReqRet.FlowContributeRankingRet> queryFlowContributeRanking(String merchantid, BusinessType business_type,
QueryType queryType , String startDay,String endDay,RankType rankType) {
logger.info("queryFlowContributeRanking:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.FlowContributeRankingRet ret = boutiqueService.queryFlowContributeRanking(merchantid,business_type,queryType,startDay,endDay,rankType);
return RopResponse.success(ret);
}else {
ReqRet.FlowContributeRankingRet ret = businessAnalysisService.queryFlowContributeRanking(merchantid,business_type,queryType,startDay,endDay,rankType);
return RopResponse.success(ret);
}
}
@GetMapping("/queryServiceSupervisionSale")
@ApiOperation("门店+业务场景下的所属服务商老板、区域督导、销售名称")
public RopResponse<ReqRet.ServiceSupervisionSaleRet> queryServiceSupervisionSale(String merchantid, BusinessType business_type, String startDay,String endDay) {
logger.info("queryServiceSupervisionSale:req=" );
if(business_type.equals(BusinessType.qinggai)){
ReqRet.ServiceSupervisionSaleRet ret = boutiqueService.queryServiceSupervisionSale(merchantid,business_type,startDay,endDay);
return RopResponse.success(ret);
}else {
ReqRet.ServiceSupervisionSaleRet ret = businessAnalysisService.queryServiceSupervisionSale(merchantid,business_type,startDay,endDay);
return RopResponse.success(ret);
}
}
@GetMapping("/queryProductOutput")
@ApiOperation("品类分析")
public RopResponse<ReqRet.ProductOutputRet> queryProductOutput(String merchantid, BusinessType business_type, String startDay,String endDay) {
logger.info("queryProductOutput:req=" );
if(!business_type.equals(BusinessType.qinggai)){
ReqRet.ProductOutputRet ret = new ReqRet.ProductOutputRet();
ret.setCode(-1);
ret.setMessage("请检查参数");
return RopResponse.success(ret);
}
ReqRet.ProductOutputRet ret = boutiqueService.queryProductOutput(merchantid,business_type,startDay,endDay);
return RopResponse.success(ret);
}
}