|
@@ -45,6 +45,7 @@ import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -755,7 +756,16 @@ public class TrialDetectionController extends BladeController {
|
|
|
dto.setMeasuringRange(deviceInfo.getMeasuringRange());
|
|
|
dto.setAccuracy(deviceInfo.getAccuracy());
|
|
|
// 计算使用时长
|
|
|
- dto.setUseDuration(DateUtils.dateDiff(dto.getStartDate(), dto.getEndDate()));
|
|
|
+ if (dto.getStartDate() != null && dto.getEndDate() != null) {
|
|
|
+ dto.setUseDuration(DateUtils.dateDiff(dto.getStartDate(), dto.getEndDate()));
|
|
|
+ }
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
|
|
+ if (dto.getStartDate() != null) {
|
|
|
+ dto.setUseEndTime(sdf.format(dto.getStartDate()));
|
|
|
+ }
|
|
|
+ if (dto.getEndDate() != null) {
|
|
|
+ dto.setUseStartTime(sdf.format(dto.getEndDate()));
|
|
|
+ }
|
|
|
trailDeviceUseInfoDTOS.add(dto);
|
|
|
}
|
|
|
});
|