分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-21 15cfe97f5cf6f1e8591da7cf658fab2452e0d60f
优化检测上料逻辑,优化出库逻辑
已修改2个文件
17 ■■■■ 文件已修改
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs
@@ -111,11 +111,11 @@
                    {
                        if (AreaNr == 0)
                        {
                            Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(QueryMateriel(Station.stationType) == null ? QueryMateriel1(Station.stationType).TypeId : QueryMateriel(Station.stationType).TypeId), number);//车轮类型
                            var area = Convert.ToInt16(Station.stationCode.Substring(Station.stationCode.Length - 1, 1));
                            Gantry_client.WriteByOrder("W_AreaNr", (Int16)area, number);//区域货位号
                            Gantry_client.WriteByOrder("W_IndexNr", (Int16)SNS.Length, number);//托盘上的第几个车轮
                            Gantry_client.WriteByOrder("W_Storage_Type", (Int16)1, number); //托盘类型1-横放;2-竖放
                            Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(QueryMateriel(Station.stationType) == null ? QueryMateriel1(Station.stationType).TypeId : QueryMateriel(Station.stationType).TypeId), number);//车轮类型
                            Gantry_client.WriteByOrder("W_Wheel_id", SNS[SNS.Length - 1], number);//车轮SN号
                            Gantry_client.WriteByOrder("W_RequestUnload", true, number);
                            #region æ—¥å¿—记录
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs
@@ -43,9 +43,10 @@
                        var Station = stationinfoRepository.Find(x => x.stationCode == inventory.stationCode).FirstOrDefault();//查找库存货位
                        if (Station != null)
                        {
                            dt_stationinfo stationinfo = null;
                            #region åº“区一
                            #region
                            dt_stationinfo stationinfo = null;
                            if (Station.area == "1")
                            {
                                //查找当前货位同列是否存在入库任务
@@ -53,7 +54,6 @@
                                stationinfo = stationinfoRepository.Find(x => x.column == Station.column && x.enable && x.area == "1" && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.line).FirstOrDefault();
                            }
                            #endregion
                            else
                            {
                                //查找当前货位同列是否存在入库任务
@@ -61,9 +61,10 @@
                                stationinfo = stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.column).FirstOrDefault();
                            }
                            if (stationinfo != null)
                            {
                                if (stationinfoRepository.Find(x => x.line == stationinfo.line && x.area == stationinfo.area && x.column > stationinfo.column && !x.enable).Any())
                                    continue;
                                if (string.IsNullOrEmpty(stationinfo.bindSN))
                                {
                                    stationinfo.remark = "车轮SN号信息异常";
@@ -86,8 +87,8 @@
                                var count = 0;
                                foreach (var SN in lists)
                                {
                                    //if (!workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) return;
                                    if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++;
                                    if (workinfoRepository.Find(x => x.processCode == "28" && x.SN == SN).Any()) count++;
                                    //if (workinfoRepository.Find(x => x.processCode == "28" && x.SN.Contains(SN)).Any()) count++;
                                }
                                if (count != lists.Count) continue;
@@ -153,6 +154,7 @@
                                //}
                                #endregion
                            }
                            #endregion
                        }
                    }
                }
@@ -162,6 +164,5 @@
                WriteDBLog.Error("创建出库任务", $"错误信息:{ex.Message}", "PCS");
            }
        }
    }
}