| | |
| | | //éæ |
| | | List<Dt_StockInfo> stockInfos=new List<Dt_StockInfo>(); |
| | | List<Dt_Task> tasksNew = new List<Dt_Task>(); |
| | | List<Dt_AGVStationInfo> _AGVStationInfos = new List<Dt_AGVStationInfo>(); |
| | | foreach (var item in returnIssueDTOs.Where(x => x.ReturnMaterial != null)) |
| | | { |
| | | MESReturnMaterial? returnMaterial = item.ReturnMaterial; |
| | |
| | | return content.Error($"æªæ¾å°æ¡ç {returnMaterial.BarCode}ç©æä¿¡æ¯"); |
| | | } |
| | | //夿 |
| | | if (returnMaterial.Thickness <= 0 && materielInfo.WarehouseId==WarehouseEnum.LLDYL.ObjToInt()) |
| | | if ((returnMaterial.Thickness <= 0 || returnMaterial.Wide <= 0)&& materielInfo.WarehouseId==WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | return content.Error($"ç©æ{returnMaterial.MaterialCode}æ¡ç {returnMaterial.BarCode}ç´å¾ä¸è½å°äº0"); |
| | | } |
| | | if (returnMaterial.Wide <= 0 && materielInfo.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | return content.Error($"ç©æ{returnMaterial.MaterialCode}æ¡ç {returnMaterial.BarCode}ç´å¾ä¸è½å°äº0"); |
| | | return content.Error($"ç©æ{returnMaterial.MaterialCode}æ¡ç {returnMaterial.BarCode}ç´å¾æå¹
宽ä¸è½å°äº0"); |
| | | } |
| | | Dt_StockInfo? stockInfoOld = stockInfosOld.FirstOrDefault(x => x.PalletCode == returnMaterial.BarCode); |
| | | if (stockInfoOld != null) |
| | |
| | | BatchNo = returnMaterial.MaterialLot, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = returnMaterial.Thickness, |
| | | CheckThickness= returnMaterial.Thickness, |
| | | MaterielWide = returnMaterial.Wide, |
| | | MaterielWeight = returnMaterial.Weight, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | |
| | | IsPick = returnMaterial.Whether == 0 ? WhetherEnum.True.ObjToInt() : WhetherEnum.False.ObjToInt(), |
| | | Remark = StockStatusEmun.MES使éåº.ToString() |
| | | }; |
| | | if (stockInfo.MaterielWide > 1200) |
| | | if (stockInfo.MaterielWide >= 1160) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | |
| | | TaskTypeEnum taskTypeEnum = aGVStationInfo.StationArea switch |
| | | { |
| | | nameof(StationAreaEnum.䏿¥¼å°å·) => TaskTypeEnum.PrintYLBackInbound, |
| | | nameof(StationAreaEnum.䏿¥¼çº¸å¼ æ·è) => TaskTypeEnum.PaperLMYLBackInbound, |
| | | nameof(StationAreaEnum.䏿¥¼æ 纺æ·è) => TaskTypeEnum.WFBLMYLBackInbound, |
| | | nameof(StationAreaEnum.äºæ¥¼æ 纺å¸è¢) => TaskTypeEnum.WFBBackInbound, |
| | | nameof(StationAreaEnum.äºæ¥¼çº¸è¢) => TaskTypeEnum.PaperYLBackInbound, |
| | | _ => throw new Exception("æªæ¾å°å¯¹åºä»»å¡") |
| | | }; |
| | | if (taskTypeEnum == TaskTypeEnum.WFBLMYLBackInbound || taskTypeEnum == TaskTypeEnum.WFBBackInbound) |
| | | { |
| | | Dt_AGVStationInfo? stationInfo = AssignWFBStation(_AGVStationInfos?.Select(x=>x.AGVStationCode).ToList()) ?? throw new Exception("æªæ¾å°å¯ç¨æ çººå¸æåæ¶"); |
| | | newTask.NextAddress = stationInfo.AGVStationCode; |
| | | newTask.TargetAddress = stationInfo.AGVStationCode; |
| | | newTask.Roadway = "AGV"; |
| | | stationInfo.IsOccupied = 1; |
| | | _AGVStationInfos.Add(stationInfo); |
| | | } |
| | | newTask.TaskType = taskTypeEnum.ObjToInt(); |
| | | tasksNew.Add(newTask); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.AddData(tasksNew); |
| | | _basicRepository.AGVStationInfoRepository.UpdateData(_AGVStationInfos); |
| | | _stockRepository.StockInfoRepository.AddData(stockInfos); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |