diff --git a/.gitignore b/.gitignore
index 600aceff..7864a2f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
index def257b0..16131b53 100644
--- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
+++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs
@@ -1361,5 +1361,41 @@ public static class MultiLanguageConst
///
[Description("预订舱数据已发送成功,不能修改")]
public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify";
+
+ ///
+ /// 附件不能为空
+ ///
+ [Description("附件不能为空")]
+ public const string BookingSlotImportFileNull = "BookingSlot_Import_FileNull";
+
+ ///
+ /// 请上传指定模板文件
+ ///
+ [Description("请上传指定模板文件")]
+ public const string BookingSlotImportFileTypeError = "BookingSlot_Import_TypeError";
+
+ ///
+ /// 内容为空
+ ///
+ [Description("内容为空")]
+ public const string BookingSlotImportExcelEmpty = "BookingSlot_Import_ExcelEmpty";
+
+ ///
+ /// 导入舱位异常,原因:{0}
+ ///
+ [Description("导入舱位异常,原因:{0}")]
+ public const string BookingSlotImportException = "BookingSlot_Import_Exception";
+
+ ///
+ /// 导入失败
+ ///
+ [Description("导入失败")]
+ public const string BookingSlotImportFail = "BookingSlot_Import_Fail";
+
+ #endregion
+
+ #region 关联任务
+ [Description("此类型的任务已存在")]
+ public const string Task_Exists = "Task_Exists";
#endregion
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.Module.Core/Data/BaseTenantModel.cs b/ds-wms-service/DS.Module.Core/Data/BaseTenantModel.cs
index ec3ecd38..912c56d1 100644
--- a/ds-wms-service/DS.Module.Core/Data/BaseTenantModel.cs
+++ b/ds-wms-service/DS.Module.Core/Data/BaseTenantModel.cs
@@ -19,4 +19,10 @@ public abstract class BaseTenantModel : BaseModel, ITenantId
///
[SqlSugar.SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
public long TenantId { get; set; } = 0;
+
+ ///
+ /// 租户名称
+ ///
+ [SqlSugar.SugarColumn(ColumnDescription = "租户名称", IsOnlyIgnoreUpdate = true,Length = 150)]
+ public string TenantName { get; set; }
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.Module.Core/Data/UserTenantModel.cs b/ds-wms-service/DS.Module.Core/Data/UserTenantModel.cs
index 5084b3d3..28f3a3f3 100644
--- a/ds-wms-service/DS.Module.Core/Data/UserTenantModel.cs
+++ b/ds-wms-service/DS.Module.Core/Data/UserTenantModel.cs
@@ -19,4 +19,10 @@ public abstract class UserTenantModel : BaseModel, ITenantId
///
[SqlSugar.SugarColumn(ColumnDescription = "租户Id")]
public long TenantId { get; set; } = 0;
+
+ ///
+ /// 租户名称
+ ///
+ [SqlSugar.SugarColumn(ColumnDescription = "租户名称", Length = 150)]
+ public string TenantName { get; set; }
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs b/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs
index e595f31a..04f626e9 100644
--- a/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs
+++ b/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs
@@ -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
///
public IDictionary DefaultHeaders { get; private set; }
+ ///
+ /// 在发送网络请求之前的事件
+ ///
+ public event EventHandler? BeforeSend;
+
+ ///
+ /// 在发送网络请求完成时的事件
+ ///
+ public event EventHandler? Completed;
+
///
/// 初始化
///
@@ -100,7 +111,7 @@ namespace DS.Module.Core
///
/// 为null
/// 为null或空字符串
- public virtual async Task> SendRequestAsync(HttpMethod method, string url, object? requestParams = null)
+ public async Task> 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.FailedData(response, string.Format(MultiLanguageConst.HttpRequestFailed, $"{response.StatusCode}"));
@@ -164,5 +188,60 @@ namespace DS.Module.Core
http?.Dispose();
}
}
+
+ ///
+ /// 在发送网络请求之前调用
+ ///
+ /// 事件参数
+ protected virtual void OnBeforeSend(BeforeSendEventArgs e)
+ {
+ BeforeSend?.Invoke(this, e);
+ }
+
+ ///
+ /// 在发送网络请求完成时调用
+ ///
+ /// 事件参数
+ protected virtual void OnCompleted(CompleteEventArgs e)
+ {
+ Completed?.Invoke(this, e);
+ }
+ }
+
+ ///
+ /// 发送网络请求之前的事件参数
+ ///
+ public class BeforeSendEventArgs : EventArgs
+ {
+ ///
+ /// 远程请求的URI
+ ///
+ public Uri RequestUri { get; internal set; }
+
+ ///
+ /// 请求标头
+ ///
+ public HttpRequestHeaders RequestHeaders { get; internal set; }
+
+ ///
+ /// 请求参数
+ ///
+ public object? RequestParameter { get; set; }
+ }
+
+ ///
+ /// 发送网络请求完成的事件参数
+ ///
+ public class CompleteEventArgs : EventArgs
+ {
+ ///
+ /// 远程请求的URI
+ ///
+ public Uri RequestUri { get; internal set; }
+
+ ///
+ /// 网络响应对象
+ ///
+ public HttpResponseMessage Response { get; internal set; }
}
}
diff --git a/ds-wms-service/DS.Module.Core/Utils/JwtHelper.cs b/ds-wms-service/DS.Module.Core/Utils/JwtHelper.cs
index ef06c086..deed8e80 100644
--- a/ds-wms-service/DS.Module.Core/Utils/JwtHelper.cs
+++ b/ds-wms-service/DS.Module.Core/Utils/JwtHelper.cs
@@ -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
///
public string TenantId { get; set; }
+
+ ///
+ /// 租户名称
+ ///
+ public string TenantName { get; set; }
}
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.Module.UserModule/AspNetUser.cs b/ds-wms-service/DS.Module.UserModule/AspNetUser.cs
index 0dc9f680..757753bf 100644
--- a/ds-wms-service/DS.Module.UserModule/AspNetUser.cs
+++ b/ds-wms-service/DS.Module.UserModule/AspNetUser.cs
@@ -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();
diff --git a/ds-wms-service/DS.Module.UserModule/IUser.cs b/ds-wms-service/DS.Module.UserModule/IUser.cs
index b284d4bc..0b527100 100644
--- a/ds-wms-service/DS.Module.UserModule/IUser.cs
+++ b/ds-wms-service/DS.Module.UserModule/IUser.cs
@@ -30,6 +30,11 @@ public interface IUser
/// 租户ID
///
string TenantId { get; }
+
+ ///
+ /// 租户名称
+ ///
+ string TenantName { get; }
///
/// 机构ID
///
diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs
index cfe59893..0b9ffaaa 100644
--- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs
+++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs
@@ -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
{
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
index 08fb2ef0..a72bc969 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs
@@ -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
diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs
index 560dd731..3675e19b 100644
--- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs
+++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs
@@ -27,11 +27,6 @@ namespace DS.WMS.Core.Fee.Method
///
public const string USD_CODE = "USD";
- ///
- /// 工作流运行状态值
- ///
- public static readonly int RunningStatus = (int)FlowStatusEnum.Running;
-
///
/// 获取用户相关信息
///
@@ -294,7 +289,7 @@ namespace DS.WMS.Core.Fee.Method
///
protected ISugarQueryable GetCurrentFlowsQuery(string[] auditTypes)
{
- return Db.Queryable().Where(x => x.FlowStatus == RunningStatus
+ return Db.Queryable().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 });
}
diff --git a/ds-wms-service/DS.WMS.Core/Flow/Entity/FlowInstance.cs b/ds-wms-service/DS.WMS.Core/Flow/Entity/FlowInstance.cs
index bacda6a6..c5aab57c 100644
--- a/ds-wms-service/DS.WMS.Core/Flow/Entity/FlowInstance.cs
+++ b/ds-wms-service/DS.WMS.Core/Flow/Entity/FlowInstance.cs
@@ -68,7 +68,7 @@ public class FlowInstance : BaseTenantModel
/// 工作流状态
///
[Description("工作流状态")]
- public int FlowStatus { get; set; } = FlowStatusEnum.Ready.ToEnumInt();
+ public FlowStatusEnum FlowStatus { get; set; } = FlowStatusEnum.Ready;
///
/// 中文视图名;设计方案时,提供中文字段的视图来源
@@ -86,7 +86,7 @@ public class FlowInstance : BaseTenantModel
/// 回调地址
///
[SugarColumn(ColumnDescription = "回调地址", IsNullable = true, Length = 255)]
- public string CallbackURL { get; set; }
+ public string? CallbackURL { get; set; }
///
/// 审批类型
diff --git a/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs b/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
index ce1fcd8d..48eae217 100644
--- a/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
+++ b/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
@@ -80,7 +80,7 @@ public class ClientFlowInstanceService : FlowInstanceService, IClientFlowInstanc
///
public DataResult> GetFlowInstances(long businessId, BusinessType? businessType)
{
- var query = db.Queryable().Where(x => x.BusinessId == businessId && x.FlowStatus != 1);
+ var query = db.Queryable().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);
diff --git a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs
index 4f562142..3ed6a95b 100644
--- a/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs
+++ b/ds-wms-service/DS.WMS.Core/Flow/Method/FlowInstanceService.cs
@@ -24,6 +24,8 @@ public class FlowInstanceService : IFlowInstanceService
protected readonly IUser user;
private readonly ICommonService _commonService;
+ private ApiFox api;
+
///
///
///
@@ -34,6 +36,14 @@ public class FlowInstanceService : IFlowInstanceService
db = _serviceProvider.GetRequiredService();
user = _serviceProvider.GetRequiredService();
_commonService = _serviceProvider.GetRequiredService();
+
+ api = new ApiFox();
+ api.BeforeSend += Api_BeforeSend;
+ }
+
+ private void Api_BeforeSend(object? sender, BeforeSendEventArgs e)
+ {
+ e.RequestHeaders.Add("Authorization", "Bearer " + user.GetToken());
}
public DataResult> GetListByPage(PageRequest request)
@@ -57,7 +67,7 @@ public class FlowInstanceService : IFlowInstanceService
{
var info = db.Queryable().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
/// 运行实例
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().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(instance.CallbackURL, callback);
+
+ //更新回调执行标识
+ var id = instance.Id;
+ await db.Updateable().SetColumns(it => new FlowInstance { IsCallbackExecuted = true })
+ .Where(it => it.Id == id).ExecuteCommandAsync();
}
protected virtual FlowRuntime CreateRuntimeService(FlowInstance instance)
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs
index 3d072175..762100a3 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/BookingSlot/BookingSlotBaseSaveOutput.cs
@@ -351,6 +351,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 更新时间
///
public DateTime UpdateTime { get; set; }
+
+ ///
+ /// 标签列表
+ ///
+ public List LabelList { get; set; }
+
}
///
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreation.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreation.cs
deleted file mode 100644
index cb640fa0..00000000
--- a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreation.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-using System.Runtime.Serialization;
-using DS.Module.Core;
-
-namespace DS.WMS.Core.Op.Dtos.TaskInteraction
-{
- ///
- /// 任务台创建参数
- ///
- 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();
- }
- }
-
- ///
- /// 任务标头
- ///
- public class TaskHeader
- {
- ///
- /// 流水ID
- ///
- [DataMember(Name = "gid")]
- public Guid GID { get; set; } = Guid.NewGuid();
-
- ///
- /// 订单Id
- ///
- [DataMember(Name = "bsno")]
- public long BSNO { get; set; }
-
- ///
- /// 消息类型
- ///
- [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; } = "任务管理平台";
-
- ///
- /// 标识符
- ///
- [DataMember(Name = "token")]
- public string? Token { get; set; }
-
- ///
- /// 版本
- ///
- [DataMember(Name = "version")]
- public string? Version { get; set; } = "1.0";
-
- ///
- /// 请求时间
- ///
- [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";
- }
-
- ///
- /// 任务主信息
- ///
- public class TaskMain
- {
- ///
- /// 任务类型
- ///
- [DataMember(Name = "taskType")]
- public TaskBaseTypeEnum TaskType { get; set; }
-
- ///
- /// 任务来源
- ///
- [DataMember(Name = "taskSource")]
- public int TaskSource { get; set; } = 9;
-
- ///
- /// 任务标题
- ///
- [DataMember(Name = "taskTitle")]
- public string TaskTitle { get; set; } = string.Empty;
-
- ///
- /// 任务描述
- ///
- [DataMember(Name = "taskDesp")]
- public string? TaskDescription { get; set; }
-
- ///
- /// 任务创建者ID
- ///
- [DataMember(Name = "taskUserId")]
- public long TaskUserId { get; set; }
-
- ///
- /// 任务创建者
- ///
- [DataMember(Name = "taskUserName")]
- public string? TaskUserName { get; set; }
-
- ///
- /// 任务接收者ID
- ///
- [DataMember(Name = "recvUserId")]
- public long RecvUserId { get; set; }
-
- ///
- /// 任务创建者
- ///
- [DataMember(Name = "recvUserName")]
- public string? RecvUserName { get; set; }
-
- ///
- /// 任务租户ID
- ///
- [DataMember(Name = "taskTenatId")]
- public long TaskTenatId { get; set; }
-
- ///
- /// 任务租户
- ///
- [DataMember(Name = "taskTenatName")]
- public string? TaskTenatName { get; set; }
- }
-}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreationRequest.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreationRequest.cs
new file mode 100644
index 00000000..05080338
--- /dev/null
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskCreationRequest.cs
@@ -0,0 +1,36 @@
+using DS.Module.Core;
+using DS.WMS.Core.Op.Entity;
+
+namespace DS.WMS.Core.Op.Dtos.TaskInteraction
+{
+ ///
+ /// 任务台创建参数
+ ///
+ public class TaskCreationRequest
+ {
+ ///
+ /// 业务ID
+ ///
+ public long BusinessId { get; set; }
+
+ ///
+ /// 业务类型
+ ///
+ public BusinessType BusinessType { get; set; }
+
+ ///
+ /// 任务类型
+ ///
+ public TaskBaseTypeEnum TaskType { get; set; }
+
+ ///
+ /// 任务标题
+ ///
+ public string TaskTitle { get; set; } = string.Empty;
+
+ ///
+ /// 任务描述
+ ///
+ public string? TaskDescription { get; set; }
+ }
+}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskUpdateRequest.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskUpdateRequest.cs
new file mode 100644
index 00000000..1504f2a8
--- /dev/null
+++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskUpdateRequest.cs
@@ -0,0 +1,31 @@
+using DS.Module.Core;
+using DS.WMS.Core.Op.Entity;
+
+namespace DS.WMS.Core.Op.Dtos.TaskInteraction
+{
+ ///
+ /// 任务台状态更新参数
+ ///
+ public class TaskUpdateRequest
+ {
+ ///
+ /// 业务ID
+ ///
+ public long BusinessId { get; set; }
+
+ ///
+ /// 业务类型
+ ///
+ public BusinessType BusinessType { get; set; }
+
+ ///
+ /// 任务类型
+ ///
+ public TaskBaseTypeEnum TaskType { get; set; }
+
+ ///
+ /// 任务状态
+ ///
+ public TaskStatusEnum TaskStatus { get; set; }
+ }
+}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTask.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTask.cs
new file mode 100644
index 00000000..0567b602
--- /dev/null
+++ b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTask.cs
@@ -0,0 +1,60 @@
+using DS.Module.Core;
+using SqlSugar;
+
+namespace DS.WMS.Core.Op.Entity.TaskInteraction
+{
+ ///
+ /// 业务任务交互表
+ ///
+ [SugarTable("business_task", "业务任务交互表")]
+ public class BusinessTask
+ {
+ ///
+ /// 业务ID
+ ///
+ [SugarColumn(ColumnDescription = "业务ID", IsPrimaryKey = true, IsNullable = false)]
+ public long BusinessId { get; set; }
+
+ ///
+ /// 业务类型
+ ///
+ [SugarColumn(ColumnDescription = "业务类型", IsPrimaryKey = true, IsNullable = false)]
+ public BusinessType BusinessType { get; set; }
+
+ ///
+ /// 任务类型
+ ///
+ [SugarColumn(ColumnDescription = "任务类型", IsPrimaryKey = true, IsNullable = false)]
+ public TaskBaseTypeEnum TaskType { get; set; }
+
+ ///
+ /// 任务状态
+ ///
+ [SugarColumn(ColumnDescription = "任务状态", IsNullable = false)]
+ public TaskStatusEnum TaskStatus { get; set; }
+
+ ///
+ /// 下一任务类型
+ ///
+ [SugarColumn(ColumnDescription = "下一任务类型", IsNullable = true)]
+ public TaskBaseTypeEnum? NextType { get; set; }
+
+ ///
+ /// 当前工作流ID
+ ///
+ [SugarColumn(ColumnDescription = "当前工作流ID", IsNullable = true)]
+ public long? FlowId { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ [SugarColumn(ColumnDescription = "创建人", IsNullable = false)]
+ public long CreateBy { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnDescription = "创建时间", IsNullable = false)]
+ public DateTime CreateTime { get; set; }
+ }
+}
diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs
index 5ad3ee5c..345cbeaf 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Interface/BookingSlot/IBookingSlotService.cs
@@ -120,7 +120,8 @@ namespace DS.WMS.Core.Op.Interface
///
/// 导入舱位文件
/// 返回回执
- Task ImportSlotFromFile(IFormFile file);
+ Task>> ImportSlotFromFile(IFormFile file);
+
///
/// 生成订舱订单
diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
index b41a6eba..616cce15 100644
--- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
+++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs
@@ -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
///
/// 导入舱位文件
/// 返回回执
- public async Task ImportSlotFromFile(IFormFile file)
+ public async Task>> ImportSlotFromFile(IFormFile file)
{
- TaskManageOrderResultDto result = new TaskManageOrderResultDto();
-
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
+ bool succ = false;
+ List