| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | |
| | | if (!permissionConfig.check(MenuEnum.C3_CHARGING_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.successPage(c3ChargingService.getC3ChargingListByKeyword(baseConditionVO, c3ChargingParam)); |
| | | return ResponseUtil.success(c3ChargingService.getC3ChargingListByKeyword(baseConditionVO, c3ChargingParam)); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | |
| | | return ResponseUtil.success(c3ChargingService.getChargingInfo(poleId)); |
| | | } |
| | | |
| | | // /** |
| | | // * 充电开启 |
| | | // */ |
| | | // @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); |
| | | // } |
| | | // |
| | | // } |
| | | /** |
| | | * 充电开启 |
| | | */ |
| | | @AnonymousAccess |
| | | @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); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 充电结束 |
| | | * 充电结束——小程序用户结束,不需要token,需要openId |
| | | */ |
| | | @PostMapping("/finishCharging") |
| | | public ResponseVO<Object> finishCharging(@RequestBody C3ChargingParam c3ChargingParam) { |
| | | String result = c3ChargingService.finishCharging(c3ChargingParam.getC3Mac()); |
| | | if (c3ChargingParam.getC3Mac() == null || c3ChargingParam.getOpenId() == null) { |
| | | throw new BusinessException("参数错误!"); |
| | | } |
| | | String result = c3ChargingService.finishCharging(c3ChargingParam.getC3Mac(), c3ChargingParam.getOpenId()); |
| | | |
| | | if ("操作成功".equals(result)) { |
| | | return ResponseUtil.success(result); |