Explorar o código

修复高低温阈值解决小数问题。

zhuoning %!s(int64=2) %!d(string=hai) anos
pai
achega
300adb377c

+ 2 - 1
huimv-env-platform/huimv-env-common/src/main/java/com/huimv/env/common/service/impl/TempThresholdServiceImpl.java

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Example;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Optional;
 
@@ -54,7 +55,7 @@ public class TempThresholdServiceImpl implements ITempThresholdService {
                 return "0";
             }else{
                 EnvTempThresholdEntity tempThresholdEntity = optional.get();
-                return tempThresholdEntity.getHighTemp()+"+"+tempThresholdEntity.getLowTemp();
+                return tempThresholdEntity.getHighTemp().multiply(new BigDecimal(10)).intValue()+"+"+tempThresholdEntity.getLowTemp().multiply(new BigDecimal(10)).intValue();
             }
 //        }
     }