| | |
| | | import com.sandu.ximon.admin.param.C3ChargingParam; |
| | | import com.sandu.ximon.admin.service.C3ChargingService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 同步结束 |
| | | */ |
| | | @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()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询心跳包间隔时间 |
| | | */ |
| | | @PostMapping("/QueryIntervalTime") |
| | | public ResponseVO<Object> QueryIntervalTime(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryIntervalTime(c3ChargingParam.getC3Mac()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询电压/电流常数 |
| | | */ |
| | | @PostMapping("/QueryConstant") |
| | | public ResponseVO<Object> QueryConstant(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryConstant(c3ChargingParam.getC3Mac()); |
| | | |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询地址 |
| | | */ |
| | | @PostMapping("/QueryAddress") |
| | | public ResponseVO<Object> QueryAddress(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryAddress(c3ChargingParam.getC3Mac()); |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询故障码 |
| | | */ |
| | | @PostMapping("/QueryFaultCode") |
| | | public ResponseVO<Object> QueryFaultCode(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.QueryFaultCode(c3ChargingParam.getC3Mac()); |
| | | return ResponseUtil.success(result); |
| | | } |
| | | |
| | | /** |
| | | * 读心跳包 |
| | | */ |
| | | @PostMapping("/ReadTheHeartbeatPackage") |
| | | public ResponseVO<Object> ReadTheHeartbeatPackage(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | return ResponseUtil.success(c3ChargingService.ReadTheHeartbeatPackage(c3ChargingParam.getC3Mac())); |
| | | } |
| | | |
| | | /** |
| | | * 设置心跳包间隔时间(秒)-充电状态时 |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTimeCharging") |
| | | public ResponseVO<Object> SetHeartbeatPacketTimeCharging(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetHeartbeatPacketTimeCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getTime(), true)); |
| | | } |
| | | |
| | | /** |
| | | * 设置心跳包间隔时间(秒)-非充电状态时 |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTimeNotCharging") |
| | | public ResponseVO<Object> SetHeartbeatPacketTimeNotCharging(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetHeartbeatPacketTimeCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getTime(), false)); |
| | | } |
| | | |
| | | /** |
| | | * 设置电压/电流常数(各一字节)(默认值0xBC64) |
| | | */ |
| | | @PostMapping("/SetConstant") |
| | | public ResponseVO<Object> SetConstant(@RequestBody @Validated C3ChargingParam c3ChargingParam) { |
| | | |
| | | return ResponseUtil.success(c3ChargingService.SetConstant(c3ChargingParam.getC3Mac(), c3ChargingParam.getConstant())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 软重启 |