Browse Source

#视频、实时画面配置功能

zhongwei
yang_shj 3 months ago
parent
commit
d1ec707976
  1. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java
  2. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java
  3. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java
  4. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java
  5. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java
  6. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java
  7. 13
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java
  8. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java

14
hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java

@ -1,25 +1,19 @@
package com.hnac.hzims.history.controller; package com.hnac.hzims.history.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.history.entity.HistoryPointRecordEntity; import com.hnac.hzims.history.entity.HistoryPointRecordEntity;
import com.hnac.hzims.history.entity.HistoryTemplateEntity;
import com.hnac.hzims.history.service.IHistoryDeviceService;
import com.hnac.hzims.history.service.IHistoryPointRecordService; import com.hnac.hzims.history.service.IHistoryPointRecordService;
import com.hnac.hzims.history.vo.*; import com.hnac.hzims.history.vo.HistoryPointRecordParamVo;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import com.hnac.hzinfo.sdk.v5.hzfac.vo.FacDeviceVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author ysj * @author ysj

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationFrameRecordController.java

@ -31,7 +31,7 @@ public class StationFrameRecordController extends BladeController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity")
public R submit(@Valid @RequestBody FrameRecordEntity entity) { public R submit(@Valid @RequestBody FrameRecordEntity entity) {
return R.status(frameRecordService.saveOrUpdate(entity)); return R.status(frameRecordService.submit(entity));
} }
@GetMapping("/query") @GetMapping("/query")

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoRecordController.java

@ -29,7 +29,7 @@ public class StationVideoRecordController extends BladeController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity")
public R submit(@Valid @RequestBody VideoRecordEntity entity) { public R submit(@Valid @RequestBody VideoRecordEntity entity) {
return R.status(videoRecordService.saveOrUpdate(entity)); return R.status(videoRecordService.submit(entity));
} }
@GetMapping("/query") @GetMapping("/query")

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java

@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.FrameRecordEntity;
* @author ysj * @author ysj
*/ */
public interface FrameRecordService extends IService<FrameRecordEntity> { public interface FrameRecordService extends IService<FrameRecordEntity> {
boolean submit(FrameRecordEntity entity);
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java

@ -7,4 +7,5 @@ import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
* @author ysj * @author ysj
*/ */
public interface VideoRecordService extends IService<VideoRecordEntity> { public interface VideoRecordService extends IService<VideoRecordEntity> {
boolean submit(VideoRecordEntity entity);
} }

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java

@ -1,5 +1,7 @@
package com.hnac.hzims.operational.station.service.impl; package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.FrameRecordEntity; import com.hnac.hzims.operational.station.entity.FrameRecordEntity;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity; import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
@ -19,4 +21,17 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class FrameRecordServiceImpl extends ServiceImpl<FrameRecordMapper, FrameRecordEntity> implements FrameRecordService { public class FrameRecordServiceImpl extends ServiceImpl<FrameRecordMapper, FrameRecordEntity> implements FrameRecordService {
@Override
public boolean submit(FrameRecordEntity entity) {
// 根据用户,站点查询历史配置记录
FrameRecordEntity frameRecord = this.getOne(Wrappers.<FrameRecordEntity>lambdaQuery()
.eq(FrameRecordEntity::getStationId,entity.getStationId())
.eq(FrameRecordEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(frameRecord)){
return this.save(entity);
}
entity.setId(frameRecord.getId());
return this.updateById(entity);
}
} }

13
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java

@ -1,9 +1,11 @@
package com.hnac.hzims.operational.station.service.impl; package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.entity.UserDeptConfigEntity; import com.hnac.hzims.operational.station.entity.UserDeptConfigEntity;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
import com.hnac.hzims.operational.station.mapper.UserDeptConfigMapper; import com.hnac.hzims.operational.station.mapper.UserDeptConfigMapper;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.service.UserDeptConfigService; import com.hnac.hzims.operational.station.service.UserDeptConfigService;
@ -65,7 +67,16 @@ public class UserDeptConfigServiceImpl extends ServiceImpl<UserDeptConfigMapper,
entity.setStationName(null); entity.setStationName(null);
} }
return super.saveOrUpdate(entity); // 检查记录是否保存
UserDeptConfigEntity userDeptConfig = this.getOne(Wrappers.<UserDeptConfigEntity>lambdaQuery()
.eq(UserDeptConfigEntity::getStationId,entity.getStationId())
.eq(UserDeptConfigEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(userDeptConfig)){
return this.save(entity);
}
entity.setId(userDeptConfig.getId());
return this.updateById(entity);
} }
@Override @Override

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java

@ -1,5 +1,7 @@
package com.hnac.hzims.operational.station.service.impl; package com.hnac.hzims.operational.station.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.operational.station.entity.VideoRecordEntity; import com.hnac.hzims.operational.station.entity.VideoRecordEntity;
import com.hnac.hzims.operational.station.mapper.VideoRecordMapper; import com.hnac.hzims.operational.station.mapper.VideoRecordMapper;
@ -16,4 +18,22 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class VideoRecordServiceImpl extends ServiceImpl<VideoRecordMapper, VideoRecordEntity> implements VideoRecordService { public class VideoRecordServiceImpl extends ServiceImpl<VideoRecordMapper, VideoRecordEntity> implements VideoRecordService {
/**
* 视频配置记录提交
* @param entity
* @return
*/
@Override
public boolean submit(VideoRecordEntity entity) {
// 根据用户,站点查询历史配置记录
VideoRecordEntity videoRecord = this.getOne(Wrappers.<VideoRecordEntity>lambdaQuery()
.eq(VideoRecordEntity::getStationId,entity.getStationId())
.eq(VideoRecordEntity::getCreateUser,entity.getCreateUser())
);
if(ObjectUtils.isEmpty(videoRecord)){
return this.save(entity);
}
entity.setId(videoRecord.getId());
return this.updateById(entity);
}
} }
Loading…
Cancel
Save