using Myshipping.Core; using Furion.DependencyInjection; using Furion.DynamicApiController; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using System.Linq; using System.Threading.Tasks; using Myshipping.Application.Entity; using Microsoft.AspNetCore.Authorization; using Furion; using Microsoft.AspNetCore.Http; using Furion.DataEncryption; using System.Collections.Generic; using System.Security.Claims; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; using Furion.FriendlyException; using Furion.Logging; using System; using Microsoft.Extensions.Logging; using System.Reflection; using System.ComponentModel; using Myshipping.Application.Service.BookingOrder.Dto; using Myshipping.Application.ConfigOption; using System.IO; using Yitter.IdGenerator; using Myshipping.Core.Entity; using Furion.RemoteRequest.Extensions; using System.Net.Http; using Myshipping.Core.Service; using Myshipping.Application.EDI; using System.Text; using System.Web; using Newtonsoft.Json.Linq; using Myshipping.Core.Helper; using Myshipping.Application.Enum; using Org.BouncyCastle.Asn1.X500; using System.Drawing.Drawing2D; using StackExchange.Profiling.Internal; using Myshipping.Application; using Myshipping.Application.EDI.PIL; using Newtonsoft.Json; using Myshipping.Application.EDI.TSL; using Myshipping.Application.EDI.WY; using Myshipping.Application.EDI.YML; using Myshipping.Application.EDI.YT; using System.Runtime.InteropServices; using System.Threading; using Furion.JsonSerialization; using System.Xml.Linq; using Myshipping.Application.Helper; using System.Net; using Furion.DistributedIDGenerator; using System.Linq.Expressions; using Myshipping.Core.Extension; using System.Text.RegularExpressions; using MathNet.Numerics.Distributions; using Microsoft.IdentityModel.Tokens; using Myshipping.Application.EDI.ESL; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.SS.Formula.Functions; using NPOI.HPSF; using MimeKit; using NPOI.SS.Formula; using NPOI.Util; using System.Collections.Specialized; using System.Net.Http.Headers; using MySqlX.XDevAPI.Common; using Ubiety.Dns.Core; using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData; using System.Security.Cryptography; using Myshipping.Application.Service.DataSync.Dto; using RabbitMQ.Client; using System.Configuration; using System.Collections; using System.Security.Principal; using Myshipping.Application.Service.BookingOrderSF.Dto; namespace Myshipping.Application { /// /// 顺丰服务 /// [ApiDescriptionSettings("Application", Name = "BookingOrderSF", Order = 20)] public class BookingOrderSFService : IBookingOrderSFService, IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; private readonly SqlSugarRepository _business; private readonly SqlSugarRepository _detail; private readonly ILogger _logger; private readonly ISysCacheService _cache; public BookingOrderSFService(SqlSugarRepository rep, SqlSugarRepository business, SqlSugarRepository detail, ILogger logger, ISysCacheService cache) { this._logger = logger; this._cache = cache; this._rep = rep; this._business = business; this._detail = detail; } /// /// 分页查询快递主表 /// /// /// [HttpGet("/BookingOrderSF/Page")] public async Task Page([FromQuery] BookingOrderSFInput input) { var entities = await _rep.AsQueryable().Filter(null, true) .Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false) .WhereIF(!string.IsNullOrWhiteSpace(input.KDNO), u => u.KDNO.Contains(input.KDNO)) .WhereIF(!string.IsNullOrWhiteSpace(input.SJCompany), u => u.KDNO.Contains(input.SJCompany)) .WhereIF(!string.IsNullOrWhiteSpace(input.SJPeople), u => u.KDNO.Contains(input.SJPeople)) .WhereIF(!string.IsNullOrWhiteSpace(input.SJTel), u => u.KDNO.Contains(input.SJTel)) .WhereIF(!string.IsNullOrWhiteSpace(input.FJCompany), u => u.KDNO.Contains(input.FJCompany)) .WhereIF(!string.IsNullOrWhiteSpace(input.FJPeople), u => u.KDNO.Contains(input.FJPeople)) .WhereIF(!string.IsNullOrWhiteSpace(input.FJTel), u => u.KDNO.Contains(input.FJTel)) .WhereIF(!string.IsNullOrWhiteSpace(input.VESSEL), u => u.KDNO.Contains(input.VESSEL)) .WhereIF(!string.IsNullOrWhiteSpace(input.VOYNO), u => u.KDNO.Contains(input.VOYNO)) .WhereIF(!string.IsNullOrWhiteSpace(input.State), u => u.State == input.State) .WhereIF(input.BDate != null, u => u.Date >= input.BDate) .WhereIF(input.EDate != null, u => u.Date <= input.EDate) .OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.DescSort)) .ToPagedListAsync(input.PageNo, input.PageSize); var list = entities.Adapt>(); foreach (var item in list.Items) { item.Business = await _business.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync(); item.detail= await _detail.AsQueryable().Filter(null, true).Where(x => x.PId == item.Id).ToListAsync(); } return list; } /// /// 保存并返回数据 /// /// [HttpGet("/BookingOrderSF/Save")] public async Task Save(BookingOrderSFDto input) { if (input.Id == 0) { } else { } return null; } } }