修改服务状态保存和取消,增加非登录情况判断

optimize
jianghaiqing 1 year ago
parent a797af037c
commit 7d8b2b0e29

@ -2224,6 +2224,20 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model)); _logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
string operUserId = bookingOrder.CreatedUserId.ToString();
string operUserName = bookingOrder.CreatedUserName;
//这里因为没有登录所以导致异常,因为当前接口是不验证登录的所以这里加了异常捕获,异常后登录人从订舱上制单人取。
try
{
operUserId = UserManager.UserId.ToString();
operUserName = UserManager.Name;
}
catch (Exception ex)
{
_logger.LogInformation("批次={no} 这里因为是非登录请求接口所以自动捕获异常", batchNo);
}
TrackingMessageInfo msgInfo = new TrackingMessageInfo TrackingMessageInfo msgInfo = new TrackingMessageInfo
{ {
Head = new TrackingMessageHeadInfo Head = new TrackingMessageHeadInfo
@ -2249,8 +2263,8 @@ namespace Myshipping.Application
OperTenantId = bookingOrder.TenantId.Value, OperTenantId = bookingOrder.TenantId.Value,
OperTenantName = bookingOrder.TenantName, OperTenantName = bookingOrder.TenantName,
OpertType = TrackingOperTypeEnum.MANUAL, OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(), OperUserId = operUserId,
OperUserName = UserManager.Name, OperUserName = operUserName,
SourceType = model.SourceType, SourceType = model.SourceType,
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
{ {
@ -2318,6 +2332,19 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model)); _logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
string operUserId = bookingOrder.CreatedUserId.ToString();
string operUserName = bookingOrder.CreatedUserName;
try
{
operUserId = UserManager.UserId.ToString();
operUserName = UserManager.Name;
}
catch (Exception ex)
{
_logger.LogInformation("批次={no} 这里因为是非登录请求接口所以自动捕获异常", batchNo);
}
TrackingMessageInfo msgInfo = new TrackingMessageInfo TrackingMessageInfo msgInfo = new TrackingMessageInfo
{ {
Head = new TrackingMessageHeadInfo Head = new TrackingMessageHeadInfo
@ -2343,8 +2370,8 @@ namespace Myshipping.Application
OperTenantId = bookingOrder.TenantId.Value, OperTenantId = bookingOrder.TenantId.Value,
OperTenantName = bookingOrder.TenantName, OperTenantName = bookingOrder.TenantName,
OpertType = TrackingOperTypeEnum.MANUAL, OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = UserManager.UserId.ToString(), OperUserId = operUserId,
OperUserName = UserManager.Name, OperUserName = operUserName,
SourceType = model.SourceType, SourceType = model.SourceType,
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
{ {

Loading…
Cancel
Save