| | |
| | | |
| | | if (string.IsNullOrEmpty(task.TargetAddress)) |
| | | { |
| | | if(task.TaskStatus == (int)InTaskStatusEnum.PLC_InExecuting) |
| | | { |
| | | int loctype = 0; |
| | | if (task.Roadway == "1" || task.Roadway == "2") |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //夿æ¯å¦æè¯¥ç«å° |
| | | return content.Error("䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯è¾é线æ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥"); |
| | | } |
| | | |
| | | string Resultplc = MesInTaskStatusEnum.å
¥åºå®æ.GetDescription(); |
| | | |
| | | } |
| | | 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") |
| | | { |
| | |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_PCLParameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯è¾é线æ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | case 2: |
| | | string Resultsc = MesInTaskStatusEnum.å
¥åºå®æ.GetDescription(); |
| | | 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") |
| | | 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(); |
| | |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_Parameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼å½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | default: |
| | | return content.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | |
| | | switch (wcsTaskType) |
| | | { |
| | | case 1: |
| | | string Resultplc = MesOutTaskStatusEnum.å°è¾¾ç®çå°.GetDescription(); |
| | | 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") |
| | | if (mES_Parameter.Result == "Y") |
| | | { |
| | | task.TaskStatus = (int)OutTaskStatusEnum.PLC_OutFinish; |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | |
| | | { |
| | | 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; |
| | |
| | | Dt_LocationInfo dt_LocationInfo = _locationInfoService.Repository.QueryData(x => x.LocationCode == dt_Stockowc.LocationCode).FirstOrDefault(); |
| | | dt_LocationInfo.LocationStatus = (int)LocationStatusEnum.Free; |
| | | |
| | | string Result = MesOutTaskStatusEnum.åºåºå®æ.GetDescription(); |
| | | string Result = MesOutTaskStatusEnum.Outstore.GetDescription(); |
| | | //è°å䏿¸¸ç³»ç»åé¦å¼å§ä»»å¡ |
| | | MES_parameter mES_SCParameter = OutStoreDocCallback(task.TaskNum, Result, "æä½æå"); |
| | | if (mES_SCParameter.Result != "Y") |
| | | if (mES_SCParameter.Result == "Y") |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoService.DeleteData(dt_Stockowc); |
| | |
| | | { |
| | | return content.Error("ä¸ä¼ MES失败ï¼åå ï¼" + mES_SCParameter.ResultMsg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"䏿¥å¤±è´¥ï¼WMSå½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | default: |
| | | return content.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | |
| | | { |
| | | 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.TargetAddress).FirstOrDefault(); |
| | | Dt_StockInfo dt_StockInfo = _stockInfoService.Repository.QueryData(x => x.LocationCode == task.SourceAddress).FirstOrDefault(); |
| | | |
| | | List<Dt_LocationInfo> dt_Locations = new List<Dt_LocationInfo>(); |
| | | |
| | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return WebResponseContent.Instance.OK($"å·²æ¥æ¶ç§»åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | return responseContent.OK($"å·²æ¥æ¶ç§»åºå åæºå®æä¿¡æ¯ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | return responseContent.Error($"䏿¥å¤±è´¥ï¼WMSå½åä»»å¡ä¸æ¯å åæºæ§è¡ä¸ï¼WCS䏿¥å®æå¤±è´¥ï¼ä»»å¡å·ï¼{task.TaskId},æçç¼å·ï¼{task.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return responseContent.Error($"WCS䏿¥ç±»åé误ï¼{wcsTaskType}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error($"WMSç³»ç»é误ï¼åå ï¼{ex.Message}"); |
| | | return responseContent.Error($"WMSç³»ç»é误ï¼åå ï¼{ex.Message}"); |
| | | } |
| | | |
| | | } |