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.

340 lines
10 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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
{
/// <summary>
///
/// </summary>
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<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_seaExportService = _serviceProvider.GetRequiredService<ISeaExportService>();
}
#region 提单管理台账查询
/// <summary>
/// 提单管理台账查询
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns>返回回执</returns>
public async Task<DataResult<List<BLIssueManageBaseDto>>> GetPageAsync(PageRequest querySearch)
{
/*
1、海运出口的订单数据跟提单管理表的数据关联有提单记录的以提单记录为准。
*/
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var query = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
.LeftJoin<BLIssueManageBase>((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<BLIssueManageBaseDto> resultList = new List<BLIssueManageBaseDto>();
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<BLIssueManageBaseDto>();
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<List<BLIssueManageBaseDto>>.Success(resultList);
}
#endregion
#region 导出
/// <summary>
/// 导出
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns>返回回执</returns>
public async Task<DataResult<string>> Export(PageRequest querySearch)
{
return null;
}
#endregion
#region 打印
/// <summary>
/// 打印
/// </summary>
/// <param name="id">提单管理主键</param>
/// <returns>返回回执</returns>
public async Task<DataResult<string>> Print(long id)
{
return null;
}
#endregion
#region 提单签入
/// <summary>
/// 提单签入
/// </summary>
/// <param name="model">提单签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckIn(BLCheckInOutDto model)
{
/*
1、判断是否已签入已签入的不能重复签入
*/
return null;
}
#endregion
#region 取消提单签入
/// <summary>
/// 取消提单签入
/// </summary>
/// <param name="model">取消提单签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckInCancel(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 提单签出
/// <summary>
/// 提单签出
/// </summary>
/// <param name="model">提单签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckOut(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 取消提单签出
/// <summary>
/// 取消提单签出
/// </summary>
/// <param name="model">取消提单签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckOutCancel(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 船证签入
/// <summary>
/// 船证签入
/// </summary>
/// <param name="model">船证签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> ShipCertCheckIn(ShipCertCheckInOutDto model)
{
return null;
}
#endregion
#region 取消船证签入
/// <summary>
/// 取消船证签入
/// </summary>
/// <param name="model">取消船证签入请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> ShipCertCheckInCancel(ShipCertCheckInOutDto model)
{
return null;
}
#endregion
#region 船证签出
/// <summary>
/// 船证签出
/// </summary>
/// <param name="model">船证签出请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> ShipCertCheckOut(ShipCertCheckInOutDto model)
{
return null;
}
#endregion
#region 取消船证签出
/// <summary>
/// 取消船证签出
/// </summary>
/// <param name="model">取消船证签出请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> ShipCertCheckOutCancel(ShipCertCheckInOutDto model)
{
return null;
}
#endregion
#region 提单换签(背书)
/// <summary>
/// 提单换签(背书)
/// </summary>
/// <param name="model">提单换签(背书)请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckChangeEndorse(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 取消提单换签(背书)
/// <summary>
/// 取消提单换签(背书)
/// </summary>
/// <param name="model">取消提单换签(背书)请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLCheckChangeEndorseCancel(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 驳回放单通知
/// <summary>
/// 驳回放单通知
/// </summary>
/// <param name="model">驳回放单通知请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLRejectReleaseNotice(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 更改提单(其他)
/// <summary>
/// 更改提单(其他)
/// </summary>
/// <param name="model">更改提单请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLModify(BLCheckInOutDto model)
{
return null;
}
#endregion
#region 状态更改
/// <summary>
/// 状态更改
/// </summary>
/// <param name="model">状态更改请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> BLModifyStatus(BLCheckInOutDto model)
{
return null;
}
#endregion
}
}