分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-06-20 58bd958f1fa8a85d0a3ac33a1ab1e2cab5d63dd2
按照SN号查询最新的工单
已修改5个文件
23 ■■■■ 文件已修改
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Pipeline.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs
@@ -75,7 +75,7 @@
                            }
                        }
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询车轮" ? "17" : "28")).FirstOrDefault();
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询车轮" ? "17" : "28")).OrderByDescending(x => x.CreateTime).FirstOrDefault();
                        if (Mes_Work == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
@@ -173,7 +173,7 @@
                        }
                        var wp_type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_type").First(), client);
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询订单" ? "17" : "28")).FirstOrDefault();
                        var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "辊道上料查询订单" ? "17" : "28")).OrderByDescending(x => x.CreateTime).FirstOrDefault();
                        if (Mes_Work == null)
                        {
                            client.WriteByOrder("W_i_status", (byte)2, name);
@@ -299,7 +299,7 @@
                            }
                            //var Wheel_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_id").First(), client).ToString();
                            var Mes_Work = workinfoRepository.Find(x => x.SN == Wheel_SN && x.processCode == "17").FirstOrDefault();
                            var Mes_Work = workinfoRepository.Find(x => x.SN == Wheel_SN && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                            if (Mes_Work == null)
                            {
                                #region æ—¥å¿—记录
@@ -429,7 +429,7 @@
                            WriteLog.Write_Log(name + "申请放料异常", "车轮SN号为空", "", $"读取桁架信息:\n车轮SN号:{Wheel_id}为空");
                            continue;
                        }
                        var Work = workinfoRepository.Find(x => x.SN == Wheel_id && x.processCode == "17").FirstOrDefault();
                        var Work = workinfoRepository.Find(x => x.SN == Wheel_id && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                        if (Work == null)
                        {
                            client.WriteByOrder("W_Enabl_Load", false, name);//信号为false桁架停止进入
@@ -463,7 +463,8 @@
                        #endregion
                        #region æ‰˜ç›˜ç±»åž‹ä¸ä¸€è‡´éœ€æ›´æ¢æ‰˜ç›˜
                        foreach (var Stationinfo in Stations)
                        stations = Stations.Where(x => x.enable).ToList();
                        foreach (var Stationinfo in stations)
                        {
                            if (Stationinfo.tray_type != "LargeTray" && /*(wheel == null ? wheel1.e :)*/ wheel.e > 1100)
                            {
@@ -717,7 +718,7 @@
                                    //WriteDBLog.Success(name + "允许放料", $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:NG" +$"\n读取托盘光电信号:{PalletSignal}" +
                                    //    $"\n\n写入桁架信息:\n下料位号:{area}\n第几个车轮:{(Stationinfo.quantity + 1)}\n托盘类型:1\nW_Enabl_Load:true", "PCS");
                                    WriteLog.Write_Log(name + "申请放料", Wheel_id, "允许放料",
                                        $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:合格" +
                                        $"读取桁架信息:\n车轮SN:{Wheel_id}\n轮型ID:{Wheel_Type}\n车轮状态:不合格" +
                                        $"\n读取托盘光电信号:{PalletSignal}" +
                                        $"\n\n写入桁架信息:\n下料位号:{area}\n第几个车轮:{(Stationinfo.quantity + 1)}\n托盘类型:1\n是否允许下料:true");
                                    #endregion
@@ -748,7 +749,7 @@
            VOLContext Context = new VOLContext();
            Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
            IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
            Work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.processCode == "17").FirstOrDefault();
            Work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
            var task = agvtaskRepository.Find(x => x.agv_fromaddress == stationinfo.stationCode).FirstOrDefault();
            if (task != null) return;
            if (!string.IsNullOrEmpty(Work.area))
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Pipeline.cs
@@ -578,7 +578,7 @@
            Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context);
            IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
            //var mes_Detail = freeDB.Select<dt_mes_detail>().Where(x => x.SN == SN).First();
            var Mes_Work = workinfoRepository.Find(x => x.SN == SN && x.processCode == "28").FirstOrDefault();
            var Mes_Work = workinfoRepository.Find(x => x.SN == SN && x.processCode == "28").OrderByDescending(x => x.CreateTime).FirstOrDefault();
            var mes_Detail = mes_DetailRepository.Find(x => x.SN == SN && x.jobID == Mes_Work.jobID).FirstOrDefault();
            if (mes_Detail != null)
            {
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/Wheel_info_trace.cs
@@ -76,7 +76,7 @@
                        info.trace_status = "待加工";
                        info.trace_online_time = time;
                        info.trace_line_number = StackerDBItem.Name;
                        var Work = workinfoRepository.Find(x => x.SN == info.trace_SN && x.processCode == "17").FirstOrDefault();
                        var Work = workinfoRepository.Find(x => x.SN == info.trace_SN && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                        if (Work != null)
                        {
                            info.trace_workOrder = Work.workOrder;
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -84,7 +84,7 @@
                    if (string.IsNullOrEmpty(agvtask.agv_toaddress))
                    {
                        var stationinfo = stationinfoRepository.Find(x => x.stationCode == agvtask.agv_fromaddress).FirstOrDefault();
                        var work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.drawingNo == stationinfo.stationType && x.heatID == stationinfo.heatNumber && x.processCode == "17").FirstOrDefault();
                        var work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.drawingNo == stationinfo.stationType && x.heatID == stationinfo.heatNumber && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
                        var TargetLocation = agvtask.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString() ? GetLocation.GetEmptyLocation(stationinfoRepository, work, agvtask) : StationTask.GetEmptyLocation(stationinfoRepository);
                        if (TargetLocation != null)
                        {
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs
@@ -54,7 +54,7 @@
                    //根据下料口的绑定信息查询对应工单,检测此工单是否已完成  å®Œæˆå³å¯å°†å…¶é€å…¥åº“
                    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 = "触发入库任务,但未找到工单信息!";