From ceb82ce60d984e2a9457502e74ec12b6800d26ef Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期一, 27 五月 2024 08:21:24 +0800 Subject: [PATCH] 托盘数量可修改 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs | 79 +++++---------------------------------- 1 files changed, 10 insertions(+), 69 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" index 9ad8b37..714b1d9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" @@ -496,7 +496,8 @@ var station = stationinfoRepository.Find(x => x.area == areaCode && x.stationCode.Substring(x.stationCode.Length - 1, 1) == AreaNr.ToString()).FirstOrDefault(); if (station != null) { - if (station.quantity >= 5) + if (station.quantity >= Mes_Work.stackNoRange) + //if (station.quantity >= 5) { Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//鎶ヨ WriteLog.Write_Log(name + "鏀炬枡瀹屾垚鍑洪敊", Wheel_SN, "杞﹁疆鏁伴噺宸叉弧锛�", $"鍖哄煙鍙凤細{AreaNr}锛沑n杞﹁疆鏁帮細{station.quantity}\n閿欒淇℃伅锛氬尯鍩熷彿杞﹁疆鏁伴噺宸叉弧锛�"); @@ -657,7 +658,8 @@ .Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() - && x.quantity < 5 + && x.quantity < Work.stackNoRange + //&& x.quantity < 5 && x.stationType == Work.drawingNo && x.Number == Work.workOrder && x.heatNumber == Work.heatID) @@ -670,7 +672,8 @@ .Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() - && x.quantity < 5 + && x.quantity < Work.stackNoRange + //&& x.quantity < 5 && x.stationType == Work.drawingNo && x.Number == Work.workOrder) .OrderByDescending(x => x.quantity) @@ -699,7 +702,8 @@ #endregion #region 鎵樼洏杞﹁疆鍫嗗灈绗洓涓椂涓嬪彂鍙﹀涓�涓倝鍙风殑鍏ュ簱浠诲姟 - if (Stationinfo.quantity + 1 >= 4) + //if (Stationinfo.quantity + 1 >= 4) + if (Stationinfo.quantity + 1 >= Work.stackNoRange - 1) { var stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.stationCode != Stationinfo.stationCode && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); if (stationinfo != null) @@ -798,7 +802,8 @@ dt_stationinfo Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() - && x.quantity < 5 + && x.quantity < Work.stackNoRange + //&& x.quantity < 5 && x.stationType == Work.drawingNo).FirstOrDefault(); if (Stationinfo == null) @@ -912,70 +917,6 @@ tasktype = "TaskType_OutsourceInbound"; AGVTask.AddQueueTask(stationinfoRepository, agvtaskRepository, stationinfo, tasktype, Work); } - - #region MyRegion - /// <summary> - /// AGV浠诲姟 - /// </summary> - //public void agvtask(Idt_stationinfoRepository stationinfoRepository, dt_stationinfo stationinfo, VV_Mes_Workinfo Work, string tasktype) - //{ - // VOLContext Context = new VOLContext(); - // Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context); - // Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context); - - // var task = agvtaskRepository.Find(x => x.agv_fromaddress == stationinfo.stationCode).FirstOrDefault(); - // if (task != null) return; - // //var mes_Head = mes_HeadRepository.Find(x => x.jobID == Work.jobID).FirstOrDefault(); - // //if (mes_Head == null) - // //{ - // // stationinfo.remark = "瑙﹀彂鍏ュ簱浠诲姟,浣嗘湭鎵惧埌宸ュ崟澶磋〃锛�"; - // // stationinfo.location_state = LocationStateEnum.Abnormal.ToString(); - // // stationinfoRepository.Update(stationinfo, true); - // // return; - // //} - - // dt_stationinfo TargetLocation = null; - // //int CompeletedNum = Convert.ToInt32(mes_Head.quantity) - Convert.ToInt32(mes_Head.finishNum); - // //if (mes_Head.quantity <= 50) tasktype = "TaskType_OutsourceInbound"; - - // if (tasktype == "TaskType_OutsourceInbound" || !string.IsNullOrEmpty(Work.area)) - // TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository); - // else if (tasktype == "TaskType_Inbound") - // TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, Work, stationinfo); - // //TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, mes_Head, stationinfo); - // if (TargetLocation != null) - // { - // dt_agvtask agvtask = new dt_agvtask() - // { - // agv_fromaddress = stationinfo.stationCode, - // agv_id = Guid.NewGuid(), - // agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"), - // agv_grade = 1, - // agv_createtime = DateTime.Now, - // agv_taskstate = "Create", - // agv_materielid = stationinfo.stationType, - // agv_qty = stationinfo.quantity, - // agv_tasktype = tasktype, - // agv_toaddress = TargetLocation.stationCode, - // agv_userid = "绯荤粺", - // bindSN = stationinfo.bindSN, - // agv_worktype = Convert.ToInt32(Work.processCode), - // agv_materbarcode = Work.materialCode, - // agv_Traytype = stationinfo.tray_type, - // jobID = stationinfo.Number, - // agv_TrayStatus = stationinfo.tray_status - // }; - // agvtaskRepository.Add(agvtask, true); - // stationinfo.location_state = LocationStateEnum.InBusy.ToString(); - // stationinfoRepository.Update(stationinfo, true); - // TargetLocation.location_state = LocationStateEnum.InBusy.ToString(); - // TargetLocation.stationType = agvtask.agv_materielid; - // TargetLocation.heatNumber = stationinfo.heatNumber; - // TargetLocation.Number = agvtask.jobID; - // stationinfoRepository.Update(TargetLocation, true); - // } - //} - #endregion } } -- Gitblit v1.9.3