刘磊
2026-01-17 f1d726e3de8f15cdfe30d4ca5fbba733d73a1e56
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -31,10 +31,6 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            //string palletCode = saveModel.MainData["palletCode"].ToString();
            //string station = saveModel.MainData["station"].ToString();
            // è°ƒç”¨BaseDal.QueryFirstAsync方法,查询任务
            var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode);
            if (task != null)
            {
@@ -46,14 +42,20 @@
            {
                throw new Exception($"站台{input.Position}不存在");
            }
            var carBody = _carBodyRepository.QueryFirst(x => x.PalletCode == input.PalletCode);
            //BDCManager bDCManager = new BDCManager(_bdcConfigurationService, _locationRepository, _roadWayInfoRepository);
            //await bDCManager.AddToBDC(carBody);
            // èŽ·å–åº“ä½
            var location = RequestLocation(stationInfo.Roadway);
            if (location == null)
            {
                return content.Error("无法获取货位信息或库位已满");
            }
            var newtask = new Dt_Task
            {
                CurrentAddress = input.Position,
@@ -61,7 +63,6 @@
                Roadway = stationInfo.Roadway,
                TargetAddress = location.LocationCode,
                Dispatchertime = DateTime.Now,
                NextAddress = stationInfo.Roadway,
                OrderNo = null,
                PalletCode = input.PalletCode,
@@ -70,10 +71,9 @@
                TaskType = (int)TaskInboundTypeEnum.Inbound,
                TaskNum = await BaseDal.GetTaskNo(),
                Creater = "Systeam",
            };
            _unitOfWorkManage.BeginTran();
            BaseDal.AddData(newtask);
@@ -81,7 +81,7 @@
            _locationRepository.UpdateData(location);
            _unitOfWorkManage.CommitTran();
            content.OK("申请入库成功",data: newtask);
            content.OK("申请入库成功", data: newtask);
        }
        catch (Exception er)
        {
@@ -96,10 +96,11 @@
    #endregion è¯·æ±‚任务入库
    #region åº“位分配
    #region èŽ·å–è´§ä½
    object objLOCK = new object();
    /// <summary>
    /// åŒå‡åº“位分配
    /// åº“位分配
    /// </summary>
    /// <param name="requestTask"></param>
    /// <param name="locationInfos"></param>
@@ -121,7 +122,7 @@
                return location;
            }
            catch (Exception err)
            {
            {
                Console.WriteLine(err.Message.ToString());
                return null;
            }
@@ -132,10 +133,10 @@
    private DtLocationInfo GetEmptyLocation(List<DtLocationInfo> dtLocationInfos)
    {
        var locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Column).ThenBy(x => x.Row).ThenBy(x => x.Layer).FirstOrDefault();   //.ThenByDescending(x => x.Depth)
        return locationinfo;
    }
    #endregion èŽ·å–è´§ä½
    #endregion åº“位分配