package com.ard.work.inspect.service.impl;
|
|
import java.util.Collections;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.stream.Collectors;
|
|
import com.ard.common.core.utils.uuid.IdUtils;
|
import com.ard.common.datascope.annotation.DataScope;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.ard.work.inspect.mapper.ArdVideoInspectRecordMapper;
|
import com.ard.work.inspect.domain.ArdVideoInspectRecord;
|
import com.ard.work.inspect.service.IArdVideoInspectRecordService;
|
|
/**
|
* 视频巡检记录Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2024-09-12
|
*/
|
@Service
|
public class ArdVideoInspectRecordServiceImpl implements IArdVideoInspectRecordService {
|
@Autowired
|
private ArdVideoInspectRecordMapper ardVideoInspectRecordMapper;
|
|
/**
|
* 查询视频巡检记录
|
*
|
* @param id 视频巡检记录主键
|
* @return 视频巡检记录
|
*/
|
@Override
|
public ArdVideoInspectRecord selectArdVideoInspectRecordById(String id) {
|
return ardVideoInspectRecordMapper.selectArdVideoInspectRecordById(id);
|
}
|
|
/**
|
* 查询视频巡检记录列表
|
*
|
* @param ardVideoInspectRecord 视频巡检记录
|
* @return 视频巡检记录
|
*/
|
@Override
|
@DataScope(deptAlias = "d", userAlias = "u")
|
public List<ArdVideoInspectRecord> selectArdVideoInspectRecordList(ArdVideoInspectRecord ardVideoInspectRecord) {
|
//return ardVideoInspectRecordMapper.selectArdVideoInspectRecordList(ardVideoInspectRecord);
|
List<ArdVideoInspectRecord> result = ardVideoInspectRecordMapper.selectArdVideoInspectRecordList(ardVideoInspectRecord);
|
result = result.stream().filter(ardVideoInspectRecord0 -> ardVideoInspectRecord0.getRecordUrl() != null).collect(Collectors.toList());
|
result = result.stream().filter(ardVideoInspectRecord0 -> !"".equals(ardVideoInspectRecord0.getRecordUrl())).collect(Collectors.toList());
|
return result;
|
}
|
|
/**
|
* 新增视频巡检记录
|
*
|
* @param ardVideoInspectRecord 视频巡检记录
|
* @return 结果
|
*/
|
@Override
|
public int insertArdVideoInspectRecord(ArdVideoInspectRecord ardVideoInspectRecord) {
|
ardVideoInspectRecord.setId(IdUtils.simpleUUID());
|
return ardVideoInspectRecordMapper.insertArdVideoInspectRecord(ardVideoInspectRecord);
|
}
|
|
/**
|
* 修改视频巡检记录
|
*
|
* @param ardVideoInspectRecord 视频巡检记录
|
* @return 结果
|
*/
|
@Override
|
public int updateArdVideoInspectRecord(ArdVideoInspectRecord ardVideoInspectRecord) {
|
return ardVideoInspectRecordMapper.updateArdVideoInspectRecord(ardVideoInspectRecord);
|
}
|
|
/**
|
* 批量删除视频巡检记录
|
*
|
* @param ids 需要删除的视频巡检记录主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteArdVideoInspectRecordByIds(String[] ids) {
|
return ardVideoInspectRecordMapper.deleteArdVideoInspectRecordByIds(ids);
|
}
|
|
/**
|
* 删除视频巡检记录信息
|
*
|
* @param id 视频巡检记录主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteArdVideoInspectRecordById(String id) {
|
return ardVideoInspectRecordMapper.deleteArdVideoInspectRecordById(id);
|
}
|
|
/**
|
* 按照月份统计巡检记录数量
|
*
|
* @param startMonth 开始月份
|
* @return List<Map < String, Object>>
|
*/
|
@Override
|
public List<Map<String, Object>> selectArdVideoInspectRecordCountByStartMonth(String startMonth, String wellName, String taskName) {
|
return ardVideoInspectRecordMapper.selectArdVideoInspectRecordCountByStartMonth(startMonth, wellName, taskName);
|
}
|
}
|