diff --git a/Myshipping.Application/Enum/RollingNominationDispatchStatusEnum.cs b/Myshipping.Application/Enum/RollingNominationDispatchStatusEnum.cs
new file mode 100644
index 00000000..98a99160
--- /dev/null
+++ b/Myshipping.Application/Enum/RollingNominationDispatchStatusEnum.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Myshipping.Application
+{
+ ///
+ /// 预甩货调度状态枚举
+ ///
+ public enum RollingNominationDispatchStatusEnum
+ {
+ ///
+ /// 待确认
+ ///
+ [Description("待确认")]
+ WAIT,
+
+ ///
+ /// 已完成
+ ///
+ [Description("已完成")]
+ COMPLETE,
+
+ ///
+ /// 已取消
+ ///
+ [Description("已取消")]
+ CANCEL,
+
+ ///
+ /// 失效
+ ///
+ [Description("失效")]
+ EXPIRE
+ }
+}
diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs
index 0c5d2d48..dec6b966 100644
--- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageRollingNominationService.cs
@@ -49,9 +49,9 @@ namespace Myshipping.Application
///
/// 查看分享链接
///
- /// 预甩货调度批次主键组
+ /// 预甩调度批次号
/// 返回回执
- Task GetUrl(string nominationDispatchId);
+ Task GetUrl(string dispatchBatchId);
///
/// 获取Status是load的可配载的列表
@@ -89,5 +89,13 @@ namespace Myshipping.Application
/// 预甩调度批次ID
/// 返回回执
Task CancelShareLink(string dispatchBatchId);
+
+
+ ///
+ /// 获取用户反馈信息
+ ///
+ /// 预甩调度批次ID
+ /// 返回回执
+ Task GetUserFeedBack(string dispatchBatchId);
}
}
diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageShareLinkService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageShareLinkService.cs
index 7a1fb5f2..78e1fb25 100644
--- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageShareLinkService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageShareLinkService.cs
@@ -22,9 +22,9 @@ namespace Myshipping.Application
///
/// 取消访问链接
///
- /// 访问链接主键
+ /// 访问链接业务主键
/// 返回回执
- Task CancelShareLink(string pkId);
+ Task CancelShareLink(string busiId);
///
diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs
index 41ab78f4..2f385a84 100644
--- a/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageRollingNominationService.cs
@@ -553,6 +553,50 @@ namespace Myshipping.Application
/*
获取所有当票预甩的所有没有BOOKING_ID的明细记录,并用SHIPMENT(提单号),检索订舱数据,能匹配的更新
*/
+ var list = _taskRollingNominationInfoRepository.AsQueryable().Filter(null, true)
+ .InnerJoin((nom, detail) => nom.PK_ID == detail.NOM_ID)
+ .Where((nom, detail) => nom.PK_ID == nominationId
+ && detail.IsDeleted == false && !detail.BOOKING_ID.HasValue)
+ .Select((nom, detail) => detail).ToList();
+
+
+ if (list.Count > 0)
+ {
+ var mblNoArg = list.Select(a=>a.SHIPMENT).Distinct().ToList();
+
+ var orderList = _bookingOrderRepository.AsQueryable()
+ .Where(a => mblNoArg.Contains(a.MBLNO) && !a.ParentId.HasValue && a.IsDeleted == false).ToList();
+
+ DateTime nowDate = DateTime.Now;
+
+ if (orderList.Count > 0)
+ {
+ orderList.ForEach(ord =>
+ {
+ var dlist = list.Where(b => b.SHIPMENT.Equals(ord.MBLNO)).ToList();
+
+ if (dlist.Count > 0)
+ {
+ dlist.ForEach(dt =>
+ {
+ dt.BOOKING_ID = ord.Id;
+ dt.UpdatedTime = nowDate;
+ dt.UpdatedUserId = UserManager.UserId;
+ dt.UpdatedUserName = UserManager.Name;
+
+ _taskRollingNominationDetailInfoRepository.AsUpdateable(dt)
+ .UpdateColumns(it => new
+ {
+ it.BOOKING_ID,
+ it.UpdatedTime,
+ it.UpdatedUserId,
+ it.UpdatedUserName
+ }).ExecuteCommand();
+ });
+ }
+ });
+ }
+ }
}
catch (Exception ex)
@@ -569,18 +613,42 @@ namespace Myshipping.Application
///
/// 查看分享链接
///
- /// 预甩任务主键
+ /// 预甩调度批次号
/// 返回回执
[HttpGet("/TaskManageRollingNomination/GetUrl")]
- public async Task GetUrl(string batchId)
+ public async Task GetUrl(string dispatchBatchId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
/*
- 用预甩调度的batchId关联分享表的BUSI_ID获取分享KEY
+ 用预甩调度的dispatchBatchId关联分享表的BUSI_ID获取分享KEY
*/
+ if (!string.IsNullOrWhiteSpace(dispatchBatchId))
+ throw Oops.Oh($"预甩调度批次号不能为空");
+
+ var dispatchInfo = _taskRollingNominationDispatchInfoRepository.AsQueryable()
+ .First(a => a.BATCH_ID == dispatchBatchId);
+
+ if (dispatchInfo == null)
+ {
+ throw Oops.Oh($"获取预甩调度信息失败,不存在或已作废");
+ }
+
+ if(string.IsNullOrWhiteSpace(dispatchInfo.SHARE_LINK_KEY))
+ throw Oops.Oh($"链接访问KEY不存在,请生成分享链接");
+
+
+ string[] statusArg = new string[] { RollingNominationDispatchStatusEnum.CANCEL.ToString(),
+ RollingNominationDispatchStatusEnum.EXPIRE.ToString() };
+
+ if (statusArg.Any(a => a.Equals(dispatchInfo.STATUS, StringComparison.OrdinalIgnoreCase)))
+ throw Oops.Oh($"链接访问KEY状态不可用");
+
+
+ result.succ = true;
+ result.ext = dispatchInfo.SHARE_LINK_KEY;
}
catch (Exception ex)
{
@@ -815,5 +883,45 @@ namespace Myshipping.Application
return result;
}
#endregion
+
+ #region 获取用户反馈信息
+ ///
+ /// 获取用户反馈信息
+ ///
+ /// 预甩调度批次ID
+ /// 返回回执
+ public async Task GetUserFeedBack(string dispatchBatchId)
+ {
+ TaskManageOrderResultDto result = new TaskManageOrderResultDto();
+
+ try
+ {
+ if (string.IsNullOrWhiteSpace(dispatchBatchId))
+ {
+ throw Oops.Oh($"预甩调度批次ID不能为空");
+ }
+
+ var list = _taskRollingNominationDispatchInfoRepository.AsQueryable()
+ .Where(a => a.BATCH_ID == dispatchBatchId).ToList();
+
+ if (list.Count == 0)
+ throw Oops.Oh($"预甩调度批次ID无法获取业务信息");
+
+ result.succ = true;
+ result.ext = new
+ {
+ userOpinion = list.FirstOrDefault().USER_OPINION,
+ userOpinionTxt = list.FirstOrDefault().USER_OPINION_TXT
+ };
+ }
+ catch (Exception ex)
+ {
+ result.succ = false;
+ result.msg = $"获取用户反馈信息异常,原因:{ex.Message}";
+ }
+
+ return result;
+ }
+ #endregion
}
}
diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageShareLinkService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageShareLinkService.cs
index 912e2c38..1346a6e9 100644
--- a/Myshipping.Application/Service/TaskManagePlat/TaskManageShareLinkService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageShareLinkService.cs
@@ -16,6 +16,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -245,13 +246,59 @@ namespace Myshipping.Application.Service.TaskManagePlat
///
/// 取消访问链接
///
- /// 访问链接主键
+ /// 访问链接业务主键
/// 返回回执
[HttpGet("/TaskManageShareLink/CancelShareLink")]
- public async Task CancelShareLink(string pkId)
+ public async Task CancelShareLink(string busiId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
+ try
+ {
+ var shareInfo = _taskShareLinkInfoRepository.AsQueryable()
+ .First(a => a.BUSI_ID == busiId && a.IsDeleted == false);
+
+ if(shareInfo == null)
+ throw Oops.Oh($"分享链接不存在或已删除");
+
+ var statusArg = new string[] {
+ RollingNominationDispatchStatusEnum.COMPLETE.ToString(),
+ RollingNominationDispatchStatusEnum.EXPIRE.ToString(),
+ RollingNominationDispatchStatusEnum.CANCEL.ToString()
+ };
+
+ if(statusArg.Any(a=>a.Equals(shareInfo.STATUS,StringComparison.OrdinalIgnoreCase)))
+ throw Oops.Oh($"分享链接状态{shareInfo.STATUS} 不需要取消");
+
+ shareInfo.STATUS = RollingNominationDispatchStatusEnum.CANCEL.ToString();
+ shareInfo.UpdatedTime = DateTime.Now;
+ shareInfo.UpdatedUserId = UserManager.UserId;
+ shareInfo.UpdatedUserName = UserManager.Name;
+
+ await _taskShareLinkInfoRepository.AsUpdateable(shareInfo)
+ .UpdateColumns(it => new
+ {
+ it.STATUS,
+ it.UpdatedTime,
+ it.UpdatedUserId,
+ it.UpdatedUserName
+ }).ExecuteCommandAsync();
+
+ if (_cache.Exists(shareInfo.SHARE_LINK_KEY))
+ _cache.DelAsync(shareInfo.SHARE_LINK_KEY);
+
+
+ result.succ = true;
+ result.msg = "成功";
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError($"取消访问链接异常,原因:{ex.Message}");
+
+ result.succ = false;
+ result.msg = $"取消访问链接异常,原因:{ex.Message}";
+ }
+
return result;
}
#endregion
@@ -497,7 +544,17 @@ namespace Myshipping.Application.Service.TaskManagePlat
if (shareEntity == null)
throw Oops.Oh($"链接分享不存在");
-
+ shareEntity.USER_OPINION = model.userOpinion;
+ shareEntity.USER_OPINION_TXT = model.userOpinionTxt;
+ shareEntity.CONFIRM_DATE = DateTime.Now;
+
+ await _taskShareLinkInfoRepository.AsUpdateable(shareEntity)
+ .UpdateColumns(it => new
+ {
+ it.USER_OPINION,
+ it.USER_OPINION_TXT,
+ it.CONFIRM_DATE,
+ }).ExecuteCommandAsync();
result.succ = true;
result.msg = "成功";