| | |
| | | using Microsoft.Extensions.Logging; |
| | | using MailKit.Search; |
| | | using System.Reflection.Metadata; |
| | | using static WIDESEA_ITaskInfoService.ITaskService; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | }; |
| | | BaseDal.AddData(task); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | |
| | | |
| | | |
| | | if (isUpdateStock) |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | |
| | | /// </summary> |
| | | /// <param name="PalletCode"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateInventoryInformation(string SourceAddress, string PalletCode) |
| | | public WebResponseContent GenerateInventoryInformation(GenerateInv generate) |
| | | { |
| | | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == PalletCode); |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (task != null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"å·²æè¯¥æççå
¥åºä»»å¡ï¼æçå·ï¼{task.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == PalletCode); |
| | | if (dt_StockInfo == null) |
| | | |
| | | if ((generate.SourceAddress == "R01-003-041-011-01" || generate.SourceAddress == "R01-002-043-001-01" || generate.SourceAddress == "R02-003-027-011-01")) |
| | | { |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if(dt_StockInfo2 == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.空æ, |
| | | Materialweight = 0, |
| | | Wlstatus = (int)InventoryMaterialStatus.空æ, |
| | | }; |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | } |
| | | } |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (dt_StockInfo != null) |
| | | { |
| | | Dt_LocationInfo newLocation; |
| | | Dt_LocationInfo newSourceAddress; |
| | | newSourceAddress = _basicService.LocationInfoService.GetLocationplatform(SourceAddress); |
| | | newLocation = _basicService.LocationInfoService.GetLocation(newSourceAddress.RoadwayNo); |
| | | string[] Pallet = PalletCode.Split("-"); |
| | | newSourceAddress = _basicService.LocationInfoService.GetLocationplatform(generate.SourceAddress); |
| | | int Locationtype = 9; //é»è®¤ä¸º9 |
| | | if(dt_StockInfo.MaterialType== (int)InventoryMaterialType.æå || (generate.SourceAddress == "R01-003-041-001-01" && dt_StockInfo.MaterialType == (int)InventoryMaterialType.åææ)) |
| | | { |
| | | Locationtype = 11; |
| | | }else if(dt_StockInfo.MaterialType == (int)InventoryMaterialType.åææ) |
| | | { |
| | | Locationtype = 10; |
| | | } |
| | | newLocation = _basicService.LocationInfoService.GetLocation(newSourceAddress.RoadwayNo, Locationtype); |
| | | //string[] Pallet = PalletCode.Split("-"); |
| | | if (newLocation != null && newSourceAddress != null) |
| | | { |
| | | |
| | | |
| | | //çæå
¥åºä»»å¡ |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = PalletCode, |
| | | PalletCode = generate.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = newLocation.RoadwayNo, |
| | | TaskType = newSourceAddress.LocationType == (int)LocationTypeEnum.EmptyOut ? TaskTypeEnum.PalletInbound.ObjToInt() : TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = newSourceAddress.LocationCode, |
| | | TargetAddress = newLocation.LocationCode, |
| | |
| | | Creater = "WMS", |
| | | Depth = newLocation.Depth, |
| | | CreateDate = DateTime.Now, |
| | | MaterialType= dt_StockInfo.MaterialType |
| | | }; |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = PalletCode, |
| | | LocationCode = newLocation.LocationCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = newSourceAddress.LocationType == (int)LocationTypeEnum.EmptyIn ? (int)InventoryMaterialType.空æ: |
| | | (newSourceAddress.LocationType == (int)LocationTypeEnum.FinishedIn ? (int)InventoryMaterialType.æå: (int)InventoryMaterialType.åææ), |
| | | Materialweight = float.Parse(Pallet[3]), |
| | | }; |
| | | |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (newLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | |
| | | } |
| | | BaseDal.AddData(dt_Task); |
| | | _basicService.LocationInfoService.UpdateData(newLocation); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçèµ·ç¹:{SourceAddress},æç»ç¹{newSourceAddress.RoadwayNo}ï¼ä¿¡æ¯"); |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçèµ·ç¹:{generate.SourceAddress},æç»ç¹{newSourceAddress.RoadwayNo}ï¼ä¿¡æ¯"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"该æçå·å·²å
¥åºï¼è¯·æ ¸å¯¹æçå·:{PalletCode}"); |
| | | //Queryinventory(generate.PalletCode); |
| | | return content = WebResponseContent.Instance.Error($"ç»çï¼è¯·æ ¸å¯¹æçå·:{generate.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | /// æ¥è¯¢1å··éåºåï¼æ¯å¦è¿è¡è¿è¡å
¥åº //带åç»éæ°æ¼æ¥ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent Queryinventory(string palletCode) |
| | | public WebResponseContent Queryinventory3(GenerateInv generate) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string[] targetCodes = palletCode.Split("-"); |
| | | if (targetCodes[2] == "2") |
| | | try |
| | | { |
| | | List<Dt_LocationInfo> LocationInfo = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo == "2" && x.LocationType == (int)LocationStatusEnum.Free).ToList(); |
| | | if (LocationInfo.Count < 40) |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string result = generate.PalletCode.Substring(0, 2); |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.UpperOrderNo == result); |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (dt_Inbound != null) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(); |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.åææ, |
| | | Materialweight = 0, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | |
| | | string part2 = generate.PalletCode.Substring(2, 8); |
| | | |
| | | string part3 = generate.PalletCode.Split('#')[1]; |
| | | Dt_StockInfo dt_StockInfo2= _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |
| | | StockId = dt_StockInfo2.Id, |
| | | MaterielCode = result, //ç©æç¼å· |
| | | MaterielName = dt_Inbound.OrderNo, //æè´¨ |
| | | OrderNo = generate.PalletCode, //åæ®ï¼æçæ¡ç ï¼ |
| | | BatchNo = part2, //æ¹æ¬¡å· |
| | | SerialNumber = part3, //åºåå· |
| | | StockQuantity = 1, //åºåå· |
| | | OutboundQuantity = 1, //åºåå· |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error(); |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°è¯¥ç±»åçè§£æ"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è§£æåºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent Queryinventory(GenerateInv generate) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | string[] targetCodes = generate.PalletCode.Split("*"); |
| | | if (targetCodes.Length == 4) |
| | | { |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodes[0]); |
| | | |
| | | if(dt_Inbound != null) |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (dt_Inbound.OrderType == (int)InventoryMaterialType.åææ) //0ä¸ºåææç¼ç |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo == "2" && x.LocationStatus == (int)LocationStatusEnum.Free && x.Depth == 1 && x.EnableStatus == (int)EnableStatusEnum.Normal && x.LocationType == (int)LocationTypeEnum.MaterialsCube); |
| | | |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.åææ, |
| | | Materialweight = decimal.Parse(targetCodes[3]), |
| | | Wlstatus = (int)InventoryMaterialStatus.å¾
æ£, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | string part2 = targetCodes[1].Substring(0, 2); //è§£æç©ææ¹æ¬¡æ¾è¯¦æ
|
| | | Dt_InboundOrder dt_Int = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.UpperOrderNo == part2); |
| | | |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |
| | | StockId = dt_StockInfo2.Id, |
| | | MaterielCode = dt_Inbound.OrderName, //ç©æå· |
| | | MaterielName = dt_Inbound.UpperOrderNo, //ç©æåç§° |
| | | OrderNo = dt_Inbound.OrderNo, //ç©æè¯¦æ
|
| | | BatchNo = targetCodes[1].ToString(), //ç©ææ¹æ¬¡ |
| | | SerialNumber = targetCodes[2].ToString(), //å
å· |
| | | BatchNoName = dt_Int.OrderNo, |
| | | StockQuantity = decimal.Parse(targetCodes[3].ToString()), //éé |
| | | OutboundQuantity = 1, //åºåå· |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | if (locationInfos.Count < 50) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (dt_StockInfo.StockStatus == (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | if (locationInfos.Count < 50) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | else if (dt_Inbound.OrderType == (int)InventoryMaterialType.æå) |
| | | { |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.æå, |
| | | Materialweight = decimal.Parse(targetCodes[3]), |
| | | Wlstatus = (int)InventoryMaterialStatus.å¾
æ£, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |
| | | StockId = dt_StockInfo2.Id, |
| | | MaterielCode = dt_Inbound.OrderName, //ç©æå· |
| | | MaterielName = dt_Inbound.UpperOrderNo, //ç©æåç§° |
| | | OrderNo = dt_Inbound.OrderNo, //ç©æè¯¦æ
|
| | | BatchNo = targetCodes[1].ToString(), //ç©ææ¹æ¬¡ |
| | | BatchNoName = "", |
| | | SerialNumber = targetCodes[2], //å
å· |
| | | StockQuantity = decimal.Parse(targetCodes[3]), //éé |
| | | OutboundQuantity = 1, //åºåå· |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | if (dt_StockInfo.StockStatus == (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°æ¡ç è§£æï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"è§£æçæçæ¡ç é¿åº¦ä¸è¶³4,æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content=WebResponseContent.Instance.Error($"ç³»ç»å··éå
¥åºæ¥å£è§£æé误ï¼é误ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent Queryinventory2(GenerateInv generate) |
| | | { |
| | | try |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string result = generate.PalletCode.Substring(0, 2); |
| | | if (result == "B-") |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.æå, |
| | | Materialweight = 0, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | |
| | | //string part2 = generate.PalletCode.Substring(2, 8); |
| | | |
| | | //string part3 = generate.PalletCode.Split('#')[1]; |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |
| | | StockId = dt_StockInfo2.Id, |
| | | MaterielCode = dt_StockInfo2.PalletCode, //ç©æç¼å· |
| | | MaterielName = dt_StockInfo2.PalletCode, //æè´¨ |
| | | OrderNo = dt_StockInfo2.PalletCode, //åæ®ï¼æçæ¡ç ï¼ |
| | | BatchNo = dt_StockInfo2.PalletCode, //æ¹æ¬¡å· |
| | | SerialNumber = dt_StockInfo2.PalletCode, //åºåå· |
| | | StockQuantity = 1, //åºåå· |
| | | OutboundQuantity = 1, //åºåå· |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | if(dt_StockInfo.StockStatus== (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data:1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.UpperOrderNo == result); |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | List<Dt_LocationInfo> locationinfoData = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo == "2" && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() |
| | | && x.LocationType == (int)LocationTypeEnum.MaterialsCube); |
| | | if (dt_Inbound != null) |
| | | { |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | | PalletCode = generate.PalletCode, |
| | | IsFull = true, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.åææ, |
| | | Materialweight = 0, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | |
| | | string part2 = generate.PalletCode.Substring(2, 8); |
| | | |
| | | string part3 = generate.PalletCode.Split('#')[1]; |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |
| | | StockId = dt_StockInfo2.Id, |
| | | MaterielCode = result, //ç©æç¼å· |
| | | MaterielName = dt_Inbound.OrderNo, //æè´¨ |
| | | OrderNo = generate.PalletCode, //åæ®ï¼æçæ¡ç ï¼ |
| | | BatchNo = part2, //æ¹æ¬¡å· |
| | | SerialNumber = part3, //åºåå· |
| | | StockQuantity = 1, //åºåå· |
| | | OutboundQuantity = 1, //åºåå· |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | |
| | | if (locationinfoData.Count > 40) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (dt_StockInfo.StockStatus == (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | if (locationinfoData.Count > 40) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°è¯¥ç±»åçè§£æ"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent PalletQueryinventory() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | List<Dt_LocationInfo> locationinfoData = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo=="2" && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() |
| | | && x.LocationType == (int)LocationTypeEnum.MaterialsCube && x.EnableStatus == (int)EnableStatusEnum.Normal); |
| | | if (locationinfoData.Count < 20) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.OK(); |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |