陈勇
2026-03-30 7154cc02c0fa9ef6786a19da0281bf6982fa61bd
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestEmptyInboundRoadWayNo.cs
@@ -11,6 +11,7 @@
using WIDESEA_DTO;
using WIDESEA_Model.Models;
using WIDESEA_Repository;
using WIDESEA_StorageBasicRepository;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Model.Models;
@@ -28,18 +29,30 @@
            WebResponseContent response = new WebResponseContent();
            try
            {
                //如任务已存在则 è¿”回此任务
                var checkTask = _taskRepository.QueryFirst(x => x.PalletCode == json.PalletCode && x.PVI == json.PVI);
                if (checkTask != null)
                {
                    return response.OK("申请入库成功", data: checkTask);
                }
                var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode);
                if (carInfo == null) throw new Exception("未知空撬信息,无法入库");
                //{
                //    Dt_CarBodyInfo _CarBodyInfo = new Dt_CarBodyInfo  //测试
                //    {
                //        PVI = "J25000660",
                //        RFID = json.PVI,
                //        BodyStatus = 0,
                //        CarType = 1,
                //    };
                //}
                if (carInfo == null)
                {
                    Dt_CarBodyInfo dt_CarBodyInfo = new Dt_CarBodyInfo
                    {
                        PalletCode = json.PalletCode,
                        CarType = 3,
                        PVI = json.PalletCode,
                        RFID = json.PalletCode,
                        BodyStatus = 0
                    };
                    _carBodyInfoRepository.AddData(dt_CarBodyInfo);
                    carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode);
                }
                var maxGroup = _locationRepository.QueryData(x => x.LocationType == 3 && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable)
                                .GroupBy(x => x.RoadwayNo)
@@ -77,13 +90,11 @@
                    TaskNum = _taskRepository.GetTaskNo().Result,
                    Creater = "Systeam",
                    PVI = json.PVI,
                    CarType = carInfo.CarType
                };
                _unitOfWorkManage.BeginTran();
                _taskRepository.AddData(newtask);
                //location.LocationStatus = (int)LocationEnum.InStockDisable;
                //_locationRepository.UpdateData(location);
                _unitOfWorkManage.CommitTran();
                response.OK("空撬申请入库成功", data: newtask);
@@ -92,7 +103,7 @@
            }
            catch (Exception ex)
            {
                response.Error($"请求巷道号失败:{ex.Message}");
                response.Error($"空撬请求巷道号失败:{ex.Message}");
            }
            return response;
        }