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;
|
}
|
}
|
}
|