分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-07-19 7a4c218909936721fe281737491d10efc7378e09
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs
@@ -54,12 +54,20 @@
                    //根据下料口的绑定信息查询对应工单,检测此工单是否已完成  å®Œæˆå³å¯å°†å…¶é€å…¥åº“
                    var work = workinfoRepository.Find(x => x.workOrder == item.Number && x.drawingNo == item.stationType && x.heatID == item.heatNumber && x.processCode == "17").FirstOrDefault();
                    var work = workinfoRepository.Find(x => x.workOrder == item.Number && x.drawingNo == item.stationType && x.heatID == item.heatNumber && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                    if (work == null)
                    {
                        item.remark = "触发入库任务,但未找到工单信息!";
                        item.location_state = LocationStateEnum.Abnormal.ToString();
                        stationinfoRepository.Update(item, true);
                        stationinfoRepository.Update(item, x => new { x.remark, x.location_state }, true);
                        continue;
                    }
                    var geometry = Pipeline.QueryMateriel(work.drawingNo);
                    if (geometry == null)
                    {
                        item.remark = "未找到车轮信息!";
                        item.location_state = LocationStateEnum.Abnormal.ToString();
                        stationinfoRepository.Update(item, x => new { x.remark, x.location_state }, true);
                        continue;
                    }
@@ -67,7 +75,7 @@
                    string tasktype = "";
                    //if (item.quantity == 5)
                    if (item.quantity == work.stackNoRange)
                    if (item.quantity == geometry.stackNoRange)
                    {
                        if (!string.IsNullOrEmpty(work.area) || item.stationCode.Contains("3"))
                            tasktype = "TaskType_OutsourceInbound";
@@ -364,10 +372,10 @@
                if (TargetLocation != null && PalletSignal == 2 && MaterialSignal == 2) return TargetLocation;
            }
            if (TargetLocation == null)
            {
                throw new Exception("外协入库口已满");
            }
            //if (TargetLocation == null)
            //{
            //    throw new Exception("外协入库口已满");
            //}
            return TargetLocation;
        }
        /// <summary>