wangxinhui
2026-03-26 ad05ef2341fe19a4220f7ada1987636f9ec4a1a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using AutoMapper;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ISystemRepository;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.Service;
 
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public partial class AGVErrorJob : JobBase, IJob
    {
        public readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly ILocationInfoRepository _locationInfoRepository;
        private readonly IMapper _mapper;
        private readonly ISys_LogService _logService;
 
 
        public AGVErrorJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, ILocationInfoRepository locationInfoRepository, ISys_LogService logService,  IMapper mapper)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
            _locationInfoRepository = locationInfoRepository;
            _mapper = mapper;
            _logService = logService;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                _taskService.AgvSearchStatus();
                // 查询日志前3个月和3天前并且是Url为http://11.2.30.141:10870/interfaces/api/amr/robotQuery和清理数据库
                _logService.ScheduleDatabaseMaintenance();
 
            }
            catch (Exception ex)
            {
                WriteError(nameof(AGVErrorJob),ex.Message);
            }
            return Task.CompletedTask;
        }
    }
}