xiaoyong931011
2021-07-05 cf200a1f92c01ba22c326c49391f748ffb006910
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
package com.xcong.excoin.modules.otc.controller;
 
import com.xcong.excoin.common.annotation.ControllerEndpoint;
import com.xcong.excoin.common.controller.BaseController;
import com.xcong.excoin.common.entity.FebsResponse;
import com.xcong.excoin.common.entity.QueryRequest;
import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
import com.xcong.excoin.modules.member.entity.MemberEntity;
import com.xcong.excoin.modules.otc.entity.*;
import com.xcong.excoin.modules.otc.service.OtcService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Map;
 
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/otc")
public class OtcController extends BaseController {
 
    private final OtcService otcService;
 
    /**
     * 获取商户审核列表
     */
    @GetMapping("otcShopList")
    public FebsResponse otcShopList(OtcMarketBussinessEntity otcMarketBussinessEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(otcService.otcShopList(otcMarketBussinessEntity, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 商户审核---通过
     * @return
     */
    @GetMapping("agreeShop/{id}")
    @ControllerEndpoint(operation = "商户审核---通过", exceptionMessage = "通过失败")
    public FebsResponse agreeShop(@NotNull(message = "{required}") @PathVariable Long id) {
        return otcService.agreeShop(id);
    }
 
    /**
     * 商户审核---拒绝
     * @return
     */
    @GetMapping("disagreeShop/{id}")
    @ControllerEndpoint(operation = "商户审核---通过", exceptionMessage = "通过失败")
    public FebsResponse disagreeShop(@NotNull(message = "{required}") @PathVariable Long id) {
        return otcService.disagreeShop(id);
    }
 
    /**
     * 订单申诉列表
     */
    @GetMapping("otcAppealList")
    public FebsResponse otcAppealList(OtcOrderAppealEntity otcOrderAppealEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(otcService.otcAppealList(otcOrderAppealEntity, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 申诉---处理中
     * @return
     */
    @GetMapping("dealIng/{id}")
    @ControllerEndpoint(operation = "申诉---处理中", exceptionMessage = "失败")
    public FebsResponse dealIng(@NotNull(message = "{required}") @PathVariable Long id) {
        return otcService.dealIng(id);
    }
 
    /**
     * 申诉---处理完
     * @return
     */
    @GetMapping("dealDone/{id}")
    @ControllerEndpoint(operation = "申诉---处理完", exceptionMessage = "失败")
    public FebsResponse dealDone(@NotNull(message = "{required}") @PathVariable Long id) {
        return otcService.dealDone(id);
    }
 
    /**
     * 委托单列表
     */
    @GetMapping("otcEntrustList")
    public FebsResponse otcEntrustList(OtcEntrustOrderEntity otcEntrustOrderEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(otcService.otcEntrustList(otcEntrustOrderEntity, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     *委托单--更新
     * @return
     */
    @PostMapping("otcEntrustConfirm")
    @ControllerEndpoint(operation = "委托单--更新", exceptionMessage = "失败")
    public FebsResponse otcEntrustConfirm(@Valid OtcEntrustOrderEntity otcEntrustOrderEntity) {
        return otcService.otcEntrustConfirm(otcEntrustOrderEntity);
    }
 
    /**
     * 订单列表
     */
    @GetMapping("otcOrderList")
    public FebsResponse otcOrderList(OtcOrderEntity otcOrderEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(otcService.otcOrderList(otcOrderEntity, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     *订单列表---付款人
     * @return
     */
    @PostMapping("updateOrderInfo")
    @ControllerEndpoint(operation = "订单列表---付款人", exceptionMessage = "失败")
    public FebsResponse updateOrderInfo(@Valid OtcOrderEntity otcOrderEntity) {
        return otcService.updateOrderInfo(otcOrderEntity);
    }
 
    /**
     *回款
     * @return
     */
    @PostMapping("otcHuiKuan")
    @ControllerEndpoint(operation = "订单列表---付款人", exceptionMessage = "失败")
    public FebsResponse otcHuiKuan(@Valid OtcMarketBussinessEntity otcMarketBussinessEntity) {
        return otcService.otcHuiKuan(otcMarketBussinessEntity);
    }
 
    /**
     * 设置列表
     */
    @GetMapping("otcSettingList")
    public FebsResponse otcSettingList(OtcSettingEntity otcSettingEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(otcService.otcSettingList(otcSettingEntity, request));
        return new FebsResponse().success().data(data);
    }
    /**
     *设置列表--更新
     * @return
     */
    @PostMapping("updateOtcSetting")
    @ControllerEndpoint(operation = "设置列表--更新", exceptionMessage = "失败")
    public FebsResponse updateOtcSetting(@Valid OtcSettingEntity otcSettingEntity) {
        return otcService.updateOtcSetting(otcSettingEntity);
    }
 
    /**
     * 放币
     */
    @PostMapping("/reduceCoin/{id}")
    @ControllerEndpoint(operation = "放币", exceptionMessage = "失败")
    public FebsResponse reduceCoin(@PathVariable("id") Long id) {
        otcService.reduceCoin(id);
        return new FebsResponse().success();
    }
 
}