| | |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategy; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.query.TChargingGunQuery; |
| | |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.mapper.TChargingGunMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | import com.ruoyi.chargingPile.service.TAccountingStrategyService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.common.core.enums.status.ChargingGunModeEnum; |
| | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | tChargingGunVO.setAuthUpdate(roleType == 1 ? true : partnerService.authMenu(objectId, siteId, SiteMenu.CHARGING_GUN_UPDATE)); |
| | | tChargingGunVO.setAuthViewRates(roleType == 1 ? true : partnerService.authMenu(objectId, siteId, SiteMenu.CHARGING_GUN_VIEW_RATES)); |
| | | if(null == tChargingGunVO.getAccountingStrategyId()){ |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(tChargingGunVO.getSiteId())).getData().get(0); |
| | | tChargingGunVO.setAccountingStrategyId(site.getAccountingStrategyId()); |
| | | List<Site> data = siteClient.getSiteByIds(Arrays.asList(tChargingGunVO.getSiteId())).getData(); |
| | | if(data.size() > 0){ |
| | | Site site = data.get(0); |
| | | tChargingGunVO.setAccountingStrategyId(site.getAccountingStrategyId()); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | |
| | | if(count > 0){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.save(dto); |
| | | TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId()); |
| | | dto.setFullNumber(chargingPile.getCode() + dto.getCode()); |
| | | this.save(dto); |
| | | |
| | | //下发硬件充电二维码 |
| | | String code_prefix = "https://mxcd.zhinenganguan.com?No="; |
| | | QrCodeDelivery qrCodeDelivery = new QrCodeDelivery(); |
| | | qrCodeDelivery.setCharging_pile_code(chargingPile.getCode()); |
| | | qrCodeDelivery.setCharging_gun_code(dto.getCode()); |
| | | qrCodeDelivery.setCode_format(1); |
| | | qrCodeDelivery.setPrefix_length(code_prefix.length()); |
| | | qrCodeDelivery.setCode_prefix(code_prefix); |
| | |
| | | if(null != one && !dto.getId().equals(one.getId())){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | this.updateById(dto); |
| | | TChargingPile chargingPile = chargingPileService.getById(dto.getChargingPileId()); |
| | | dto.setFullNumber(chargingPile.getCode() + dto.getCode()); |
| | | this.updateById(dto); |
| | | |
| | | //下发硬件充电二维码 |
| | | String code_prefix = "https://mxcd.zhinenganguan.com?No="; |
| | | QrCodeDelivery qrCodeDelivery = new QrCodeDelivery(); |
| | | qrCodeDelivery.setCharging_pile_code(chargingPile.getCode()); |
| | | qrCodeDelivery.setCharging_gun_code(dto.getCode()); |
| | | qrCodeDelivery.setCode_format(1); |
| | | qrCodeDelivery.setPrefix_length(code_prefix.length()); |
| | | qrCodeDelivery.setCode_prefix(code_prefix); |
| | |
| | | StatusModeStatisticsVO statusModeStatistics1 = this.baseMapper.getStatusModeStatistics(siteIds,1); |
| | | StatusModeStatisticsVO statusModeStatistics2 = this.baseMapper.getStatusModeStatistics(siteIds,2); |
| | | StatusModeStatisticsVO statusModeStatistics3 = this.baseMapper.getStatusModeStatistics(siteIds,3); |
| | | if (statusModeStatistics1==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(1); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics1 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics1); |
| | | if (statusModeStatistics2==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(2); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics2 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics2); |
| | | |
| | | if (statusModeStatistics3==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(3); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics3 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics3); |
| | | gunStatusStatisticsVO.setStatusModeStatistics(statusModeStatisticsVOS); |
| | | return gunStatusStatisticsVO; |