分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-05-14 5b909ae151855d0fc04cd1215a48ba1c9251dc11
优化入库逻辑
已修改4个文件
58 ■■■■ 文件已修改
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/GetLocation.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs
@@ -19,7 +19,52 @@
    public class GetStation
    {
        /// <summary>
        /// å½“前库位同一行是否存在入库占用
        /// true:是 false:否
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
        public static bool InBusyStation(string StationCode)
        {
            bool OK = false;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var station = stationinfoRepository.Find(x => x.stationCode == StationCode).FirstOrDefault();
                OK = stationinfoRepository.Find(x => x.area == station.area && x.line == station.line && x.location_state == LocationStateEnum.InBusy.ToString()).Any();
            }
            catch (Exception ex)
            {
            }
            return OK;
        }
        /// <summary>
        /// å½“前库位同一行是否存在出库占用
        /// true:是 false:否
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
        public static bool OutBusyStation(string StationCode)
        {
            bool OK = false;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var station = stationinfoRepository.Find(x => x.stationCode == StationCode).FirstOrDefault();
                OK = stationinfoRepository.Find(x => x.area == station.area && x.line == station.line && x.location_state == LocationStateEnum.OutBusy.ToString()).Any();
            }
            catch (Exception ex)
            {
            }
            return OK;
        }
        /// <summary>
        /// å½“前库位外边的货位是否都为空
        /// true:否 false:是
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs
@@ -48,7 +48,7 @@
                            dt_stationinfo stationinfo = null;
                            //查找当前货位同行是否存在入库任务
                            if (stationinfoRepository.Find(x => x.line == Station.line && x.area == Station.area && x.location_state == LocationStateEnum.InBusy.ToString()).Any()) continue;
                            if (GetStation.InBusyStation(Station.stationCode)) continue;
                            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)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -176,7 +176,7 @@
                }
                else if (agvtask.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceInbound.ToString() || agvtask.agv_tasktype == AGVTaskTypeEnum.TaskType_Inbound.ToString())//外协库入库/AB库入库
                {
                    if (agvtask.agv_toaddress == "")
                    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();
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ÐÂÎļþ¼Ð/GetLocation.cs
@@ -44,10 +44,7 @@
                    {
                        TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderBy(x => x.column).FirstOrDefault();
                        if (TargetLocation != null)
                        {
                            if (!stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any())
                                return TargetLocation;
                        }
                            if (!GetStation.OutBusyStation(TargetLocation.stationCode) && !GetStation.QueueStation(TargetLocation.stationCode)) return TargetLocation;
                    }
                    #endregion
@@ -80,7 +77,7 @@
                        TargetLocation = stationinfoRepository.Find(x => x.line == station.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == station.area).OrderBy(x => x.column).FirstOrDefault();
                        if (TargetLocation != null)
                        {
                            if (!stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any())
                            if (!GetStation.OutBusyStation(TargetLocation.stationCode) && !GetStation.QueueStation(TargetLocation.stationCode))
                                return TargetLocation;
                        }
                        #endregion
@@ -144,7 +141,7 @@
                    #region æŸ¥çœ‹å½“前空货位后是否存在有料
                    if (TargetLocation != null)
                        if (stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any()) TargetLocation = null;
                        if (GetStation.QueueStation(TargetLocation.stationCode)) TargetLocation = null;
                    #endregion
                    #endregion