| | |
| | | /** |
| | | * 查询计费策略明细列表 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查询计费策略明细列表") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理", "管理后台-充电桩信息"},value = "查询计费策略明细列表") |
| | | @GetMapping(value = "/queryAccountingStrategyDetailByStrategyId") |
| | | public AjaxResult<List<TAccountingStrategyDetailVO>> queryAccountingStrategyDetailByStrategyId(@RequestParam Integer strategyId) { |
| | | List<TAccountingStrategyDetailVO> list = accountingStrategyDetailService.queryAccountingStrategyDetailByStrategyId(strategyId); |
| | |
| | | /** |
| | | * 添加计费策略管理 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "添加计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "添加计费策略") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | public AjaxResult<Integer> add(@RequestBody TAccountingStrategyDTO dto) { |
| | | accountingStrategyService.save(dto); |
| | | // 添加明细 |
| | | dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId())); |
| | | accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails()); |
| | | // TODO 硬件 同步策略到充电桩 |
| | | return AjaxResult.ok(accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails())); |
| | | return AjaxResult.ok(dto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 修改计费策略 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "修改计费策略") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "修改计费策略") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TAccountingStrategyDTO dto) { |
| | | // 删除计费策略明细信息 |
| | |
| | | /** |
| | | * 查看计费策略详情 |
| | | */ |
| | | @ApiOperation(tags = {"后台-计费策略"},value = "查看计费策略详情") |
| | | @ApiOperation(tags = {"后台-计费策略", "管理后台-站点管理"},value = "查看计费策略详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TAccountingStrategy> getDetailById(@RequestParam Integer id) { |
| | | return AjaxResult.ok(accountingStrategyService.getById(id)); |
| | |
| | | return AjaxResult.ok(accountingStrategyService.removeByIds(ids)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(tags = {"管理后台-站点管理"},value = "获取平台添加的计费策略") |
| | | @DeleteMapping(value = "/getPlatformAccountingStrategy") |
| | | public AjaxResult<List<TAccountingStrategyVO>> getPlatformAccountingStrategy(){ |
| | | List<TAccountingStrategyVO> list = accountingStrategyService.getPlatformAccountingStrategy(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | | |