| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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; |
| | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.integration.api.feignClient.SendMessageClient; |
| | | import com.ruoyi.integration.api.model.QrCodeDelivery; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | |
| | | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | |
| | | @Resource |
| | | private SendMessageClient sendMessageClient; |
| | | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | tChargingGunVO.setAuthQueryInfo(roleType == 1 ? true : partnerService.authMenu(objectId, siteId, SiteMenu.CHARGING_GUN_QUERY_INFO)); |
| | | 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()){ |
| | | 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); |
| | | return pageInfo; |
| | |
| | | return ajaxResult; |
| | | } |
| | | long count = this.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()) |
| | | .eq(TChargingGun::getDelFlag, 0)); |
| | | .eq(TChargingGun::getDelFlag, 0).eq(TChargingGun::getChargingPileId, dto.getChargingPileId())); |
| | | if(count > 0){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | 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); |
| | | qrCodeDelivery.setQr_code(code_prefix + chargingPile.getCode() + dto.getCode()); |
| | | sendMessageClient.qrCodeDelivery(qrCodeDelivery); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | return ajaxResult; |
| | | } |
| | | TChargingGun one = this.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, dto.getCode()) |
| | | .eq(TChargingGun::getDelFlag, 0)); |
| | | .eq(TChargingGun::getDelFlag, 0).eq(TChargingGun::getChargingPileId, dto.getChargingPileId())); |
| | | if(null != one && !dto.getId().equals(one.getId())){ |
| | | return AjaxResult.error("接口编码已存在"); |
| | | } |
| | | 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); |
| | | qrCodeDelivery.setQr_code(code_prefix + chargingPile.getCode() + dto.getCode()); |
| | | sendMessageClient.qrCodeDelivery(qrCodeDelivery); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getStatus, 1)); |
| | | HashMap<String, Integer> objectObjectHashMap1 = new HashMap<>(); |
| | | objectObjectHashMap1.put("1", count.intValue()); |
| | | objectObjectHashMap1.put("charge_mode",1); |
| | | objectObjectHashMap1.put("modeCount", count.intValue()); |
| | | statusStatistics.add(objectObjectHashMap1); |
| | | // statusStatistics.put(1, count.intValue()); |
| | | // 故障 |
| | | count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getStatus, 7)); |
| | | HashMap<String, Integer> objectObjectHashMap2 = new HashMap<>(); |
| | | objectObjectHashMap2.put("2", count.intValue()); |
| | | // objectObjectHashMap2.put("2", count.intValue()); |
| | | objectObjectHashMap2.put("charge_mode",2); |
| | | objectObjectHashMap2.put("modeCount", count.intValue()); |
| | | statusStatistics.add(objectObjectHashMap2); |
| | | |
| | | // statusStatistics.put(2, count.intValue()); |
| | |
| | | count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .in(TChargingGun::getStatus, Arrays.asList(3,4,5,6))); |
| | | HashMap<String, Integer> objectObjectHashMap = new HashMap<>(); |
| | | objectObjectHashMap.put("3", count.intValue()); |
| | | objectObjectHashMap.put("charge_mode",3); |
| | | objectObjectHashMap.put("modeCount", count.intValue()); |
| | | statusStatistics.add(objectObjectHashMap); |
| | | |
| | | // statusStatistics.put(3, count.intValue()); |