From 8ba93b74ace8866f8dc5ab0d51ff0943008346ba Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Sun, 10 Nov 2024 10:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/config/SecurityConfig.java | 1 + .../main/java/com/ruoyi/system/domain/vo/IndexVo.java | 3 +++ .../system/service/impl/AsDeviceServiceImpl.java | 2 +- .../ruoyi/system/service/impl/EtOrderServiceImpl.java | 11 +++++++++++ .../main/resources/mapper/system/AsDeviceMapper.xml | 3 ++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/electripper-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/electripper-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 5a7fe54..b568545 100644 --- a/electripper-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/electripper-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -120,6 +120,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter "/appCodeLogin", "/app/**", "/appVerify/**", + "/getToken", "/common/upload", "/common/receive", "/payment/callback/**", diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexVo.java b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexVo.java index 71fbf72..cf92d8b 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexVo.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/IndexVo.java @@ -102,6 +102,9 @@ public class IndexVo { /** 已离线 */ private Integer offlineNum; + /** 全部离线设备 */ + private Integer allOfflineNum; + /** 正常待租 */ private Integer normalNum; diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index 27ace8f..c1fd625 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -810,7 +810,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i wrapperForOffline.eq("area_id",areaId); } Integer allOfflineNum = asDeviceMapper.selectCount(wrapperForOffline); - deviceNumVo.setOfflineNum(allOfflineNum);//全部离线数 + deviceNumVo.setAllOfflineNum(allOfflineNum);//全部离线数 wrapperForOffline.ne("status","0"); diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java index a651891..84cf38e 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java @@ -950,6 +950,12 @@ public class EtOrderServiceImpl implements IEtOrderService String endDateStr = formattedDate + " " + Constants.DATE_FORMAT_END_PEREND; IndexVo.OrderFeeStatisticsVo todayOrderInfo = getOrderFeeStatistics(startDateStr, endDateStr, areaId); log.info("【首页统计】营收统计----------todayOrderInfo: {}" , JSON.toJSON(todayOrderInfo)); + + // 如果 orderNum 或 income 为 0,跳过当前循环 + if (todayOrderInfo.getOrderCount() == 0 && todayOrderInfo.getIncomeFee().compareTo(BigDecimal.ZERO) == 0) { + continue; + } + IndexVo.IncomeVo incomeVo = new IndexVo.IncomeVo(); incomeVo.setDay(formattedDate); incomeVo.setOrderNum(todayOrderInfo.getOrderCount()); @@ -2361,6 +2367,11 @@ public class EtOrderServiceImpl implements IEtOrderService IndexVo.OrderFeeStatisticsVo todayOrderInfo = getOrderFeeStatisticsByDeptId(startDateStr, endDateStr, areaIds); log.info("【获取营收统计】营收统计----------todayOrderInfo: {}" , JSON.toJSON(todayOrderInfo)); + // 如果 orderNum 或 income 为 0,跳过当前循环 + if (todayOrderInfo.getOrderCount() == 0 && todayOrderInfo.getIncomeFee().compareTo(BigDecimal.ZERO) == 0) { + continue; + } + // 构建收入统计对象 IndexVo.IncomeVo incomeVo = new IndexVo.IncomeVo(); incomeVo.setDay(formattedDate); diff --git a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml index 201fe75..d8ef000 100644 --- a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml @@ -43,7 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, area_id, activation_time, online_status, create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, - lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking,signal_strength, satellites, quality, appid, app_name, dept_id from et_device + lock_status, location, remaining_power, voltage, qrcode, longitude, latitude, is_area_out_outage, is_admin_unlocking, + signal_strength, satellites, quality, appid, app_name, dept_id from et_device