| | |
| | | import com.ruoyi.chargingPile.dto.ChargingGunCountMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunMonitoring; |
| | | import com.ruoyi.chargingPile.dto.GetChargingGunMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingPileBatchBuildDTO; |
| | | import com.ruoyi.chargingPile.dto.ChargingPileImportDTO; |
| | | import com.ruoyi.chargingPile.dto.ChargingPileImportResultDTO; |
| | | import com.ruoyi.chargingPile.export.ChargingPileExport; |
| | |
| | | @RequiresPermissions(value = {"/chargingPile/export", "/chargingPile"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PutMapping("/export") |
| | | @Log(title = "??????????????", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "???????", tags = {"????-?????"}) |
| | | @Log(title = "【充电桩信息】导出充电桩数据", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "导出充电桩数据", tags = {"管理后台-充电桩信息"}) |
| | | public void export(@RequestBody PageChargingPileList page, HttpServletResponse response){ |
| | | List<PageChargingPileListDTO> records = chargingPileService.listChargingPileForExport(page); |
| | | List<ChargingPileExport> exports = records.stream().map(record -> { |
| | |
| | | return export; |
| | | }).collect(Collectors.toList()); |
| | | ExcelUtil<ChargingPileExport> util = new ExcelUtil<>(ChargingPileExport.class); |
| | | util.exportExcel(response, exports, "?????"); |
| | | util.exportExcel(response, exports, "充电桩数据"); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/importTemplate") |
| | | @ApiOperation(value = "?????????", tags = {"????-?????"}) |
| | | @ApiOperation(value = "下载充电桩导入模板", tags = {"管理后台-充电桩信息"}) |
| | | public void importTemplate(HttpServletResponse response){ |
| | | ExcelUtil<ChargingPileImportDTO> util = new ExcelUtil<>(ChargingPileImportDTO.class); |
| | | util.importTemplateExcel(response, "???????"); |
| | | util.importTemplateExcel(response, "充电桩导入模板"); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/import") |
| | | @Log(title = "??????????????", businessType = BusinessType.IMPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "???????", tags = {"????-?????"}) |
| | | @Log(title = "【充电桩信息】批量导入充电桩", businessType = BusinessType.IMPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "批量导入充电桩", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult importChargingPile(@RequestParam("file") MultipartFile file, |
| | | @RequestParam(value = "cover", defaultValue = "false") Boolean cover) throws Exception{ |
| | | ChargingPileImportResultDTO result = chargingPileService.importChargingPile(file, cover); |
| | | if(Boolean.TRUE.equals(result.getNeedConfirm())){ |
| | | return AjaxResult.warn("????????????", result); |
| | | return AjaxResult.warn("检测到重复设备编码,是否覆盖?", result); |
| | | } |
| | | if(result.getErrorCount() != null && result.getErrorCount() > 0){ |
| | | return AjaxResult.error("????????????", result); |
| | | return AjaxResult.error("导入失败,请检查错误信息", result); |
| | | } |
| | | return AjaxResult.success("????", result); |
| | | return AjaxResult.success("导入成功", result); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/batchBuild") |
| | | @Log(title = "【充电桩信息】批量建桩", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "批量建桩", tags = {"管理后台-充电桩信息"}) |
| | | public AjaxResult batchBuild(@RequestBody ChargingPileBatchBuildDTO dto){ |
| | | return AjaxResult.success("批量建桩成功", chargingPileService.batchBuildChargingPile(dto)); |
| | | } |
| | | @RequiresPermissions(value = {"/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |