| | |
| | | public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){ |
| | | SiteInfoVO siteInfoVO = new SiteInfoVO(); |
| | | TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, number)); |
| | | Site site = siteService.getById(chargingGun.getSiteId()); |
| | | Integer accountingStrategyId = chargingGun.getAccountingStrategyId(); |
| | | if(null == accountingStrategyId){ |
| | | accountingStrategyId = site.getAccountingStrategyId(); |
| | | } |
| | | TChargingPile one = chargingPileService.getById(chargingGun.getChargingPileId()); |
| | | Site byId = siteService.getById(chargingGun.getSiteId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(chargingGun.getAccountingStrategyId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(accountingStrategyId); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list(); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { |
| | |
| | | } |
| | | siteInfoVO.setChargingGunId(chargingGun.getId()); |
| | | siteInfoVO.setChargingPileId(one.getId()); |
| | | siteInfoVO.setName(byId.getName()); |
| | | siteInfoVO.setName(site.getName()); |
| | | siteInfoVO.setNumber(one.getNumber().toString()); |
| | | siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain()); |
| | | siteInfoVO.setSpaceChargeExplain(site.getSpaceChargeExplain()); |
| | | return R.ok(siteInfoVO); |
| | | } |
| | | /** |
| | |
| | | public R<SiteInfoVO> getSiteInfoByNumber1(@RequestParam("number") String number){ |
| | | SiteInfoVO siteInfoVO = new SiteInfoVO(); |
| | | TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getCode, number).one(); |
| | | Site byId = siteService.getById(one.getSiteId()); |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId()); |
| | | TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, one.getId()).last(" limit 0, 1")); |
| | | Site site = siteService.getById(chargingGun.getSiteId()); |
| | | Integer accountingStrategyId = chargingGun.getAccountingStrategyId(); |
| | | if(null == accountingStrategyId){ |
| | | accountingStrategyId = site.getAccountingStrategyId(); |
| | | } |
| | | TAccountingStrategy byId1 = accountingStrategyService.getById(accountingStrategyId); |
| | | List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list(); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | for (TAccountingStrategyDetail tAccountingStrategyDetail : list) { |
| | |
| | | siteInfoVO.setCouponCount(num); |
| | | } |
| | | siteInfoVO.setChargingPileId(one.getId()); |
| | | siteInfoVO.setName(byId.getName()); |
| | | siteInfoVO.setName(site.getName()); |
| | | siteInfoVO.setNumber(one.getNumber().toString()); |
| | | siteInfoVO.setSpaceChargeExplain(byId.getSpaceChargeExplain()); |
| | | siteInfoVO.setSpaceChargeExplain(site.getSpaceChargeExplain()); |
| | | return R.ok(siteInfoVO); |
| | | } |
| | | |