private void dealOrder(int shopId, Order order) { String dealInfo = "dealOrder AmazonOrderId: " + order.AmazonOrderId; AppConstant.SynTaskInfo.OrderTask.dealInfoAppend(dealInfo); List <OrderItem> orderItems = getOrderItems(order.AmazonOrderId); String orderItemsJson = JsonNewtonsoft.ToJSON(orderItems); String orderJson = JsonNewtonsoft.ToJSON(order); saveOrder(shopId, orderJson, orderItemsJson); ShopService.updateLastUpdatedAfter(shopId, order.LastUpdateDate); AppConstant.SynTaskInfo.OrderTask.SynDataNumber += 1; lastUpdatedAfter = order.LastUpdateDate; }
public void syn(Shop shop) { if (shop.InventoryQueryStartDateTime == null) { shop.InventoryQueryStartDateTime = AppConstant.inventoryQueryStartDateTime; } if (inventoryQueryStartDateTime == null) { this.inventoryQueryStartDateTime = shop.InventoryQueryStartDateTime.Value; } this.sellerId = shop.SellerId; this.mwsAuthToken = shop.MwsAuthToken; shopId = shop.Id; shopMarketplaceId = shop.ShopMarketplaceId; FBAInventoryServiceMWSConfig config = new FBAInventoryServiceMWSConfig(); config.ServiceURL = serviceURL; client = new FBAInventoryServiceMWSClient(accessKey, secretKey, appName, appVersion, config); doSyn(); inventoryQueryStartDateTime = DateTime.Now.AddMinutes(-5); ShopService.updateInventoryQueryStartDateTime(shop.Id, inventoryQueryStartDateTime.Value); }