using Amazon.Runtime.Internal.Util; using DS.Module.Core; using DS.Module.Core.Log; using DS.Module.SqlSugar; using DS.Module.UserModule; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Entity; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Mapster; using Microsoft.AspNetCore.Mvc; using DS.WMS.Core.Op.Interface; using SqlSugar.IOC; using Newtonsoft.Json; using NLog; using DS.WMS.Core.Sys.Interface; using Microsoft.AspNetCore.Http; using LanguageExt.Common; using DS.Module.Core.Helpers; using NPOI.SS.Formula.Functions; using System.Text.RegularExpressions; using DS.WMS.Core.Sys.Method; using DS.WMS.Core.Map.Dtos; using Org.BouncyCastle.Ocsp; using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Map.Entity; using DS.WMS.Core.Code.Dtos; using System.Net.Http.Headers; using DS.Module.DjyServiceStatus; using NPOI.SS.UserModel; using DS.WMS.Core.Info.Interface; using Microsoft.Extensions.FileSystemGlobbing; using DS.WMS.Core.Info.Entity; using DS.WMS.Core.Info.Dtos; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using AngleSharp.Dom.Events; using Microsoft.AspNetCore.Authorization; using DS.WMS.Core.Map.Interface; using DS.WMS.Core.Code.Interface; using DS.WMS.Core.Code.Method; using DS.WMS.Core.Map.Method; using DS.Module.Core.Extensions; using DS.Module.Core.Constants; using DS.Module.Core.Data; using DS.WMS.Core.TaskPlat.Dtos; using NPOI.XSSF.UserModel; using AngleSharp.Dom; using DS.WMS.Core.TaskPlat.Entity; using Microsoft.VisualBasic.FileIO; using Microsoft.Extensions.Logging; using AnyDiff.Extensions; using DS.WMS.Core.Sys.Entity; using LanguageExt; using Masuit.Tools.Models; using System.ComponentModel; using Masuit.Tools.Systems; using System.Threading; using NPOI.OpenXmlFormats.Wordprocessing; using DS.WMS.Core.Invoice.Dtos; using DS.Module.Core.Enums; using DS.WMS.Core.Application.Dtos; namespace DS.WMS.Core.Op.Method { /// /// /// public class BLIssueManageService: IBLIssueManageService { private readonly IServiceProvider _serviceProvider; private readonly ISqlSugarClient db; private readonly IUser user; private readonly ISaasDbService saasService; private readonly ISeaExportService _seaExportService; private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); public BLIssueManageService(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; db = _serviceProvider.GetRequiredService(); user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); _seaExportService = _serviceProvider.GetRequiredService(); } #region 提单管理台账查询 /// /// 提单管理台账查询 /// /// 查询条件 /// 返回回执 public async Task>> GetPageAsync(PageRequest querySearch) { /* 1、海运出口的订单数据跟提单管理表的数据关联,有提单记录的以提单记录为准。 */ var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var query = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) .LeftJoin((l, r) => l.Id == r.BookingId) .Select((l, r) => new { order = l, bl = r }); if (!querySearch.QueryCondition.IsNullOrEmpty()) { var whereList = querySearch.GetConditionalModels(db); query = query.Where(whereList); } var result = await query.ToQueryPageAsync(querySearch.PageCondition); List resultList = new List(); if (result.Data.Count > 0) { int start = 1; foreach(var data in result.Data) { if (data.bl != null && data.bl.Id > 0) { var currBl = data.Adapt(); resultList.Add(currBl); continue; } resultList.Add(new BLIssueManageBaseDto { Id = start, BLNo = data.order.MBLNO, CustomerId = data.order.CustomerId, CustomerName = data.order.CustomerName, SaleId = data.order.SaleId, Sale = data.order.Sale, }); start++; } } return DataResult>.Success(resultList); } #endregion #region 导出 /// /// 导出 /// /// 查询条件 /// 返回回执 public async Task> Export(PageRequest querySearch) { return null; } #endregion #region 打印 /// /// 打印 /// /// 提单管理主键 /// 返回回执 public async Task> Print(long id) { return null; } #endregion #region 提单签入 /// /// 提单签入 /// /// 提单签入请求 /// 返回回执 public async Task BLCheckIn(BLCheckInOutDto model) { /* 1、判断是否已签入,已签入的不能重复签入 */ return null; } #endregion #region 取消提单签入 /// /// 取消提单签入 /// /// 取消提单签入请求 /// 返回回执 public async Task BLCheckInCancel(BLCheckInOutDto model) { return null; } #endregion #region 提单签出 /// /// 提单签出 /// /// 提单签入请求 /// 返回回执 public async Task BLCheckOut(BLCheckInOutDto model) { return null; } #endregion #region 取消提单签出 /// /// 取消提单签出 /// /// 取消提单签入请求 /// 返回回执 public async Task BLCheckOutCancel(BLCheckInOutDto model) { return null; } #endregion #region 船证签入 /// /// 船证签入 /// /// 船证签入请求 /// 返回回执 public async Task ShipCertCheckIn(ShipCertCheckInOutDto model) { return null; } #endregion #region 取消船证签入 /// /// 取消船证签入 /// /// 取消船证签入请求 /// 返回回执 public async Task ShipCertCheckInCancel(ShipCertCheckInOutDto model) { return null; } #endregion #region 船证签出 /// /// 船证签出 /// /// 船证签出请求 /// 返回回执 public async Task ShipCertCheckOut(ShipCertCheckInOutDto model) { return null; } #endregion #region 取消船证签出 /// /// 取消船证签出 /// /// 取消船证签出请求 /// 返回回执 public async Task ShipCertCheckOutCancel(ShipCertCheckInOutDto model) { return null; } #endregion #region 提单换签(背书) /// /// 提单换签(背书) /// /// 提单换签(背书)请求 /// 返回回执 public async Task BLCheckChangeEndorse(BLCheckInOutDto model) { return null; } #endregion #region 取消提单换签(背书) /// /// 取消提单换签(背书) /// /// 取消提单换签(背书)请求 /// 返回回执 public async Task BLCheckChangeEndorseCancel(BLCheckInOutDto model) { return null; } #endregion #region 驳回放单通知 /// /// 驳回放单通知 /// /// 驳回放单通知请求 /// 返回回执 public async Task BLRejectReleaseNotice(BLCheckInOutDto model) { return null; } #endregion #region 更改提单(其他) /// /// 更改提单(其他) /// /// 更改提单请求 /// 返回回执 public async Task BLModify(BLCheckInOutDto model) { return null; } #endregion #region 状态更改 /// /// 状态更改 /// /// 状态更改请求 /// 返回回执 public async Task BLModifyStatus(BLCheckInOutDto model) { return null; } #endregion } }