From 1b0c0ebcc29f5fb52f1fbc48573c6b1e35c144b0 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Wed, 13 Dec 2023 18:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/entity/VideoConfigEntity.java | 41 ++++++++++++++++++++++ .../controller/StationVideoTypeController.java | 41 ++++++++++++++++++++++ .../station/mapper/VideoConfigMapper.java | 12 +++++++ .../station/mapper/VideoConfigMapper.xml | 20 +++++++++++ .../station/service/VideoConfigService.java | 13 +++++++ .../service/impl/VideoConfigServiceImpl.java | 17 +++++++++ 6 files changed, 144 insertions(+) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/VideoConfigEntity.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.xml create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoConfigService.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoConfigServiceImpl.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/VideoConfigEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/VideoConfigEntity.java new file mode 100644 index 0000000..ba036c6 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/VideoConfigEntity.java @@ -0,0 +1,41 @@ +package com.hnac.hzims.operational.station.entity; + +import com.baomidou.mybatisplus.annotation.SqlCondition; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.tenant.mp.TenantEntity; + +@Data +@TableName("hzims_flv_video_config") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "视频配置对象", description = "视频配置表") +public class VideoConfigEntity extends TenantEntity { + + private static final long serialVersionUID = 8694213320261034807L; + + @QueryField(condition = SqlCondition.LIKE) + @ApiModelProperty("视频源配置名称") + private String name; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty("时间间隔") + private String time; + + @QueryField(condition = SqlCondition.LIKE) + @ApiModelProperty("配置json") + private String configEntity; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty("视频类型") + private String type; + + @QueryField(condition = SqlCondition.EQUAL) + @ApiModelProperty("保存人姓名") + private String savePeople; +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java index 8647c33..45f0e90 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java @@ -3,6 +3,7 @@ package com.hnac.hzims.operational.station.controller; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; @@ -11,10 +12,12 @@ import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.operational.station.dto.StationVideoTypeDTO; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity; +import com.hnac.hzims.operational.station.entity.VideoConfigEntity; import com.hnac.hzims.operational.station.response.HikDeviceResp; import com.hnac.hzims.operational.station.response.HikMonitorResp; import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationVideoTypeService; +import com.hnac.hzims.operational.station.service.VideoConfigService; import com.hnac.hzims.operational.station.utils.ArtemisPostUtils; import com.hnac.hzims.operational.station.vo.StationVO; import com.hnac.hzims.operational.station.vo.StationVideoTypeVO; @@ -56,6 +59,7 @@ public class StationVideoTypeController extends BladeController { private final ISysClient sysClient; private final IStationService stationService; + private final VideoConfigService videoConfigService; /** 秘钥appKey **/ @Value("${hzims.videoProperties.appKey}") @@ -233,6 +237,43 @@ public class StationVideoTypeController extends BladeController { page.getRecords().forEach(getFlvVideo); return R.data(page); } + + @ApiLog + @GetMapping("/getFlvVideoConfig") + @ApiOperationSupport(order = 120) + @ApiOperation(value = "获取Flv配置列表", notes = "获取Flv配置列表") + public R getFlvVideoConfig(VideoConfigEntity req,Query query) { + LambdaQueryWrapper queryWrapper = com.hnac.hzims.common.utils.Condition.getQueryWrapper(VideoConfigEntity.class, req); + IPage page = videoConfigService.page(com.hnac.hzims.common.utils.Condition.getPage(query), queryWrapper); + return R.data(page); + } + @ApiLog + @PostMapping ("/updateFlvVideoConfig") + @ApiOperationSupport(order = 120) + @ApiOperation(value = "更新Flv配置列表", notes = "更新Flv配置列表") + public R updateFlvVideoConfig(@RequestBody VideoConfigEntity req) { + if (ObjectUtil.isNotEmpty(req)) { + boolean b = videoConfigService.saveOrUpdate(req); + if (b) { + return R.success("更新视频配置成功"); + } + } + return R.fail("更新视频配置失败"); + } + @ApiLog + @PostMapping("/deleteFlvVideoConfig") + @ApiOperationSupport(order = 120) + @ApiOperation(value = "删除Flv配置列表", notes = "删除Flv配置列表") + public R deleteFlvVideoConfig(@RequestBody List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + boolean flag = videoConfigService.removeByIds(ids); + if (flag) { + return R.success("删除成功"); + } + } + return R.fail("删除失败"); + } + @ApiLog @GetMapping("/getMonitorsByStation") @ApiOperationSupport(order = 130) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.java new file mode 100644 index 0000000..a9b2c78 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.operational.station.mapper; + +import com.hnac.hzims.operational.station.entity.VideoConfigEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + + +/** + * @author ty + */ +public interface VideoConfigMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.xml new file mode 100644 index 0000000..cd7d542 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/VideoConfigMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoConfigService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoConfigService.java new file mode 100644 index 0000000..64f74a8 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoConfigService.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.operational.station.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.operational.station.entity.VideoConfigEntity; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/8/8 16:14 + */ +public interface VideoConfigService extends IService { +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoConfigServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoConfigServiceImpl.java new file mode 100644 index 0000000..5e85fc2 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoConfigServiceImpl.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.operational.station.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.operational.station.entity.VideoConfigEntity; +import com.hnac.hzims.operational.station.mapper.VideoConfigMapper; +import com.hnac.hzims.operational.station.service.VideoConfigService; +import org.springframework.stereotype.Service; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/8/8 16:17 + */ +@Service +public class VideoConfigServiceImpl extends ServiceImpl implements VideoConfigService { +}