| | |
| | | Creater = "WMS", |
| | | Depth = newLocation.Depth, |
| | | CreateDate = DateTime.Now, |
| | | MaterialType= dt_StockInfo.MaterialType |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (newLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | |
| | | /// è§£æåºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent Queryinventory2(GenerateInv generate) |
| | | public WebResponseContent Queryinventory(GenerateInv generate) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if(dt_StockInfo == null) |
| | | |
| | | string[] targetCodes = generate.PalletCode.Split("*"); |
| | | if (targetCodes.Length == 4) |
| | | { |
| | | |
| | | string[] targetCodes = generate.PalletCode.Split("*"); |
| | | if(targetCodes.Length == 4) |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodes[0]); |
| | | |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | if (dt_Inbound.OrderType == (int)InventoryMaterialType.åææ) //0ä¸ºåææç¼ç |
| | | { |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodes[0]); |
| | | 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); |
| | | |
| | | if (dt_StockInfo == null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | |
| | | Status = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | |
| | | }; |
| | | _stockService.StockInfoDetailService.AddData(dt_StockInfoDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo == "2" && x.LocationStatus== (int)LocationStatusEnum.Free && x.Depth==1); |
| | | if (locationInfos.Count < 50) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | |
| | | { |
| | | 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.æå) |
| | | |
| | | |
| | | |
| | | } |
| | | else if (dt_Inbound.OrderType == (int)InventoryMaterialType.æå) |
| | | { |
| | | if(dt_StockInfo==null) |
| | | { |
| | | Dt_StockInfo dt_Stock = new() |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°æ¡ç è§£æï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | 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($"è§£æçæçæ¡ç é¿åº¦ä¸è¶³4,æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°æ¡ç è§£æï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"å·²æåºåï¼å
¥åºå¤±è´¥ï¼{generate.PalletCode}"); |
| | | return content = WebResponseContent.Instance.Error($"è§£æçæçæ¡ç é¿åº¦ä¸è¶³4,æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent Queryinventory(GenerateInv generate) |
| | | public WebResponseContent Queryinventory2(GenerateInv generate) |
| | | { |
| | | try |
| | | { |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | |
| | | string part2 = generate.PalletCode.Substring(2, 8); |
| | | //string part2 = generate.PalletCode.Substring(2, 8); |
| | | |
| | | string part3 = generate.PalletCode.Split('#')[1]; |
| | | //string part3 = generate.PalletCode.Split('#')[1]; |
| | | Dt_StockInfo dt_StockInfo2 = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == generate.PalletCode); |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | { |