| | |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordPageInfoVO; |
| | | import com.ruoyi.chargingPile.api.vo.TParkingRecordVO; |
| | | import com.ruoyi.chargingPile.domain.SiteMenu; |
| | | import com.ruoyi.chargingPile.dto.ParkingRecordQueryDto; |
| | | import com.ruoyi.chargingPile.mapper.SiteMapper; |
| | | import com.ruoyi.chargingPile.mapper.TParkingLotMapper; |
| | | import com.ruoyi.chargingPile.mapper.TParkingRecordMapper; |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Override |
| | | public TParkingRecordPageInfoVO pageList(ParkingRecordQuery query) { |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | // 查询站点的停车场id |
| | | if(Objects.nonNull(query.getSiteId())){ |
| | | Site site = siteMapper.selectById(query.getSiteId()); |
| | |
| | | List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class) |
| | | .eq(TParkingLot::getSiteId, site.getId())); |
| | | List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(lotIds)){ |
| | | TParkingRecordPageInfoVO tParkingRecordPageInfoVO = new TParkingRecordPageInfoVO(); |
| | | tParkingRecordPageInfoVO.setParkingRecordVOS(new PageInfo<TParkingRecordVO>()); |
| | | return tParkingRecordPageInfoVO; |
| | | } |
| | | query.setLotIds(lotIds); |
| | | } |
| | | |
| | | } |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | // 查询总数 |
| | |
| | | infoVO.setParkingRecordVOS(pageInfo); |
| | | return infoVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> parkingData(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.parkingData(parkingRecordQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> parkingDataByDate(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.parkingDataByDate(parkingRecordQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getCarColor(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.getCarColor(parkingRecordQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getOutType(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.getOutType(parkingRecordQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getIsCharge(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.getIsCharge(parkingRecordQueryDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> income(ParkingRecordQueryDto parkingRecordQueryDto) { |
| | | return this.baseMapper.income(parkingRecordQueryDto); |
| | | } |
| | | } |