1
647556386
2025-12-18 3b3ff1836b8837ffd541cc7eefde8d5e5d195110
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -292,7 +292,7 @@
            task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
            //  BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
            var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.浜哄伐鍒犻櫎);
            var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚);
            if (!result)
            {
                await Db.Deleteable(task).ExecuteCommandAsync();
@@ -502,28 +502,27 @@
            locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
            _locationInfoService.Repository.UpdateData(locationInfo);
            var outloks = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>().Where(x => x.TaskNum == task.TaskNum).ToListAsync();
            var stockids = outloks.Select(x => x.StockId).ToList();
            _stockService.StockInfoService.Db.Updateable<Dt_StockInfo>()
                                  .SetColumns(it => new Dt_StockInfo
                                  {
                                      StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt(),
                                      LocationCode = ""
                                  })
                                  .Where(it => stockids.Contains(it.Id))
                                  .ExecuteCommand();
            _stockService.StockInfoDetailService.Db.Updateable<Dt_StockInfoDetail>()
                                  .SetColumns(it => new Dt_StockInfoDetail
                                  {
                                      Status = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt()
                                  })
                                  .Where(it => stockids.Contains(it.StockId))
                                  .ExecuteCommand();
            var stock = _stockService.StockInfoService.Db.Queryable<Dt_StockInfo>()
                                  .Includes(x => x.Details)
                                  .Where(x => x.PalletCode == task.PalletCode)
                                  .First();
            stock.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
            stock.LocationCode = "";
            stock.Details.ForEach(x =>
            {
                x.Status = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
            });
            _stockService.StockInfoService.Db.UpdateNav(stock).IncludesAllFirstLayer().ExecuteCommand();
            var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚);
            if (!result)
            {
                await Db.Deleteable(task).ExecuteCommandAsync();
            }
            return WebResponseContent.Instance.OK();