| | |
| | | try |
| | | { |
| | | List<ERPProItemsItem> proItemsItems = new List<ERPProItemsItem>(); |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseId==mesProInOrder.WarehouseId); |
| | | string batchNoRemark = ""; |
| | | foreach (var item in mesProInOrder.Details) |
| | | { |
| | | ERPProItemsItem proItemsItem = new ERPProItemsItem() |
| | |
| | | PartNum = item.ProductCode, |
| | | Rev=item.ProductVersion, |
| | | DateCode=item.DateCode, |
| | | BatchNumber= item.BagNo, |
| | | BatchNumber= item.ProductCode, |
| | | XLocation=item.XSite, |
| | | Xqty=item.XQty, |
| | | QtySet=item.SETQty, |
| | |
| | | } |
| | | } |
| | | }; |
| | | batchNoRemark += item.BagNo + ","; |
| | | proItemsItems.Add(proItemsItem); |
| | | } |
| | | ERPProInboundModel proInboundModel = new ERPProInboundModel() |
| | |
| | | CreatorCode = "GSWMS", |
| | | CompanyCode = "HATC", |
| | | FactoryCode = "HA02", |
| | | WarehouseCode = "HA71", |
| | | LocationCode = "HA71", |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | LocationCode = warehouse.WarehouseCode, |
| | | StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | StockFormType= "Production", |
| | | StockFormItems= proItemsItems |
| | | StockFormItems= proItemsItems, |
| | | Remark=batchNoRemark |
| | | }; |
| | | _invokeERPService.InvokeProInApi(proInboundModel); |
| | | string response = _invokeERPService.InvokeProInApi(proInboundModel); |
| | | ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | if (requestContent.res != 1) |
| | | { |
| | | return content.Error($"{requestContent.Data}"); |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return palletTypeInfo.PalletType; |
| | | } |
| | | else if (warehouse.WarehouseCode == WarehouseEnum.HA58.ObjToString()) |
| | | { |
| | | Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.CodeStartStr == palletCode.Substring(0, 2)); |
| | | if (palletTypeInfo == null) |
| | | { |
| | | throw new Exception($"æçå·é误"); |
| | | } |
| | | return palletTypeInfo.PalletType; |
| | | } |
| | | return -1; |
| | | } |
| | | /// <summary> |