分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-05-10 803e01128820d51a9308d72f1c8e746f7f9f322a
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs
@@ -444,14 +444,6 @@
                        }
                        #endregion
                        var Stations = stationinfoRepository.Find(x => x.area == Pipeline.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList();
                        #region ä¸‹æ–™ä½æ˜¯å¦ä¸ºç©ºçŠ¶æ€åŒæ­¥ç»™æ¡æž¶
                        foreach (var station in Stations)
                        {
                            client.WriteByOrder(station.stationCode, station.location_state != LocationStateEnum.Stroge.ToString(), name);
                        }
                        #endregion
                        if (finished && !updatefinished)
                        {
@@ -481,11 +473,11 @@
                            #endregion
                            var AreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_AreaNr").First(), client);
                            if (AreaNr == 0)
                            {
                                client.WriteByOrder("W_Storage_update", true, name);//货位状态更新
                                continue;
                            }
                            //if (AreaNr == 0)
                            //{
                            //    client.WriteByOrder("W_Storage_update", true, name);//货位状态更新
                            //    continue;
                            //}
                            #region åˆ¤æ–­åŒºåŸŸå·æ˜¯å¦ä¸€è‡´
                            var area = client.ReadByOrder<Int16>("place_prog", name);//放料完成的区域号
@@ -526,21 +518,6 @@
                                        throw new Exception($"{station.stationCode}已存在车轮SN号:{Wheel_SN}");
                                }
                                station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN;
                                station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID;
                                station.quantity++;
                                if (station.quantity == 1)
                                {
                                    station.stationType = Mes_Work.drawingNo;
                                    station.Number = Mes_Work.workOrder;
                                    station.heatNumber = Mes_Work.heatID;
                                    station.tray_status = "StrogeTray";
                                }
                                var count = stationinfoRepository.Update(station, true);
                                if (count < 1)
                                    throw new Exception($"下料位信息更新失败!下料位编号:{station.stationCode}");
                                #region æ¸…空给桁架的下料信息
                                client.WriteByOrder("W_IndexNr", (Int16)0, name);//托盘上的第几个车轮
                                client.WriteByOrder("W_Storage_Type", (Int16)0, name);//托盘类型1-横放;2-竖放(暂时只有横放托盘)
@@ -555,6 +532,24 @@
                                //    $"处理写入桁架信息:\nW_AreaNr:{0}\nW_IndexNr:{0}\nW_Storage_Type:{0}\n\n" +
                                //    $"写入桁架信息:\nW_Storage_update:{true}\nW_Enabl_Load:{false}", "PCS");
                                #endregion
                                #region è´§ä½çŠ¶æ€æ›´æ–°
                                station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN;
                                station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID;
                                station.quantity++;
                                if (station.quantity == 1)
                                {
                                    station.stationType = Mes_Work.drawingNo;
                                    station.Number = Mes_Work.workOrder;
                                    station.heatNumber = Mes_Work.heatID;
                                    station.tray_status = "StrogeTray";
                                }
                                var count = stationinfoRepository.Update(station, true);
                                if (count < 1)
                                    throw new Exception($"下料位信息更新失败!下料位编号:{station.stationCode}");
                                #endregion
                                #region ä¿®æ”¹å·¥å•状态
                                var Detail = mes_DetailRepository.FindFirst(x => x.jobID == Mes_Work.jobID && x.SN == Mes_Work.SN);
@@ -572,6 +567,15 @@
                            }
                        }
                        var Stations = stationinfoRepository.Find(x => x.area == Pipeline.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList();
                        #region ä¸‹æ–™ä½æ˜¯å¦ä¸ºç©ºçŠ¶æ€åŒæ­¥ç»™æ¡æž¶
                        foreach (var station in Stations)
                        {
                            client.WriteByOrder(station.stationCode, station.location_state != LocationStateEnum.Stroge.ToString(), name);
                        }
                        #endregion
                        var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client);
                        if (!Request) continue;