You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Application/Service/BookingOrderSF/BookingOrderSFService.cs

169 lines
5.9 KiB
C#

1 year ago
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
{
/// <summary>
/// 顺丰服务
/// </summary>
[ApiDescriptionSettings("Application", Name = "BookingOrderSF", Order = 20)]
public class BookingOrderSFService : IBookingOrderSFService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<BookingOrderSFExpressDelivery> _rep;
private readonly SqlSugarRepository<BookingOrderSFExpressdeliveryBusiness> _business;
private readonly SqlSugarRepository<BookingOrderSFExpressdeliveryDetail> _detail;
private readonly ILogger<BookingOrderSFService> _logger;
private readonly ISysCacheService _cache;
public BookingOrderSFService(SqlSugarRepository<BookingOrderSFExpressDelivery> rep, SqlSugarRepository<BookingOrderSFExpressdeliveryBusiness> business,
SqlSugarRepository<BookingOrderSFExpressdeliveryDetail> detail,
ILogger<BookingOrderSFService> logger, ISysCacheService cache)
{
this._logger = logger;
this._cache = cache;
this._rep = rep;
this._business = business;
this._detail = detail;
}
/// <summary>
/// 分页查询快递主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/BookingOrderSF/Page")]
public async Task<dynamic> 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<SqlSugarPagedList<BookingOrderSFDto>>();
1 year ago
//foreach (var item in list)
//{
1 year ago
1 year ago
//}
1 year ago
return list;
}
/// <summary>
/// Test
/// </summary>
/// <returns></returns>
[HttpGet("/BookingOrderSF/Test")]
public async Task<dynamic> Test()
{
return "1";
}
}
}