From 9a42354bca3999bdc713323b64cf24e21fe9b817 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 3 Sep 2024 15:42:16 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=AE=9E=E6=97=B6=E7=94=BB=E9=9D=A2&=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E9=85=8D=E7=BD=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/controller/StationFrameRecordController.java | 9 +++++++-- .../station/controller/StationVideoRecordController.java | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java index 482c337..7af76ec 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java @@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -39,10 +40,14 @@ public class StationFrameRecordController extends BladeController { @ApiOperation(value = "查询站点视频播放保存记录", notes = "传入VideoRecordEntity") public R query(@RequestParam("stationId") String stationId, @RequestParam("userId") String userId) { - return R.data(frameRecordService.getOne(Wrappers.lambdaQuery() + FrameRecordEntity frameRecord = frameRecordService.getOne(Wrappers.lambdaQuery() .eq(FrameRecordEntity::getStationId,stationId) .eq(FrameRecordEntity::getCreateUser,userId) - )); + ); + if(ObjectUtil.isEmpty(frameRecord)){ + return R.status(true); + } + return R.data(frameRecord); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java index 722dc2c..878aca0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -37,10 +38,14 @@ public class StationVideoRecordController extends BladeController { @ApiOperation(value = "查询站点视频播放保存记录", notes = "传入VideoRecordEntity") public R query(@RequestParam("stationId") String stationId, @RequestParam("userId") String userId) { - return R.data(videoRecordService.getOne(Wrappers.lambdaQuery() + VideoRecordEntity videoRecord = videoRecordService.getOne(Wrappers.lambdaQuery() .eq(VideoRecordEntity::getStationId,stationId) .eq(VideoRecordEntity::getCreateUser,userId) - )); + ); + if(ObjectUtil.isEmpty(videoRecord)){ + return R.status(true); + } + return R.data(videoRecord); }