无关风月
2024-10-26 19c3024816a0aa7d0995d3108fff8cda4e1d5e38
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/SiteController.java
@@ -110,10 +110,8 @@
   @ApiOperation(value = "扫一扫后通过桩编号获取电站信息", tags = {"小程序-扫一扫"})
   public R<SiteInfoVO> getSiteInfoByNumber(@RequestParam("number") String number){
      SiteInfoVO siteInfoVO = new SiteInfoVO();
      String chargingPileCode = number.substring(0, number.length() - 2);
      String chargingGunCode = number.substring(number.length() - 2);
      TChargingPile one = chargingPileService.lambdaQuery().eq(TChargingPile::getCode, chargingPileCode).one();
      TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getCode, chargingGunCode).eq(TChargingGun::getChargingPileId, one.getId()));
      TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, number));
      TChargingPile one = chargingPileService.getById(chargingGun.getChargingPileId());
      Site byId = siteService.getById(one.getSiteId());
      TAccountingStrategy byId1 = accountingStrategyService.getById(byId.getAccountingStrategyId());
      List<TAccountingStrategyDetail> list = accountingStrategyDetailService.lambdaQuery().eq(TAccountingStrategyDetail::getAccountingStrategyId, byId1.getId()).list();
@@ -190,17 +188,17 @@
      siteList.setPageSize(99999);
      PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList);
      for (GetSiteListDTO record : list.getRecords()) {
         Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         record.setC1(count);
         Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count();
         Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count();
         record.setC2(count1);
         Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         record.setK1(count2);
         Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count();
         Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count();
         record.setK2(count3);
         Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count();
         record.setM1(count4);
         Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getChargingPileId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count();
         Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count();
         record.setM2(count5);
         //利用率