From b31091da56446f57d21c41d009ce7b55a70a9789 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 19 六月 2025 11:59:31 +0800
Subject: [PATCH] 优化报警

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java
index 21a4db0..4926202 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java
@@ -185,6 +185,11 @@
 						warn.setTreatmentState("将来处理");
 						break;
 				}
+			}
+			if(null == warn.getPicUrl()){
+				warn.setPicUrl(vo.getPicUrl());
+			}
+			if(null == warn.getTreatmentTime()){
 				UPWarnMsgOperationInfoVo upWarnMsgOperationInfoVo = upWarnMsgOperationInfoClient.getUPWarnMsgOperationInfo(warn.getObjectId()).getData();
 				if(null != upWarnMsgOperationInfoVo){
 					warn.setTreatmentUser(upWarnMsgOperationInfoVo.getOperator());
@@ -207,9 +212,6 @@
 							break;
 					}
 				}
-			}
-			if(null == warn.getPicUrl()){
-				warn.setPicUrl(vo.getPicUrl());
 			}
 			this.updateById(warn);
 		}
@@ -304,7 +306,7 @@
 			if(total == 0){
 				map.put("rate", BigDecimal.ZERO);
 			}else{
-				map.put("rate", BigDecimal.valueOf(processed / total * 100).setScale(2, RoundingMode.HALF_EVEN));
+				map.put("rate", new BigDecimal(processed).divide(new BigDecimal(total), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN));
 			}
 		}
 		return allWarnGroupVehicleType;

--
Gitblit v1.7.1