2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-03-18 c10eae234bbef97f92a34b68ce8901255436bc59
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
package com.sandu.ximon.admin.controller;
 
import com.sandu.common.domain.ResponseVO;
import com.sandu.common.object.BaseConditionVO;
import com.sandu.common.util.ResponseUtil;
import com.sandu.ximon.admin.param.C3ChargingParam;
import com.sandu.ximon.admin.service.C3ChargingService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author ZZQ
 * C3充电桩
 * @date 2022/3/3 15:44
 */
 
@RestController
@AllArgsConstructor
@RequestMapping("/v1/admin/C3Charging")
public class C3ChargingController {
    private C3ChargingService c3ChargingService;
 
 
    @GetMapping("/C3ChargingList")
    public ResponseVO<Object> C3ChargingList(BaseConditionVO baseConditionVO) {
        return ResponseUtil.successPage(c3ChargingService.getC3ChargingList(baseConditionVO));
    }
 
    /**
     * 充电开启
     */
    @PostMapping("/startCharging")
    public ResponseVO<Object> startCharging(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.startCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getChargingCapacity(), c3ChargingParam.getChargeAmount());
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
 
    }
 
    /**
     * 充电结束
     */
    @PostMapping("/finishCharging")
    public ResponseVO<Object> finishCharging(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.finishCharging(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
    /**
     * 同步结束
     */
    @PostMapping("/EndOfTheSynchronization")
    public ResponseVO<Object> EndOfTheSynchronization(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.EndOfTheSynchronization(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
    /**
     * 查询版本
     */
    @PostMapping("/QueryVersion")
    public ResponseVO<Object> QueryVersion(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.QueryVersion(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
    /**
     * 查询心跳包间隔时间
     */
    @PostMapping("/QueryIntervalTime")
    public ResponseVO<Object> QueryIntervalTime(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.QueryIntervalTime(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
    /**
     * 查询电压/电流常数
     */
    @PostMapping("/QueryConstant")
    public ResponseVO<Object> QueryConstant(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.QueryConstant(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
    /**
     * 查询地址
     */
    @PostMapping("/QueryAddress")
    public ResponseVO<Object> QueryAddress(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.QueryAddress(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
 
 
    /**
     * 软重启
     */
    @PostMapping("/restartCharging")
    public ResponseVO<Object> restartCharging(@RequestBody C3ChargingParam c3ChargingParam) {
        String result = c3ChargingService.restartCharging(c3ChargingParam.getC3Mac());
 
        if ("操作成功".equals(result)) {
            return ResponseUtil.success(result);
        } else {
            return ResponseUtil.fail(result);
        }
    }
}