1
hutongqing
2024-10-15 f277dbca9d85812db3309e12a034e5e562e0f135
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -72,7 +72,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo stockInfo = _stockInfoService.Repository.GetStockInfo(palletCode);
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode);
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo);
@@ -99,7 +99,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(stationCode, taskType);
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType);
                if (locationInfo != null)
                {
                    Dt_Task task = new()
@@ -126,15 +126,15 @@
                            orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
                            stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                            _stockInfoService.Repository.UpdateData(stockInfo);
                            _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                        }
                        else
                        {
                            return content = WebResponseContent.Instance.Error("未找到库存信息");
                        }
                    }
                    _locationInfoService.Repository.UpdateData(locationInfo);
                    _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    return content = WebResponseContent.Instance.OK();
                }
@@ -186,7 +186,7 @@
            }
            else
            {
                if (_stockInfoService.Repository.QueryFirst(x => x.PalletCode == palletCode) != null)
                if (_stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == palletCode) != null)
                {
                    return (false, "该托盘已存在库内");
                }
@@ -195,35 +195,6 @@
            return (true, "成功");
        }
        /// <summary>
        /// ç©ºæ‰˜ç›˜å…¥åº“完成处理
        /// </summary>
        /// <param name="task">任务实体对象</param>
        /// <returns>返回处理结果</returns>
        public WebResponseContent PalletInboundTaskCompleted(Dt_Task task)
        {
            Dt_StockInfo stockInfo = new Dt_StockInfo()
            {
                PalletCode = task.PalletCode,
                LocationCode = task.TargetAddress,
                StockStatus = StockStatusEmun.已入库.ObjToInt()
            };
            Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
            CheckInboundCompleted(stockInfo, locationInfo);
            _stockInfoService.Repository.AddData(stockInfo);
            int beforeStatus = locationInfo.LocationStatus;
            locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
            _locationInfoService.Repository.UpdateData(locationInfo);
            BaseDal.DeleteData(task);
            _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
            return WebResponseContent.Instance.OK();
        }
    }
}