增强API与状态管理,优化配置及文档
添加多项API方法以支持新功能,并更新了文档注释。
减少`ReadTimeout`值以提高信号读取频率。
扩展状态枚举以支持更多场景,并调整任务逻辑以处理空托盘和实托盘。
更新仓库位置查询逻辑并优化数据删除和分页获取。
修正连接字符串配置,确保可用性,同时提醒对自动生成代码的修改。
| | |
| | | { |
| | | #region Private Member |
| | | |
| | | // 常é |
| | | /// <summary> |
| | | /// å®æä¿¡å·çå¾
æ¶é´ |
| | | /// </summary> |
| | | private const int WaitTimeout = 20 * 6000; |
| | | private const int ReadTimeout = 1500; |
| | | |
| | | /// <summary> |
| | | /// å®æä¿¡å·è¯»åé¢ç |
| | | /// </summary> |
| | | private const int ReadTimeout = 100; |
| | | |
| | | /// <summary> |
| | | /// å åæºé讯对象 |
| | |
| | | { |
| | | #region Private Member |
| | | |
| | | // 常é |
| | | |
| | | /// <summary> |
| | | /// å®æä¿¡å·çå¾
æ¶é´ |
| | | /// </summary> |
| | | private const int WaitTimeout = 20 * 6000; |
| | | private const int ReadTimeout = 1500; |
| | | |
| | | /// <summary> |
| | | /// å®æä¿¡å·è¯»åé¢ç |
| | | /// </summary> |
| | | private const int ReadTimeout = 100; |
| | | |
| | | /// <summary> |
| | | /// å åæºé讯对象 |
| | |
| | | #region << ç æ¬ 注 é >> |
| | | |
| | | /*---------------------------------------------------------------- |
| | | * å½å空é´ï¼WIDESEAWCS_QuartzJob |
| | | * å建è
ï¼è¡ç«¥åº |
| | |
| | | * ä¿®æ¹æ¶é´ï¼ |
| | | * çæ¬ï¼V1.0.1 |
| | | * ä¿®æ¹è¯´æï¼ |
| | | * |
| | | * |
| | | *----------------------------------------------------------------*/ |
| | | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using System; |
| | |
| | | PickUpCompleted, |
| | | |
| | | /// <summary> |
| | | /// è¯·æ±æ¾è´§ |
| | | /// </summary> |
| | | [Description("è¯·æ±æ¾è´§")] |
| | | RequestPut, |
| | | |
| | | /// <summary> |
| | | /// æ¾è´§ä¸ |
| | | /// </summary> |
| | | [Description("æ¾è´§ä¸")] |
| | |
| | | WorkCompleted, |
| | | |
| | | /// <summary> |
| | | /// 空åºåº |
| | | /// </summary> |
| | | [Description("空åºåº")] |
| | | EmptyOutbound, |
| | | |
| | | /// <summary> |
| | | /// éå
¥åº |
| | | /// </summary> |
| | | [Description("éå
¥åº")] |
| | | reInStock, |
| | | |
| | | /// <summary> |
| | | /// 任塿§è¡é误 |
| | | /// </summary> |
| | | [Description("任塿§è¡é误")] |
| | |
| | | [Description("æªç¥")] |
| | | Unkonw |
| | | } |
| | | } |
| | | } |
| | |
| | | private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, Platform platform) |
| | | { |
| | | var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode); |
| | | if (tasks.Count < index) |
| | | if (tasks.Count < platform.Capacity) |
| | | { |
| | | #region è°ç¨WMSè·ååºåºä»»å¡ |
| | | |
| | |
| | | if (taskNum == 0) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ã{commonStackerCrane.DeviceName}ãä»»å¡å·ä¸ºã{0}ã,ä»»å¡å·ä¸ä¸è´å¯ä»¥ä¸åä»»å¡", ConsoleColor.DarkBlue); |
| | | |
| | | Thread.Sleep(1000); |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | string str = $"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{e.TaskNum}ã"; |
| | | ConsoleHelper.WriteColorLine($"ã{commonStackerCrane.DeviceName}ãå åæºä½ä¸ç¶æï¼ã{(int)commonStackerCrane.StackerCraneWorkStatusValue}ãæ¶é´ã{DateTime.Now}ã", ConsoleColor.Magenta); |
| | | |
| | | string str = $"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{e.TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonStackerCrane.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | |
| | | _htyRepository.AddData(TASKHTY); |
| | | } |
| | | var isWorkType = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | str = $"WMS|WCSä»»å¡å®æï¼ã{content.Status}ã,å åæºå®æä¿¡å·åå
¥ï¼ã{isWorkType}ã,ä»»å¡å·ï¼ã{e.TaskNum}ã,æçå·ï¼ã{task.PalletCode}ã"; |
| | | str = $"{commonStackerCrane.DeviceName}ãWMS|WCSä»»å¡å®æï¼ã{content.Status}ã,å åæºå®æä¿¡å·åå
¥ï¼ã{isWorkType}ã,ä»»å¡å·ï¼ã{e.TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonStackerCrane.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | } |
| | |
| | | WriteInfo(commonStackerCrane.DeviceName, log); |
| | | |
| | | task = FindAnotherOutboundTask(commonStackerCrane.DeviceCode, task.TaskId); |
| | | |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return task; |
| | | } |
| | | |
| | | } |
| | | else if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | |
| | | return task; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | if (task.TargetAddress == "002-021-001" && task.Roadway.Contains("JZ") && task.TaskType == (int)TaskOutboundTypeEnum.OutTray) |
| | | if ((task.TargetAddress == "002-021-001" || task.TargetAddress == "001-021-001") && task.Roadway.Contains("JZ")) |
| | | { |
| | | string[] endCodes = task.NextAddress.Split("-"); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]); |
| | |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | Thread.Sleep(1000); |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | //commonStackerCrane.LastTaskType = task.TaskType; |
| | | //_taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.AppendLine(); |
| | | builder.AppendLine($"ã{commonStackerCrane.DeviceName}ãå åæºç¶æï¼ã{commonStackerCrane.StackerCraneStatusDes}ã,æ¶é´ï¼ã{DateTime.Now}ã"); |
| | | builder.AppendLine($"ã{commonStackerCrane.DeviceName}ãæèªå¨ç¶æï¼ã{commonStackerCrane.StackerCraneAutoStatusDes}ã,æ¶é´ï¼ã{DateTime.Now}ã"); |
| | | builder.AppendLine($"ã{commonStackerCrane.DeviceName}ãä½ä¸ç¶æï¼ã{commonStackerCrane.StackerCraneWorkStatusDes}ã,æ¶é´ï¼ã{DateTime.Now}ã"); |
| | | builder.AppendLine($"ã{commonStackerCrane.DeviceName}ãä¸å任塿å,ã{JsonConvert.SerializeObject(stackerCraneTaskCommand, Formatting.Indented)}ã"); |
| | | builder.AppendLine($"æ¶é´ï¼ã{DateTime.Now}ã"); |
| | | builder.AppendLine(); |
| | | ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue); |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | string str = $"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{e.TaskNum}ã"; |
| | | ConsoleHelper.WriteColorLine($"ã{commonStackerCrane.DeviceName}ãå åæºä½ä¸ç¶æï¼ã{(int)commonStackerCrane.StackerCraneWorkStatusValue}ãæ¶é´ã{DateTime.Now}ã", ConsoleColor.Magenta); |
| | | |
| | | string str = $"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{e.TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonStackerCrane.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | |
| | |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | |
| | | var isWorkType = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | str = $"WMS|WCSä»»å¡å®æï¼ã{content.Status}ã,å åæºå®æä¿¡å·åå
¥ï¼ã{isWorkType}ã,ä»»å¡å·ï¼ã{e.TaskNum}ã"; |
| | | str = $"{commonStackerCrane.DeviceName}ãWMS|WCSä»»å¡å®æï¼ã{content.Status}ã,å åæºå®æä¿¡å·åå
¥ï¼ã{isWorkType}ã,ä»»å¡å·ï¼ã{e.TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonStackerCrane.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | } |
| | |
| | | { |
| | | return task; |
| | | } |
| | | |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | else if (task == null) |
| | | { |
| | |
| | | /// MOMæ¥å£å°å |
| | | /// </summary> |
| | | public const string SYS_MOMIPAddress = "SYS_MOMIPAddress"; |
| | | |
| | | /// <summary> |
| | | /// ç¹æ®å
¥åºåé
|
| | | /// </summary> |
| | | public const string CONFIG_SYS_InStacker = "SYS_InStacker"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// é®ç®±å
容æ é¢ |
| | | /// </summary> |
| | | public const string SMTP_ContentTitle = "smtpContentTitle"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±å
容æ é¢ |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string ReceiveTask = "ReceiveTask"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 请æ±WCSä»»å¡ |
| | | /// </summary> |
| | | public const string GetStation = "GetStation"; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
¥åºç©ºæç |
| | | /// </summary> |
| | | public const string InboundIsEmpty = "InboundIsEmpty"; |
| | | } |
| | | } |
| | |
| | | |
| | | public interface IStockInfoService : IService<DtStockInfo> |
| | | { |
| | | Task<Dictionary<string, int>> GetLocationByStockType(bool stockType, string areaCode); |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IBusinessesRepository; |
| | | using WIDESEA_IServices; |
| | | using WIDESEA_IStorageBasicRepository; |
| | | using WIDESEA_IStorageTaskRepository; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA_Repository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | |
| | | private readonly IStockInfoRepository _stockInfoRepository; |
| | | private readonly ISys_ConfigService _configService; |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | private readonly IDt_AreaInfoRepository _areaInfoRepository; |
| | | private readonly LogFactory LogFactory = new LogFactory(); |
| | | |
| | | public MCSService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository,IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository) |
| | | public MCSService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository,IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository,IDt_AreaInfoRepository dt_AreaInfoRepository) |
| | | { |
| | | _locationRepository = locationRepository; |
| | | _taskRepository = taskRepository; |
| | | _stockInfoRepository = stockInfoRepository; |
| | | _configService = configService; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _areaInfoRepository = dt_AreaInfoRepository; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_IBusinessesRepository; |
| | | using WIDESEA_Repository; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(json.ToString())) throw new Exception("ä¸ä¼ åæ°ä¸ºç©º"); |
| | | |
| | | |
| | | var result = JsonConvert.DeserializeObject<RequsetCellInfo>(json.ToString()); |
| | | |
| | | var info = _stockInfoRepository.QueryFirst(x => x.LocationCode == result.LocationID); |
| | | var area = _areaInfoRepository.QueryFirst(x => x.AreaID == result.LocationArea); |
| | | |
| | | var info = _stockInfoRepository.QueryFirst(x => x.LocationCode == result.LocationID && x.AreaCode == area.AreaCode); |
| | | |
| | | //todo |
| | | if (info != null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return new { code = 0, palletBarcode = "",message="åºä½æ åºåè®°å½" }; |
| | | return new { code = 0, palletBarcode = "", message = "åºä½æ åºåè®°å½" }; |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å页 |
| | | /// </summary> |
| | | /// <param name="options"></param> |
| | | /// <returns></returns> |
| | | public override PageGridData<DtStockInfo> GetPageData(PageDataOptions options) |
| | | { |
| | | var data = base.GetPageData(options); |
| | |
| | | return data; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¹éå é¤ |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | List<DtStockInfo_Hty> stockInfos = new List<DtStockInfo_Hty>(); |
| | | foreach (var item in keys) |
| | | try |
| | | { |
| | | var stock = BaseDal.QueryFirstNavAsync(x => x.Id == item.ObjToInt()).Result; |
| | | var stockHty = stock.Adapt<DtStockInfo_Hty>(); |
| | | stockInfos.Add(stockHty); |
| | | } |
| | | var hty = BaseDal.Db.InsertNav(stockInfos) |
| | | .Include(x => x.StockInfoDetails) |
| | | .ExecuteCommand(); |
| | | |
| | | return base.DeleteData(keys); |
| | | List<DtStockInfo_Hty> stockInfos = new List<DtStockInfo_Hty>(); |
| | | List<DtLocationInfo> locationInfos = new List<DtLocationInfo>(); |
| | | foreach (var item in keys) |
| | | { |
| | | var stock = BaseDal.QueryFirstNavAsync(x => x.Id == item.ObjToInt()).Result; |
| | | var stockHty = stock.Adapt<DtStockInfo_Hty>(); |
| | | stockInfos.Add(stockHty); |
| | | |
| | | var location = SqlSugarHelper.DbWMS.Queryable<DtLocationInfo>().FirstAsync(x => x.Id == stock.LocationId).Result; |
| | | location.LocationStatus = (int)LocationEnum.Free; |
| | | locationInfos.Add(location); |
| | | } |
| | | |
| | | var hty = BaseDal.Db.InsertNav(stockInfos) |
| | | .Include(x => x.StockInfoDetails) |
| | | .ExecuteCommand(); |
| | | |
| | | var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange(); |
| | | return base.DeleteData(keys); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | // æ ¹æ®ä¼ å
¥åºåç±»åè·åä¸åå··éçåºå |
| | | public async Task<Dictionary<string, int>> GetLocationByStockType(bool stockType,string areaCode) |
| | | { |
| | | var stockInfos = await BaseDal.Db.Queryable<DtStockInfo>().Where(x => x.IsFull == stockType && x.AreaCode == areaCode) |
| | | .Includes(x => x.LocationInfo).ToListAsync(); |
| | | |
| | | var result = stockInfos |
| | | .GroupBy(x => x.LocationInfo.RoadwayNo) |
| | | .ToDictionary(x => x.Key, x => x.Count()); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | using Mapster; |
| | | using Autofac.Core; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Core.Const; |
| | |
| | | |
| | | if (result.SerialNos.Count <= 0) |
| | | { |
| | | return await RequestTrayInTaskAsync(input); |
| | | var config = _configService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStacker, SysConfigConst.InboundIsEmpty); |
| | | var strings = config.ConfigValue.Split(',').ToList(); |
| | | if (strings.Contains(input.Position)) |
| | | { |
| | | // todoéè³NGå£ |
| | | ConsoleHelper.WriteErrorLine($"å½åä½ç½®ä¸è½å
¥ç©ºæç"); |
| | | return content.Error("å½åä½ç½®ä¸è½å
¥ç©ºæç"); |
| | | } |
| | | else |
| | | return await RequestTrayInTaskAsync(input); |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | // å¤çå¼å¸¸çµè¯æ
åµ |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | if (serialNosError.Count > 0) |
| | |
| | | // æ ¹æ®æçç±»åæ¥è¯¢åºåä¿¡æ¯ |
| | | DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound |
| | | ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine) |
| | | : await QueryStockInfoForEmptyTrayAsync(areaCode); |
| | | : await QueryStockInfoForEmptyTrayAsync(areaCode, position); |
| | | |
| | | if (stockInfo == null) |
| | | { |
| | |
| | | { |
| | | // è®°å½å¼å¸¸ä¿¡æ¯å¹¶æåº |
| | | LogFactory.GetLog("è¯·æ±æçä»»å¡").Error(true, ex); |
| | | ConsoleHelper.WriteErrorLine("请æ±ç©º/宿çä»»å¡" + ex.Message); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | var devices = SqlSugarHelper.DbWCS.Queryable<Dt_DeviceInfo>() |
| | | .Where(x => x.DeviceStatus == "1") |
| | | .Where(x => x.DeviceRemark == "1") |
| | | .ToList(); |
| | | var deviceCode = devices.Select(x => x.DeviceCode).ToList(); |
| | | |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | | .Includes(x => x.StockInfoDetails) // é¢å è½½StockInfoDetails |
| | | .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // è¿æ»¤æ¡ä»¶ |
| | | .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // è¿æ»¤æ¡ä»¶ |
| | | .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo)) |
| | | .OrderBy(x => x.OutboundTime) // æåº |
| | | .FirstAsync(); // è·å第ä¸ä¸ªå
ç´ |
| | | |
| | |
| | | /// <summary> |
| | | /// æ¥è¯¢ç©ºçåºåä¿¡æ¯ |
| | | /// </summary> |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode) |
| | | private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode,string position) |
| | | { |
| | | var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode); |
| | | |
| | | ConsoleHelper.WriteColorLine(position + "..." + areaCode, ConsoleColor.Magenta); |
| | | var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == position && x.stationType == 17); |
| | | |
| | | ConsoleHelper.WriteColorLine(station.Roadway, ConsoleColor.Magenta); |
| | | var stackers = station.Roadway.Split(',').ToList(); |
| | | |
| | | |
| | | var devices = SqlSugarHelper.DbWCS.Queryable<Dt_DeviceInfo>() |
| | | .Where(x => x.DeviceStatus == "1") |
| | | .Where(x => stackers.Contains(x.DeviceCode)) |
| | | .ToList(); |
| | | |
| | | var deviceCode = devices.Select(x => x.DeviceCode).ToList(); |
| | | |
| | | var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | |
| | | .Where(x => x.AreaCode == areaCode && x.IsFull == false) |
| | | .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "空æç")) |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // è¿æ»¤æ¡ä»¶ |
| | | .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo)) |
| | | .OrderBy(x => x.CreateDate) // æåº |
| | | .FirstAsync(); // 转æ¢ä¸ºå表 |
| | | |
| | |
| | | { |
| | | return new Dt_Task |
| | | { |
| | | Grade = tag == 104 ? 2 : 1, |
| | | Grade = tag == 104 ? (stockInfo.LocationInfo.RoadwayNo.Contains("CWSC") ? 1 : 2) : (stockInfo.LocationInfo.RoadwayNo.Contains("CWSC") ? 2 : 1), |
| | | Roadway = stockInfo.LocationInfo.RoadwayNo, |
| | | TargetAddress = position, |
| | | Dispatchertime = DateTime.Now, |
| | |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | Grade = task.Grade.Value, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | |
| | | var task = new Dt_Task |
| | | { |
| | | CurrentAddress = input.Position, |
| | | Grade = 1, |
| | | Grade = 2, |
| | | Roadway = input.Roadways, |
| | | TargetAddress = stationManager.stationLocation, |
| | | Dispatchertime = DateTime.Now, |
| | |
| | | |
| | | var location = locations.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | |
| | | var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1"); |
| | | var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1","10086"); |
| | | |
| | | if (stockInfo != null) |
| | | { |
| | |
| | | public StockInfoController(IStockInfoService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | [HttpGet, AllowAnonymous, Route("GetLocationByStockType")] |
| | | public Task<Dictionary<string, int>> GetLocationByStockType(bool stockType, string areaCode) |
| | | { |
| | | return Service.GetLocationByStockType(stockType, areaCode); |
| | | } |
| | | } |
| | |
| | | _MCSService = MCSService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å容æµè¯å®æéç¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("NotifyFinishTest"), AllowAnonymous] |
| | | public WebResponseContent NotifyFinishTest([FromBody] object input) |
| | | { |
| | | return _MCSService.NotifyFinishTest(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 请æ±ç§»åº |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("RequestChangeLocation"), AllowAnonymous] |
| | | public WebResponseContent RequestChangeLocation([FromBody] object input) |
| | | { |
| | | return _MCSService.RequestChangeLocation(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å容åºä½åæ¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ModifyAccessStatus"), AllowAnonymous] |
| | | public WebResponseContent ModifyAccessStatus([FromBody] object input) |
| | | { |
| | | return _MCSService.ModifyAccessStatus(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å容è·ååºä½æç |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("RequestCellInfo"), AllowAnonymous] |
| | | public object RequsetCellInfo([FromBody] object input) |
| | | { |
| | |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionStringWCS": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionStringWCS": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionStringWCS": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | |
| | | //------------------------------------------------------------------------------ |
| | | // <auto-generated> |
| | | // æ¤ä»£ç ç±å·¥å
·çæã |
| | | // è¿è¡æ¶çæ¬:4.0.30319.42000 |
| | | // This code was generated by a tool. |
| | | // |
| | | // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ |
| | | // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã |
| | | // Changes to this file may cause incorrect behavior and will be lost if |
| | | // the code is regenerated. |
| | | // </auto-generated> |
| | | //------------------------------------------------------------------------------ |
| | | |