| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.entity.CheckIndexVideo; |
| | | import com.ycl.platform.domain.query.DashboardQuery; |
| | | import com.ycl.platform.domain.query.DataCenterQuery; |
| | | import com.ycl.platform.mapper.CheckIndexVideoMapper; |
| | | import com.ycl.platform.service.DataCenterService; |
| | | import com.ycl.platform.service.ICheckIndexVideoService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import utils.DateUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @date 2024-04-29 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CheckIndexVideoServiceImpl extends ServiceImpl<CheckIndexVideoMapper, CheckIndexVideo> implements ICheckIndexVideoService |
| | | { |
| | | @Autowired |
| | |
| | | return checkIndexVideoMapper.deleteCheckIndexVideoById(id); |
| | | } |
| | | |
| | | public final DataCenterService dataCenterService; |
| | | @Override |
| | | public CheckIndexVideo dashboard(DashboardQuery dashboardQuery) { |
| | | //修改 录像可用率 和 点位在线率在今天 |
| | | if(dashboardQuery.getDeptId() == null){ |
| | | DataCenterQuery dataCenterQuery = new DataCenterQuery(); |
| | | dataCenterQuery.setDate(new Date()); |
| | | dataCenterQuery.setTime(); |
| | | //区县 2 省厅 1 公安部3 |
| | | if(dashboardQuery.getDataScope() == 2){ |
| | | dataCenterQuery.setDataType(0); |
| | | }else if(dashboardQuery.getDataScope() == 1){ |
| | | dataCenterQuery.setDataType(1); |
| | | }else if(dashboardQuery.getDataScope() == 3){ |
| | | dataCenterQuery.setDataType(2); |
| | | } |
| | | //全部0 省厅1 公安部2 |
| | | |
| | | CheckIndexVideo checkIndexVideo = checkIndexVideoMapper.dashboard(dashboardQuery); |
| | | checkIndexVideo.setSiteOnline(dataCenterService.videoPointOnlineRateCount(dataCenterQuery)); |
| | | |
| | | checkIndexVideo.setVideoAvailable(dataCenterService.videoAvailabilityRateCount(dataCenterQuery)); |
| | | return checkIndexVideo; |
| | | |
| | | } |
| | | return checkIndexVideoMapper.dashboard(dashboardQuery); |
| | | } |
| | | } |