dengjunjie
2025-05-20 be484c84a25d1f6c769e7b5e958048d745942e55
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs
@@ -26,15 +26,7 @@
            {
                string ConveyorLineID = AppSettings.Configuration[nameof(ConveyorLineID)];
                if (!ConveyorLineID.Split(",").Contains(lineDTO.stationCode)) throw new Exception($"未找到输送线编号[{lineDTO.stationCode}]的信息");
                switch (lineDTO.stationCode)
                {
                    case "102":
                        content = TransmissionlineRequest(lineDTO);
                        break;
                    case "1001":
                        content = ProductionlineRequest(lineDTO);
                        break;
                }
                content = TransmissionlineRequest(lineDTO);
            }
            catch (Exception ex)
            {
@@ -105,38 +97,49 @@
                //{
                //    throw new Exception($"当前入库站台[{lineDTO.stationCode}]已有一条任务");
                //}
                var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt());
                var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode);
                if (task == null) throw new Exception($"未找到托盘号[{lineDTO.Barcode}]的入库任务");
                if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt())
                {
                    task.NextAddress = "1004";
                    task.CurrentAddress = lineDTO.stationCode;
                    task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
                    BaseDal.UpdateData(task);
                    return content;
                }
                if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"未找到托盘号[{lineDTO.Barcode}]的入库任务");
                //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"托盘号[{lineDTO.Barcode}]的入库任务状态不匹配");
                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();
                Dt_StockInfoDetail? stockInfoDetail = stockInfo.Details.FirstOrDefault();
                if (lineDTO.Spec != 1 || lineDTO.Weight != 500)//检测条件需更改!!!!!!!!!!
                if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//检测条件需更改!!!!!!!!!!
                {
                    task.NextAddress = "101";
                    task.TaskState = (int)InTaskStatusEnum.InException;
                    task.Remark = $"托盘[{lineDTO.Barcode}]信息不合格";
                    //task.NextAddress = "101";
                    //task.TaskState = (int)InTaskStatusEnum.InException;
                    task.Remark = $"托盘[{lineDTO.Barcode}]超重";
                    //task.Remark = $"托盘[{lineDTO.Barcode}]信息不合格";
                    //stockInfo.StockStatus = StockStatusEmun.入库撤销.ObjToInt();
                }
                else
                {
                    task.NextAddress = "104";
                    task.NextAddress = "1004";
                    task.CurrentAddress = lineDTO.stationCode;
                    task.Remark=string.Empty;
                    task.Remark = string.Empty;
                    task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
                    stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                    stockInfoDetail.Status = StockStatusEmun.入库确认.ObjToInt();
                    if (stockInfoDetail != null) stockInfoDetail.Status = StockStatusEmun.入库确认.ObjToInt();
                }
                #region äº‹åŠ¡
                Db.Ado.BeginTran();
                BaseDal.UpdateData(task);
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                if (stockInfoDetail != null) _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                //Db.Updateable(stockInfo).ExecuteCommand();
                Db.Ado.CommitTran();
                #endregion