| | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using AutoMapper; |
| | | using Microsoft.Extensions.Logging; |
| | | using Org.BouncyCastle.Math.EC; |
| | | using SixLabors.ImageSharp; |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | using System.Net; |
| | | using System.Reflection; |
| | | using System.Reflection.Emit; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.Log; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundService; |
| | |
| | | { |
| | | public partial class TaskService : ServiceBase<Dt_Task, IRepository<Dt_Task>>, ITaskService |
| | | { |
| | | private readonly ILogger<TaskService> _logger; |
| | | private readonly IMapper _mapper; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IWarehouseService _warehouseService; |
| | | private readonly IRoadWayinfoService _roadWayinfoService; |
| | | |
| | | private Timer _timer; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | public TaskService(ILogger<TaskService> logger, IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, ILocationInfoService locationInfoService, |
| | | IWarehouseService warehouseService, IRoadWayinfoService roadWayinfoService) : base(BaseDal) |
| | | { |
| | | _logger = logger; |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | | _locationInfoService = locationInfoService; |
| | | _warehouseService = warehouseService; |
| | | _roadWayinfoService=roadWayinfoService; |
| | | |
| | | } |
| | | public string MES_InReporttask = WIDESEA_Core.Helper.AppSettings.Configuration["MES_InReporttask"]; //å
¥åºåé¦ä¿¡æ¯ |
| | | public string MES_OutReporttask = WIDESEA_Core.Helper.AppSettings.Configuration["MES_OutReporttask"]; //åºåºåé¦ä¿¡æ¯ |
| | | public string MES_InventoryUpdateApply = WIDESEA_Core.Helper.AppSettings.Configuration["MES_InventoryUpdateApply"]; //å¨ä½å¼å¨ç³è¯· |
| | | public string MES_InventoryUpdateCallback = WIDESEA_Core.Helper.AppSettings.Configuration["MES_InventoryUpdateCallback"]; //å¨ä½å¼å¨ç³è¯· |
| | | public string MES_TaskErrorInfoCallback = WIDESEA_Core.Helper.AppSettings.Configuration["MES_TaskErrorInfoCallback"]; //ä»»å¡å¼å¸¸ä¸æ¥ |
| | | public string WCS_SendConveyorTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_SendConveyorTask"]; //è¾é线任å¡ä¸å |
| | | public string WCS_SendStackerTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_SendStackerTask"]; //å åæºä»»å¡ä¸å |
| | | |
| | | |
| | | public WebResponseContent CESTEXT() |
| | | { |
| | | WriteLog.Write_Log("æ¥æ¶MESå
¥åºä»»å¡ä¸å", $"任塿¥æ¶åæ°", "æå", $"åæ°ï¼234jkljsldafjlasdf"); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | public WebResponseContent TaskCompleted(WCSTaskDTO wCSTask) |
| | | { |
| | | WebResponseContent webResponse= new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == wCSTask.TaskNum && x.PalletCode == wCSTask.PalletCode); |
| | | if (task == null) |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | return webResponse.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | |
| | | switch ((TaskTypeEnum)task.TaskType) |
| | | { |
| | |
| | | case TaskTypeEnum.Relocation: |
| | | return HandleRelocationTask(task, wCSTask.TaskType); |
| | | default: |
| | | return WebResponseContent.Instance.Error($"ä»»å¡ç±»åé误ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode},ç±»åï¼{task.TaskType}"); |
| | | return webResponse.Error($"ä»»å¡ç±»åé误ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode},ç±»åï¼{task.TaskType}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"WMSä»»å¡å®æé误ï¼{ex.Message}"); |
| | | return webResponse.Error($"WMSä»»å¡å®æé误ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | private WebResponseContent HandleInboundTask(Dt_Task task, int wcsTaskType) |
| | | { |
| | | switch (wcsTaskType) |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | case 1: |
| | | task.TaskStatus = (int)InTaskStatusEnum.PLC_InFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶å
¥åºè¾éçº¿å®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | case 2: |
| | | task.TaskStatus = (int)InTaskStatusEnum.SC_OutFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶å
¥åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | default: |
| | | return WebResponseContent.Instance.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | switch (wcsTaskType) |
| | | { |
| | | case 1: |
| | | |
| | | if (string.IsNullOrEmpty(task.TargetAddress)) |
| | | { |
| | | if(task.TaskStatus == (int)InTaskStatusEnum.PLC_InExecuting) |
| | | { |
| | | int loctype = 0; |
| | | if (task.Roadway == "1" || task.Roadway == "2") |
| | | { |
| | | if (task.PalletType == "1") loctype = (int)LocationTypeEnum.SmallPallet; |
| | | else if (task.PalletType == "2") loctype = (int)LocationTypeEnum.MediumPallet; |
| | | } |
| | | else |
| | | { |
| | | loctype = (int)LocationTypeEnum.LargePallet; |
| | | } |
| | | |
| | | //æ¥æ¾è´§ä½ï¼æ´æ°ä»»å¡ |
| | | Dt_LocationInfo dt_Location = _locationInfoService.GetLocation(task.Roadway, loctype); |
| | | Dt_LocationInfo ShallowCargoHold = _locationInfoService.ShallowGetLocation(dt_Location.RoadwayNo, dt_Location.LocationType, dt_Location.Row, dt_Location.Layer, dt_Location.Column); |
| | | if (ShallowCargoHold == null) return content.Error($"æªæ¾å°è¯¥è´§ä½ä¿¡æ¯,è´§ä½ç¼å·:{dt_Location.LocationCode}çæµ
è´§ä½"); |
| | | if (ShallowCargoHold.LocationStatus != (int)LocationStatusEnum.Free) return content.Error($"ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode},æ¥æ¾çè´§ä½æµ
è´§ä½æè´§ï¼è´§ä½ç¼å·ï¼{ShallowCargoHold.LocationCode}"); |
| | | |
| | | if (task.PalletCode[0] == 1 && (dt_Location.RoadwayNo == "1" || dt_Location.RoadwayNo == "2") && dt_Location.Column < 4) |
| | | { |
| | | return content.Error($"æ¡ç ä¸ºé«æçï¼ä½æ¯æ¥æ¾çè´§ä½è¦å
¥å¨ä½æçä¸ï¼æ
é,æçæ¡ç ï¼{task.PalletCode},è´§ä½ç¼å·:{dt_Location.LocationCode}"); |
| | | } |
| | | |
| | | |
| | | Dt_roadwayinfo _Roadwayinfo = _roadWayinfoService.QbtainPlatform(task.Roadway); |
| | | |
| | | task.TargetAddress = dt_Location.LocationCode; |
| | | task.CurrentAddress = _Roadwayinfo.InSCStationCode; |
| | | task.NextAddress = dt_Location.LocationCode; |
| | | task.TaskStatus = (int)InTaskStatusEnum.PLC_InFinish; |
| | | |
| | | dt_Location.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | |
| | | Dt_StockInfo dt_StockInfo = new Dt_StockInfo(); |
| | | dt_StockInfo.PalletCode = task.PalletCode; |
| | | dt_StockInfo.PalletType = task.PalletType; |
| | | dt_StockInfo.WarehouseId = task.WarehouseId; |
| | | dt_StockInfo.LocationCode = dt_Location.LocationCode; |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.å
¥åºä¸; |
| | | dt_StockInfo.Creater = "MWS"; |
| | | dt_StockInfo.CreateDate = DateTime.Now; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoService.AddData(dt_StockInfo); |
| | | _locationInfoService.UpdateData(dt_Location); |
| | | BaseDal.UpdateData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"å·²æ¥æ¶å
¥åºè¾éçº¿å®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯è¾é线æ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | //夿æ¯å¦æè¯¥ç«å° |
| | | if (task.TaskStatus == (int)InTaskStatusEnum.PLC_InExecuting) |
| | | { |
| | | string Resultplc = MesInTaskStatusEnum.Finish.GetDescription(); |
| | | MES_parameter mES_PCLParameter = InStoreDocCallback(task.TaskNum, Resultplc, "æä½æå", task.PalletCode, task.TargetAddress); |
| | | if (mES_PCLParameter.Result == "Y") |
| | | { |
| | | task.TaskStatus = (int)InTaskStatusEnum.PLC_InFinish; |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"è¾é线任å¡å·²åé¦è³ä¸æ¸¸ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_PCLParameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯è¾é线æ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | case 2: |
| | | if (task.TaskStatus == (int)InTaskStatusEnum.SC_IntExecuting) |
| | | { |
| | | string Resultsc = MesInTaskStatusEnum.Finish.GetDescription(); |
| | | //䏿¥MESä»»å¡å®æ |
| | | MES_parameter mES_Parameter = InStoreDocCallback(task.TaskNum, Resultsc, "æä½æå", task.PalletCode, task.TargetAddress); |
| | | if (mES_Parameter.Result == "Y") |
| | | { |
| | | Dt_StockInfo dt_Stockowc = _stockInfoService.Repository.QueryData(x => x.PalletCode == task.PalletCode).FirstOrDefault(); |
| | | Dt_LocationInfo dt_LocationInfo = _locationInfoService.Repository.QueryData(x => x.LocationCode == dt_Stockowc.LocationCode).FirstOrDefault(); |
| | | |
| | | dt_Stockowc.StockStatus = (int)StockStatusEmun.å·²å
¥åº; |
| | | dt_LocationInfo.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | task.TaskStatus = (int)InTaskStatusEnum.InFinish; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoService.UpdateData(dt_Stockowc); |
| | | _locationInfoService.UpdateData(dt_LocationInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"å·²æ¥æ¶å
¥åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_Parameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | default: |
| | | return content.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error($"WCSä»»å¡å®ææ¥å£æ
éï¼åå ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | private WebResponseContent HandleOutboundTask(Dt_Task task, int wcsTaskType) |
| | | { |
| | | switch (wcsTaskType) |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | case 1: |
| | | task.TaskStatus = (int)OutTaskStatusEnum.PLC_OutFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶åºåºè¾éçº¿å®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | case 2: |
| | | task.TaskStatus = (int)OutTaskStatusEnum.SC_OutFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶åºåºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | default: |
| | | return WebResponseContent.Instance.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | switch (wcsTaskType) |
| | | { |
| | | case 1: |
| | | if(task.TaskStatus == (int)OutTaskStatusEnum.PLC_OutExecuting) |
| | | { |
| | | string Resultplc = MesOutTaskStatusEnum.Finish.GetDescription(); |
| | | //䏿¥MESä»»å¡å®æ |
| | | MES_parameter mES_Parameter = OutStoreDocCallback(task.TaskNum, Resultplc, "æä½æå"); |
| | | if (mES_Parameter.Result == "Y") |
| | | { |
| | | task.TaskStatus = (int)OutTaskStatusEnum.PLC_OutFinish; |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | return content.OK($"å·²æ¥æ¶åºåºè¾éçº¿å®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_Parameter.ResultMsg); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼WMSå½åä»»å¡ä¸æ¯è¾é线æ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | case 2: |
| | | |
| | | if (task.TaskStatus == (int)OutTaskStatusEnum.SC_OutExecuting) |
| | | { |
| | | //è·å对åºPLCç«å°ä¿¡æ¯ |
| | | Dt_roadwayinfo _Roadwayinfo = _roadWayinfoService.QbtainPlatform(task.Roadway); |
| | | task.CurrentAddress = _Roadwayinfo.OutStationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.TaskStatus = (int)OutTaskStatusEnum.SC_OutFinish; |
| | | |
| | | Dt_StockInfo dt_Stockowc = _stockInfoService.Repository.QueryData(x => x.PalletCode == task.PalletCode).FirstOrDefault(); |
| | | Dt_LocationInfo dt_LocationInfo = _locationInfoService.Repository.QueryData(x => x.LocationCode == dt_Stockowc.LocationCode).FirstOrDefault(); |
| | | dt_LocationInfo.LocationStatus = (int)LocationStatusEnum.Free; |
| | | |
| | | string Result = MesOutTaskStatusEnum.Outstore.GetDescription(); |
| | | //è°å䏿¸¸ç³»ç»åé¦å¼å§ä»»å¡ |
| | | MES_parameter mES_SCParameter = OutStoreDocCallback(task.TaskNum, Result, "æä½æå"); |
| | | if (mES_SCParameter.Result == "Y") |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoService.DeleteData(dt_Stockowc); |
| | | _locationInfoService.UpdateData(dt_LocationInfo); |
| | | BaseDal.UpdateData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"å·²æ¥æ¶åºåºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_SCParameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼WMSå½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | default: |
| | | return content.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error($"WCSä»»å¡å®ææ¥å£æ
éï¼åå ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | private WebResponseContent HandleRelocationTask(Dt_Task task, int wcsTaskType) |
| | | { |
| | | if (wcsTaskType == 2) |
| | | WebResponseContent responseContent = new WebResponseContent(); |
| | | try |
| | | { |
| | | task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶ç§»åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | if (wcsTaskType == 2) |
| | | { |
| | | if(task.TaskStatus == (int)RelocationTaskStatusEnum.RelocationExecuting) |
| | | { |
| | | //䏿¥MESä»»å¡å®æ |
| | | MES_parameter mES_Parameter = AbnormalStorageLocation(task.PalletCode, task.SourceAddress, task.TargetAddress); |
| | | if (mES_Parameter.Result == "Y") |
| | | { |
| | | Dt_LocationInfo OriginalLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault(); |
| | | Dt_LocationInfo NewLocation = _locationInfoService.Repository.QueryData(x => x.LocationCode == task.TargetAddress).FirstOrDefault(); |
| | | Dt_StockInfo dt_StockInfo = _stockInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault(); |
| | | |
| | | List<Dt_LocationInfo> dt_Locations = new List<Dt_LocationInfo>(); |
| | | |
| | | OriginalLocation.LocationStatus = (int)LocationStatusEnum.Free; |
| | | NewLocation.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | dt_StockInfo.LocationCode = NewLocation.LocationCode; |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.å·²å
¥åº; |
| | | task.TaskStatus = (int)RelocationTaskStatusEnum.RelocationFinish; |
| | | |
| | | dt_Locations.Add(OriginalLocation); |
| | | dt_Locations.Add(NewLocation); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationInfoService.UpdateData(dt_Locations); |
| | | _stockInfoService.UpdateData(dt_StockInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return responseContent.OK($"å·²æ¥æ¶ç§»åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | return responseContent.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_Parameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return responseContent.Error($"䏿¥å¤±è´¥ï¼WMSå½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return responseContent.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return responseContent.Error($"WMSç³»ç»é误ï¼åå ï¼{ex.Message}"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |