| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | 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.api.vo.ChargingGunCountVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | |
| | | import com.ruoyi.chargingPile.mapper.TChargingGunMapper; |
| | | import com.ruoyi.chargingPile.service.IPartnerService; |
| | | 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.enums.status.ChargingGunStatusEnum; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | @Autowired |
| | | private TChargingPileService chargingPileService; |
| | | |
| | | |
| | | |
| | |
| | | @Override |
| | | public Map<String, ChargingGunCountVO> getChargingGunCount(Integer siteId) { |
| | | Map<String, ChargingGunCountVO> map = new HashMap<>(4); |
| | | //查询充电桩 |
| | | List<TChargingPile> pileList = chargingPileService.list(Wrappers.lambdaQuery(TChargingPile.class) |
| | | .eq(TChargingPile::getSiteId, siteId)); |
| | | if(CollectionUtils.isEmpty(pileList)){ |
| | | map.put("superSufficient", new ChargingGunCountVO(0,0)); |
| | | map.put("fastSufficient", new ChargingGunCountVO(0,0)); |
| | | map.put("slowSufficient", new ChargingGunCountVO(0,0)); |
| | | map.put("totalSufficient", new ChargingGunCountVO(0,0)); |
| | | return map; |
| | | } |
| | | Set<Integer> pileIds = pileList.stream().map(TChargingPile::getId).collect(Collectors.toSet()); |
| | | // 查询全部充电枪 |
| | | List<TChargingGun> list = this.list(Wrappers.lambdaQuery(TChargingGun.class).eq(TChargingGun::getSiteId, siteId)); |
| | | List<TChargingGun> list = this.list(Wrappers.lambdaQuery(TChargingGun.class).eq(TChargingGun::getSiteId, siteId) |
| | | .in(TChargingGun::getChargingPileId, pileIds)); |
| | | int freeCount = 0; |
| | | // 超级充 |
| | | ChargingGunCountVO superSufficient = getGunCount(ChargingGunModeEnum.SUPER_SUFFICIENT.getCode(), list); |