| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Dynamic; |
| | | using System.Globalization; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Reflection; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | _invokeERPService = invokeERPService; |
| | | _warehouseService = warehouseService; |
| | | _palletTypeInfoRepository = palletTypeInfoRepository; |
| | | } |
| | | public override object GetDetailPage(PageDataOptions pageData) |
| | | { |
| | | Type t = typeof(Dt_InboundOrder); |
| | | |
| | | if (pageData.Value == null) return new PageGridData<object>(total: 0, null); |
| | | string keyName = t.GetKeyName(); |
| | | ////çææ¥è¯¢æ¡ä»¶ |
| | | //Expression<Func<TEntity, bool>> whereExpression = keyName.CreateExpression<TEntity>(pageData.Value, LinqExpressionType.Equal); |
| | | int totalCount = 0; |
| | | PropertyInfo propertyInfo = t.GetProperties().FirstOrDefault(x => x.GetCustomAttribute<Navigate>() != null); |
| | | if (propertyInfo != null) |
| | | { |
| | | Type detailType = propertyInfo.PropertyType.GetGenericArguments()[0]; |
| | | Navigate navigate = propertyInfo.GetCustomAttribute<Navigate>(); |
| | | List<Dt_InboundOrderDetail> list = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(navigate.GetName(), "=", pageData.Value).ToPageList(pageData.Page, pageData.Rows, ref totalCount); |
| | | decimal sum = 0; |
| | | list.ForEach(x => |
| | | { |
| | | sum += Convert.ToDecimal(x.OrderQuantity); |
| | | }); |
| | | PageGridData<Dt_InboundOrderDetail> pageGridData = new PageGridData<Dt_InboundOrderDetail>() |
| | | { |
| | | Total= totalCount, |
| | | Rows=list, |
| | | Summary=new |
| | | { |
| | | OrderQuantity = Math.Round(sum, 3), |
| | | } |
| | | }; |
| | | return pageGridData; |
| | | } |
| | | return new PageGridData<object>(total: 0, null); |
| | | } |
| | | /// <summary> |
| | | /// å
¶ä»å
¥åºåæ¥æ¶(è°æå
¥ä»,客ä¾åæ¶,ç©æéå®éè´§) |
| | |
| | | List<Dt_InboundOrder> dt_ReceiveOrders = new List<Dt_InboundOrder>(); |
| | | if (string.IsNullOrEmpty(orderNo)) |
| | | { |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5); |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).Includes(x=>x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10); |
| | | } |
| | | else |
| | | { |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.InboundOrderNo.Contains(orderNo)) && x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5); |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.InboundOrderNo.Contains(orderNo)) && x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10); |
| | | } |
| | | |
| | | content.OK(data: dt_ReceiveOrders); |
| | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | |
| | | notGroupDetail.ReceiptQuantity += model.Quantity; |
| | | if (notGroupDetail.ReceiptQuantity>notGroupDetail.OrderQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{notGroupDetail.ReceiptQuantity - notGroupDetail.OrderQuantity}"); |
| | | } |
| | | if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | |
| | | 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> |