分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-05-20 cb62fe00ff0c80bce983b0aa7a2b320fdc26f85f
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/ToMes/shiftingparking.cs
@@ -42,6 +42,8 @@
                if (station2 == null) return content.Error("请输入正确的起点地址!");
                if (!station1.tray_type.Contains("Small") && station2.area != "4")
                    throw new Exception($"大托盘只能存放在库区4!");
                if (station1.tray_type.Contains("Small") && station2.area != "3" && station2.area != "2")
                    throw new Exception($"小托盘只能存放在库区2/库区3!");
                if (agvtaskRepository.Find(x => x.agv_fromaddress.Contains(from_address) || x.agv_toaddress.Contains(from_address)).Any())
                    throw new Exception($"起点{from_address}已存在任务!");
                if (agvtaskRepository.Find(x => x.agv_fromaddress.Contains(to_address) || x.agv_toaddress.Contains(to_address)).Any())
@@ -52,17 +54,9 @@
                    throw new Exception($"终点{to_address}不是空货位!");
                if (string.IsNullOrEmpty(station1.stationType))
                    throw new Exception($"起点{from_address}未绑定物料类型!");
                if (station2.area == "1")
                {
                    if (stationinfoRepository.Find(x => x.area == station2.area && x.column == station2.column && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
                        throw new Exception($"终点{to_address}同列存在与起点物料类型不匹配!");
                }
                else
                {
                    if (stationinfoRepository.Find(x => x.area == station2.area && x.line == station2.line && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
                        throw new Exception($"终点{to_address}同行存在与起点物料类型不匹配!");
                }
                if (stationinfoRepository.Find(x => x.area == station2.area && x.line == station2.line && x.enable && x.location_state != LocationStateEnum.Empty.ToString() && x.stationType != station1.stationType).Any())
                    throw new Exception($"终点{to_address}同行存在与起点物料类型不匹配!");
                var inventory = inventoryRepository.Find(x => x.stationCode == station1.stationCode).FirstOrDefault();
                if (inventory == null) throw new Exception($"起点{from_address}未找到库存信息!");
@@ -92,6 +86,7 @@
                station2.location_state = LocationStateEnum.InBusy.ToString();
                station2.heatNumber = station1.heatNumber;
                station2.Number = station1.Number;
                station2.billetID = station1.billetID;
                station2.stationType = station1.stationType;
                stationinfoRepository.Update(station2, true);
                content.OK();