dengjunjie
3 天以前 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs
@@ -9,6 +9,7 @@
using WIDESEA_Model.Models;
using WIDESEAWCS_DTO.WCSInfo;
using WIDESEA_DTO.WCSInfo;
using WIDESEA_Common.TaskEnum;
namespace WIDESEA_TaskInfoService
{
@@ -107,40 +108,29 @@
                    BaseDal.UpdateData(task);
                    return content;
                }
                if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"未找到托盘号[{lineDTO.Barcode}]的入库任务");
                if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt() && task.TaskType != TaskTypeEnum.InQuality.ObjToInt()) throw new Exception($"未找到托盘号[{lineDTO.Barcode}]的入库任务");
                //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"托盘号[{lineDTO.Barcode}]的入库任务状态不匹配");
                #region åˆ¤æ–­åº“存状态
                Dt_InventoryInfo inventoryInfo = _stockService.InventoryInfoService.Repository.QueryFirst(x => x.PalletCode == lineDTO.Barcode);
                if (inventoryInfo == null) throw new Exception("未找到组盘信息");
                if (inventoryInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt()) throw new Exception("该组盘状态不可入库");
                if (!string.IsNullOrEmpty(inventoryInfo.LocationCode)) throw new Exception("该托盘已绑定货位");
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode);
                (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                Dt_StockInfoDetail? stockInfoDetail = stockInfo.Details.FirstOrDefault();
                if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//检测条件需更改!!!!!!!!!!
                {
                    //task.NextAddress = "101";
                    //task.TaskState = (int)InTaskStatusEnum.InException;
                    task.Remark = $"托盘[{lineDTO.Barcode}]超重";
                    //task.Remark = $"托盘[{lineDTO.Barcode}]信息不合格";
                    //stockInfo.StockStatus = StockStatusEmun.入库撤销.ObjToInt();
                }
                if (lineDTO.Weight > 1500) task.Remark = $"托盘[{lineDTO.Barcode}]超重";
                else
                {
                    task.NextAddress = "1004";
                    task.CurrentAddress = lineDTO.stationCode;
                    task.Remark = string.Empty;
                    task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
                    stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                    if (stockInfoDetail != null) stockInfoDetail.Status = StockStatusEmun.入库确认.ObjToInt();
                    inventoryInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                }
                #endregion
                #region äº‹åŠ¡
                Db.Ado.BeginTran();
                BaseDal.UpdateData(task);
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                if (stockInfoDetail != null) _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                //Db.Updateable(stockInfo).ExecuteCommand();
                _stockService.InventoryInfoService.Repository.UpdateData(inventoryInfo);
                Db.Ado.CommitTran();
                #endregion
                if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark);