提交代码
This commit is contained in:
parent
36706ae62c
commit
757f60e5e8
@ -7,15 +7,15 @@ public class GetPageTrackOrderInput : PageInfoInput
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 单号
|
||||
///// </summary>
|
||||
//public List<string>? OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单号
|
||||
/// </summary>
|
||||
public string? OrderNos { get; set; }
|
||||
public List<string>? OrderNos { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 单号
|
||||
///// </summary>
|
||||
//public string? OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// tab标签类型 0 全部, 1 异常 2 预警
|
||||
@ -136,7 +136,7 @@ public class TrackOrderDto
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
public string? SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
@ -153,13 +153,13 @@ public class TrackOrderDto
|
||||
/// </summary>
|
||||
public string? QuestionTypeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题描述(主数据枚举TrackProblemDescription)
|
||||
/// </summary>
|
||||
public int ProblemDescription { get; set; }
|
||||
///// <summary>
|
||||
///// 问题描述(主数据枚举TrackProblemDescription)
|
||||
///// </summary>
|
||||
//public int ProblemDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题描述名称
|
||||
/// </summary>
|
||||
public string? ProblemDescriptionName { get; set; }
|
||||
///// <summary>
|
||||
///// 问题描述名称
|
||||
///// </summary>
|
||||
//public string? ProblemDescriptionName { get; set; }
|
||||
}
|
||||
@ -1,8 +1,13 @@
|
||||
using AutoMapper;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.Enums;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using Volo.Abp.AutoMapper;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
@ -20,7 +25,10 @@ public class OrderAutoMapperProfile : Profile
|
||||
CreateMap<OrderFlightInfo, OrderFlightEntity>(MemberList.None);
|
||||
|
||||
CreateMap<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(MemberList.None);
|
||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None);
|
||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None)
|
||||
.ForMember(dest => dest.OrderTypeName, opt => opt.MapFrom(source => GetEnumDescription(2, source.OrderType)))
|
||||
.ForMember(dest => dest.QuestionTypeName, opt => opt.MapFrom(source => GetEnumDescription(1, source.QuestionType)));
|
||||
|
||||
CreateMap<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(MemberList.None);
|
||||
CreateMap<TrackDetailsIndex, TrackOrderDetailDto>(MemberList.None).Ignore(dest => dest.TrackTimeZone)
|
||||
.ForMember(dest => dest.Id, opt => opt.Ignore())
|
||||
@ -29,4 +37,34 @@ public class OrderAutoMapperProfile : Profile
|
||||
.ForMember(dest => dest.EnContent, opt => opt.MapFrom(m => m.TrackEnContent))
|
||||
.ForMember(dest => dest.TrackTimeZoneValue, opt => opt.MapFrom(m => m.TrackTimeZone));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过类型int获取枚举描述
|
||||
/// </summary>
|
||||
/// <param name="type">1 问题类型枚举 2 订单枚举</param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetEnumDescription(int type, int value)
|
||||
{
|
||||
string enumDescription = string.Empty;
|
||||
if (type == 1)
|
||||
{
|
||||
TrackProblemType trackProblem = (TrackProblemType)value; // 将int值转换为枚举
|
||||
if (trackProblem.GetDescription().IsNullOrWhiteSpace())
|
||||
enumDescription = "";
|
||||
else
|
||||
enumDescription = trackProblem.GetDescription(); // 获取描述标记
|
||||
}
|
||||
else
|
||||
{
|
||||
OrderType orderType = (OrderType)value; // 将int值转换为枚举
|
||||
if (orderType.GetDescription().IsNullOrWhiteSpace())
|
||||
enumDescription = "";
|
||||
else
|
||||
enumDescription = orderType.GetDescription(); // 获取描述标记
|
||||
|
||||
}
|
||||
|
||||
return enumDescription;
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.1.6"/>
|
||||
<None Include="..\..\.editorconfig" Link=".editorconfig" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.1.6" />
|
||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8" />
|
||||
|
||||
@ -58,7 +58,6 @@ public class TrackOrderService : ApplicationService
|
||||
list.ForEach(a =>
|
||||
{
|
||||
a.Id = id++;
|
||||
|
||||
var trackContentsOfTemplates = trackContents.Where(b => b.SubSystemId == input.SubSystemId &&
|
||||
b.TrackCode == a.Code
|
||||
&& input.TrackTemplateIds.Contains(
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当tab选中 0 默认不传 1 直接写死传值 [1,4] 2 传 [2,4]
|
||||
/// 当tab选中 0 全部 1 异常 2 警告
|
||||
/// </summary>
|
||||
public int TabType { get; set; }
|
||||
|
||||
@ -22,10 +22,15 @@
|
||||
/// </summary>
|
||||
public int? CustomerId { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 单号
|
||||
///// </summary>
|
||||
//public string? OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单号
|
||||
/// </summary>
|
||||
public string? OrderNos { get; set; }
|
||||
public List<string>? OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间开始
|
||||
@ -121,7 +126,7 @@
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
public string? SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
@ -132,5 +137,15 @@
|
||||
/// 轨迹模板Id数组
|
||||
/// </summary>
|
||||
public List<int>? TrackTemplateIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题类型(主数据枚举TrackQuestionType)
|
||||
/// </summary>
|
||||
public int QuestionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题类型名称
|
||||
/// </summary>
|
||||
public string? QuestionTypeName { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,18 @@
|
||||
namespace SJZY.Track.Domain.Enums;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace SJZY.Track.Domain.Enums;
|
||||
|
||||
public enum OrderType
|
||||
{
|
||||
干线提单 = 1
|
||||
[Description("干线提单")]
|
||||
干线提单 = 1,
|
||||
|
||||
[Description("小包运单")]
|
||||
小包运单 = 2,
|
||||
|
||||
[Description("箱/袋单")]
|
||||
箱袋单 = 3,
|
||||
|
||||
[Description("FBA订单")]
|
||||
FBA订单 = 4,
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
namespace SJZY.Track.Domain.Enums;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace SJZY.Track.Domain.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum TrackProblemType
|
||||
@ -6,15 +8,18 @@ public enum TrackProblemType
|
||||
/// <summary>
|
||||
/// 没问题
|
||||
/// </summary>
|
||||
[Description("无")]
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 异常
|
||||
/// </summary>
|
||||
[Description("异常")]
|
||||
Error = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 预警
|
||||
/// </summary>
|
||||
[Description("预警")]
|
||||
Warn = 2,
|
||||
}
|
||||
@ -24,30 +24,11 @@ public class TrackOrderQueries : ISugarRepository, ITrackOrderQueries,
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<TrackOrderVO>> GetPageTrackOrder(GetPageTrackOrderInputVO input)
|
||||
{
|
||||
List<string> orderNoList = new List<string>();
|
||||
List<int> questionTypeIds = new List<int>();
|
||||
int ques = 0;
|
||||
if (!input.OrderNos.IsNullOrWhiteSpace())
|
||||
{
|
||||
orderNoList = input.OrderNos!.Split(',', ',', ':', ':').ToList();
|
||||
}
|
||||
|
||||
if (input.TabType == 1)
|
||||
{
|
||||
questionTypeIds = new List<int> { 1, 4 };
|
||||
ques = questionTypeIds.Sum();
|
||||
}
|
||||
else if (input.TabType == 2)
|
||||
{
|
||||
questionTypeIds = new List<int> { 2, 4 };
|
||||
ques = questionTypeIds.Sum();
|
||||
}
|
||||
|
||||
var pageList = await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<VExternalSubjectEntity>((a, b) => a.CustomId == b.Id && b.IsDeleted == false)
|
||||
.LeftJoin<VSystemEntity>((a, b, c) => a.SubSystemId == c.Id && c.IsDeleted == false)
|
||||
.WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId)
|
||||
.WhereIF(!orderNoList.IsNullOrEmpty(), (a, b, c) => orderNoList.Contains(a.OrderNo))
|
||||
.WhereIF(!input.OrderNos.IsNullOrEmpty(), (a, b, c) => input.OrderNos!.Contains(a.OrderNo))
|
||||
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
||||
(a, b, c) => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
||||
@ -56,7 +37,7 @@ public class TrackOrderQueries : ISugarRepository, ITrackOrderQueries,
|
||||
(a, b, c) => a.CreateTime <= input.CreateTimeEnd)
|
||||
.WhereIF(input.CustomerId > 0, (a, b, c) => a.CustomId == input.CustomerId)
|
||||
.WhereIF(input.TrackOrderType > 0, (a, b, c) => a.OrderType == input.TrackOrderType)
|
||||
.WhereIF(input.TabType > 0 && !questionTypeIds.IsNullOrEmpty(), (a, b, c) => (a.QuestionType & ques) > 0)
|
||||
.WhereIF(input.TabType > 0, (a, b, c) => a.QuestionType == input.TabType)
|
||||
.OrderByDescending((a, b, c) => a.CreateTime)
|
||||
.Select((a, b, c) => new TrackOrderVO
|
||||
{
|
||||
|
||||
@ -83,7 +83,7 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
||||
CreateUser = e.Name,
|
||||
UpdateTime = a.UpdateTime,
|
||||
UpdateUser = f.Name,
|
||||
IsFinish= a.IsCompleted
|
||||
IsFinish = a.IsCompleted
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
|
||||
@ -97,21 +97,21 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
||||
public async Task<List<GetTemplateContentAttributeValueVO>> GetTrackContentAttributeValue(GetTemplateContentAttributeValueInputVO input)
|
||||
{
|
||||
var list = await Context.Queryable<TrackContentEntity>()
|
||||
.LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id==b.TrackContentId&& b.TrackTemplateId>0 && b.IsDeleted==false)
|
||||
.LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId==c.Id&& c.IsDeleted==false)
|
||||
.WhereIF(!input.TrackCodes.IsNullOrEmpty(), (a, b, c) => input.TrackCodes.Contains(a.Code))
|
||||
.WhereIF(input.SubSystemId>0, (a, b, c) => a.SubSystemId==input.SubSystemId)
|
||||
.WhereIF(!input.TrackTemplateIds.IsNullOrEmpty(), (a, b, c) => input.TrackTemplateIds.Contains(c.Id))
|
||||
.Where((a, b, c) => c.Id>0)
|
||||
.LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id == b.TrackContentId && b.TrackTemplateId > 0 && b.IsDeleted == false)
|
||||
.LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId == c.Id && c.IsDeleted == false)
|
||||
.WhereIF(!input.TrackCodes.IsNullOrEmpty(), (a, b, c) => input.TrackCodes!.Contains(a.Code))
|
||||
.WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId)
|
||||
.WhereIF(!input.TrackTemplateIds.IsNullOrEmpty(), (a, b, c) => input.TrackTemplateIds!.Contains(c.Id))
|
||||
.Where((a, b, c) => c.Id > 0)
|
||||
//.OrderByIF(!input.TrackTemplateIds.IsNullOrEmpty(), (a, b, c) => SqlFunc.IIF(input.TrackTemplateIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), c.CreateTime), OrderByType.Desc)
|
||||
.Select((a, b, c) => new GetTemplateContentAttributeValueVO
|
||||
{
|
||||
IsCanDelete=b.IsCanDelete,
|
||||
IsExternal=b.IsExternal,
|
||||
SubSystemId= a.SubSystemId,
|
||||
TrackCode= a.Code,
|
||||
TrackContenId= a.Id,
|
||||
TrackTemplateId=c.Id
|
||||
IsCanDelete = b.IsCanDelete,
|
||||
IsExternal = b.IsExternal,
|
||||
SubSystemId = a.SubSystemId,
|
||||
TrackCode = a.Code,
|
||||
TrackContenId = a.Id,
|
||||
TrackTemplateId = c.Id
|
||||
}).ToListAsync();
|
||||
|
||||
return list;
|
||||
@ -125,9 +125,9 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
||||
public async Task<bool> GetTemplateIsExist(int trackContentId)
|
||||
{
|
||||
//var trackTemplateContents = await _trackTemplateContentBasicQuery.GetListAsync(a => a.TrackContentId == input.Id);
|
||||
var trackContentEntities = await Context.Queryable<TrackContentEntity>().LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id==b.TrackContentId && b.IsDeleted==false)
|
||||
.LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId==c.Id&& c.IsDeleted==false)
|
||||
.Where((a, b, c) => a.Id==trackContentId)
|
||||
var trackContentEntities = await Context.Queryable<TrackContentEntity>().LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id == b.TrackContentId && b.IsDeleted == false)
|
||||
.LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId == c.Id && c.IsDeleted == false)
|
||||
.Where((a, b, c) => a.Id == trackContentId)
|
||||
.Select((a, b, c) => new
|
||||
{
|
||||
TrackContentId = a.Id,
|
||||
@ -135,7 +135,7 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
if (trackContentEntities.Any(a => a.TemplateId>0))
|
||||
if (trackContentEntities.Any(a => a.TemplateId > 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user