|
@@ -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));
|
|
|
}
|