Merge branch 'dev' into S04轨迹预警
This commit is contained in:
commit
6eab4f9172
@ -113,7 +113,6 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
var tracks = await _trackDetailsRepository.GetListAsync(@event.OrderIds, @event.TrackCode);
|
||||
tracks = tracks.DistinctBy(x => x.OrderId).ToList(); // 防止重复推送
|
||||
var temp=this.DateTimeFormat(DateTime.Now, -8.0, config);
|
||||
if (tracks.Count == 0) return; // 一个能推的轨迹都不存在
|
||||
|
||||
// tips:人工推送只要能推就推了,不会校验已推和顺序问题,因为可能是更新
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackNode;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackNodeAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackNode;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackNodeServices
|
||||
namespace SJZY.Track.Application.Services.TrackNode
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹节点服务
|
||||
|
||||
@ -22,6 +22,11 @@ public class RuleAreaInfoDto
|
||||
/// </summary>
|
||||
public string CountryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家id
|
||||
/// </summary>
|
||||
public int CountryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
|
||||
110
src/SJZY.Track.Domain/VEntities/VCountryEntity.cs
Normal file
110
src/SJZY.Track.Domain/VEntities/VCountryEntity.cs
Normal file
@ -0,0 +1,110 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace SJZY.Track.Domain.VEntities;
|
||||
|
||||
[SugarTable("v_country")]
|
||||
public class VCountryEntity : IFullAuditedBasicEntitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "AreaId")]
|
||||
public int AreaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 币种id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CurrencyId", IsNullable = true)]
|
||||
public int? CurrencyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中文名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CnName")]
|
||||
public string CnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 英文名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnName")]
|
||||
public string EnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 二字代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Digit2Code")]
|
||||
public string Digit2Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 三字代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Digit3Code", IsNullable = true)]
|
||||
public string Digit3Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业代码类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnterpriseCodeType", IsNullable = true)]
|
||||
public string EnterpriseCodeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CountryCode", IsNullable = true)]
|
||||
public int? CountryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时差
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "JetLag")]
|
||||
public int JetLag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CountryName", IsNullable = true)]
|
||||
public string CountryName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否不可使用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsUnusable", IsNullable = false)]
|
||||
public bool IsUnusable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateUserId", IsNullable = true)]
|
||||
public int? CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateTime", IsNullable = false, DefaultValue = "CURRENT_TIMESTAMP")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "UpdateUserId", IsNullable = true)]
|
||||
public int? UpdateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "UpdateTime", IsNullable = true)]
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted", IsNullable = false)]
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
@ -65,26 +65,29 @@ public class KpiAreaRepository : BasicRepository<RuleAreaEntity>, IKpiAreaReposi
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<RuleAreaInfoDto>> GetAreaInfos(QueryAreaInfoRequest query)
|
||||
{
|
||||
var queryable = Context.Queryable<RuleAreaInfoEntity>();
|
||||
queryable = queryable.Where(x => x.AreaId == query.AreaId);
|
||||
return await queryable.OrderBy(x => x.Id, OrderByType.Desc)
|
||||
.Select<RuleAreaInfoDto>(val => new RuleAreaInfoDto()
|
||||
return await Context.Queryable<RuleAreaInfoEntity>()
|
||||
.InnerJoin<VCountryEntity>((x,c)=>x.CountryCode==c.Digit2Code)
|
||||
.Where(x => x.AreaId == query.AreaId)
|
||||
.OrderBy(x => x.UpdateTime, OrderByType.Desc)
|
||||
.Select<RuleAreaInfoDto>((x,c)=> new RuleAreaInfoDto()
|
||||
{
|
||||
Id = val.Id,
|
||||
AreaId = val.AreaId,
|
||||
City = val.City,
|
||||
CountryCode = val.CountryCode,
|
||||
CountryName = val.CountryName,
|
||||
LeftPostcode = val.LeftPostcode,
|
||||
RightPostcode = val.RightPostcode,
|
||||
Province = val.Province
|
||||
Id = x.Id,
|
||||
AreaId = x.AreaId,
|
||||
City = x.City,
|
||||
CountryId = c.Id,
|
||||
CountryCode = x.CountryCode,
|
||||
CountryName = x.CountryName,
|
||||
LeftPostcode = x.LeftPostcode,
|
||||
RightPostcode = x.RightPostcode,
|
||||
Province = x.Province
|
||||
})
|
||||
.ToPagedListAsync(query.PageIndex, query.PageSize);
|
||||
}
|
||||
|
||||
public Task<RuleAreaInfoEntity?> GetAreaInfoById(int id)
|
||||
{
|
||||
return Context.Queryable<RuleAreaInfoEntity>().FirstAsync(val => val.Id == id)!;
|
||||
return Context.Queryable<RuleAreaInfoEntity>()
|
||||
.FirstAsync(val => val.Id == id)!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user