Merge branch 'S06' into test
This commit is contained in:
commit
f3fcc271f9
@ -79,4 +79,9 @@ public class TrackPushCompletedEvent
|
||||
/// 推送内容(json)
|
||||
/// </summary>
|
||||
public string PushContent { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹的额外新
|
||||
/// </summary>
|
||||
public string? Extra { get; set; }
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Version>7.0.8</Version>
|
||||
<Version>7.0.9</Version>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@ -12,7 +12,7 @@ public interface ITrackPushService : IRemoteService
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public Task<string> PushTrackAsync(PushTrackInput input);
|
||||
public Task<UnifyResultDto> PushTrackAsync(PushTrackInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹推送内容
|
||||
@ -20,12 +20,12 @@ public interface ITrackPushService : IRemoteService
|
||||
/// <returns></returns>
|
||||
/// <param name="subSystemId">子系统id</param>
|
||||
/// <param name="customerId">客户id</param>
|
||||
public Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(int subSystemId, int customerId);
|
||||
public Task<UnifyResultDto<List<TrackPushContentDto>>> GetTrackPushContentListAsync(int subSystemId, int customerId);
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹推送记录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public Task<List<TrackPushRecordOutput>> GetTrackPushRecordsAsync(OrderNoInfo input);
|
||||
public Task<UnifyResultDto<List<TrackPushRecordOutput>>> GetTrackPushRecordsAsync(OrderNoInfo input);
|
||||
}
|
||||
|
||||
@ -125,7 +125,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
TrackTimeZone = @event.SystemPushInfo.TrackTimeZone,
|
||||
CreateUser = GlobalConst.SystemUser,
|
||||
SubSystemCode = @event.SubSystemCode,
|
||||
IsToMq = @event.IsToMq
|
||||
IsToMq = @event.IsToMq,
|
||||
Extra = @event.SystemPushInfo.Extra
|
||||
};
|
||||
var item = await BuiltPushItem(config, log, @event.SystemPushInfo.Extra);
|
||||
item.Log = JsonConvert.SerializeObject(log);
|
||||
@ -173,7 +174,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
TrackTimeZone = track.TrackTimeZone,
|
||||
CreateUser = @event.OperationMan,
|
||||
SubSystemCode = @event.SubSystemCode,
|
||||
IsToMq = @event.IsToMq
|
||||
IsToMq = @event.IsToMq,
|
||||
Extra = track.Extra
|
||||
};
|
||||
var item = await BuiltPushItem(config, log, track.Extra);
|
||||
item.Log = JsonConvert.SerializeObject(log);
|
||||
@ -223,7 +225,8 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
TrackTimeZone = @event.SystemPushInfo.TrackTimeZone,
|
||||
CreateUser = GlobalConst.SystemUser,
|
||||
SubSystemCode = @event.SubSystemCode,
|
||||
IsToMq = @event.IsToMq
|
||||
IsToMq = @event.IsToMq,
|
||||
Extra = @event.SystemPushInfo.Extra
|
||||
};
|
||||
var item = BuiltUpdateItem(config, log, @event.SystemPushInfo.Extra);
|
||||
item.Log = JsonConvert.SerializeObject(log);
|
||||
|
||||
@ -93,7 +93,8 @@ public class BroadcastingService : ITransientDependency
|
||||
TrackTimeZone = log.TrackTimeZone,
|
||||
TrackTime = log.TrackTime,
|
||||
TrackPlace = log.TrackPlace,
|
||||
TrackCode = log.TrackCode
|
||||
TrackCode = log.TrackCode,
|
||||
Extra = log.Extra
|
||||
};
|
||||
|
||||
_rabbitClientBus.Publish(GlobalConst.TrackPushExchange, $"TrackPush.{log.SubSystemCode}", Encoding.UTF8.GetBytes(data.ToJson()));
|
||||
|
||||
@ -49,7 +49,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
/// <returns></returns>
|
||||
[HttpPost("Track/Push")]
|
||||
[CustomerResult]
|
||||
public async Task<string> PushTrackAsync(PushTrackInput input)
|
||||
public async Task<UnifyResultDto> PushTrackAsync(PushTrackInput input)
|
||||
{
|
||||
input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空
|
||||
|
||||
@ -92,7 +92,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
await _capPublisher.PublishAsync(GlobalConst.TrackManualPushSubscribe, trackPushEvent);
|
||||
}
|
||||
|
||||
return $"即将推送轨迹代码{input.TrackCode}给{orders.Length}个订单";
|
||||
return new UnifyResultDto(true,$"即将推送轨迹代码{input.TrackCode}给{orders.Length}个订单");
|
||||
}
|
||||
|
||||
|
||||
@ -104,13 +104,13 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
/// <returns></returns>
|
||||
[HttpGet("Track/GetTrackPushContentList")]
|
||||
[CustomerResult]
|
||||
public async Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(int subSystemId, int customerId)
|
||||
public async Task<UnifyResultDto<List<TrackPushContentDto>>> GetTrackPushContentListAsync(int subSystemId, int customerId)
|
||||
{
|
||||
var list = await _trackPushConfigRepository.GetTrackPushContentListAsync(subSystemId, customerId);
|
||||
|
||||
var result = ObjectMapper.Map<List<GetTrackPushContentListVo>, List<TrackPushContentDto>>(list);
|
||||
|
||||
return result;
|
||||
return new UnifyResultDto<List<TrackPushContentDto>>(true, result, "操作成功");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -120,7 +120,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
/// <param name="input"></param>
|
||||
[HttpGet("Track/GetTrackPushRecords")]
|
||||
[CustomerResult]
|
||||
public async Task<List<TrackPushRecordOutput>> GetTrackPushRecordsAsync([FromQuery] OrderNoInfo input)
|
||||
public async Task<UnifyResultDto<List<TrackPushRecordOutput>>> GetTrackPushRecordsAsync([FromQuery] OrderNoInfo input)
|
||||
{
|
||||
var orderId = await _orderRepository.GetFirstAsync(x =>
|
||||
x.SubSystemId == input.SubSystemId && x.OrderType == input.OrderType && input.OrderNo == x.OrderNo,
|
||||
@ -132,6 +132,7 @@ public class TrackPushService : ApplicationService, ITrackPushService
|
||||
|
||||
var records = await _trackPushRecordEsRepository.GetTrackPushRecordsAsync(orderId);
|
||||
|
||||
return ObjectMapper.Map<List<TrackPushRecordIndex>, List<TrackPushRecordOutput>>(records);
|
||||
var res = ObjectMapper.Map<List<TrackPushRecordIndex>, List<TrackPushRecordOutput>>(records);
|
||||
return new UnifyResultDto<List<TrackPushRecordOutput>>(true, res, "操作成功");
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,11 +140,14 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
throw new BusinessException(message: $"订单:{input.OrderNo},轨迹代码:{input.TrackCode}存在多条记录,不允许修改");
|
||||
}
|
||||
|
||||
var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync(input.OptionUserId);
|
||||
var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync();
|
||||
if (userInfo.Code != GlobalConst.SuccessCode || userInfo.Data is null)
|
||||
{
|
||||
//TODO: log || ex
|
||||
throw new BusinessException(message: $"调用用户中心,获取用户信息失败:{userInfo.Msg}");
|
||||
//todo:保留之前的方式 后续可去除
|
||||
userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync(input.OptionUserId);
|
||||
if (userInfo.Code != GlobalConst.SuccessCode || userInfo.Data is null)
|
||||
//TODO: log || ex
|
||||
throw new BusinessException(message: $"调用用户中心,获取用户信息失败:{userInfo.Msg}");
|
||||
}
|
||||
|
||||
var name = userInfo.Data.UserName;
|
||||
|
||||
@ -92,4 +92,9 @@ public class TrackPushRecordIndex : IdBaseIndex
|
||||
/// 是否广播
|
||||
/// </summary>
|
||||
public bool IsToMq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹额外信息
|
||||
/// </summary>
|
||||
public string? Extra { get; set; }
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
using NUglify.Helpers;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user