|
|
@@ -4,18 +4,19 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.Constants;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotDevice;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotDvrChannel;
|
|
|
import com.xunmei.common.core.domain.video.MediatorVideoDaysCheck;
|
|
|
+import com.xunmei.common.core.domain.video.MediatorVideoDaysCheckLog;
|
|
|
+import com.xunmei.common.core.domain.video.MediatorVideoIntegrityCheck;
|
|
|
+import com.xunmei.common.core.domain.video.MediatorVideoIntegrityCheckLog;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.mediator.api.mapper.VideoDaysCheckMapper;
|
|
|
-import com.xunmei.mediator.api.service.IIotDeviceService;
|
|
|
-import com.xunmei.mediator.api.service.IIotDvrChannelService;
|
|
|
-import com.xunmei.mediator.api.service.IVideoDaysCheckService;
|
|
|
-import com.xunmei.mediator.api.service.NorthErrorService;
|
|
|
+import com.xunmei.mediator.api.service.*;
|
|
|
import com.xunmei.system.api.domain.north.NorthError;
|
|
|
import com.xunmei.system.api.dto.protection.ReceiveErrorDto;
|
|
|
import com.xunmei.mediator.domain.dto.videoDaysCheck.VideoDaysCheckDto;
|
|
|
@@ -25,6 +26,7 @@ import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.domain.SysDevice;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
@@ -52,6 +54,9 @@ public class VideoDaysCheckServiceImpl extends ServiceImpl<VideoDaysCheckMapper,
|
|
|
@Resource
|
|
|
IIotDvrChannelService dvrChannelService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ IVideoDaysCheckLogService daysCheckLogService;
|
|
|
+
|
|
|
@Override
|
|
|
public ReceiveErrorDto saveData(VideoDaysCheckDto videoDaysCheckDto, String msgId, String branchId) {
|
|
|
if (null == videoDaysCheckDto) {
|
|
|
@@ -93,7 +98,7 @@ public class VideoDaysCheckServiceImpl extends ServiceImpl<VideoDaysCheckMapper,
|
|
|
MediatorVideoDaysCheck videoDaysCheck = new MediatorVideoDaysCheck();
|
|
|
|
|
|
//获取监控主机
|
|
|
- IotDevice hostDevice = iIotDeviceService.findByHostCode(videoDaysCheckDto.getEquipmentCode(),org.getId());
|
|
|
+ IotDevice hostDevice = iIotDeviceService.findByHostCode(videoDaysCheckDto.getEquipmentCode(), org.getId());
|
|
|
if (hostDevice != null) {
|
|
|
videoDaysCheck.setEquipmentName(hostDevice.getEquipmentName());
|
|
|
}
|
|
|
@@ -144,6 +149,7 @@ public class VideoDaysCheckServiceImpl extends ServiceImpl<VideoDaysCheckMapper,
|
|
|
return ReceiveErrorDto.success();
|
|
|
}
|
|
|
this.saveOrUpdate(videoDaysCheck);
|
|
|
+ saveLog(videoDaysCheck);
|
|
|
return ReceiveErrorDto.success();
|
|
|
}
|
|
|
|
|
|
@@ -157,4 +163,13 @@ public class VideoDaysCheckServiceImpl extends ServiceImpl<VideoDaysCheckMapper,
|
|
|
qw.last(Constants.LIMIT1);
|
|
|
return baseMapper.selectOne(qw);
|
|
|
}
|
|
|
+
|
|
|
+ private void saveLog(MediatorVideoDaysCheck daysCheck) {
|
|
|
+ MediatorVideoDaysCheckLog newLog = new MediatorVideoDaysCheckLog();
|
|
|
+ BeanUtils.copyProperties(daysCheck, newLog, "id");
|
|
|
+ newLog.setId(IdWorker.getId());
|
|
|
+ newLog.setVideoDaysCheckId(daysCheck.getId());
|
|
|
+ daysCheckLogService.save(newLog);
|
|
|
+
|
|
|
+ }
|
|
|
}
|