localizer
lzq 2025-10-25 17:11:43 +08:00
parent ea863e731a
commit fa8bffe040
2 changed files with 25 additions and 7 deletions

View File

@ -71,30 +71,32 @@ public class SupervisionStatisticsService {
.thenApply(dataStatistics -> {
Double todayTotalWeight = MapUtil.getDouble(dataStatistics, "todayTotalWeight", 0.0);
Double yesterdayTotalWeight = MapUtil.getDouble(dataStatistics, "yesterdayTotalWeight", 0.0);
Double dayRate = yesterdayTotalWeight == 0 ? 100 : (todayTotalWeight - yesterdayTotalWeight) / yesterdayTotalWeight * 100;
Double dayRate = yesterdayTotalWeight == 0 ? 0 : (todayTotalWeight - yesterdayTotalWeight) / yesterdayTotalWeight * 100;
Double currentMonthTotalWeight = MapUtil.getDouble(dataStatistics, "currentMonthTotalWeight", 0.0);
Double lastMonthTotalWeight = MapUtil.getDouble(dataStatistics, "lastMonthTotalWeight", 0.0);
Double monthRate = lastMonthTotalWeight == 0 ? 100 : (currentMonthTotalWeight - lastMonthTotalWeight) / lastMonthTotalWeight * 100;
Double monthRate = lastMonthTotalWeight == 0 ? 0 : (currentMonthTotalWeight - lastMonthTotalWeight) / lastMonthTotalWeight * 100;
Double todayFinishCount = MapUtil.getDouble(dataStatistics, "todayFinishCount", 0.0);
Double todayTotalCount = MapUtil.getDouble(dataStatistics, "todayTotalCount", 0.0);
Double todayFinishRate = todayTotalCount == 0 ? 100 : todayFinishCount / todayTotalCount * 100;
Double todayFinishRate = todayTotalCount == 0 ? 0 : todayFinishCount / todayTotalCount * 100;
Double yesterdayFinishCount = MapUtil.getDouble(dataStatistics, "yesterdayFinishCount", 0.0);
// Double yesterdayTotalCount = MapUtil.getDouble(dataStatistics, "yesterdayTotalCount", 0.0);
// Double yesterdayFinishRate = yesterdayFinishCount == 0 ? 100 : yesterdayFinishCount / yesterdayTotalCount * 100;
Double incFinishRate = yesterdayFinishCount == 0 ? 100 : (todayFinishCount - yesterdayFinishCount) / yesterdayFinishCount * 100;
Double incFinishRate = yesterdayFinishCount == 0 ? 0 : (todayFinishCount - yesterdayFinishCount) / yesterdayFinishCount * 100;
Double todayWarnCount = MapUtil.getDouble(dataStatistics, "todayWarnCount", 0.0);
Double yesterdayWarnCount = MapUtil.getDouble(dataStatistics, "yesterdayWarnCount", 0.0);
Double warnRate = yesterdayWarnCount == 0 ? 100 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 100;
Double warnRate = todayTotalCount == 0 ? 0 : todayWarnCount / todayTotalCount * 100;
Double incWarnRate = yesterdayWarnCount == 0 ? 0 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 100;
dataStatistics.put("dayRate", dayRate);
dataStatistics.put("monthRate", monthRate);
dataStatistics.put("finishRate", todayFinishRate);
dataStatistics.put("incFinishRate", incFinishRate);
dataStatistics.put("warnRate", warnRate);
dataStatistics.put("incWarnRate", incWarnRate);
return dataStatistics;
})
.exceptionally(ex -> {

View File

@ -190,7 +190,15 @@
LIMIT #{count}
</select>
<select id="baseInfo" resultType="java.util.Map">
SELECT biz_obj bizObj, COUNT(*) `count`
SELECT biz_obj bizObj,
case biz_obj
when 'WuYe' then '物业'
when 'SheQu' then '社区'
when 'QiYe' then '企业'
when 'GeTi' then '个体户'
else ''
end bizObjTxt,
COUNT(*) `count`
FROM sys_user
WHERE biz_obj IN (
'WuYe',
@ -282,7 +290,15 @@
LIMIT 50
</select>
<select id="warningInfo" resultType="java.util.Map">
SELECT warn_category warnCategory, count(*) `count`
SELECT warn_category warnCategory,
case warn_category
when 'SAFETY' then '订单超时预警'
when 'SPEED' then '车辆超速预警'
when 'ROUTE' then '路线偏离预警'
when 'EQUIPMENT' then 'GPS异常预警'
else ''
end warnCategoryTxt,
count(*) `count`
FROM biz_warn
GROUP BY warn_category
</select>