rk
6 小时以前 11c5ab8d97809bdeddb60b22a4fe161a67aa3b05
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
package com.doumee.api.web;
 
import com.doumee.config.annotation.LoginRequired;
import com.doumee.config.annotation.LoginShopRequired;
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.Shop;
import com.doumee.dao.business.model.WithdrawRecord;
import com.doumee.dao.web.dto.ShopLoginDTO;
import com.doumee.dao.web.dto.shop.*;
import com.doumee.dao.web.request.MyCustomerRequest;
import com.doumee.dao.web.request.SaleReportRequest;
import com.doumee.dao.web.request.WithdrawApplyRequest;
import com.doumee.dao.web.response.AccountResponse;
import com.doumee.dao.web.response.MyCustomerResponse;
import com.doumee.dao.web.response.SaleReportResponse;
import com.doumee.dao.web.response.ShopInfoResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2023/3/23 17:33
 */
@Api(tags = "商户门面信息业务")
@Trace(exclude = true)
@RestController
@RequestMapping("/web/shop")
@Slf4j
public class ShopApi extends ApiController{
 
 
    /**
     * 获取店铺门面信息
     * @param shopId
     * @return
     */
    @ApiOperation(value = "获取店铺门面信息", notes = "小程序端")
    @GetMapping("/shopFaceDetailDTO")
    public ApiResponse<ShopFaceDetailDTO> getShopFaceDetailDTO(@RequestParam Integer shopId){
        return ApiResponse.success(shopService.getShopFaceDetailDTO(shopId,getMemberId()));
    }
 
    /**
     * 推荐商铺列表
     * @param pageWrap
     * @return
     */
    @ApiOperation(value = "获取店铺门面信息", notes = "小程序端")
    @GetMapping("/findShopPage")
    public ApiResponse<PageData<ShopSimpleDTO>> getShopSimpleDTOList(@RequestParam PageWrap<ShopSimpleDTO> pageWrap){
        return ApiResponse.success(shopService.getShopSimpleDTOList(pageWrap));
    }
 
    /**
     * 查询店铺统计信息
     * @param shopId
     * @return
     */
    @ApiOperation(value = "查询店铺统计信息", notes = "小程序端")
    @GetMapping("/getShopDataStatisticsDTO")
    public ApiResponse<ShopDataStatisticsDTO> getShopDataStatisticsDTO(@RequestParam Integer shopId){
        return ApiResponse.success(shopService.getShopDataStatisticsDTO(shopId));
    }
 
    /**
     * 支持维护店铺信息
     * @param shopDTO
     */
    @ApiOperation(value = "支持维护店铺信息", notes = "小程序端")
    @PostMapping("/update")
    public ApiResponse update(@RequestBody ShopDTO shopDTO){
        Integer memberId = getMemberId();
        shopService.update(shopDTO,memberId);
        return ApiResponse.success(null);
    }
 
 
 
    @LoginRequired
    @ApiOperation(value = "用户下单查询可选择的自提经销商", notes = "小程序端")
    @PostMapping("/getShopList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse getShopList(@RequestBody ShopListDTO dto){
        return ApiResponse.success(shopService.getShopList(dto));
    }
 
 
 
    @LoginShopRequired
    @ApiOperation(value = "经销商 - 提现申请", notes = "小程序端")
    @PostMapping("/withdrawApply")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse withdrawApply(@RequestBody WithdrawApplyRequest request){
        request.setMemberId(getShopId());
        withdrawRecordService.withdrawApply(request,integralService);
        return ApiResponse.success("操作成功");
    }
 
 
 
    @LoginShopRequired
    @ApiOperation("经销商 - 查询提现申请详情")
    @GetMapping("/withdrawDetail")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<WithdrawRecord> withdrawDetail(@RequestParam Integer id) {
        return ApiResponse.success(withdrawRecordService.findById(id));
    }
 
 
    @ApiOperation("经销商 - 账号密码登录")
    @PostMapping("/shopPasswordLogin")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<AccountResponse> shopPasswordLogin(@RequestBody ShopLoginDTO dto) {
        return ApiResponse.success(shopService.shopPasswordLogin(dto));
    }
 
    @ApiOperation("经销商 - 静默登录")
    @PostMapping("/shopOpenidLogin")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<AccountResponse> shopOpenidLogin(@RequestBody ShopLoginDTO dto) {
        return ApiResponse.success(shopService.shopOpenidLogin(dto));
    }
 
    @LoginShopRequired
    @ApiOperation("经销商 - 店铺详情")
    @GetMapping("/getShopInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<ShopInfoResponse> getShopInfo() {
        return ApiResponse.success(shopService.getShopInfo(getShopId()));
    }
 
 
    @LoginShopRequired
    @ApiOperation("经销商 - 我的客户信息")
    @GetMapping("/myCustomer")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<List<MyCustomerResponse>> myCustomer(MyCustomerRequest request) {
        return ApiResponse.success(shopService.myCustomer(request,getShopId()));
    }
 
    @LoginShopRequired
    @ApiOperation("经销商 - 销售明细")
    @GetMapping("/saleReport")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<SaleReportResponse> saleReport(SaleReportRequest request) {
        return ApiResponse.success(shopService.saleReport(request,getShopId()));
    }
 
 
 
 
 
 
}