| | |
| | | public PageInfo<Site> getSiteListPaging(@RequestParam("PageNo") Integer PageNo, @RequestParam("PageSize") Integer PageSize, |
| | | @RequestParam("ids") List<String> ids){ |
| | | PageInfo<Site> pageInfo = new PageInfo<>(PageNo, PageSize); |
| | | PageInfo<Site> page = siteService.lambdaQuery().eq(Site::getStatus, 1).in(ids.size() > 0, Site::getId, ids).page(pageInfo); |
| | | PageInfo<Site> page = siteService.lambdaQuery().eq(Site::getStatus, 1).in(ids.size() > 0, Site::getId, ids) |
| | | .ne(Site::getSiteType, 2).page(pageInfo); |
| | | return page; |
| | | } |
| | | } |
| | |
| | | Integer status = vo.getStatus(); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_gun_online"); |
| | | Long time = (Long) charging_pile_online.get(pile_code + gun_code); |
| | | //小于30秒才处理数据,防止频繁查询数据 |
| | | if(null != time && (System.currentTimeMillis() - time) < 30000){ |
| | | //小于1分钟才处理数据,防止频繁查询数据 |
| | | if(null != time && (System.currentTimeMillis() - time) < 60000){ |
| | | return; |
| | | } |
| | | TChargingGun tChargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, (pile_code + gun_code)).eq(TChargingGun::getDelFlag, 0)); |
| | |
| | | } |
| | | for (TChargingGun chargingGun : list) { |
| | | Long time = (Long) charging_gun_online.get(chargingGun.getFullNumber()); |
| | | //判断设备是否真的脸1分钟(1分钟+代码中的30秒间隔处理存储) |
| | | if(null != time && System.currentTimeMillis() - time > 90000){ |
| | | //判断设备是否真的离线3分钟(2分钟+代码中的60秒间隔处理存储) |
| | | if(null != time && System.currentTimeMillis() - time > 180000){ |
| | | TChargingGun chargingGun1 = new TChargingGun(); |
| | | chargingGun1.setId(chargingGun.getId()); |
| | | chargingGun1.setStatus(1); |
| | |
| | | |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | * 每隔2分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | @Scheduled(fixedRate = 120000) |
| | | public void taskMinute(){ |
| | | chargingPileService.updateStatus(); |
| | | } |
| | |
| | | BigDecimal commissionAmount = BigDecimal.ZERO; |
| | | for (Map<String, Object> map : maps) { |
| | | BigDecimal periodElectricPrice = (BigDecimal) map.get("period_electric_price"); |
| | | allMoney = allMoney.add(periodElectricPrice); |
| | | Long order_source = (Long)map.get("order_source"); |
| | | if(2 != order_source){ |
| | | allMoney = allMoney.add(periodElectricPrice); |
| | | } |
| | | BigDecimal total_amount = (BigDecimal) map.get("total_amount"); |
| | | allMoney = allMoney.add(total_amount); |
| | | commissionAmount = commissionAmount.add((BigDecimal) map.get("commissionAmount")); |
| | |
| | | WHEN t2.order_source = 0 THEN 0 |
| | | WHEN t2.order_source = 1 THEN 0 |
| | | ELSE t1.period_service_price * 0.2 |
| | | END) AS commissionAmount |
| | | END) AS commissionAmount, |
| | | t2.order_source |
| | | FROM |
| | | t_charging_order_accounting_strategy t1 |
| | | LEFT JOIN t_charging_order t2 on t1.charging_order_id = t2.id |
| | |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | t1.type |
| | | t1.type, t2.order_source |
| | | </select> |
| | | <select id="getDateData" resultType="java.util.Map"> |
| | | SELECT |