1
schangxiang@126.com
2024-12-02 607fa9a9dec5ff4fe780231d635bbd62e1740f37
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Inbound/1¡¢DataProcess_BZ39.cs
@@ -30,11 +30,11 @@
            LogType logType = LogType.DataProcess_BZ39;
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                Thread.Sleep(1000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_alert_DataProcess_BZ39 = string.Empty;
                try
                {
                    if (SystemValue.isAllowRuning_DataProcess_BZ39 && SystemValue.isStartedModel)
                    if (SystemValue.isStartedModel)//SystemValue.isAllowRuning_DataProcess_BZ39 &&
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        /*
@@ -54,13 +54,16 @@
                            var qitaoReault = false;
                            using (WmsDBModel wmsDB = new WmsDBModel())
                            {
                                //不再拦截
                                //要是有已下发的任务,就不要执行
                                var isValidate = TaskHandler.ValidateIssueTaskForRobotBuffer(wmsDB);
                                var isValidate = TaskHandler.ValidateIssueTaskForRobotBuffer(wmsDB, upiCode);
                                if (!isValidate)
                                {
                                    SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-有‘已下发’的任务,不能处理,此次循环结束";
                                    continue;
                                }
                                //
                                var upiObj = wmsDB.mes_batchOrderUPI_new.Where(x => x.UPI == upiCode).FirstOrDefault();
                                if (upiObj == null)
                                {
@@ -75,20 +78,6 @@
                                    continue;
                                }
                                using (StationServiceClient client = new StationServiceClient())
                                {
                                    var res = await client.WriteInStoreTaskInfoAsync((int)EDevice.Station, rgvLocation, place.PlaceCode, (short)upiObj.Length,
                                        (short)upiObj.Width, (short)upiObj.Thk);
                                    if (!res.result)
                                    {
                                        SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-下发入库任务 å¤±è´¥,WriteInStoreTaskInfoAsync è¿”回:{res.resMsg}";
                                        continue;
                                    }
                                    else
                                    {
                                        Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-下发入库任务 æˆåŠŸ,WriteInStoreTaskInfoAsync,参数: ç«™ç‚¹{rgvLocation}");
                                    }
                                }
                                //记录任务
                                var _id = Yitter.IdGenerator.YitIdHelper.NextId();
@@ -97,7 +86,6 @@
                                {
                                    Id = _id,
                                    TaskNo = plcTaskNo,
                                    UPI = upiObj.UPI,
                                    Length = upiObj.Length,
                                    Width = upiObj.Width,
@@ -122,8 +110,29 @@
                                wmsDB.wms_rbline_task.Add(task);
                                using (StationServiceClient client = new StationServiceClient())
                                {
                                    var res = await client.WriteInStoreTaskInfoAsync((int)EDevice.Station, rgvLocation, place.PlaceCode,
                                       (short)upiObj.Length,
                                       (short)upiObj.Width, (short)upiObj.Thk, Convert.ToInt32(task.TaskNo));
                                    if (!res.result)
                                    {
                                        SystemWarningMsg._lbl_alert_DataProcess_BZ39 = $"{rgvLocation.ToString()}-下发入库任务 å¤±è´¥,WriteInStoreTaskInfoAsync è¿”回:{res.resMsg}";
                                        continue;
                                    }
                                    else
                                    {
                                        Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-下发入库任务 æˆåŠŸ,WriteInStoreTaskInfoAsync,参数: ç«™ç‚¹{rgvLocation}");
                                    }
                                }
                                place.PlaceStatus = (int)PlaceStatusEnum.锁定;
                                WmsRecordUpiProcessHandler.SaveWmsRecordUpiProcess(wmsDB, upiObj, "BZ39", "缓存入库");
                                wmsDB.SaveChanges();
                            }
                        }