| | |
| | | CreateDate = DateTime.Now, |
| | | MaterialType = (int)InventoryMaterialType.空æ, |
| | | Materialweight = 0, |
| | | Wlstatus = (int)InventoryMaterialStatus.空æ, |
| | | }; |
| | | _stockService.StockInfoService.Repository.AddData(dt_Stock); |
| | | } |
| | |
| | | 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]); |
| | | |
| | | if(dt_Inbound != null) |
| | | { |
| | | 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_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]), |
| | | }; |
| | | _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); |
| | | 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); |
| | | |
| | | Dt_StockInfoDetail dt_StockInfoDetail = new() |
| | | if (dt_StockInfo == null) |
| | | { |
| | | 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(); |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.QueryData(x => x.RoadwayNo == "2" && x.LocationStatus== (int)LocationStatusEnum.Free && x.Depth==1); |
| | | if (locationInfos.Count < 50) |
| | | 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 |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 3); |
| | | if (dt_StockInfo.StockStatus == (int)StockStatusEmun.ç»çæå) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (dt_Inbound.OrderType == (int)InventoryMaterialType.æå) |
| | | { |
| | | 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]), |
| | | }; |
| | | _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 |
| | | { |
| | |
| | | } |
| | | 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() |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error(); |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error(); |
| | | return content = WebResponseContent.Instance.Error($"åºåå·²æè¯¥æ¡ç ï¼æ¡ç ä¿¡æ¯ï¼{generate.PalletCode}"); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | 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.EmptyCube); |
| | | && x.LocationType == (int)LocationTypeEnum.MaterialsCube && x.EnableStatus == (int)EnableStatusEnum.Normal); |
| | | if (locationinfoData.Count < 20) |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: 1); |