// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAutomaticPostingFactory apFactory) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } //app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); var webSocketOptions = new WebSocketOptions() { KeepAliveInterval = TimeSpan.FromSeconds(120), ReceiveBufferSize = 4 * 1024 }; app.UseWebSockets(webSocketOptions); app.UseCustomWebSocketManager(); //app.AutomaticPostingApp(); string Text = HelperAspNet.Http.HttpGet("http://172.16.1.34:7777/api/GetAutomaticPosting/GetAutomaticPostingAPI"); List <AutomaticPosting> AutomaticPostingList = new List <AutomaticPosting>(); AutomaticPostingList = Text.ConvertToList <AutomaticPosting>(); foreach (AutomaticPosting item in AutomaticPostingList) { Helperlog4.Info("取得未过账数据" + item.ConvertToJson()); apFactory.AutomaticPostingAdd(item); } Helperlog4.Info("取得未过账数据" + AutomaticPostingList.ConvertToJson()); if (AutomaticPostingList.Count == 0) { AutomaticPosting AutomaticPostings = new AutomaticPosting(); AutomaticPostings.id = 0; AutomaticPostings.in_time = null; AutomaticPostings.item_num = null; AutomaticPostings.JobNumber = null; AutomaticPostings.state = 0; AutomaticPostings.Warehouse_ = null; apFactory.AutomaticPostingAdd(AutomaticPostings); } }
/// <summary> /// 定位过账行 /// </summary> /// <param name="automaticposting"></param> /// <returns></returns> public AutomaticPosting AutomaticPostingClient(AutomaticPosting automaticposting) { return(AutomaticPostingList.First(c => c.JobNumber == automaticposting.JobNumber && c.item_num == automaticposting.item_num && c.Warehouse_ == automaticposting.Warehouse_)); }
/// <summary> /// 取得过账行 /// </summary> /// <param name="automaticposting"></param> /// <returns></returns> public List <AutomaticPosting> AutomaticPostingOthers(AutomaticPosting automaticposting) { return(AutomaticPostingList.Where(c => c.JobNumber == automaticposting.JobNumber && c.item_num == automaticposting.item_num && c.Warehouse_ == automaticposting.Warehouse_).ToList()); }
/// <summary> /// 删除过账行 /// </summary> /// <param name="automaticposting"></param> public void AutomaticPostingRemove(AutomaticPosting automaticposting) { AutomaticPostingList.Remove(AutomaticPostingClient(automaticposting)); }
/// <summary> /// 添加过账行到List /// </summary> /// <param name="automaticposting"></param> public void AutomaticPostingAdd(AutomaticPosting automaticposting) { AutomaticPostingList.Add(automaticposting); }