| | |
| | | |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingGunService chargingGunService; |
| | | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | |
| | | @Resource |
| | | private TFaultMessageService faultMessageService; |
| | | |
| | |
| | | return R.ok(chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .in(!siteIds.isEmpty(),TChargingPile::getSiteId,siteIds))); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/pageChargingPileList") |
| | | @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/addChargingPile") |
| | |
| | | public AjaxResult addChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingPile/{id}") |
| | | @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"}) |
| | |
| | | TChargingPile chargingPile = chargingPileService.getChargingPile(id); |
| | | return AjaxResult.success(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/editChargingPile") |
| | |
| | | public AjaxResult editChargingPile(@RequestBody TChargingPile chargingPile){ |
| | | return chargingPileService.editChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delChargingPile") |
| | | @Log(title = "【充电桩信息】删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE) |
| | |
| | | public AjaxResult delChargingPile(@RequestParam("id") Integer[] id){ |
| | | return chargingPileService.delChargingPile(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @Log(title = "【充电桩信息】批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | | @PostMapping("/batchSetAccountingStrategy") |
| | |
| | | chargingPileService.batchSetAccountingStrategy(setAccountingStrategy); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/chargeMonitoring/{siteId}") |
| | | @ApiOperation(value = "获取充电设施监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | ChargingGunCountMonitoring chargingGunCountMonitoring = chargingPileService.getChargingGunCountMonitoring(siteId); |
| | | return AjaxResult.success(chargingGunCountMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getChargingGunMonitoring") |
| | | @ApiOperation(value = "获取充电枪监控数据", tags = {"管理后台-充电设备监控"}) |
| | |
| | | PageInfo<ChargingGunMonitoring> chargingGunMonitoring = chargingPileService.getChargingGunMonitoring(query); |
| | | return AjaxResult.success(chargingGunMonitoring); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取充电桩信息 |
| | | * @param id |
| | |
| | | TChargingPile chargingPile = chargingPileService.getById(id); |
| | | return R.ok(chargingPile); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 更新充电桩状态 |
| | | * @param code |
| | |
| | | TChargingPile chargingPile = chargingPileService.getOne(new LambdaQueryWrapper<TChargingPile>() |
| | | .eq(TChargingPile::getCode, code).eq(TChargingPile::getDelFlag, 0)); |
| | | if(null != chargingPile){ |
| | | if(chargingPile.getStatus() == 1){ |
| | | //充电桩正常,返回异常,处理充电桩状态和添加故障记录 |
| | | if(chargingPile.getStatus() == 1 && 1 == status){ |
| | | TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()) |
| | | .eq(TFaultMessage::getStatus, 2).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); |
| | | if(null == faultMessage){ |
| | |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备故障"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | } |
| | |
| | | one.setEndTime(LocalDateTime.now()); |
| | | faultMessageService.updateById(one); |
| | | } |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | } |
| | | if(0 == status){ |
| | | redisService.getCacheMap("charging_pile_online").put(code, System.currentTimeMillis()); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_pile_online"); |
| | | charging_pile_online.put(code, System.currentTimeMillis()); |
| | | redisService.setCacheMap("charging_pile_online", charging_pile_online); |
| | | } |
| | | } |
| | | } |