| | |
| | | * @param charge |
| | | * @return |
| | | */ |
| | | // @PostMapping("/addC3mCharging") |
| | | // @PostMapping("/addC3mCharging") |
| | | public ResponseVO<Object> addC3mCharging(@RequestBody C3mChargingChargeParam charge) { |
| | | // chargeService.save(charge); |
| | | // chargeService.initCharge(charge); |
| | |
| | | |
| | | @PostMapping("/updateC3mCharging") |
| | | public ResponseVO<Object> updateC3mCharging(@RequestBody List<C3mChargingCharge> chargeEntities) { |
| | | if(chargeEntities.size()>5){ |
| | | if (chargeEntities.size() > 5) { |
| | | throw new BusinessException("当前最高仅支持4组费率"); |
| | | } |
| | | if(chargeEntities.size()==0){ |
| | | if (chargeEntities.size() == 0) { |
| | | throw new BusinessException("最少需要一条费率"); |
| | | } |
| | | return ResponseUtil.success(chargeService.updateCharge(chargeEntities)); |
| | | } |
| | | |
| | | // @PostMapping("/deleteC3mCharging") |
| | | // @PostMapping("/deleteC3mCharging") |
| | | public ResponseVO<Object> deleteC3mCharging(@RequestBody C3mChargingChargeParam charge) { |
| | | boolean remove = chargeService.remove(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, charge.getC3Id()) |
| | | .eq(C3mChargingCharge::getHour, charge.getCharge()).eq(C3mChargingCharge::getHour, charge.getHour()) |
| | |
| | | return ResponseUtil.success(chargeService.getChargeByPoleId(PoleId)); |
| | | } |
| | | |
| | | |
| | | } |