刘磊
2025-06-09 dabbcafc629ef87d11ba55ef8cc1cdc776c047d8
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
57
58
59
60
using LogLibrary.Log;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Const;
using WIDESEA_IBusinessesRepository;
using WIDESEA_IServices;
using WIDESEA_IStorageBasicRepository;
using WIDESEA_IStorageTaskRepository;
using WIDESEA_IStoragIntegrationServices;
using WIDESEA_Repository;
using WIDESEAWCS_BasicInfoRepository;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class ToAGVService : IToAGVService
    {
        private readonly ILocationInfoRepository _locationRepository;
        private readonly IDt_TaskRepository _taskRepository;
        private readonly IStockInfoRepository _stockInfoRepository;
        private readonly ISys_ConfigService _configService;
        private readonly IDt_StationManagerRepository _stationManagerRepository;
        private readonly IDt_AreaInfoRepository _areaInfoRepository;
        private readonly IDt_Task_HtyRepository _task_HtyRepository;
        private readonly LogFactory LogFactory = new LogFactory();
 
        public static string AGV_Interface = "http://172.21.7.215:8182/rcms/services/rest/hikRpcService";
 
        public ToAGVService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository, IDt_AreaInfoRepository dt_AreaInfoRepository, IDt_Task_HtyRepository task_HtyRepository)
        {
            _locationRepository = locationRepository;
            _taskRepository = taskRepository;
            _stockInfoRepository = stockInfoRepository;
            _configService = configService;
            _stationManagerRepository = stationManagerRepository;
            _areaInfoRepository = dt_AreaInfoRepository;
            _task_HtyRepository = task_HtyRepository;
        }
 
 
        private string CreateSixteenId()
        {
            return Guid.NewGuid().ToString().Replace("-", "").Take(16).ToString();
        }
        
        private string GetMethName(string methodName)
        {
            var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
            var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.AGVIPAddress)?.ConfigValue;
            var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == methodName)?.ConfigValue;
            if (wmsBase == null || ipAddress == null)
            {
                return null;
            }
            return wmsBase + ipAddress;
        }
    }
}