zhangxiaofeng 4 months ago
commit 6d49b37b1f

1
.gitignore vendored

@ -55,3 +55,4 @@ bin-release/
/ds-wms-service/DS.WMS.TaskApi/Logs
/ds-wms-service/DS.WMS.TaskApi/LinkAttach/bcfiles
/ds-wms-service/DS.WMS.TaskApi/LinkAttach/bcnoticefiles
/ds-wms-service/DS.WMS.OpApi/LinkAttach

@ -1361,5 +1361,41 @@ public static class MultiLanguageConst
/// </summary>
[Description("预订舱数据已发送成功,不能修改")]
public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify";
/// <summary>
/// 附件不能为空
/// </summary>
[Description("附件不能为空")]
public const string BookingSlotImportFileNull = "BookingSlot_Import_FileNull";
/// <summary>
/// 请上传指定模板文件
/// </summary>
[Description("请上传指定模板文件")]
public const string BookingSlotImportFileTypeError = "BookingSlot_Import_TypeError";
/// <summary>
/// 内容为空
/// </summary>
[Description("内容为空")]
public const string BookingSlotImportExcelEmpty = "BookingSlot_Import_ExcelEmpty";
/// <summary>
/// 导入舱位异常,原因:{0}
/// </summary>
[Description("导入舱位异常,原因:{0}")]
public const string BookingSlotImportException = "BookingSlot_Import_Exception";
/// <summary>
/// 导入失败
/// </summary>
[Description("导入失败")]
public const string BookingSlotImportFail = "BookingSlot_Import_Fail";
#endregion
#region 关联任务
[Description("此类型的任务已存在")]
public const string Task_Exists = "Task_Exists";
#endregion
}

@ -19,4 +19,10 @@ public abstract class BaseTenantModel<TKey> : BaseModel<TKey>, ITenantId
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
public long TenantId { get; set; } = 0;
/// <summary>
/// 租户名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "租户名称", IsOnlyIgnoreUpdate = true,Length = 150)]
public string TenantName { get; set; }
}

@ -19,4 +19,10 @@ public abstract class UserTenantModel<TKey> : BaseModel<TKey>, ITenantId
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "租户Id")]
public long TenantId { get; set; } = 0;
/// <summary>
/// 租户名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "租户名称", Length = 150)]
public string TenantName { get; set; }
}

@ -1,4 +1,5 @@
using System.Collections.Specialized;
using System.Net.Http.Headers;
using System.Text;
using DS.Module.Core.Extensions;
using Newtonsoft.Json;
@ -20,6 +21,16 @@ namespace DS.Module.Core
/// </summary>
public IDictionary<string, string> DefaultHeaders { get; private set; }
/// <summary>
/// 在发送网络请求之前的事件
/// </summary>
public event EventHandler<BeforeSendEventArgs>? BeforeSend;
/// <summary>
/// 在发送网络请求完成时的事件
/// </summary>
public event EventHandler<CompleteEventArgs>? Completed;
/// <summary>
/// 初始化
/// </summary>
@ -100,7 +111,7 @@ namespace DS.Module.Core
/// <returns></returns>
/// <exception cref="ArgumentNullException"><paramref name="method"/>为null</exception>
/// <exception cref="ArgumentException"><paramref name="url"/>为null或空字符串</exception>
public virtual async Task<DataResult<HttpResponseMessage>> SendRequestAsync(HttpMethod method, string url, object? requestParams = null)
public async Task<DataResult<HttpResponseMessage>> SendRequestAsync(HttpMethod method, string url, object? requestParams = null)
{
ArgumentNullException.ThrowIfNull(method);
ArgumentException.ThrowIfNullOrEmpty(url);
@ -128,6 +139,13 @@ namespace DS.Module.Core
if (!http.DefaultRequestHeaders.Contains("Accept"))
http.DefaultRequestHeaders.Add("Accept", "application/json, text/plain");
OnBeforeSend(new BeforeSendEventArgs
{
RequestHeaders = http.DefaultRequestHeaders,
RequestParameter = requestParams,
RequestUri = reqUri
});
try
{
HttpResponseMessage? response = null;
@ -154,6 +172,12 @@ namespace DS.Module.Core
throw new NotSupportedException($"不支持的请求方法:{method.Method}");
}
OnCompleted(new CompleteEventArgs
{
RequestUri = reqUri,
Response = response
});
if (!response.IsSuccessStatusCode)
return DataResult<HttpResponseMessage>.FailedData(response, string.Format(MultiLanguageConst.HttpRequestFailed, $"{response.StatusCode}"));
@ -164,5 +188,60 @@ namespace DS.Module.Core
http?.Dispose();
}
}
/// <summary>
/// 在发送网络请求之前调用
/// </summary>
/// <param name="e">事件参数</param>
protected virtual void OnBeforeSend(BeforeSendEventArgs e)
{
BeforeSend?.Invoke(this, e);
}
/// <summary>
/// 在发送网络请求完成时调用
/// </summary>
/// <param name="e">事件参数</param>
protected virtual void OnCompleted(CompleteEventArgs e)
{
Completed?.Invoke(this, e);
}
}
/// <summary>
/// 发送网络请求之前的事件参数
/// </summary>
public class BeforeSendEventArgs : EventArgs
{
/// <summary>
/// 远程请求的URI
/// </summary>
public Uri RequestUri { get; internal set; }
/// <summary>
/// 请求标头
/// </summary>
public HttpRequestHeaders RequestHeaders { get; internal set; }
/// <summary>
/// 请求参数
/// </summary>
public object? RequestParameter { get; set; }
}
/// <summary>
/// 发送网络请求完成的事件参数
/// </summary>
public class CompleteEventArgs : EventArgs
{
/// <summary>
/// 远程请求的URI
/// </summary>
public Uri RequestUri { get; internal set; }
/// <summary>
/// 网络响应对象
/// </summary>
public HttpResponseMessage Response { get; internal set; }
}
}

@ -77,7 +77,7 @@ public class JwtHelper
// new Claim("OrgId", data.OrgId), // 公司ID
new Claim("UserName", data.Name), // UserName
new Claim("TenantId", data.TenantId), // 租户ID
new Claim("TenantName", data.TenantName), // 租户名称
};
// 添加机构信息
if (isClient)
@ -168,5 +168,10 @@ public class JwtHelper
/// 租户ID
/// </summary>
public string TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
}
}

@ -60,6 +60,23 @@ public class AspNetUser : IUser
_userName = value;
}
}
private string _tenantName;
public string TenantName
{
get
{
if (_tenantName == null)
{
var claimValue = GetClaimValueByType("TenantName").FirstOrDefault();
_tenantName = claimValue != null ? claimValue.ObjToString() : "系统租户";
}
return _tenantName;
}
set
{
_tenantName = value;
}
}
public long GetTenantId()
{
var token = GetToken();

@ -30,6 +30,11 @@ public interface IUser
/// 租户ID
/// </summary>
string TenantId { get; }
/// <summary>
/// 租户名称
/// </summary>
string TenantName { get; }
/// <summary>
/// 机构ID
/// </summary>

@ -485,7 +485,7 @@ namespace DS.WMS.Core.Application.Method
return DataResult.Failed(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.NoNeedWithdraw)), msg));
}
var flows = list.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = (int)FlowStatusEnum.Draft, MakerList = string.Empty }).ToList();
var flows = list.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = FlowStatusEnum.Draft, MakerList = string.Empty }).ToList();
DateTime dtNow = DateTime.Now;
try
{

@ -566,7 +566,7 @@ namespace DS.WMS.Core.Fee.Method
return DataResult.Failed(string.Format(MultiLanguageConst.NoNeedWithdraw, msg));
}
var flows = fees.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = (int)FlowStatusEnum.Draft, MakerList = string.Empty }).ToList();
var flows = fees.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = FlowStatusEnum.Draft, MakerList = string.Empty }).ToList();
DateTime dtNow = DateTime.Now;
await TenantDb.Ado.BeginTranAsync();
try

@ -27,11 +27,6 @@ namespace DS.WMS.Core.Fee.Method
/// </summary>
public const string USD_CODE = "USD";
/// <summary>
/// 工作流运行状态值
/// </summary>
public static readonly int RunningStatus = (int)FlowStatusEnum.Running;
/// <summary>
/// 获取用户相关信息
/// </summary>
@ -294,7 +289,7 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns>
protected ISugarQueryable<FlowInstance> GetCurrentFlowsQuery(string[] auditTypes)
{
return Db.Queryable<FlowInstance>().Where(x => x.FlowStatus == RunningStatus
return Db.Queryable<FlowInstance>().Where(x => x.FlowStatus == FlowStatusEnum.Running
&& SqlFunc.SplitIn(x.MakerList, User.UserId) && auditTypes.Contains(x.AuditType))
.Select(x => new FlowInstance { Id = x.Id, BusinessId = x.BusinessId, BusinessType = x.BusinessType });
}

@ -68,7 +68,7 @@ public class FlowInstance : BaseTenantModel<long>
/// 工作流状态
/// </summary>
[Description("工作流状态")]
public int FlowStatus { get; set; } = FlowStatusEnum.Ready.ToEnumInt();
public FlowStatusEnum FlowStatus { get; set; } = FlowStatusEnum.Ready;
/// <summary>
/// 中文视图名;设计方案时,提供中文字段的视图来源
@ -86,7 +86,7 @@ public class FlowInstance : BaseTenantModel<long>
/// 回调地址
/// </summary>
[SugarColumn(ColumnDescription = "回调地址", IsNullable = true, Length = 255)]
public string CallbackURL { get; set; }
public string? CallbackURL { get; set; }
/// <summary>
/// 审批类型

@ -80,7 +80,7 @@ public class ClientFlowInstanceService : FlowInstanceService, IClientFlowInstanc
/// <returns></returns>
public DataResult<List<FlowInstanceRes>> GetFlowInstances(long businessId, BusinessType? businessType)
{
var query = db.Queryable<FlowInstance>().Where(x => x.BusinessId == businessId && x.FlowStatus != 1);
var query = db.Queryable<FlowInstance>().Where(x => x.BusinessId == businessId && x.FlowStatus != FlowStatusEnum.Running);
if (businessType.HasValue)
query = query.Where(x => x.BusinessType == businessType.Value);
@ -112,7 +112,7 @@ public class ClientFlowInstanceService : FlowInstanceService, IClientFlowInstanc
if (info == null)
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
if (info.Instance.FlowStatus == FlowStatusEnum.Approve.ToEnumInt())
if (info.Instance.FlowStatus == FlowStatusEnum.Approve)
return DataResult.Failed("该工作流已完成!", MultiLanguageConst.FlowInstanceFinished);
return AuditFlowCore(info.Status, info.AuditNote, info.Instance);

@ -24,6 +24,8 @@ public class FlowInstanceService : IFlowInstanceService
protected readonly IUser user;
private readonly ICommonService _commonService;
private ApiFox api;
/// <summary>
///
/// </summary>
@ -34,6 +36,14 @@ public class FlowInstanceService : IFlowInstanceService
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
_commonService = _serviceProvider.GetRequiredService<ICommonService>();
api = new ApiFox();
api.BeforeSend += Api_BeforeSend;
}
private void Api_BeforeSend(object? sender, BeforeSendEventArgs e)
{
e.RequestHeaders.Add("Authorization", "Bearer " + user.GetToken());
}
public DataResult<List<FlowInstanceRes>> GetListByPage(PageRequest request)
@ -57,7 +67,7 @@ public class FlowInstanceService : IFlowInstanceService
{
var info = db.Queryable<FlowInstance>().Where(x => x.Id == req.Id).First();
if (!(info.FlowStatus == FlowStatusEnum.Draft.ToEnumInt() || info.FlowStatus == FlowStatusEnum.Ready.ToEnumInt()))
if (!(info.FlowStatus == FlowStatusEnum.Draft || info.FlowStatus == FlowStatusEnum.Ready))
{
return DataResult.Failed("只能修改【就绪】和【撤销】状态的流程", MultiLanguageConst.FlowEditOnlyReadyAndCancel);
}
@ -129,7 +139,7 @@ public class FlowInstanceService : IFlowInstanceService
instance.ActivityName = wfruntime.CurrentNode.Name;
instance.PreviousId = "";
instance.MakerList = GetCurrentMakers(wfruntime);
instance.FlowStatus = FlowStatusEnum.Ready.ToEnumInt();
instance.FlowStatus = FlowStatusEnum.Ready;
wfruntime.FlowInstanceId = instance.Id;
@ -176,7 +186,7 @@ public class FlowInstanceService : IFlowInstanceService
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
if (instance.FlowStatus == FlowStatusEnum.Approve.ToEnumInt())
if (instance.FlowStatus == FlowStatusEnum.Approve)
{
return DataResult.Failed("该工作流已完成!", MultiLanguageConst.FlowInstanceFinished);
}
@ -195,7 +205,7 @@ public class FlowInstanceService : IFlowInstanceService
instance.ActivityName = wfruntime.ChildNodes.First(x => x.Id == startNodeId).Name;
instance.MakerList =
(wfruntime.GetNextNodeType() != 4 ? GetCurrentMakers(wfruntime) : "1");
instance.FlowStatus = FlowStatusEnum.Draft.ToEnumInt();
instance.FlowStatus = FlowStatusEnum.Draft;
wfruntime.FlowInstanceId = instance.Id;
@ -242,7 +252,7 @@ public class FlowInstanceService : IFlowInstanceService
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
if (instance.FlowStatus == FlowStatusEnum.Approve.ToEnumInt())
if (instance.FlowStatus == FlowStatusEnum.Approve)
{
return DataResult.Failed("该工作流已完成!", MultiLanguageConst.FlowInstanceFinished);
}
@ -258,9 +268,7 @@ public class FlowInstanceService : IFlowInstanceService
instance.PreviousId = wfruntime.CurrentNodeId;
instance.MakerList =
(wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime) : "1");
instance.FlowStatus = (wfruntime.GetNextNodeType() == 4
? FlowStatusEnum.Approve.ToEnumInt()
: FlowStatusEnum.Running.ToEnumInt());
instance.FlowStatus = (wfruntime.GetNextNodeType() == 4 ? FlowStatusEnum.Approve : FlowStatusEnum.Running);
wfruntime.FlowInstanceId = instance.Id;
@ -293,7 +301,7 @@ public class FlowInstanceService : IFlowInstanceService
return DataResult.Failed("该工作流不存在!", MultiLanguageConst.FlowInstanceNotExist);
}
if (instance.FlowStatus == FlowStatusEnum.Approve.ToEnumInt())
if (instance.FlowStatus == FlowStatusEnum.Approve)
{
return DataResult.Failed("该工作流已完成!", MultiLanguageConst.FlowInstanceFinished);
}
@ -328,7 +336,7 @@ public class FlowInstanceService : IFlowInstanceService
var res = runtime.NodeConfluence(runtime.CurrentNodeId, tag);
if (res == TagState.No.ToString("D"))
{
instance.FlowStatus = FlowStatusEnum.Reject.ToEnumInt();
instance.FlowStatus = FlowStatusEnum.Reject;
}
else if (!string.IsNullOrEmpty(res))
{
@ -342,9 +350,7 @@ public class FlowInstanceService : IFlowInstanceService
instance.ActivityId = runtime.NextNodeId;
instance.ActivityType = runtime.NextNodeType;
instance.ActivityName = runtime.NextNode.Name;
instance.FlowStatus = runtime.NextNodeType == 4
? FlowStatusEnum.Approve.ToEnumInt()
: FlowStatusEnum.Running.ToEnumInt();
instance.FlowStatus = runtime.NextNodeType == 4 ? FlowStatusEnum.Approve : FlowStatusEnum.Running;
instance.MakerList = runtime.NextNodeType == 4 ? "1" : GetNextMakers(runtime);
}
// AddTransHistory(wfruntime);
@ -371,13 +377,11 @@ public class FlowInstanceService : IFlowInstanceService
instance.ActivityType = runtime.NextNodeType;
instance.ActivityName = runtime.NextNode.Name;
instance.MakerList = runtime.NextNodeType == 4 ? "1" : GetNextMakers(runtime);
instance.FlowStatus = (runtime.NextNodeType == 4
? FlowStatusEnum.Approve.ToEnumInt()
: FlowStatusEnum.Running.ToEnumInt());
instance.FlowStatus = (runtime.NextNodeType == 4 ? FlowStatusEnum.Approve : FlowStatusEnum.Running);
}
else
{
instance.FlowStatus = FlowStatusEnum.Reject.ToEnumInt(); //表示该节点不同意
instance.FlowStatus = FlowStatusEnum.Reject; //表示该节点不同意
runtime.NextNodeId = "-1";
runtime.NextNodeType = 4;
}
@ -425,13 +429,6 @@ public class FlowInstanceService : IFlowInstanceService
/// <param name="instance">运行实例</param>
protected virtual async Task RunCallbackAsync(FlowInstance instance)
{
if (!Uri.TryCreate(instance.CallbackURL, UriKind.RelativeOrAbsolute, out Uri? uri))
return;
HttpClient http = new HttpClient();
http.DefaultRequestHeaders.Add("User-Agent", "X-HttpClient");
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + user.GetToken());
//请求参数设置
var callback = new FlowCallback
{
@ -442,29 +439,13 @@ public class FlowInstanceService : IFlowInstanceService
FlowStatus = (FlowStatusEnum)instance.FlowStatus,
RejectReason = instance.Note
};
var jsonRequest = new StringContent(JsonConvert.SerializeObject(callback), Encoding.UTF8, "application/json");
try
{
var response = await http.PostAsync(uri, jsonRequest);
if (!response.IsSuccessStatusCode)
{
await new HttpRequestException("回调请求失败", null, response.StatusCode).LogAsync(db);
return;
}
//更新回调执行标识
var id = instance.Id;
db.Updateable<FlowInstance>().SetColumns(it => new FlowInstance { IsCallbackExecuted = true })
.Where(it => it.Id == id).ExecuteCommand();
}
catch (Exception ex)
{
await ex.LogAsync(db);
}
finally
{
http?.Dispose();
}
await api.PostAsync<DataResult>(instance.CallbackURL, callback);
//更新回调执行标识
var id = instance.Id;
await db.Updateable<FlowInstance>().SetColumns(it => new FlowInstance { IsCallbackExecuted = true })
.Where(it => it.Id == id).ExecuteCommandAsync();
}
protected virtual FlowRuntime CreateRuntimeService(FlowInstance instance)

@ -351,6 +351,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 标签列表
/// </summary>
public List<BookingLabelBaseDto> LabelList { get; set; }
}
/// <summary>

@ -1,149 +0,0 @@
using System.Runtime.Serialization;
using DS.Module.Core;
namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
/// <summary>
/// 任务台创建参数
/// </summary>
public class TaskCreation
{
[DataMember(Name = "head")]
public TaskHeader Head { get; set; }
[DataMember(Name = "main")]
public TaskMain Main { get; set; }
public TaskCreation()
{
Head = new TaskHeader();
Main = new TaskMain();
}
}
/// <summary>
/// 任务标头
/// </summary>
public class TaskHeader
{
/// <summary>
/// 流水ID
/// </summary>
[DataMember(Name = "gid")]
public Guid GID { get; set; } = Guid.NewGuid();
/// <summary>
/// 订单Id
/// </summary>
[DataMember(Name = "bsno")]
public long BSNO { get; set; }
/// <summary>
/// 消息类型
/// </summary>
[DataMember(Name = "messageType")]
public string MessageType { get; set; } = "WORK_FLOW_TASK";
[DataMember(Name = "senderId")]
public string SenderId { get; set; } = "WorkFlow";
[DataMember(Name = "senderName")]
public string SenderName { get; set; } = "工作流平台";
[DataMember(Name = "receiverId")]
public string ReceiverId { get; set; } = "TaskManage";
[DataMember(Name = "receiverName")]
public string ReceiverName { get; set; } = "任务管理平台";
/// <summary>
/// 标识符
/// </summary>
[DataMember(Name = "token")]
public string? Token { get; set; }
/// <summary>
/// 版本
/// </summary>
[DataMember(Name = "version")]
public string? Version { get; set; } = "1.0";
/// <summary>
/// 请求时间
/// </summary>
[DataMember(Name = "requestDate")]
public DateTime RequestDate { get; set; } = DateTime.Now;
[DataMember(Name = "senderKey")]
public string? SenderKey { get; set; }
[DataMember(Name = "requestAction")]
public string? RequestAction { get; set; } = "Add";
}
/// <summary>
/// 任务主信息
/// </summary>
public class TaskMain
{
/// <summary>
/// 任务类型
/// </summary>
[DataMember(Name = "taskType")]
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务来源
/// </summary>
[DataMember(Name = "taskSource")]
public int TaskSource { get; set; } = 9;
/// <summary>
/// 任务标题
/// </summary>
[DataMember(Name = "taskTitle")]
public string TaskTitle { get; set; } = string.Empty;
/// <summary>
/// 任务描述
/// </summary>
[DataMember(Name = "taskDesp")]
public string? TaskDescription { get; set; }
/// <summary>
/// 任务创建者ID
/// </summary>
[DataMember(Name = "taskUserId")]
public long TaskUserId { get; set; }
/// <summary>
/// 任务创建者
/// </summary>
[DataMember(Name = "taskUserName")]
public string? TaskUserName { get; set; }
/// <summary>
/// 任务接收者ID
/// </summary>
[DataMember(Name = "recvUserId")]
public long RecvUserId { get; set; }
/// <summary>
/// 任务创建者
/// </summary>
[DataMember(Name = "recvUserName")]
public string? RecvUserName { get; set; }
/// <summary>
/// 任务租户ID
/// </summary>
[DataMember(Name = "taskTenatId")]
public long TaskTenatId { get; set; }
/// <summary>
/// 任务租户
/// </summary>
[DataMember(Name = "taskTenatName")]
public string? TaskTenatName { get; set; }
}
}

@ -0,0 +1,36 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
/// <summary>
/// 任务台创建参数
/// </summary>
public class TaskCreationRequest
{
/// <summary>
/// 业务ID
/// </summary>
public long BusinessId { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务标题
/// </summary>
public string TaskTitle { get; set; } = string.Empty;
/// <summary>
/// 任务描述
/// </summary>
public string? TaskDescription { get; set; }
}
}

@ -0,0 +1,31 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Op.Dtos.TaskInteraction
{
/// <summary>
/// 任务台状态更新参数
/// </summary>
public class TaskUpdateRequest
{
/// <summary>
/// 业务ID
/// </summary>
public long BusinessId { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public TaskStatusEnum TaskStatus { get; set; }
}
}

@ -0,0 +1,60 @@
using DS.Module.Core;
using SqlSugar;
namespace DS.WMS.Core.Op.Entity.TaskInteraction
{
/// <summary>
/// 业务任务交互表
/// </summary>
[SugarTable("business_task", "业务任务交互表")]
public class BusinessTask
{
/// <summary>
/// 业务ID
/// </summary>
[SugarColumn(ColumnDescription = "业务ID", IsPrimaryKey = true, IsNullable = false)]
public long BusinessId { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[SugarColumn(ColumnDescription = "业务类型", IsPrimaryKey = true, IsNullable = false)]
public BusinessType BusinessType { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(ColumnDescription = "任务类型", IsPrimaryKey = true, IsNullable = false)]
public TaskBaseTypeEnum TaskType { get; set; }
/// <summary>
/// 任务状态
/// </summary>
[SugarColumn(ColumnDescription = "任务状态", IsNullable = false)]
public TaskStatusEnum TaskStatus { get; set; }
/// <summary>
/// 下一任务类型
/// </summary>
[SugarColumn(ColumnDescription = "下一任务类型", IsNullable = true)]
public TaskBaseTypeEnum? NextType { get; set; }
/// <summary>
/// 当前工作流ID
/// </summary>
[SugarColumn(ColumnDescription = "当前工作流ID", IsNullable = true)]
public long? FlowId { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnDescription = "创建人", IsNullable = false)]
public long CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDescription = "创建时间", IsNullable = false)]
public DateTime CreateTime { get; set; }
}
}

@ -120,7 +120,8 @@ namespace DS.WMS.Core.Op.Interface
/// </summary>
/// <param name="file">导入舱位文件</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> ImportSlotFromFile(IFormFile file);
Task<DataResult<List<object>>> ImportSlotFromFile(IFormFile file);
/// <summary>
/// 生成订舱订单

@ -109,6 +109,13 @@ namespace DS.WMS.Core.Op.Method
//船公司基础映射模块
const string CONST_MAPPING_CARRIER_MODULE = "CarrierBaseMapping";
/*
*
*/
const string IS_ENABLE_CUSTOMER_AUTHORITY = "IS_ENABLE_CUSTOMER_AUTHORITY";
public BookingSlotService(IServiceProvider serviceProvider)
{
@ -2802,28 +2809,32 @@ namespace DS.WMS.Core.Op.Method
/// </summary>
/// <param name="file">导入舱位文件</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> ImportSlotFromFile(IFormFile file)
public async Task<DataResult<List<object>>> ImportSlotFromFile(IFormFile file)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
bool succ = false;
List<object> list = new List<object>();
try
{
result.succ = false;
if (file == null)
{
result.msg = "附件不能为空";
return result;
//附件不能为空
return DataResult<List<object>>.Failed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportFileNull)));
}
FileInfo fileInfo = new FileInfo(file.FileName);
if (fileInfo.Extension != ".xlsx")
{
result.msg = "请上传指定模板文件";
return result;
//请上传指定模板文件
return DataResult<List<object>>.Failed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportFileTypeError)));
}
var tempDic = string.Empty;// Path.Combine(App.WebHostEnvironment.WebRootPath, App.GetOptions<TempFileOptions>().Path, DateTime.Now.Ticks.ToString());
string fileRoot = AppSetting.app(new string[] { "FileSettings", "BasePath" });
string relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
var tempDic = Path.Combine(fileRoot, relativePath, DateTime.Now.Ticks.ToString());
Directory.CreateDirectory(tempDic);
var filePath = Path.Combine(tempDic, file.FileName);
@ -2836,15 +2847,15 @@ namespace DS.WMS.Core.Op.Method
var sheet = readbook.GetSheet("导入");
if (sheet == null)
{
result.msg = "内容为空";
return result;
//内容为空
return DataResult<List<object>>.Failed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportExcelEmpty)));
}
var rowCount = sheet.LastRowNum;
if (rowCount <= 1)
{
result.msg = "内容为空";
return result;
//内容为空
return DataResult<List<object>>.Failed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportExcelEmpty)));
}
Dictionary<BookingSlotBase, List<BookingSlotCtn>> data = new(rowCount);
@ -2985,7 +2996,7 @@ namespace DS.WMS.Core.Op.Method
}
}
// 特殊处理
if (!string.IsNullOrWhiteSpace(slot.CarrierCode)) slot.Carrier = cacheMappCarrier.FirstOrDefault(x => x.CarrierName == slot.CarrierCode)?.CarrierName;
if (!string.IsNullOrWhiteSpace(slot.CarrierCode)) slot.Carrier = cacheMappCarrier.FirstOrDefault(x => x.MapCode == slot.CarrierCode)?.MapName;
if (!string.IsNullOrWhiteSpace(slot.PortLoadCode)) slot.PortLoad = cachePort.FirstOrDefault(x => x.EdiCode == slot.PortLoadCode)?.PortName;
if (!string.IsNullOrWhiteSpace(slot.PortDischargeCode)) slot.PortDischarge = cachePort.FirstOrDefault(x => x.EdiCode == slot.PortDischargeCode)?.PortName;
if (!string.IsNullOrWhiteSpace(slot.LaneName)) slot.LaneCode = cacheLane.FirstOrDefault(x => x.LaneName == slot.LaneName)?.LaneEnName;
@ -3040,8 +3051,7 @@ namespace DS.WMS.Core.Op.Method
.Select(x => x.SlotBookingNo)
.ToListAsync();
List<object> list = new List<object>();
result.ext = list;
foreach (var item in data)
{
if (existsNoList.Contains(item.Key.SlotBookingNo))
@ -3072,7 +3082,7 @@ namespace DS.WMS.Core.Op.Method
});
}
result.succ = true;
succ = true;
var group = data.Keys.Where(x =>
!existsNoList.Contains(x.SlotBookingNo)
@ -3113,11 +3123,15 @@ namespace DS.WMS.Core.Op.Method
{
Logger.Log(NLog.LogLevel.Error, $"导入舱位异常,原因:{ex.Message}");
result.succ = false;
result.msg = $"导入舱位异常,原因:{ex.Message}";
return DataResult<List<object>>.Failed(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportException)), ex.Message));
}
return result;
if(succ)
{
return DataResult<List<object>>.Success(list);
}
return DataResult<List<object>>.Failed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotImportFail)));
}
#endregion
@ -3470,14 +3484,176 @@ namespace DS.WMS.Core.Op.Method
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
List<string> ctnCodeArr = new List<string>();
List<long> labelIdArray = new List<long>();
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("ctnStat", StringComparison.OrdinalIgnoreCase)))
{
var codList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("ctnStat", StringComparison.OrdinalIgnoreCase)).ToList();
ctnCodeArr = codList.Select(t => ((ConditionalModel)t).FieldValue).ToList();
codList.ForEach(t =>
{
whereList.Remove(t);
});
}
if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("labelIdArray", StringComparison.OrdinalIgnoreCase)))
{
var codList = whereList.Where(t => ((ConditionalModel)t).FieldName.Equals("labelIdArray", StringComparison.OrdinalIgnoreCase)).ToList();
labelIdArray = codList.Select(t => long.Parse(((ConditionalModel)t).FieldValue)).ToList();
codList.ForEach(t =>
{
whereList.Remove(t);
});
}
var result = tenantDb.Queryable<BookingSlotBase>()
.InnerJoin<BookingSlotCtn>((a, b) => a.Id == b.SlotId)
.Select<BookingSlotBaseDto>()
.Where(whereList);
//.ToQueryPageAsync(request.PageCondition);
var list = result.ToList();
.LeftJoin<BookingSlotCtn>((a, b) => a.Id == b.SlotId)
.Where(whereList)
.WhereIF(ctnCodeArr != null && ctnCodeArr.Count > 0, (a, b) => b != null
&& !string.IsNullOrWhiteSpace(b.CtnCode)
&& ctnCodeArr.Contains(b.CtnCode) && b.Deleted == false)
.WhereIF(labelIdArray != null && labelIdArray.Count > 0,
a => SqlFunc.Subqueryable<BookingLabelAllocation>()
.Where(x => x.BusinessId == a.Id && labelIdArray.Contains(x.LabelId))
.Any())
.Select<BookingSlotBaseDto>();
var data = await result.ToQueryPageAsync(querySearch.PageCondition);
var slotIds = data.Data.Select(x => x.Id);
if (slotIds.Any())
{
// 查询舱位绑定的销售信息,赋值到舱位对象中
List<BookingSlotSaleInfoDto> allocationInfoList = await tenantDb.Queryable<BookingSlotAllocation>()
.Where(x => slotIds.Contains(x.BookingSlotId))
.Select(x => new BookingSlotSaleInfoDto
{
Id = x.Id,
BookingId = x.BookingId,
BookingSlotId = x.BookingSlotId,
CustomerId = x.CustomerId,
CustomerName = x.CustomerName,
CustServiceId = x.CustServiceId,
CustService = x.CustService,
SaleId = x.SaleId,
Sale = x.Sale,
OpId = x.OpId,
Op = x.Op,
DocId = x.DocId,
Doc = x.Doc,
Business = x.Business,
BusinessId = x.BusinessId,
SaleTime = x.SaleTime,
Shipper = x.Shipper,
GoodsName = x.GoodsName,
SellingPrice = x.SellingPrice,
CreateBy = x.CreateBy
}).ToListAsync();
if (allocationInfoList.Any())
{
var paramConfig = _configService.GetConfig(IS_ENABLE_CUSTOMER_AUTHORITY, long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value;
// 判断是否启用了委托单位查看控制权限
bool isEnableCustomerAuthority = false;
if(paramConfig.Equals("ENABLE",StringComparison.OrdinalIgnoreCase))
{
isEnableCustomerAuthority = true;
}
List<long> userList = null;
List<string> userListStr = null;
//if (isEnableCustomerAuthority)
//{
// userList = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuDjyCustomer);
// if (userList == null || userList.Count == 0)
// {
// isEnableCustomerAuthority = false;
// }
// else
// {
// userListStr = userList.Select(x => x.ToString()).ToList();
// }
//}
var saleInfoGroup = allocationInfoList.GroupBy(x => x.BookingSlotId);
foreach (var item in saleInfoGroup)
{
if (isEnableCustomerAuthority)
{
// 遍历销售信息,如果销售信息中的“销售、操作、单证、客服、创建人”中不在当前登陆人的权限范围,则隐藏客户信息
foreach (BookingSlotSaleInfoDto saleInfoItem in item)
{
if (!userList.Contains(saleInfoItem.CreateBy)
&& !userListStr.Contains(saleInfoItem.OpId)
&& !userListStr.Contains(saleInfoItem.DocId)
&& !userListStr.Contains(saleInfoItem.SaleId)
&& !userListStr.Contains(saleInfoItem.CustServiceId))
{
saleInfoItem.CustomerId = 0;
saleInfoItem.CustomerName = "--";
saleInfoItem.OpId = "";
saleInfoItem.Op = "--";
saleInfoItem.DocId = "";
saleInfoItem.Doc = "--";
saleInfoItem.SaleId = "";
saleInfoItem.Sale = "--";
saleInfoItem.Shipper = "--";
saleInfoItem.GoodsName = "--";
saleInfoItem.CustServiceId = "";
saleInfoItem.CustService = "--";
}
}
}
var slot = data.Data.FirstOrDefault(x => x.Id == item.Key);
if (slot != null)
{
slot.BookingSlotSaleInfoList = item.ToList();
}
}
}
// 查询舱位绑定的标签信息,赋值到舱位对象中
var labelCacheList = await _bookingLabelService.List(1);
var labelAllocationList = await tenantDb.Queryable<BookingLabelAllocation>()
.Where(x => slotIds.Contains(x.BusinessId))
.ToListAsync();
if (labelAllocationList.Any())
{
var labelInfoGroup = labelAllocationList.GroupBy(x => x.BusinessId);
foreach (var item in labelInfoGroup)
{
var slot = data.Data.FirstOrDefault(x => x.Id == item.Key);
if (slot != null)
{
slot.LabelList = item.Select(x =>
{
var labelCache = labelCacheList.Data.FirstOrDefault(l => l.Id == x.LabelId);
if (labelCache != null)
{
return new BookingLabelBaseDto
{
Id = x.LabelId,
Name = labelCache.Name,
Color = labelCache.Color,
Scope = labelCache.Scope
};
}
return null;
}).ToList();
slot.LabelList.RemoveAll(x => x == null);
}
}
}
}
return data;
}

@ -1,4 +1,15 @@
using DS.WMS.Core.Fee.Method;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
using Masuit.Tools.Systems;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Op.Method.TaskInteraction
{
@ -7,14 +18,179 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
/// </summary>
public class SeaExportTaskService : FeeServiceBase
{
ITaskManageService taskService;
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public SeaExportTaskService(IServiceProvider provider) : base(provider)
{
taskService = provider.GetRequiredService<ITaskManageService>();
}
/// <summary>
/// 创建关联任务
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> CreateTaskAsync(TaskCreationRequest request)
{
var task = await GetTaskAsync(request.BusinessId, request.BusinessType, request.TaskType);
if (task != null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Task_Exists));
long tenatId = long.Parse(User.TenantId);
string tenatName = Db.Queryable<SysTenant>().Where(x => x.Id == tenatId).Select(x => x.Name).First();
var info = new TaskManageOrderMessageInfo
{
Head = new TaskManageOrderMessageHeadInfo
{
GID = Guid.NewGuid().ToString(),
BSNO = request.BusinessId,
MessageType = "WORK_FLOW_TASK",
SenderId = "WorkFlow",
SenderName = "工作流平台",
ReceiverId = "TaskManage",
ReceiverName = "任务管理平台",
Version = "1.0",
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
RequestAction = "Add"
},
Main = new TaskManageOrderMessageMainInfo
{
TaskType = request.TaskType,
TaskSource = TaskSourceEnum.WORK_FLOW,
TaskTitle = request.TaskTitle,
TaskDesp = request.TaskDescription,
TaskUserId = User.UserId,
TaskUserName = User.UserName,
RecvUserId = User.UserId,
RecvUserName = User.UserName,
TaskTenatId = tenatId,
TaskTenatName = tenatName
}
};
if (info.Main.TaskTitle.IsNullOrEmpty())
{
var biz = await TenantDb.Queryable<SeaExport>().Select(x => new
{
x.Id,
x.MBLNO,
x.Vessel,
x.Voyno,
x.ETD,
}).FirstAsync();
info.Main.TaskDesp = info.Main.TaskTitle = $"{request.TaskType.GetDescription()} {biz.Vessel} {biz.Voyno} ETD:{biz.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz.MBLNO}";
}
await TenantDb.Ado.BeginTranAsync();
try
{
var result = await taskService.InitTaskJob(info);
if (!result.Succeeded)
return result;
var businessTask = new BusinessTask
{
BusinessId = request.BusinessId,
BusinessType = request.BusinessType,
TaskType = request.TaskType,
TaskStatus = TaskStatusEnum.Create,
CreateBy = long.Parse(User.UserId),
CreateTime = DateTime.Now
};
businessTask.NextType = GetNextType(businessTask);
await TenantDb.Insertable(businessTask).ExecuteCommandAsync();
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
{
//待审核,需创建工作流
}
else if (request.TaskType == TaskBaseTypeEnum.WAIT_BILL_CONFIRM)
{
//根据业务所选服务,生成子任务
}
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
/// <summary>
/// 设置任务状态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> UpdateTaskStatusAsync(TaskUpdateRequest request)
{
await TenantDb.Ado.BeginTranAsync();
try
{
var result = await taskService.SetTaskStatus(request.BusinessId, request.TaskType, request.TaskStatus, DateTime.Now);
if (!result.Succeeded)
return result;
//更新当前任务状态
BusinessTask task = await GetTaskAsync(request.BusinessId, request.BusinessType, request.TaskType);
if (task == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
task.TaskStatus = request.TaskStatus;
await TenantDb.Updateable(task).UpdateColumns(x => x.TaskStatus).ExecuteCommandAsync();
//若存在下一任务,则创建
if (task.NextType.HasValue)
{
var req = new TaskCreationRequest
{
BusinessId = request.BusinessId,
BusinessType = request.BusinessType,
TaskType = task.NextType.Value
};
await CreateTaskAsync(req);
}
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
internal async Task<BusinessTask> GetTaskAsync(long id, BusinessType businessType, TaskBaseTypeEnum taskType)
{
return await TenantDb.Queryable<BusinessTask>().FirstAsync(x =>
x.BusinessId == id && x.BusinessType == businessType && x.TaskType == taskType);
}
internal async Task<BusinessTask> GetCurrentTaskAsync(long id, BusinessType businessType)
{
return await TenantDb.Queryable<BusinessTask>().Where(x => x.BusinessId == id && x.BusinessType == businessType)
.OrderByDescending(x => x.CreateTime).Take(1).FirstAsync();
}
internal static TaskBaseTypeEnum? GetNextType(BusinessTask current)
{
if (current.TaskType == TaskBaseTypeEnum.WAIT_VGM)
return null;
int currentTypeVal = (int)current.TaskType;
return (TaskBaseTypeEnum)currentTypeVal++;
}
}
}

@ -13,8 +13,19 @@ namespace DS.WMS.Core.Sys.Interface;
///
/// </summary>
public interface IClientCommonService
{
{
/// <summary>
/// 根据id获取往来单位参数信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Task<DataResult<List<ClientParamRes>>> GetClientParamListById(string id);
/// <summary>
/// 根据用户ids获取用户邮箱信息
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public Task<DataResult<List<UserSelectRes>>> GetUseEmailListByIds(long[] ids);
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.Core.Log;
using DS.Module.SqlSugar;
@ -9,6 +10,7 @@ using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.EDI;
using DS.WMS.Core.Op.Entity;
@ -43,7 +45,34 @@ public class ClientCommonService : IClientCommonService
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 根据id获取往来单位参数信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult<List<ClientParamRes>>> GetClientParamListById(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<InfoClientParam>()
.Where(x => x.CustomerId == long.Parse(id) && x.Status == StatusEnum.Enable)
.Select<ClientParamRes>()
.ToListAsync();
return await Task.FromResult(DataResult<List<ClientParamRes>>.Success(data));
}
/// <summary>
/// 根据用户ids获取用户邮箱信息
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public async Task<DataResult<List<UserSelectRes>>> GetUseEmailListByIds(long[] ids)
{
var data = await db.Queryable<SysUser>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && ids.Contains(a.Id))
.Select<UserSelectRes>()
.ToListAsync();
return await Task.FromResult(DataResult<List<UserSelectRes>>.Success(data));
}
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>

@ -78,6 +78,7 @@ public class CommonService : ICommonService
// OrgId = userInfo.OrgId,
// GID = userInfo.GID,
TenantId = userInfo.TenantId.ToString(),
TenantName = userInfo.TenantName,
};
var token = JwtHelper.Encrypt(tokenModel);
@ -377,6 +378,7 @@ public class CommonService : ICommonService
Name = userInfo.UserName,
OrgId = userInfo.DefaultOrgId.ToString(),
TenantId = userInfo.TenantId.ToString(),
TenantName = userInfo.TenantName,
};
var token = JwtHelper.Encrypt(tokenModel, false, true);
@ -417,6 +419,7 @@ public class CommonService : ICommonService
Name = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == userId).UserName,
OrgId = user.GetOrgId().ToString(),
TenantId = tenantId.ToString(),
TenantName = user.TenantName
};
var refreshToken = JwtHelper.Encrypt(tokenModel, true, true);
@ -477,6 +480,7 @@ public class CommonService : ICommonService
OrgId = id,
Name = sysUser.UserName,
TenantId = tenantId.ToString(),
TenantName = sysUser.TenantName,
};
var token = new RefreshTokenRes
{

@ -29,6 +29,30 @@ public class ClientCommonController : ApiController
_invokeService = invokeService;
}
/// <summary>
/// 根据id获取往来单位参数信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetClientParamListById")]
public async Task<DataResult<List<ClientParamRes>>> GetClientParamListById([FromQuery] string id)
{
var res = await _invokeService.GetClientParamListById(id);
return res;
}
/// <summary>
/// 根据用户ids获取用户邮箱信息
/// </summary>
/// <param name="ids">用户Ids</param>
/// <returns></returns>
[HttpGet]
[Route("GetUseEmailListByIds")]
public async Task<DataResult<List<UserSelectRes>>> GetUseEmailListByIds([FromQuery] long[] ids)
{
var res = await _invokeService.GetUseEmailListByIds(ids);
return res;
}
/// <summary>
/// 根据类型获取用户下拉列表
/// </summary>
/// <returns></returns>

@ -6,7 +6,7 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-mainapi</_PublishTargetUrl>
<History>True|2024-07-24T01:32:35.6165520Z||;True|2024-07-19T12:03:03.1399057+08:00||;True|2024-07-19T11:47:36.2698405+08:00||;True|2024-07-18T15:59:36.7010783+08:00||;True|2024-07-16T18:17:43.9220347+08:00||;True|2024-06-18T17:36:34.9035076+08:00||;True|2024-06-18T16:25:54.2461596+08:00||;True|2024-06-18T10:09:37.3872162+08:00||;True|2024-06-18T10:00:43.4402179+08:00||;True|2024-06-18T08:55:07.3014083+08:00||;True|2024-06-18T08:40:51.6182342+08:00||;True|2024-06-13T19:48:34.0429148+08:00||;True|2024-06-13T19:09:39.6804400+08:00||;True|2024-06-13T15:41:56.9502735+08:00||;True|2024-06-13T15:23:59.4555910+08:00||;True|2024-06-13T15:12:55.6093356+08:00||;True|2024-06-11T17:08:01.8930314+08:00||;True|2024-06-07T15:23:11.1389680+08:00||;True|2024-06-07T10:23:59.6079620+08:00||;True|2024-06-06T17:42:56.1843783+08:00||;True|2024-06-04T14:20:46.7742295+08:00||;True|2024-05-31T17:57:35.6858600+08:00||;True|2024-05-31T15:25:20.8503086+08:00||;True|2024-05-30T17:22:52.2563382+08:00||;True|2024-05-30T17:05:35.7504154+08:00||;True|2024-05-29T17:17:39.6966826+08:00||;</History>
<History>True|2024-07-24T01:40:52.9333341Z||;True|2024-07-24T09:32:35.6165520+08:00||;True|2024-07-19T12:03:03.1399057+08:00||;True|2024-07-19T11:47:36.2698405+08:00||;True|2024-07-18T15:59:36.7010783+08:00||;True|2024-07-16T18:17:43.9220347+08:00||;True|2024-06-18T17:36:34.9035076+08:00||;True|2024-06-18T16:25:54.2461596+08:00||;True|2024-06-18T10:09:37.3872162+08:00||;True|2024-06-18T10:00:43.4402179+08:00||;True|2024-06-18T08:55:07.3014083+08:00||;True|2024-06-18T08:40:51.6182342+08:00||;True|2024-06-13T19:48:34.0429148+08:00||;True|2024-06-13T19:09:39.6804400+08:00||;True|2024-06-13T15:41:56.9502735+08:00||;True|2024-06-13T15:23:59.4555910+08:00||;True|2024-06-13T15:12:55.6093356+08:00||;True|2024-06-11T17:08:01.8930314+08:00||;True|2024-06-07T15:23:11.1389680+08:00||;True|2024-06-07T10:23:59.6079620+08:00||;True|2024-06-06T17:42:56.1843783+08:00||;True|2024-06-04T14:20:46.7742295+08:00||;True|2024-05-31T17:57:35.6858600+08:00||;True|2024-05-31T15:25:20.8503086+08:00||;True|2024-05-30T17:22:52.2563382+08:00||;True|2024-05-30T17:05:35.7504154+08:00||;True|2024-05-29T17:17:39.6966826+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -194,9 +194,9 @@ namespace DS.WMS.OpApi.Controllers
/// <returns>返回回执</returns>
[HttpPost]
[Route("ImportSlotFromFile")]
public async Task<DataResult> ImportSlotFromFile([FromBody] IFormFile file)
public async Task<DataResult<List<object>>> ImportSlotFromFile(IFormFile file)
{
return null;//await _bookingSlotService.ImportSlotFromFile(file);
return await _bookingSlotService.ImportSlotFromFile(file);
}
#endregion

@ -705,3 +705,80 @@
2024-07-22 18:36:53.5029 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-22 18:36:53.5029 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-22 18:36:53.5029 Info Configuration initialized.
2024-07-24 10:39:33.3284 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 10:39:33.3499 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 10:39:33.3562 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 10:39:33.3735 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 10:39:33.3842 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 10:39:33.3842 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 10:39:33.4009 Info Configuration initialized.
2024-07-24 11:42:53.2416 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 11:42:53.2594 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 11:42:53.2594 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 11:42:53.2853 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 11:42:53.2981 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 11:42:53.3046 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 11:42:53.3046 Info Configuration initialized.
2024-07-24 11:53:04.9564 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 11:53:04.9683 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 11:53:04.9683 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 11:53:04.9813 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 11:53:04.9813 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 11:53:04.9813 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 11:53:04.9940 Info Configuration initialized.
2024-07-24 11:56:48.6539 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 11:56:48.6666 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 11:56:48.6666 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 11:56:48.6812 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 11:56:48.6812 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 11:56:48.6812 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 11:56:48.6977 Info Configuration initialized.
2024-07-24 12:13:15.7940 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 12:13:15.8109 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 12:13:15.8109 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 12:13:15.8289 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 12:13:15.8361 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 12:13:15.8361 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 12:13:15.8361 Info Configuration initialized.
2024-07-24 12:46:02.1315 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 12:46:02.1542 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 12:46:02.1542 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 12:46:02.1817 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 12:46:02.1817 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 12:46:02.1970 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 12:46:02.1970 Info Configuration initialized.
2024-07-24 12:55:07.1127 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 12:55:07.1250 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 12:55:07.1250 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 12:55:07.1385 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 12:55:07.1385 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 12:55:07.1473 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 12:55:07.1473 Info Configuration initialized.
2024-07-24 13:38:21.3202 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 13:38:21.3470 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 13:38:21.3528 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 13:38:21.3717 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 13:38:21.3863 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 13:38:21.3863 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 13:38:21.4016 Info Configuration initialized.
2024-07-24 14:07:06.0244 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 14:07:06.0410 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 14:07:06.0410 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 14:07:06.0633 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 14:07:06.0764 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 14:07:06.0764 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 14:07:06.0901 Info Configuration initialized.
2024-07-24 14:08:38.1325 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 14:08:38.1325 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 14:08:38.1325 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 14:08:38.1552 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 14:08:38.1552 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 14:08:38.1635 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 14:08:38.1635 Info Configuration initialized.
2024-07-24 14:14:41.8507 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-24 14:14:41.8507 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-24 14:14:41.8507 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-24 14:14:41.8726 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-24 14:14:41.8726 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-24 14:14:41.8726 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-24 14:14:41.8863 Info Configuration initialized.

@ -6,7 +6,7 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl>
<History>True|2024-07-24T00:47:26.1616069Z||;True|2024-07-24T08:42:02.7606608+08:00||;True|2024-07-24T08:41:18.4678459+08:00||;False|2024-07-24T08:40:29.5381703+08:00||;False|2024-07-24T08:39:20.2230656+08:00||;True|2024-07-23T15:56:16.8305907+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History>
<History>True|2024-07-24T04:56:48.1663545Z||;True|2024-07-24T08:47:26.1616069+08:00||;True|2024-07-24T08:42:02.7606608+08:00||;True|2024-07-24T08:41:18.4678459+08:00||;False|2024-07-24T08:40:29.5381703+08:00||;False|2024-07-24T08:39:20.2230656+08:00||;True|2024-07-23T15:56:16.8305907+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
Loading…
Cancel
Save