Przeglądaj źródła

1.pagehelper的多数据源分页配置 2.返回的字段的基本数据类型和引用数据类型转换,如果获取不到返回null 3.最后一次化验时间和开始化验时间根据状态再返回

王苗苗 6 miesięcy temu
rodzic
commit
479871331f

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/business/res/DeviceRes.java

@@ -38,7 +38,7 @@ public class DeviceRes {
 
     private String beginAssayTime;//化验开始时间
 
-    private double assayProgress;//化验进度  计算
+    private Double assayProgress;//化验进度  计算
 
     private Double currentTemperature;//当前温度
 
@@ -48,9 +48,9 @@ public class DeviceRes {
 
     private int assayTotals;//检验总次数  聚合
 
-    private double passAssayRates;//合格率(质控样) 计算
+    private Double passAssayRates;//合格率(质控样) 计算
 
-    private double wasteLiquidAmounts;//废液产生总量  todo 待提供数据
+    private Double wasteLiquidAmounts;//废液产生总量  todo 待提供数据
 
 
 

+ 8 - 3
ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusinessServiceImpl.java

@@ -105,8 +105,13 @@ public class BusinessServiceImpl implements IBusinessService {
 
             //获取最新的一条化验明细数据
             ZAssayResult zAssayResult = zAssayResults.get(0);
-            deviceRes.setLastAssayTime(zAssayResult.getUpdateTime());
-            deviceRes.setBeginAssayTime(zAssayResult.getCreateTime());
+            //根据化验类型处理不同的数据
+            String assayStatus = deviceRes.getAssayStatus();
+            if("1".equals(assayStatus)){//离线
+                deviceRes.setLastAssayTime(zAssayResult.getUpdateTime());
+            }else if("2".equals(assayStatus)){//化验中
+                deviceRes.setBeginAssayTime(zAssayResult.getUpdateTime());
+            }
             deviceRes.setCurrentTemperature(zAssayResult.getResultWendu());
             deviceRes.setCurrentHumidity(zAssayResult.getResultShidu());
 
@@ -118,7 +123,7 @@ public class BusinessServiceImpl implements IBusinessService {
                     String stepNow = zAssay.getStepNow();
                     String stepTotal = zAssay.getStepTotal();
                     if(StringUtils.isBlank(stepNow) || StringUtils.isBlank(stepTotal) || "0".equals(stepNow) || "0".equals(stepTotal)){
-                        deviceRes.setAssayProgress(0);
+                        deviceRes.setAssayProgress(Double.valueOf("0"));
                     }else{
                         deviceRes.setAssayProgress(Double.parseDouble(stepNow)/Double.parseDouble(stepTotal));
                     }