wet 1 year ago
commit 49d00316be

@ -87,6 +87,16 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 最后活动名称
/// </summary>
public int LST_ACT_NAME { get; set; }
public string LST_ACT_NAME { get; set; }
/// <summary>
/// 是否已产生 1-已产生 0-未产生
/// </summary>
public int IS_YIELD { get; set; }
/// <summary>
/// 项目发生时间
/// </summary>
public Nullable<DateTime> ACT_DATE { get; set; }
}
}

@ -22,5 +22,10 @@ namespace Myshipping.Application
/// </summary>
[Description("查询服务项目和状态")]
QUERY_SERVICE_PROJECT_STATUS,
/// <summary>
/// 查询所有服务项目和关联状态
/// </summary>
[Description("查询所有服务项目和关联状态")]
QUERY_SERVICE_ALL,
}
}

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 服务项目来源类型
/// </summary>
public enum TrackingSourceTypeEnum
{
/// <summary>
/// 自动
/// </summary>
[Description("自动")]
AUTO,
/// <summary>
/// 人工
/// </summary>
[Description("人工")]
MANUAL,
}
}

@ -1947,7 +1947,8 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <returns>返回服务状态列表</returns>
public async Task<BookingAttachedDataDto> GetAllDataVNTWO(long bookingId)
[HttpGet("/BookingValueAdded/GetAllDataVNTWO")]
public async Task<BookingAttachedDataDto> GetAllDataVNTWO([FromQuery] long bookingId)
{
BookingAttachedDataDto resultDto = new BookingAttachedDataDto();
@ -1986,7 +1987,8 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <returns>返回日志详情</returns>
public async Task<BookingLogDataDto> GetAllLogDataVNTWO(long bookingId)
[HttpGet("/BookingValueAdded/GetAllLogDataVNTWO")]
public async Task<BookingLogDataDto> GetAllLogDataVNTWO([FromQuery] long bookingId)
{
BookingLogDataDto resultDto = new BookingLogDataDto();
@ -2049,10 +2051,10 @@ namespace Myshipping.Application
/// <summary>
/// 保存服务项目
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <param name="projectCode">服务项目代码</param>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SaveServiceProject(long bookingId, string projectCode)
[HttpPost("/BookingValueAdded/SaveServiceProject")]
public async Task<TaskManageOrderResultDto> SaveServiceProject([FromBody] ModifyServiceProjectDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -2061,12 +2063,12 @@ namespace Myshipping.Application
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null,true)
.First(a=>a.Id == bookingId);
.First(a=>a.Id == model.BookingId);
if(bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
_logger.LogInformation("批次={no} 请求保存服务项目 bookingid={id} project={prj} ", batchNo, bookingId, projectCode);
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
TrackingMessageInfo msgInfo = new TrackingMessageInfo {
Head = new TrackingMessageHeadInfo {
@ -2082,7 +2084,7 @@ namespace Myshipping.Application
},
Main = new TrackingMessageMainInfo
{
BusiId = bookingId.ToString(),
BusiId = model.BookingId.ToString(),
BusiSystemCode = "BOOKING_ORDER",
MBlNo = bookingOrder.MBLNO,
VesselVoyno = $"{bookingOrder.VESSEL}/{bookingOrder.VOYNO}",
@ -2093,11 +2095,11 @@ namespace Myshipping.Application
OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(),
OperUserName = UserManager.Name,
ProjectList = new List<TrackingMessageMainProjectInfo> {
new TrackingMessageMainProjectInfo{
ServiceProjectCode = projectCode,
}
}
SourceType = TrackingSourceTypeEnum.MANUAL,
ProjectList = model.ProjectCodes.Select(a=> new TrackingMessageMainProjectInfo
{
ServiceProjectCode = a,
}).ToList()
}
};
DateTime bDate = DateTime.Now;
@ -2138,10 +2140,10 @@ namespace Myshipping.Application
/// <summary>
/// 取消服务项目
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <param name="projectCode">服务项目代码</param>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelServiceProject(long bookingId, string projectCode)
[HttpPost("/BookingValueAdded/CancelServiceProject")]
public async Task<TaskManageOrderResultDto> CancelServiceProject([FromBody] ModifyServiceProjectDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -2150,12 +2152,12 @@ namespace Myshipping.Application
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingId);
.First(a => a.Id == model.BookingId);
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
_logger.LogInformation("批次={no} 请求保存服务项目 bookingid={id} project={prj} ", batchNo, bookingId, projectCode);
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
TrackingMessageInfo msgInfo = new TrackingMessageInfo
{
@ -2173,7 +2175,7 @@ namespace Myshipping.Application
},
Main = new TrackingMessageMainInfo
{
BusiId = bookingId.ToString(),
BusiId = model.BookingId.ToString(),
BusiSystemCode = "BOOKING_ORDER",
MBlNo = bookingOrder.MBLNO,
VesselVoyno = $"{bookingOrder.VESSEL}/{bookingOrder.VOYNO}",
@ -2184,18 +2186,18 @@ namespace Myshipping.Application
OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(),
OperUserName = UserManager.Name,
ProjectList = new List<TrackingMessageMainProjectInfo> {
new TrackingMessageMainProjectInfo{
ServiceProjectCode = projectCode,
}
}
SourceType = TrackingSourceTypeEnum.MANUAL,
ProjectList = model.ProjectCodes.Select(a => new TrackingMessageMainProjectInfo
{
ServiceProjectCode = a,
}).ToList()
}
};
DateTime bDate = DateTime.Now;
_logger.LogInformation("批次={no} 推送取消服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
var rlt = await _serviceWorkFlowManageService.CancelProject(msgInfo);
var rlt = await _serviceWorkFlowManageService.CancelStatus(msgInfo);
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
@ -2224,6 +2226,280 @@ namespace Myshipping.Application
return result;
}
#endregion
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/SaveServiceStatus")]
public async Task<TaskManageOrderResultDto> SaveServiceStatus([FromBody] ModifyServiceProjectStatusDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == model.BookingId);
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
TrackingMessageInfo msgInfo = new TrackingMessageInfo
{
Head = new TrackingMessageHeadInfo
{
GID = IDGen.NextID().ToString(),
MessageType = "PROJECT",
ReceiverId = "ServiceProjectStatus",
ReceiverName = "服务项目和状态",
SenderId = "BookingOrder",
SenderName = "海运订舱",
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
Version = "2.0",
RequestAction = "AddOrModify",
},
Main = new TrackingMessageMainInfo
{
BusiId = model.BookingId.ToString(),
BusiSystemCode = "BOOKING_ORDER",
MBlNo = bookingOrder.MBLNO,
VesselVoyno = $"{bookingOrder.VESSEL}/{bookingOrder.VOYNO}",
OrderNo = bookingOrder.BSNO,
PushType = TrackingPushTypeEnum.Status,
OperTenantId = bookingOrder.TenantId.Value,
OperTenantName = bookingOrder.TenantName,
OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(),
OperUserName = UserManager.Name,
SourceType = TrackingSourceTypeEnum.MANUAL,
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
{
StatusCode = a.StatusCode,
StatusDate = a.SetActDate,
StatusVal = a.SetActVal
}).ToList()
}
};
DateTime bDate = DateTime.Now;
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
var rlt = await _serviceWorkFlowManageService.PushStatus(msgInfo);
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
, JSON.Serialize(rlt));
if (!rlt.succ)
{
result = rlt;
}
else
{
result.succ = true;
result.msg = "推送成功";
}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"服务项目状态推送失败,原因:{ex.Message}";
}
return result;
}
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/CancelServiceStatus")]
public async Task<TaskManageOrderResultDto> CancelServiceStatus([FromBody] ModifyServiceProjectStatusDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == model.BookingId);
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
TrackingMessageInfo msgInfo = new TrackingMessageInfo
{
Head = new TrackingMessageHeadInfo
{
GID = IDGen.NextID().ToString(),
MessageType = "PROJECT",
ReceiverId = "ServiceProjectStatus",
ReceiverName = "服务项目和状态",
SenderId = "BookingOrder",
SenderName = "海运订舱",
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
Version = "2.0",
RequestAction = "AddOrModify",
},
Main = new TrackingMessageMainInfo
{
BusiId = model.BookingId.ToString(),
BusiSystemCode = "BOOKING_ORDER",
MBlNo = bookingOrder.MBLNO,
VesselVoyno = $"{bookingOrder.VESSEL}/{bookingOrder.VOYNO}",
OrderNo = bookingOrder.BSNO,
PushType = TrackingPushTypeEnum.Status,
OperTenantId = bookingOrder.TenantId.Value,
OperTenantName = bookingOrder.TenantName,
OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(),
OperUserName = UserManager.Name,
SourceType = TrackingSourceTypeEnum.MANUAL,
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
{
StatusCode = a.StatusCode,
StatusDate = a.SetActDate,
StatusVal = a.SetActVal
}).ToList()
}
};
DateTime bDate = DateTime.Now;
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
var rlt = await _serviceWorkFlowManageService.CancelStatus(msgInfo);
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
, JSON.Serialize(rlt));
if (!rlt.succ)
{
result = rlt;
}
else
{
result.succ = true;
result.msg = "推送成功";
}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"服务项目状态推送失败,原因:{ex.Message}";
}
return result;
}
#region 获取服务项目列表
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/GetServiceProjectList")]
public async Task<TaskManageOrderResultDto> GetServiceProjectList([FromBody] QueryServiceProjectWithStatus model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == model.BookingId);
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
QueryServiceProjectWithStatus queryInfo = new QueryServiceProjectWithStatus {
BookingId = model.BookingId,
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
TenantId = bookingOrder.TenantId.Value
};
result = await _serviceWorkFlowManageService.GetEnableProjectList(queryInfo);
}
catch(Exception ex)
{
result.succ = false;
result.msg = $"获取服务项目列表失败,原因:{ex.Message}";
}
return result;
}
#endregion
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/GetServiceStatusList")]
public async Task<TaskManageOrderResultDto> GetServiceStatusList([FromBody] QueryServiceProjectWithStatus model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
try
{
//查询所有服务服务项目和状态时,需要先获取订舱详情
if (model.QueryType == TrackingQueryTypeEnum.QUERY_SERVICE_ALL)
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == model.BookingId);
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
QueryServiceProjectWithStatus queryInfo = new QueryServiceProjectWithStatus
{
BookingId = model.BookingId,
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
TenantId = bookingOrder.TenantId.Value
};
result = await _serviceWorkFlowManageService.GetEnableProjectList(queryInfo);
}
else
{
if (model.ProjectCodes == null || (model.ProjectCodes != null && model.ProjectCodes.Length == 0))
throw Oops.Oh($"服务项目代码不能为空");
model.TenantId = UserManager.TENANT_ID;
result = await _serviceWorkFlowManageService.GetEnableStatusListByProject(model);
}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"获取服务项目下的状态列表失败,原因:{ex.Message}";
}
return result;
}
}
public class DateTimeJsonConverter : System.Text.Json.Serialization.JsonConverter<Nullable<DateTime>>

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 修改服务项目
/// </summary>
public class ModifyServiceProjectDto
{
/// <summary>
/// 订舱主键
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 服务项目代码
/// </summary>
public string[] ProjectCodes { get; set; }
}
/// <summary>
/// 修改服务项目状态
/// </summary>
public class ModifyServiceProjectStatusDto
{
/// <summary>
/// 订舱主键
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 服务项目状态明细
/// </summary>
public List<ModifyServiceProjectStatusDetailDto> StatusCodes { get; set; }
}
public class ModifyServiceProjectStatusDetailDto
{
/// <summary>
/// 状态代码
/// </summary>
public string StatusCode { get; set; }
/// <summary>
/// 人工设定状态完成时间
/// </summary>
public Nullable<DateTime> SetActDate { get; set; }
/// <summary>
/// 人工设定状态值(可传箱使天数)
/// </summary>
public string SetActVal { get; set; }
}
}

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 查询服务项目和状态
/// </summary>
public class QueryServiceProjectWithStatus
{
/// <summary>
/// 订舱ID(可为空,不为空时需要查询已触发的记录和未触发的记录,为空时只查询已启用的)
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// 0-查服务项目 1-查服务项目下的状态
/// </summary>
public TrackingQueryTypeEnum QueryType { get; set; }
/// <summary>
/// 服务项目代码组
/// </summary>
public string[] ProjectCodes { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long TenantId { get; set; }
}
}

@ -91,17 +91,45 @@ namespace Myshipping.Application
/// <summary>
/// 保存服务项目
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <param name="projectCode">服务项目代码</param>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SaveServiceProject(long bookingId, string projectCode);
Task<TaskManageOrderResultDto> SaveServiceProject(ModifyServiceProjectDto model);
/// <summary>
/// 取消服务项目
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <param name="projectCode">服务项目代码</param>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceProject(ModifyServiceProjectDto model);
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceProjectList(QueryServiceProjectWithStatus model);
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceStatusList(QueryServiceProjectWithStatus model);
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceProject(long bookingId, string projectCode);
Task<TaskManageOrderResultDto> SaveServiceStatus(ModifyServiceProjectStatusDto model);
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceStatus(ModifyServiceProjectStatusDto model);
}
}

@ -1873,7 +1873,8 @@ namespace Myshipping.Application
_bookingOrderRepository.AsUpdateable(bookingOrder).UpdateColumns(it => new
{
it.TRUCKERID,
it.TRUCKER
it.TRUCKER,
it.VERSION
}).ExecuteCommand();
var syncDongshengRlt = await _bookingOrderService.SendBookingOrder(new long[] { bookingTruckInfo.BookingId.Value });
@ -1904,7 +1905,8 @@ namespace Myshipping.Application
_bookingOrderRepository.AsUpdateable(bookingOrder).UpdateColumns(it => new
{
it.TRUCKERID,
it.TRUCKER
it.TRUCKER,
it.VERSION
}).ExecuteCommand();
//这里直接调用订舱服务的功能,担心有异常所以这里单独做了异常捕获
@ -1930,8 +1932,6 @@ namespace Myshipping.Application
if (bookingTruckInfo.TenantId.HasValue)
messageInfo.Main.TenantId = bookingTruckInfo.TenantId.Value;
var mqRlt = await PushSyncBookingTruckMQToDS6(messageInfo);
_logger.LogInformation("发送MQrlt={rlt}", JSON.Serialize(mqRlt));

@ -49,13 +49,28 @@ namespace Myshipping.Application
/// <summary>
/// 发布日期
/// </summary>
public DateTime ReleaseDate { get; set; }
public Nullable<DateTime> ReleaseDate { get; set; }
/// <summary>
/// 状态代码列表(方便检索)
/// </summary>
public string[] StatusSKUCodeArgs { get; set; }
/// <summary>
/// 是否已完成
/// </summary>
public bool IsYield { get; set; }
/// <summary>
/// 完成时间
/// </summary>
public Nullable<DateTime> ActDate { get; set; }
/// <summary>
/// 状态数量(含子状态)
/// </summary>
public int StatusNum { get; set; }
/// <summary>
/// 状态列表
/// </summary>

@ -16,6 +16,11 @@ namespace Myshipping.Application
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 服务项目主键
/// </summary>
public string ServiceProjectId { get; set; }
/// <summary>
/// 服务项目代码
/// </summary>
@ -26,6 +31,16 @@ namespace Myshipping.Application
/// </summary>
public string ServiceProjectName { get; set; }
/// <summary>
/// 是否已产生 1-已产生 0-未产生
/// </summary>
public int IsYield { get; set; }
/// <summary>
/// 项目发生时间
/// </summary>
public Nullable<DateTime> ActDate { get; set; }
/// <summary>
/// 状态列表
/// </summary>

@ -158,6 +158,11 @@ namespace Myshipping.Application
/// </summary>
public TrackingPushTypeEnum PushType { get; set; }
/// <summary>
/// 来源类型
/// </summary>
public TrackingSourceTypeEnum SourceType { get; set; }
/// <summary>
/// 服务项目列表
/// </summary>
@ -197,7 +202,7 @@ namespace Myshipping.Application
/// <summary>
/// 状态产生时间
/// </summary>
public DateTime StatusDate { get; set; }
public Nullable<DateTime> StatusDate { get; set; }
/// <summary>
/// 状态产生值

@ -129,5 +129,8 @@ namespace Myshipping.Application
/// <param name="isAvoidCache">是否不从缓存取值</param>
/// <returns>返回回执</returns>
Task<List<ServiceProjectWithStatusDto>> GetEnableProjectWithStatusList(string tenantId, bool isAvoidCache = false);
}
}

@ -49,20 +49,33 @@ namespace Myshipping.Application
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> QueryServiceInfo(TrackingQueryMessageInfo info);
/// <summary>
/// 取消服务项目
/// 校验取消状态
/// </summary>
/// <param name="info">服务流程报文详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelProject(TrackingMessageInfo info);
Task<TaskManageOrderResultDto> ValidateCancelProject(TrackingMessageInfo info);
/// <summary>
/// 校验取消状态
/// 检索已选中并且可用的服务项目列表
/// </summary>
/// <param name="info">服务流程报文详情</param>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> ValidateCancelProject(TrackingMessageInfo info);
Task<TaskManageOrderResultDto> GetEnableProjectList(QueryServiceProjectWithStatus model);
/// <summary>
/// 检索服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetEnableStatusListByProject(QueryServiceProjectWithStatus model);
/// <summary>
/// 单票检索服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetEnableStatusListByBusiness(QueryServiceProjectWithStatus model);
}
}

@ -1756,19 +1756,15 @@ namespace Myshipping.Application
if (isAvoidCache || projectList == null || projectList.Count == 0)
{
var list = _serviceWorkFlowBaseRepository.AsQueryable().Filter(null, true)
.InnerJoin<ServiceWorkFlowProjectRelation>((wf, rela)
=> wf.PK_ID == rela.SERVICE_WORKFLOW_ID && wf.RELEASE_VERSION == rela.WF_VERSION)
.InnerJoin<ServiceProjectBaseInfo>((wf, rela, prj)
=> rela.SERVICE_PROJECT_ID == prj.PK_ID)
.Where((wf, rela, prj)
=> !string.IsNullOrWhiteSpace(wf.RELEASE_VERSION) && wf.BELONG_TENANT_ID == long.Parse(tenantId)
&& wf.IS_ENABLE == 1 && !wf.IsDeleted)
.Select((wf, rela, prj)
=> prj).ToList();
projectList = list.Select(a => a.Adapt<ServiceProjectBaseDto>())
.Distinct().OrderBy(a => a.SortNo).ToList();
var statusList = ReloadServiceProjectCacheInfo(tenantId);
projectList = statusList.Select(a => new ServiceProjectBaseDto
{
PKId = a.ProjectPKId,
ServiceProjectCode = a.ProjectCode,
ServiceProjectName = a.ProjectName,
SortNo = a.SortNo
}).OrderBy(a => a.SortNo).ToList();
await _cache.SetAsync($"{CONST_CACHE_ENABLE_PROJECT}_{tenantId}", projectList);
}
@ -1820,6 +1816,18 @@ namespace Myshipping.Application
await _cache.SetAsync($"{CONST_CACHE_ENABLE_PROJECT_STATUS}_{tenantId}", statusList);
_logger.LogInformation($"租户下可用的服务流程详情并写入缓存完成");
var projectList = statusList.Select(a => new ServiceProjectBaseDto
{
PKId = a.ProjectPKId,
ServiceProjectCode = a.ProjectCode,
ServiceProjectName = a.ProjectName,
SortNo = a.SortNo
}).OrderBy(a => a.SortNo).ToList();
await _cache.SetAsync($"{CONST_CACHE_ENABLE_PROJECT}_{tenantId}", projectList);
_logger.LogInformation($"租户下可用的服务写入缓存完成");
}
catch(Exception ex)
{
@ -1915,13 +1923,13 @@ namespace Myshipping.Application
dto.SubStatusList = currList.Select(e => {
var skuInfo = statusSKUList.FirstOrDefault(e => e.PK_ID == act.STATUS_SKU_ID);
var skuInfo = statusSKUList.FirstOrDefault(t => t.PK_ID == e.Act.STATUS_SKU_ID);
var itemDto = new ServiceProjectStatusDto
{
SkuPKId = act.STATUS_SKU_ID,
ActPKId = act.PK_ID,
ShowName = act.SHOW_NAME,
SkuPKId = e.Act.STATUS_SKU_ID,
ActPKId = e.Act.PK_ID,
ShowName = e.Act.SHOW_NAME,
ActSortNo = e.Rela.SORT_NO,
WFPKId = wf.PK_ID,
StatusSKUCode = skuInfo.STATUS_SKU_CODE,
@ -2006,5 +2014,7 @@ namespace Myshipping.Application
return statusList;
}
#endregion
}
}

Loading…
Cancel
Save