cjy 3 months ago
commit c2f81a8163

@ -24,6 +24,11 @@ namespace DS.WMS.Core.Application.Dtos
/// </summary> /// </summary>
public BusinessType BusinessType { get; set; } public BusinessType BusinessType { get; set; }
/// <summary>
/// 客户ID
/// </summary>
public long CustomerId { get; set; }
/// <summary> /// <summary>
/// 客户名称 /// 客户名称
/// </summary> /// </summary>

@ -1,5 +1,4 @@
using System.Runtime.Serialization; using DS.Module.Core.Extensions;
using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Application.Dtos namespace DS.WMS.Core.Application.Dtos
{ {
@ -18,6 +17,9 @@ namespace DS.WMS.Core.Application.Dtos
/// </summary> /// </summary>
public string ApplicationNO { get; set; } public string ApplicationNO { get; set; }
/// <summary>
/// 客户名称/结算单位ID
/// </summary>
public long? CustomerId { get; set; } public long? CustomerId { get; set; }
/// <summary> /// <summary>
@ -98,7 +100,6 @@ namespace DS.WMS.Core.Application.Dtos
/// <summary> /// <summary>
/// 所属分部 /// 所属分部
/// </summary> /// </summary>
[IgnoreDataMember]
public long? SaleDeptId { get; set; } public long? SaleDeptId { get; set; }
/// <summary> /// <summary>

@ -16,6 +16,11 @@ namespace DS.WMS.Core.Application.Dtos
/// <summary> /// <summary>
/// 业务信息 /// 业务信息
/// </summary> /// </summary>
public List<BizItem> Items { get; set; } public List<BizItem> Items { get; set; } = [];
/// <summary>
/// 查询条件字符串
/// </summary>
public string? QueryString { get; set; }
} }
} }

@ -110,13 +110,6 @@ namespace DS.WMS.Core.Application.Entity
[SugarColumn(ColumnDescription = "驳回原因", Length = 200, IsNullable = true)] [SugarColumn(ColumnDescription = "驳回原因", Length = 200, IsNullable = true)]
public string? Reason { get; set; } public string? Reason { get; set; }
/// <summary>
/// 工作流ID
/// </summary>
[SugarColumn(ColumnDescription = "工作流ID", IsNullable = true)]
public long? FlowId { get; set; }
/// <summary> /// <summary>
/// 是否已打印 /// 是否已打印
/// </summary> /// </summary>

@ -13,10 +13,14 @@ namespace DS.WMS.Core.Application.Method
/// <summary> /// <summary>
/// 申请单审核服务 /// 申请单审核服务
/// </summary> /// </summary>
public class ApplicationAuditService<TEntity> : FeeServiceBase, IApplicationAuditService<TEntity> public abstract class ApplicationAuditService<TEntity> : FeeServiceBase, IApplicationAuditService<TEntity>
where TEntity : ApplicationForm, new() where TEntity : ApplicationForm, new()
{ {
internal static readonly TaskBaseTypeEnum[] AuditTypes = [TaskBaseTypeEnum.APPLICATION_PAYMENT_AUDIT]; /// <summary>
/// 适用于当前申请单的审核类型
/// </summary>
public abstract TaskBaseTypeEnum AuditType { get; }
readonly IClientFlowInstanceService flowService; readonly IClientFlowInstanceService flowService;
/// <summary> /// <summary>
@ -36,7 +40,7 @@ namespace DS.WMS.Core.Application.Method
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> AuditAsync(int yesOrNo, string? remark) public async Task<DataResult> AuditAsync(int yesOrNo, string? remark)
{ {
var recordIds = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).ToArrayAsync(); var recordIds = await GetCurrentFlowsQuery([AuditType]).Select(x => x.BusinessId).ToArrayAsync();
//没有待审批的列表直接返回不再执行后续查询 //没有待审批的列表直接返回不再执行后续查询
if (recordIds.Length == 0) if (recordIds.Length == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems)); return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
@ -55,49 +59,34 @@ namespace DS.WMS.Core.Application.Method
{ {
Id = x.Id, Id = x.Id,
ApplicationNO = x.ApplicationNO, ApplicationNO = x.ApplicationNO,
Status = x.Status, Status = x.Status
FlowId = x.FlowId
}).ToListAsync(); }).ToListAsync();
if (apps.Count == 0) if (apps.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData)); return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
if (apps.Exists(x => !x.FlowId.HasValue))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInFlows));
var result = PreAudit(apps); var result = PreAudit(apps);
if (!result.Succeeded) if (!result.Succeeded)
return result; return result;
var flowIds = apps.Select(x => x.FlowId.GetValueOrDefault()); var flows = await flowService.GetInstanceByBSIdAsync(AuditType, null, request.Ids);
var flows = await Db.Queryable<FlowInstance>().Where(x => flowIds.Contains(x.Id)).ToListAsync(); if (flows.Count != request.Ids.Length)
if (flows.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound)); return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound));
if (flows.Exists(x => !x.MakerList.Contains(User.UserId)))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.AuditUnauthorization));
List<string> list = []; List<string> list = [];
foreach (var app in apps) foreach (var item in flows)
{ {
var flow = flows.Find(x => x.Id == app.FlowId.Value);
if (flow == null)
continue;
result = flowService.AuditFlowInstance(new FlowAuditInfo result = flowService.AuditFlowInstance(new FlowAuditInfo
{ {
Instance = flow, Instance = item,
Status = request.Result, Status = request.Result,
AuditNote = request.Remark AuditNote = request.Remark
}); });
if (!result.Succeeded) if (!result.Succeeded)
list.Add(app.ApplicationNO); return result;
} }
if (list.Count > 0)
return DataResult.Failed($"{MultiLanguageConst.Operation_Failed}{string.Join("", list)}");
return DataResult.Success; return DataResult.Success;
} }
@ -199,8 +188,7 @@ namespace DS.WMS.Core.Application.Method
x.AuditerId, x.AuditerId,
x.AuditerName, x.AuditerName,
x.AuditTime, x.AuditTime,
x.Reason, x.Reason
x.FlowId
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
} }
} }

@ -1,4 +1,5 @@
using DS.Module.Core; using System.Collections.Generic;
using DS.Module.Core;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Application.Entity;
@ -9,6 +10,8 @@ using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity; using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface; using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Sys.Interface; using DS.WMS.Core.Sys.Interface;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SqlSugar; using SqlSugar;
@ -24,6 +27,7 @@ namespace DS.WMS.Core.Application.Method
{ {
readonly IClientFlowInstanceService flowService; readonly IClientFlowInstanceService flowService;
readonly Lazy<ICommonService> commonService; readonly Lazy<ICommonService> commonService;
readonly ITaskService taskService;
/// <summary> /// <summary>
/// 初始化 /// 初始化
@ -33,6 +37,7 @@ namespace DS.WMS.Core.Application.Method
{ {
flowService = serviceProvider.GetRequiredService<IClientFlowInstanceService>(); flowService = serviceProvider.GetRequiredService<IClientFlowInstanceService>();
commonService = new Lazy<ICommonService>(serviceProvider.GetRequiredService<ICommonService>()); commonService = new Lazy<ICommonService>(serviceProvider.GetRequiredService<ICommonService>());
taskService = serviceProvider.GetRequiredService<ITaskService>();
} }
#region 保存 #region 保存
@ -44,7 +49,7 @@ namespace DS.WMS.Core.Application.Method
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<TEntity>> SaveAsync(TEntity application) public async Task<DataResult<TEntity>> SaveAsync(TEntity application)
{ {
TEntity dbValue = null; TEntity? dbValue = null;
if (application.Id > 0) if (application.Id > 0)
{ {
//修改需检查申请单状态 //修改需检查申请单状态
@ -110,8 +115,6 @@ namespace DS.WMS.Core.Application.Method
{ {
detail.ApplicationId = application.Id; detail.ApplicationId = application.Id;
var fee = fees.Find(x => x.Id == detail.RecordId); var fee = fees.Find(x => x.Id == detail.RecordId);
//detail.BusinessId = fee.BusinessId;
//detail.BusinessType = fee.BusinessType;
detail.ExchangeRate = detail.ExchangeRate ?? fee.ExchangeRate; detail.ExchangeRate = detail.ExchangeRate ?? fee.ExchangeRate;
detail.FeeId = fee.FeeId; detail.FeeId = fee.FeeId;
detail.FeeName = fee.FeeName; detail.FeeName = fee.FeeName;
@ -179,7 +182,12 @@ namespace DS.WMS.Core.Application.Method
public async Task<DataResult<TEntity>> SaveAsync(ApplicationRequest<TEntity> request) public async Task<DataResult<TEntity>> SaveAsync(ApplicationRequest<TEntity> request)
{ {
request.Application ??= new(); request.Application ??= new();
request.Application.Details = await GetDetailsAsync(request.Items);
List<IConditionalModel> whereList = [];
if (!string.IsNullOrEmpty(request.QueryString))
whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryString);
request.Application.Details = await GetDetailsAsync(request.Items, whereList);
return await SaveAsync(request.Application); return await SaveAsync(request.Application);
} }
@ -189,7 +197,7 @@ namespace DS.WMS.Core.Application.Method
/// <param name="application">提交的申请单</param> /// <param name="application">提交的申请单</param>
/// <param name="dbValue">数据库值新增时为null</param> /// <param name="dbValue">数据库值新增时为null</param>
/// <returns></returns> /// <returns></returns>
protected virtual DataResult EnsureApplication(TEntity application, TEntity dbValue) protected virtual DataResult EnsureApplication(TEntity application, TEntity? dbValue)
{ {
return DataResult.Success; return DataResult.Success;
} }
@ -248,8 +256,9 @@ namespace DS.WMS.Core.Application.Method
/// 获取业务所关联的申请明细 /// 获取业务所关联的申请明细
/// </summary> /// </summary>
/// <param name="items"></param> /// <param name="items"></param>
/// <param name="conditions"></param>
/// <returns></returns> /// <returns></returns>
protected virtual Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items) protected virtual Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items, List<IConditionalModel>? conditions)
{ {
return Task.FromResult(new List<ApplicationDetail>()); return Task.FromResult(new List<ApplicationDetail>());
} }
@ -402,33 +411,57 @@ namespace DS.WMS.Core.Application.Method
if (!result.Succeeded) if (!result.Succeeded)
return result; return result;
var template = await FindTemplateAsync(auditType); List<TEntity> entities = new List<TEntity>(idArray.Length);
if (template == null) bool hasAuthorized = await taskService.HasAuthorizedAsync();
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TemplateNotFound));
await TenantDb.Ado.BeginTranAsync(); await TenantDb.Ado.BeginTranAsync();
try try
{ {
var list2 = list.Select(x => new TEntity { Id = x.Id, Status = x.Status }).ToList(); if (hasAuthorized)
foreach (var item in list2)
{ {
result = flowService.CreateFlowInstance(new CreateFlowInstanceReq for (int i = 0; i < idArray.Length; i++)
{ {
BusinessId = item.Id, var req = new TaskCreationRequest
TemplateId = template.Id {
}); BusinessId = idArray[i],
TaskTypeName = auditType.ToString()
};
result = await taskService.CreateTaskAsync(req);
if (result.Succeeded)
{
var entity = new TEntity { Id = req.BusinessId };
OnSubmitApproval(entity);
entities.Add(entity);
}
}
}
else
{
var template = await FindTemplateAsync(auditType);
if (template == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TemplateNotFound));
if (result.Succeeded) var list2 = list.Select(x => new TEntity { Id = x.Id, Status = x.Status }).ToList();
foreach (var item in list2)
{ {
var instance = result.Data as FlowInstance; result = flowService.CreateFlowInstance(new CreateFlowInstanceReq
flowService.StartFlowInstance(instance.Id.ToString()); {
BusinessId = item.Id,
item.FlowId = instance.Id; TemplateId = template.Id
OnSubmitApproval(item); });
await TenantDb.Updateable(item).UpdateColumns(x => new { x.Status, x.FlowId }).ExecuteCommandAsync();
if (result.Succeeded)
{
var instance = result.Data as FlowInstance;
flowService.StartFlowInstance(instance.Id.ToString());
OnSubmitApproval(item);
entities.Add(item);
}
} }
} }
await TenantDb.Updateable(entities).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
return DataResult.Success; return DataResult.Success;
} }
@ -471,33 +504,29 @@ namespace DS.WMS.Core.Application.Method
{ {
Id = x.Id, Id = x.Id,
ApplicationNO = x.ApplicationNO, ApplicationNO = x.ApplicationNO,
Status = x.Status, Status = x.Status
FlowId = x.FlowId
}).ToListAsync(); }).ToListAsync();
if (list.Count == 0) if (list.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData)); return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
//未在审批状态中 //未在审批状态中
var list2 = list.FindAll(x => x.FlowId == null).ToList(); if (!await flowService.Exists(ids: ids))
if (list2.Count > 0) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
{
string msg = string.Join("; ", list2.Select(x => $"{x.ApplicationNO}"));
return DataResult.Failed(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.NoNeedWithdraw)), msg));
}
var flows = list.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = FlowStatusEnum.Draft, MakerList = string.Empty }).ToList(); DataResult result;
DateTime dtNow = DateTime.Now;
try try
{ {
await Db.Updateable(flows).UpdateColumns(x => new { x.FlowStatus, x.MakerList }).ExecuteCommandAsync(); result = await flowService.WithdrawAsync(ids);
if (!result.Succeeded)
return result;
foreach (var item in list) foreach (var item in list)
{ {
OnWithdraw(item); OnWithdraw(item);
item.FlowId = null;
} }
await TenantDb.Updateable(list).UpdateColumns(x => new { x.Status, x.FlowId }).ExecuteCommandAsync(); await TenantDb.Updateable(list).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
return DataResult.Success; return DataResult.Success;

@ -18,6 +18,8 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
public class InvoiceApplicationAuditService : ApplicationAuditService<InvoiceApplication>, IInvoiceApplicationAuditService public class InvoiceApplicationAuditService : ApplicationAuditService<InvoiceApplication>, IInvoiceApplicationAuditService
{ {
public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_INVOICE_AUDIT;
/// <summary> /// <summary>
/// 初始化 /// 初始化
/// </summary> /// </summary>

@ -34,10 +34,7 @@ namespace DS.WMS.Core.Application.Method
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest request) public async Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest request)
{ {
List<IConditionalModel> whereList = []; List<IConditionalModel> whereList = request.GetConditionalModels(Db);
if (!request.QueryCondition.IsNullOrEmpty())
whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var result = await TenantDb.Queryable<InvoiceApplication>().Where(whereList) var result = await TenantDb.Queryable<InvoiceApplication>().Where(whereList)
.Select((x) => new InvoiceApplicationDto .Select((x) => new InvoiceApplicationDto
{ {
@ -243,6 +240,7 @@ namespace DS.WMS.Core.Application.Method
RecordId = f.Id, RecordId = f.Id,
BusinessId = f.BusinessId, BusinessId = f.BusinessId,
BusinessType = f.BusinessType, BusinessType = f.BusinessType,
CustomerId = f.CustomerId,
CustomerName = f.CustomerName, CustomerName = f.CustomerName,
FeeId = f.FeeId, FeeId = f.FeeId,
FeeName = f.FeeName, FeeName = f.FeeName,
@ -285,6 +283,7 @@ namespace DS.WMS.Core.Application.Method
{ {
Id = a.Id, Id = a.Id,
ApplicationNO = a.ApplicationNO, ApplicationNO = a.ApplicationNO,
AutualCustomerName = a.AutualCustomerName,
Currency = a.Currency, Currency = a.Currency,
CustomerId = a.CustomerId, CustomerId = a.CustomerId,
CustomerName = a.CustomerName, CustomerName = a.CustomerName,
@ -298,6 +297,7 @@ namespace DS.WMS.Core.Application.Method
InvoiceBillNO = a.InvoiceBillNO, InvoiceBillNO = a.InvoiceBillNO,
InvoiceRemark = a.InvoiceRemark, InvoiceRemark = a.InvoiceRemark,
SaleDeptId = a.SaleDeptId, SaleDeptId = a.SaleDeptId,
TaxID = a.TaxID,
Note = a.Note, Note = a.Note,
ApplyAmount = a.ApplyAmount, ApplyAmount = a.ApplyAmount,
OtherCurrencyAmount = a.OtherCurrencyAmount, OtherCurrencyAmount = a.OtherCurrencyAmount,
@ -305,12 +305,9 @@ namespace DS.WMS.Core.Application.Method
CustomerAddTel = a.CustomerAddTel, CustomerAddTel = a.CustomerAddTel,
CustomerBankId = a.CustomerBankId, CustomerBankId = a.CustomerBankId,
CustomerBankName = b1.BankName, CustomerBankName = b1.BankName + " " + b1.Account,
CustomerAccount = b1.Account,
USDCustomerBankId = a.USDCustomerBankId, USDCustomerBankId = a.USDCustomerBankId,
USDCustomerBankName = b2.BankName, USDCustomerBankName = b2.BankName + " " + b2.Account
USDCustomerAccount = b2.Account
}).FirstAsync(); }).FirstAsync();
if (dto != null) if (dto != null)
@ -410,18 +407,17 @@ namespace DS.WMS.Core.Application.Method
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed)); return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
} }
protected override async Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items) protected override async Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items, List<IConditionalModel>? conditions)
{ {
var ids1 = items.Select(x => x.Id); var ids1 = items.Select(x => x.Id);
var ids2 = items.Select(x => x.BusinessType); var ids2 = items.Select(x => x.BusinessType);
var list = await TenantDb.Queryable<FeeRecord>().Where(x => var list = await TenantDb.Queryable<FeeRecord>().Where(x =>
ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed) ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed)
.Where(conditions)
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {
Id = x.Id, Id = x.Id,
//BusinessId = x.BusinessId,
//BusinessType = x.BusinessType,
ApplyAmount = x.Amount - x.InvoiceAmount - x.OrderInvoiceAmount + x.OrderInvSettlementAmount, ApplyAmount = x.Amount - x.InvoiceAmount - x.OrderInvoiceAmount + x.OrderInvSettlementAmount,
ExchangeRate = x.ExchangeRate, ExchangeRate = x.ExchangeRate,
OriginalCurrency = x.Currency OriginalCurrency = x.Currency
@ -434,14 +430,11 @@ namespace DS.WMS.Core.Application.Method
return list; return list;
} }
protected override DataResult EnsureApplication(InvoiceApplication application, InvoiceApplication dbValue) protected override DataResult EnsureApplication(InvoiceApplication application, InvoiceApplication? dbValue)
{ {
if (dbValue != null && dbValue.Status != InvoiceApplicationStatus.Pending && dbValue.Status != InvoiceApplicationStatus.AuditRejected) if (dbValue != null && dbValue.Status != InvoiceApplicationStatus.Pending && dbValue.Status != InvoiceApplicationStatus.AuditRejected)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ApplicationSaveStatusError)); return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ApplicationSaveStatusError));
if (application.Currency.IsNullOrEmpty())
application.Currency = FeeCurrency.RMB_CODE;
return DataResult.Success; return DataResult.Success;
} }

@ -15,10 +15,12 @@ using SqlSugar;
namespace DS.WMS.Core.Application.Method namespace DS.WMS.Core.Application.Method
{ {
/// <summary> /// <summary>
/// 申请审核服务 /// 费申请审核服务
/// </summary> /// </summary>
public class PaymentApplicationAuditService : ApplicationAuditService<PaymentApplication>, IPaymentApplicationAuditService public class PaymentApplicationAuditService : ApplicationAuditService<PaymentApplication>, IPaymentApplicationAuditService
{ {
public override TaskBaseTypeEnum AuditType => TaskBaseTypeEnum.APPLICATION_PAYMENT_AUDIT;
/// <summary> /// <summary>
/// 初始化 /// 初始化
/// </summary> /// </summary>
@ -51,7 +53,7 @@ namespace DS.WMS.Core.Application.Method
break; break;
case AuditStatusForQuery.MarkerOnly: case AuditStatusForQuery.MarkerOnly:
var ids = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).ToListAsync(); var ids = await GetCurrentFlowsQuery([AuditType]).Select(x => x.BusinessId).ToListAsync();
if (ids.Count == 0) if (ids.Count == 0)
ids.Add(0L); ids.Add(0L);
query = query.Where(x => ids.Contains(x.Id)); query = query.Where(x => ids.Contains(x.Id));

@ -376,13 +376,14 @@ namespace DS.WMS.Core.Application.Method
return DataResult<PaymentApplicationDto>.Success(dto); return DataResult<PaymentApplicationDto>.Success(dto);
} }
protected override async Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items) protected override async Task<List<ApplicationDetail>> GetDetailsAsync(IEnumerable<BizItem> items, List<IConditionalModel>? conditions)
{ {
var ids1 = items.Select(x => x.Id); var ids1 = items.Select(x => x.Id);
var ids2 = items.Select(x => x.BusinessType); var ids2 = items.Select(x => x.BusinessType);
var list = await TenantDb.Queryable<FeeRecord>().Where(x => var list = await TenantDb.Queryable<FeeRecord>().Where(x =>
ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed) ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed)
.Where(conditions)
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {
RecordId = x.Id, RecordId = x.Id,
@ -400,7 +401,7 @@ namespace DS.WMS.Core.Application.Method
} }
protected override DataResult EnsureApplication(PaymentApplication application, PaymentApplication dbValue) protected override DataResult EnsureApplication(PaymentApplication application, PaymentApplication? dbValue)
{ {
if (dbValue != null) if (dbValue != null)
{ {

@ -15,7 +15,6 @@ using DS.WMS.Core.Sys.Entity;
using Mapster; using Mapster;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SqlSugar; using SqlSugar;
using static AnyDiff.DifferenceLines;
namespace DS.WMS.Core.Fee.Method namespace DS.WMS.Core.Fee.Method
{ {

@ -56,8 +56,8 @@ public class InfoClient : SharedOrgModel<long>
/// <summary> /// <summary>
/// Desc:邮箱 /// Desc:邮箱
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "邮箱", Length = 50)] [SugarColumn(ColumnDescription = "邮箱", IsNullable = true, Length = 50)]
public string Email { get; set; } public string? Email { get; set; }
/// <summary> /// <summary>
/// Desc:网页 /// Desc:网页

@ -30,10 +30,21 @@ public class ClientBankService : ServiceBase, IClientBankService
{ {
//序列化查询条件 //序列化查询条件
var whereList = request.GetConditionalModels(Db); var whereList = request.GetConditionalModels(Db);
var data = TenantDb.Queryable<InfoClientBank>() var result = TenantDb.Queryable<InfoClientBank>()
.Where(whereList) .Where(whereList)
.Select<ClientBankRes>().ToQueryPage(request.PageCondition); .Select<ClientBankRes>().ToQueryPage(request.PageCondition);
return data;
if (result.Data?.Count > 0)
{
var ids = result.Data.Select(x => x.Id);
var list = TenantDb.Queryable<InvoiceHeader>().Where(x => ids.Contains(x.RelativeId)).ToList();
foreach (var item in result.Data)
{
item.InvoiceHeaders = list.FindAll(x => x.RelativeId == item.Id);
}
}
return result;
} }
/// <summary> /// <summary>

@ -7,7 +7,7 @@ using DS.WMS.Core.Op.Interface.TaskInteraction;
namespace DS.WMS.Core.Op.Method.TaskInteraction namespace DS.WMS.Core.Op.Method.TaskInteraction
{ {
/// <summary> /// <summary>
/// 邮件配置服务 /// 邮件模板配置服务
/// </summary> /// </summary>
public class TaskMailService : ServiceBase, ITaskMailService public class TaskMailService : ServiceBase, ITaskMailService
{ {
@ -27,7 +27,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public async Task<DataResult<List<BusinessTaskMail>>> GetListAsync(PageRequest request) public async Task<DataResult<List<BusinessTaskMail>>> GetListAsync(PageRequest request)
{ {
var whereList = request.GetConditionalModels(Db); var whereList = request.GetConditionalModels(Db);
return await TenantDb.Queryable<BusinessTaskMail>().Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC) return await TenantDb.Queryable<BusinessTaskMail>()
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC)
.Where(whereList).ToQueryPageAsync(request.PageCondition); .Where(whereList).ToQueryPageAsync(request.PageCondition);
} }
@ -39,7 +40,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public async Task<DataResult<BusinessTaskMail>> GetAsync(long id) public async Task<DataResult<BusinessTaskMail>> GetAsync(long id)
{ {
var entity = await TenantDb.Queryable<BusinessTaskMail>() var entity = await TenantDb.Queryable<BusinessTaskMail>()
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments).Includes(x => x.CC) .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC).Includes(x => x.Attachments)
.Where(x => x.Id == id).FirstAsync(); .Where(x => x.Id == id).FirstAsync();
return DataResult<BusinessTaskMail>.Success(entity); return DataResult<BusinessTaskMail>.Success(entity);
@ -53,8 +54,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public async Task<BusinessTaskMail> GetAsync(string name) public async Task<BusinessTaskMail> GetAsync(string name)
{ {
return await TenantDb.Queryable<BusinessTaskMail>() return await TenantDb.Queryable<BusinessTaskMail>()
.Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments).Includes(x => x.CC) .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.CC).Includes(x => x.Attachments)
.Where(x => x.Name == name).FirstAsync(); .Where(x => x.Name.Contains(name)).FirstAsync();
} }
/// <summary> /// <summary>
@ -73,11 +74,15 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
taskMail.Sender ??= new(); taskMail.Sender ??= new();
taskMail.CC ??= new(); taskMail.CC ??= new();
taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteReturnEntityAsync(); taskMail = await TenantDb.InsertNav(taskMail)
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC)
.ExecuteReturnEntityAsync();
} }
else else
{ {
await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteCommandAsync(); await TenantDb.UpdateNav(taskMail)
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC)
.ExecuteCommandAsync();
} }
if (taskMail.Attachments?.Count > 0) if (taskMail.Attachments?.Count > 0)
@ -88,6 +93,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
await TenantDb.Deleteable<BusinessTaskAttachment>().Where(x => x.TaskMailId == taskMail.Id).ExecuteCommandAsync(); await TenantDb.Deleteable<BusinessTaskAttachment>().Where(x => x.TaskMailId == taskMail.Id).ExecuteCommandAsync();
await TenantDb.Insertable(taskMail.Attachments).ExecuteCommandAsync(); await TenantDb.Insertable(taskMail.Attachments).ExecuteCommandAsync();
//await TenantDb.Storageable(taskMail.Attachments).DefaultAddElseUpdate().ExecuteCommandAsync();
} }
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
@ -113,7 +120,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
try try
{ {
await TenantDb.DeleteNav<BusinessTaskMail>(x => model.Ids.Contains(x.Id)) await TenantDb.DeleteNav<BusinessTaskMail>(x => model.Ids.Contains(x.Id))
.Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Attachments) .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.CC).Include(x => x.Attachments)
.ExecuteCommandAsync(); .ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
@ -127,6 +134,5 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
} }
} }
} }
} }

@ -24,5 +24,22 @@
/// 接收人信息姓名 /// 接收人信息姓名
/// </summary> /// </summary>
public string RecvUserName { get; set; } public string RecvUserName { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 接收人信息状态
/// </summary>
public string RecvUserStatus { get; set; }
/// <summary>
/// 接收人信息状态名称
/// </summary>
public string RecvUserStatusName { get; set; }
/// <summary>
/// 接收人信息状态时间
/// </summary>
public DateTime? RecvUserStatusTime { get; set; }
} }
} }

@ -36,8 +36,8 @@ namespace DS.WMS.Core.TaskPlat.Entity
/// <summary> /// <summary>
/// 状态名称 /// 状态名称
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "状态名称", IsNullable = true, Length = 50)] [SugarColumn(ColumnDescription = "状态名称", IsNullable = false, Length = 50, DefaultValue = "")]
public string? StatusName { get; set; } public string StatusName { get; set; } = "";
/// <summary> /// <summary>
/// 状态发生时间 /// 状态发生时间

@ -2688,10 +2688,10 @@ namespace DS.WMS.Core.TaskPlat.Method
{ {
return DataResult.Failed("未执行:" + seaExport.Message); return DataResult.Failed("未执行:" + seaExport.Message);
} }
if (seaExport.Data.MBLNO != taskBcInfo.MBL_NO && seaExport.Data.BookingNo != taskBcInfo.MBL_NO) //if (seaExport.Data.MBLNO != taskBcInfo.MBL_NO && seaExport.Data.BookingNo != taskBcInfo.MBL_NO)
{ //{
return DataResult.Failed(string.Format(MultiLanguageConst.GetDescription(MultiLanguageConst.BCMblnoNotMatchSeaexport), seaExport.Data.MBLNO, taskBcInfo.MBL_NO)); // return DataResult.Failed(string.Format(MultiLanguageConst.GetDescription(MultiLanguageConst.BCMblnoNotMatchSeaexport), seaExport.Data.MBLNO, taskBcInfo.MBL_NO));
} //}
TaskFlowDataContext dataContext = new((TaskFlowDataNameConst.Business, seaExport.Data)); TaskFlowDataContext dataContext = new((TaskFlowDataNameConst.Business, seaExport.Data));
@ -2699,10 +2699,10 @@ namespace DS.WMS.Core.TaskPlat.Method
var taskInfo = new TaskBaseInfo var taskInfo = new TaskBaseInfo
{ {
Id = SnowFlakeSingle.Instance.NextId(), Id = SnowFlakeSingle.Instance.NextId(),
STATUS = TaskStatusEnum.Complete.ToString(), STATUS = TaskStatusEnum.Create.ToString(),
STATUS_NAME = TaskStatusEnum.Complete.EnumDescription(), STATUS_NAME = TaskStatusEnum.Create.EnumDescription(),
IS_EXCEPT = 0, IS_EXCEPT = 0,
IS_COMPLETE = 1, IS_COMPLETE = 0,
MBL_NO = taskBcInfo.MBL_NO, MBL_NO = taskBcInfo.MBL_NO,
TASK_TYPE = TaskBaseTypeEnum.BC.ToString(), TASK_TYPE = TaskBaseTypeEnum.BC.ToString(),
TASK_TYPE_NAME = TaskBaseTypeEnum.BC.EnumDescription(), TASK_TYPE_NAME = TaskBaseTypeEnum.BC.EnumDescription(),
@ -2923,7 +2923,7 @@ namespace DS.WMS.Core.TaskPlat.Method
TaskFlowRuner taskFlow = new TaskFlowRuner(tenantDb, serviceProvider); TaskFlowRuner taskFlow = new TaskFlowRuner(tenantDb, serviceProvider);
await taskFlow.Run(TaskBaseTypeEnum.BC, taskInfo.Id, dataContext); await taskFlow.Run(TaskBaseTypeEnum.BC, taskInfo.Id, dataContext);
return DataResult.Successed("上传完成,请审核相关任务及订单状态", MultiLanguageConst.UploadBcThenRunTaskSuccess); return DataResult.Successed("上传完成,请查看相关任务状态", MultiLanguageConst.UploadBcThenRunTaskSuccess);
} }
/// <summary> /// <summary>

@ -351,10 +351,12 @@ namespace DS.WMS.Core.TaskPlat.Method
//任务不考虑OrgId,这里去掉 //任务不考虑OrgId,这里去掉
tenantDb.QueryFilter.Clear<IOrgId>(); tenantDb.QueryFilter.Clear<IOrgId>();
var time = DateTime.Now.AddMonths(-3);
var taskList = await tenantDb.Queryable<TaskBaseInfo>() var taskList = await tenantDb.Queryable<TaskBaseInfo>()
.Where(x => x.IS_PUBLIC == 1 .Where(x => x.IS_PUBLIC == 1
&& x.STATUS == TaskStatusEnum.Create.ToString() && x.STATUS == TaskStatusEnum.Create.ToString()
&& !string.IsNullOrEmpty(x.MBL_NO)) && !string.IsNullOrEmpty(x.MBL_NO)
&& x.CreateTime > time)
.WhereIF(taskIdList != null && taskIdList.Count > 0, x => taskIdList!.Contains(x.Id)) .WhereIF(taskIdList != null && taskIdList.Count > 0, x => taskIdList!.Contains(x.Id))
//.Where(x => x.Id == 1813475270208917504 || x.Id == 1816277472539447296 || x.Id == 1813509723408961536) //.Where(x => x.Id == 1813475270208917504 || x.Id == 1816277472539447296 || x.Id == 1813509723408961536)
.ToListAsync(x => new TaskBaseInfo .ToListAsync(x => new TaskBaseInfo
@ -588,8 +590,8 @@ namespace DS.WMS.Core.TaskPlat.Method
x.StatusName = taskStatusEnum.EnumDescription(); x.StatusName = taskStatusEnum.EnumDescription();
x.StatusTime = statusTime; x.StatusTime = statusTime;
}); });
await tenantDb.Updateable(taskBaseAllocationList).UpdateColumns(x => new await tenantDb.CopyNew().Updateable(taskBaseAllocationList).UpdateColumns(x => new
{ {
x.UpdateBy, x.UpdateBy,
x.UpdateTime, x.UpdateTime,

@ -1716,441 +1716,456 @@ namespace DS.WMS.Core.TaskPlat.Method
//throw new ArgumentException("TaskCategory"); //throw new ArgumentException("TaskCategory");
} }
var userId = long.Parse(user.UserId); var userId = long.Parse(user.UserId);
DataResult<List<dynamic>> result; DataResult<List<dynamic>> result = new();
switch (taskType) try
{ {
case TaskBaseTypeEnum.BC: switch (taskType)
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>() case TaskBaseTypeEnum.BC:
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) {
.LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID); var queryable = tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
Id = t.Id.SelectAll(),
bc.BUSI_TYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.BC_MODIFY_TIMES,
bc.BC_MODIFY_DATE,
//bc.MBL_NO,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.PLACERECEIPT,
bc.PORTLOAD,
bc.CLOSING_DATE,
bc.VGM_CUTOFF_TIME,
bc.ETA,
//bc.ETD,
bc.POD_ETA,
bc.CUT_SINGLE_TIME,
bc.PORTDISCHARGE,
bc.PLACEDELIVERY,
bc.SHIPPING_METHOD,
bc.SERVICE,
bc.PRETRANS_MODE,
bc.DESCRIPTION,
bc.ISSUEPLACE,
bc.COLLECTION_TERMINAL,
bc.CONTRACTNO,
bc.PREPARDAT,
bc.SHIP_AGENT,
bc.YARD,
bc.YARD_CONTACT_USR,
bc.YARD_CONTACT_TEL,
bc.FST_CUSTOMER_SER_USRNAME,
bc.FST_CUSTOMER_SER_TEL,
bc.FST_CUSTOMER_SER_EMAIL,
bc.REMARK1,
bc.CY_CUTOFF_TIME,
bc.CARRIERID,
bc.LANECODE,
bc.LANENAME,
bc.CARRIAGE_TYPE,
bc.CARRIAGE_TYPE_NAME,
bc.BOOKING_SLOT_TYPE,
bc.BOOKING_SLOT_TYPE_NAME,
bc.CTN_STAT,
bc.WEEK_AT,
bc.DETENSION_FREE_DAYS,
bc.SI_CUT_DATE,
bc.MANIFEST_CUT_DATE,
bc.MDGF_CUT_DATE,
bc.TRANSFER_PORT_1,
bc.TRANSFER_PORT_2,
bc.SECOND_VESSEL,
bc.SECOND_VOYNO,
bc.SECOND_ETD,
bc.SECOND_ETA,
//bc.STATUS,
bc.FILE_MD5,
bc.LAST_TOBOOKING_DATE,
bc.FROM_EMAIL,
bc.RECV_EMAIL,
bc.BOOKING_ORDER_ID,
bc.BOOKING_SLOT_ID,
bc.BOOKING_COMFIRM_DATE,
bc.BATCH_NO,
bc.CUSTOM_SI_CUT_DATE,
bc.IS_SET_AUTO_EMAIL,
bc.IS_SEND_EMAIL,
bc.DIFF_NUM,
bc.AUTO_SEND_USER,
bc.PROCESS_STATUS,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.PRICE_CALCULATION_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
//var sql = queryable.ToSqlString();
return result;
}
case TaskBaseTypeEnum.SI_FEEDBACK:
{ {
Id = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.BUSI_TYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.BC_MODIFY_TIMES,
bc.BC_MODIFY_DATE,
//bc.MBL_NO,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.PLACERECEIPT,
bc.PORTLOAD,
bc.CLOSING_DATE,
bc.VGM_CUTOFF_TIME,
bc.ETA,
//bc.ETD,
bc.POD_ETA,
bc.CUT_SINGLE_TIME,
bc.PORTDISCHARGE,
bc.PLACEDELIVERY,
bc.SHIPPING_METHOD,
bc.SERVICE,
bc.PRETRANS_MODE,
bc.DESCRIPTION,
bc.ISSUEPLACE,
bc.COLLECTION_TERMINAL,
bc.CONTRACTNO,
bc.PREPARDAT,
bc.SHIP_AGENT,
bc.YARD,
bc.YARD_CONTACT_USR,
bc.YARD_CONTACT_TEL,
bc.FST_CUSTOMER_SER_USRNAME,
bc.FST_CUSTOMER_SER_TEL,
bc.FST_CUSTOMER_SER_EMAIL,
bc.REMARK1,
bc.CY_CUTOFF_TIME,
bc.CARRIERID,
bc.LANECODE,
bc.LANENAME,
bc.CARRIAGE_TYPE,
bc.CARRIAGE_TYPE_NAME,
bc.BOOKING_SLOT_TYPE,
bc.BOOKING_SLOT_TYPE_NAME,
bc.CTN_STAT,
bc.WEEK_AT,
bc.DETENSION_FREE_DAYS,
bc.SI_CUT_DATE,
bc.MANIFEST_CUT_DATE,
bc.MDGF_CUT_DATE,
bc.TRANSFER_PORT_1,
bc.TRANSFER_PORT_2,
bc.SECOND_VESSEL,
bc.SECOND_VOYNO,
bc.SECOND_ETD,
bc.SECOND_ETA,
//bc.STATUS,
bc.FILE_MD5,
bc.LAST_TOBOOKING_DATE,
bc.FROM_EMAIL,
bc.RECV_EMAIL,
bc.BOOKING_ORDER_ID,
bc.BOOKING_SLOT_ID,
bc.BOOKING_COMFIRM_DATE,
bc.BATCH_NO,
bc.CUSTOM_SI_CUT_DATE,
bc.IS_SET_AUTO_EMAIL,
bc.IS_SEND_EMAIL,
bc.DIFF_NUM,
bc.AUTO_SEND_USER,
bc.PROCESS_STATUS,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.PRICE_CALCULATION_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
//var sql = queryable.ToSqlString();
return result;
}
case TaskBaseTypeEnum.SI_FEEDBACK:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.CARRIER,
//bc.MBL_NO,
bc.TAKE_ISSUETYPE_NAME,
bc.ISSUETYPE,
bc.NOTICE_DATE,
bc.BOOKING_ID,
bc.SUBMITTED_DATE,
bc.BILLOF_NUM,
bc.RELEASE_INSTRUCTION,
bc.SI_SUBTYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.NOTIFYPARTY2,
bc.TRANSPORT_RECEIVER,
bc.MARKS,
bc.HSCODE,
bc.DESCRIPTION,
bc.PKGS,
bc.KINDPKGS,
bc.KGS,
bc.CBM,
bc.VESSEL,
bc.VOYNO,
bc.COMMODITY,
bc.PLACERECEIPTID,
bc.PLACERECEIPT,
bc.PORTLOADID,
bc.PORTLOAD,
bc.PORTDISCHARGEID,
bc.PORTDISCHARGE,
bc.PLACEDELIVERYID,
bc.PLACEDELIVERY,
bc.PROCESS_STATUS,
bc.IS_SET_AUTO_UPD_BOOKING,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.DIFF_NUM,
bc.IS_UPDATE_BOOKING,
bc.UPDATE_BOOKING_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.INVOICE_BILL_MAIL:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.CARRIER,
//bc.MBL_NO,
bc.TAKE_ISSUETYPE_NAME,
bc.ISSUETYPE,
bc.NOTICE_DATE,
bc.BOOKING_ID,
bc.SUBMITTED_DATE,
bc.BILLOF_NUM,
bc.RELEASE_INSTRUCTION,
bc.SI_SUBTYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.NOTIFYPARTY2,
bc.TRANSPORT_RECEIVER,
bc.MARKS,
bc.HSCODE,
bc.DESCRIPTION,
bc.PKGS,
bc.KINDPKGS,
bc.KGS,
bc.CBM,
bc.VESSEL,
bc.VOYNO,
bc.COMMODITY,
bc.PLACERECEIPTID,
bc.PLACERECEIPT,
bc.PORTLOADID,
bc.PORTLOAD,
bc.PORTDISCHARGEID,
bc.PORTDISCHARGE,
bc.PLACEDELIVERYID,
bc.PLACEDELIVERY,
bc.PROCESS_STATUS,
bc.IS_SET_AUTO_UPD_BOOKING,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.DIFF_NUM,
bc.IS_UPDATE_BOOKING,
bc.UPDATE_BOOKING_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.INVOICE_BILL_MAIL:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_PKID,
//bc.MBL_NO,
bc.INVOICE_NO,
bc.CANCEL_NO,
bc.TOTAL_AMOUNT,
bc.IS_DONGSH_RECV,
bc.IS_DONGSH_RESULT,
bc.DONGSH_RECV_TIME,
bc.DONGSH_RESULT_TIME,
bc.DONGSH_RECV_REASON
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.TRUCK_DISPATCH:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_PKID,
//bc.MBL_NO,
bc.INVOICE_NO,
bc.CANCEL_NO,
bc.TOTAL_AMOUNT,
bc.IS_DONGSH_RECV,
bc.IS_DONGSH_RESULT,
bc.DONGSH_RECV_TIME,
bc.DONGSH_RESULT_TIME,
bc.DONGSH_RECV_REASON
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.TRUCK_DISPATCH:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.BookingTruckId,
bc.BookingId,
bc.TruckId,
bc.TruckCode,
bc.TruckName,
bc.ToName,
bc.Attn,
bc.AttnTel,
bc.AttnMail,
bc.AttnFax,
bc.FromName,
bc.FromTel,
bc.FromMail,
bc.FromMobile,
bc.FromFax,
bc.KGS,
bc.Fee,
bc.PayMethod,
bc.PayMethodName,
bc.TruckTime,
bc.YARDID,
bc.YARD,
bc.YARDCONTRACT,
bc.YARDCONTRACTTEL,
bc.FactoryId,
bc.FactoryCode,
bc.FactoryName,
bc.FactoryContact,
bc.FactoryTel,
bc.ReturnTime,
bc.InYardID,
bc.InYard,
bc.InYardContact,
bc.InYardContractTel,
//bc.NeedArriveTime,
bc.ClosingTime,
bc.PickUpTime,
bc.IsGuaJi,
//bc.Status,
bc.Attention,
bc.Remark,
bc.DispatcherId,
bc.DispatcherName,
bc.TruckFlowNo,
bc.TaskNo,
bc.Vessel,
bc.VoyNo,
bc.MBLNo,
bc.CntrTotal,
bc.FactoryAddr
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CUT_MODIFY:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.BookingTruckId,
bc.BookingId,
bc.TruckId,
bc.TruckCode,
bc.TruckName,
bc.ToName,
bc.Attn,
bc.AttnTel,
bc.AttnMail,
bc.AttnFax,
bc.FromName,
bc.FromTel,
bc.FromMail,
bc.FromMobile,
bc.FromFax,
bc.KGS,
bc.Fee,
bc.PayMethod,
bc.PayMethodName,
bc.TruckTime,
bc.YARDID,
bc.YARD,
bc.YARDCONTRACT,
bc.YARDCONTRACTTEL,
bc.FactoryId,
bc.FactoryCode,
bc.FactoryName,
bc.FactoryContact,
bc.FactoryTel,
bc.ReturnTime,
bc.InYardID,
bc.InYard,
bc.InYardContact,
bc.InYardContractTel,
//bc.NeedArriveTime,
bc.ClosingTime,
bc.PickUpTime,
bc.IsGuaJi,
//bc.Status,
bc.Attention,
bc.Remark,
bc.DispatcherId,
bc.DispatcherName,
bc.TruckFlowNo,
bc.TaskNo,
bc.Vessel,
bc.VoyNo,
bc.MBLNo,
bc.CntrTotal,
bc.FactoryAddr
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CUT_MODIFY:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.VESSEL,
bc.VOYNO,
bc.NOTICE_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROLLING_NOMINATION:
case TaskBaseTypeEnum.TRANSFER_NOMINATION:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.CARRIER,
bc.VESSEL,
bc.VOYNO,
bc.NOTICE_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROLLING_NOMINATION:
case TaskBaseTypeEnum.TRANSFER_NOMINATION:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.PLAN_TYPE,
bc.BATCH_NO,
bc.CARRIERID,
bc.CARRIER,
bc.CONFIRM_DEAD_LINE,
bc.READ_CREATE_TIME,
bc.ROLL_DOUBLE_REMARK,
bc.PLAN_TXT,
//bc.REMARK,
bc.TASK_BATCH_TOTAL,
bc.TASK_BATCH_PER_TOTAL
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.DRAFT:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.PLAN_TYPE,
bc.BATCH_NO,
bc.CARRIERID,
bc.CARRIER,
bc.CONFIRM_DEAD_LINE,
bc.READ_CREATE_TIME,
bc.ROLL_DOUBLE_REMARK,
bc.PLAN_TXT,
//bc.REMARK,
bc.TASK_BATCH_TOTAL,
bc.TASK_BATCH_PER_TOTAL
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.DRAFT:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
//bc.MBL_NO,
bc.BOOKING_ID,
bc.IS_CHANGE,
bc.IS_EMAIL_SEND,
bc.SEND_EMAIL_DATE,
bc.NOTICE_DATE,
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.POD_DISCHARGE_FULL:
case TaskBaseTypeEnum.POD_GATEOUT_FULL:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.CARRIER,
//bc.MBL_NO,
bc.BOOKING_ID,
bc.IS_CHANGE,
bc.IS_EMAIL_SEND,
bc.SEND_EMAIL_DATE,
bc.NOTICE_DATE,
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.POD_DISCHARGE_FULL:
case TaskBaseTypeEnum.POD_GATEOUT_FULL:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.NOTICE_TYPE,
bc.NOTICE_TYPE_NAME,
//bc.MBL_NO,
bc.NOTICE_DATE
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CAUTION_NOTICE:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.CARRIER,
bc.NOTICE_TYPE,
bc.NOTICE_TYPE_NAME,
//bc.MBL_NO,
bc.NOTICE_DATE
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CAUTION_NOTICE:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.SOURCE_SYSTEM,
bc.SOURCE_BUSI_TYPE,
bc.SOURCE_BUSI_TYPENAME,
bc.NOTIFY_CONTENT,
//bc.MBL_NO,
bc.CARRIER,
bc.CAUTION_NOTICE_TYPE,
bc.IS_WEEK_DIFF,
bc.IS_PRICE_DATE_DIFF,
bc.IS_TRANSFER,
bc.IS_VESSEL_CHANGE,
bc.IS_CUT_DATE_ADVANCED,
bc.BOOKING_ID,
bc.BOOKING_SLOT_ID,
bc.SOURCE_TASK_ID,
bc.OLD_VAL,
bc.NEW_VAL,
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROUTE_CUT_CHANGE:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
TASK_USER_STATUS = a.Status, .LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID);
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.SOURCE_SYSTEM,
bc.SOURCE_BUSI_TYPE,
bc.SOURCE_BUSI_TYPENAME,
bc.NOTIFY_CONTENT,
//bc.MBL_NO,
bc.CARRIER,
bc.CAUTION_NOTICE_TYPE,
bc.IS_WEEK_DIFF,
bc.IS_PRICE_DATE_DIFF,
bc.IS_TRANSFER,
bc.IS_VESSEL_CHANGE,
bc.IS_CUT_DATE_ADVANCED,
bc.BOOKING_ID,
bc.BOOKING_SLOT_ID,
bc.SOURCE_TASK_ID,
bc.OLD_VAL,
bc.NEW_VAL,
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROUTE_CUT_CHANGE:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new result = await queryable.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.READ_PORTLOAD,
bc.ORIG_ETD,
bc.MDGF_CUT_DATE,
bc.ETA,
//bc.ETD,
bc.SI_CUT_DATE,
bc.TM_SHIFT_CUT_DATE,
bc.VGM_CUTOFF_TIME,
bc.CY_CUT_DATE,
bc.ROUTE_CODE,
bc.EMAIL_SUBJECT,
bc.WEEK,
bc.PORTLOADID,
bc.PORTLOAD
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
default:
{ {
PK_ID = t.Id.SelectAll(), var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId);
TASK_USER_STATUS = a.Status,
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime,
bc.TASK_ID,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.READ_PORTLOAD,
bc.ORIG_ETD,
bc.MDGF_CUT_DATE,
bc.ETA,
//bc.ETD,
bc.SI_CUT_DATE,
bc.TM_SHIFT_CUT_DATE,
bc.VGM_CUTOFF_TIME,
bc.CY_CUT_DATE,
bc.ROUTE_CODE,
bc.EMAIL_SUBJECT,
bc.WEEK,
bc.PORTLOADID,
bc.PORTLOAD
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
default:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a) => new result = await queryable.Select<dynamic>((t, a) => new
{
PK_ID = t.Id.SelectAll(),
//TASK_USER_STATUS = a.Status,
//TASK_USER_STATUS_NAME = a.StatusName,
//TASK_USER_STATUS_TIME = a.StatusTime
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
}
}
finally
{
if (result.Data?.Count > 0)
{
var taskIdList = result.Data.Select(x => (long)x.Id).ToList();
var allRecvUserList = await tenantDb.Queryable<TaskBaseAllocation>()
.Where(x => taskIdList.Contains(x.TaskId))
.Select(x => new RecvUserInfo()
{
TaskId = x.TaskId,
RecvUserId = x.UserId,
RecvUserName = x.UserName,
RecvUserStatus = x.Status,
RecvUserStatusName = x.StatusName,
RecvUserStatusTime = x.StatusTime
}).ToListAsync();
if (allRecvUserList.Count > 0)
{
foreach (var item in result.Data)
{ {
PK_ID = t.Id.SelectAll(), var recvUserList = allRecvUserList.Where(x => x.TaskId == item.Id).ToList();
TASK_USER_STATUS = a.Status,
TASK_USER_STATUS_NAME = a.StatusName,
TASK_USER_STATUS_TIME = a.StatusTime
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
var currentUserStatus = recvUserList.FirstOrDefault(x => x.RecvUserId == userId);
if (currentUserStatus != null)
{
var n = recvUserList.IndexOf(currentUserStatus);
if (n != 0)
{
recvUserList.RemoveAt(n);
recvUserList.Insert(0, currentUserStatus);
}
return result; item.TASK_USER_STATUS = currentUserStatus.RecvUserStatus;
item.TASK_USER_STATUS_NAME = currentUserStatus.RecvUserStatusName;
item.TASK_USER_STATUS_TIME = currentUserStatus.RecvUserStatusTime;
}
item.RecvUserList = recvUserList;
}
} }
}
} }
} }
/// <summary> /// <summary>
@ -2212,7 +2227,7 @@ namespace DS.WMS.Core.TaskPlat.Method
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.Where(whereList) .Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString()) .Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 boss提出只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId || .Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
.WhereIF(!string.IsNullOrEmpty(querySearch.BusinessNo), (t, a) => t.MBL_NO == querySearch.BusinessNo || t.CUSTOMER_NO == querySearch.BusinessNo) .WhereIF(!string.IsNullOrEmpty(querySearch.BusinessNo), (t, a) => t.MBL_NO == querySearch.BusinessNo || t.CUSTOMER_NO == querySearch.BusinessNo)
.GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC }) .GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC })
.Select((t, a) => new .Select((t, a) => new
@ -2685,7 +2700,7 @@ namespace DS.WMS.Core.TaskPlat.Method
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo) .WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status) .WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0 .WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 boss提出只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId || && (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryTaskManageDto.Status) && a.Status == queryTaskManageDto.Status)
.OrderByDescending(t => t.Id); .OrderByDescending(t => t.Id);
} }
@ -2707,7 +2722,7 @@ namespace DS.WMS.Core.TaskPlat.Method
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo) .WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status) .WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0 .WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 boss提出只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId || && (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryTaskManageDto.Status) && a.Status == queryTaskManageDto.Status)
.OrderByDescending(t => t.Id); .OrderByDescending(t => t.Id);
} }

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl> <_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-09-03T02:01:09.7656702Z||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History> <History>True|2024-09-03T08:41:23.7516960Z||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup> </PropertyGroup>

Loading…
Cancel
Save