diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java index de7d4dc..3759081 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/CommonUseController.java @@ -1,25 +1,19 @@ package com.hnac.hzims.history.controller; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; 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.vo.*; -import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO; -import com.hnac.hzinfo.sdk.v5.hzfac.vo.FacDeviceVO; +import com.hnac.hzims.history.vo.HistoryPointRecordParamVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; 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.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.Map; /** * @author ysj 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 91e8902..482c337 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 @@ -31,7 +31,7 @@ public class StationFrameRecordController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") public R submit(@Valid @RequestBody FrameRecordEntity entity) { - return R.status(frameRecordService.saveOrUpdate(entity)); + return R.status(frameRecordService.submit(entity)); } @GetMapping("/query") 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 679d6e1..722dc2c 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 @@ -29,7 +29,7 @@ public class StationVideoRecordController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增或修改站点视频播放保存记录", notes = "传入VideoRecordEntity") public R submit(@Valid @RequestBody VideoRecordEntity entity) { - return R.status(videoRecordService.saveOrUpdate(entity)); + return R.status(videoRecordService.submit(entity)); } @GetMapping("/query") diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java index f22ba35..b1fe4f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/FrameRecordService.java +++ b/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 */ public interface FrameRecordService extends IService { + boolean submit(FrameRecordEntity entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java index 88bba2b..015812e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/VideoRecordService.java +++ b/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 */ public interface VideoRecordService extends IService { + boolean submit(VideoRecordEntity entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java index 99408ed..1c509e4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/FrameRecordServiceImpl.java +++ b/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; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.FrameRecordEntity; import com.hnac.hzims.operational.station.entity.VideoRecordEntity; @@ -19,4 +21,17 @@ import org.springframework.stereotype.Service; @Slf4j public class FrameRecordServiceImpl extends ServiceImpl implements FrameRecordService { + @Override + public boolean submit(FrameRecordEntity entity) { + // 根据用户,站点查询历史配置记录 + FrameRecordEntity frameRecord = this.getOne(Wrappers.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); + } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java index 50cfb2a..bbf9442 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/UserDeptConfigServiceImpl.java +++ b/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; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.StationEntity; 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.service.IStationService; import com.hnac.hzims.operational.station.service.UserDeptConfigService; @@ -65,7 +67,16 @@ public class UserDeptConfigServiceImpl extends ServiceImpllambdaQuery() + .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 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java index d01994c..9eb47fe 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/VideoRecordServiceImpl.java +++ b/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; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.operational.station.entity.VideoRecordEntity; import com.hnac.hzims.operational.station.mapper.VideoRecordMapper; @@ -16,4 +18,22 @@ import org.springframework.stereotype.Service; @Slf4j public class VideoRecordServiceImpl extends ServiceImpl implements VideoRecordService { + /** + * 视频配置记录提交 + * @param entity + * @return + */ + @Override + public boolean submit(VideoRecordEntity entity) { + // 根据用户,站点查询历史配置记录 + VideoRecordEntity videoRecord = this.getOne(Wrappers.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); + } } \ No newline at end of file