feat: 补充注释
This commit is contained in:
parent
d67c7ce820
commit
2f5354960d
@ -9,6 +9,11 @@ public class ForewarningFactorHelper
|
|||||||
{
|
{
|
||||||
var total = Factorial(ruleFactors);
|
var total = Factorial(ruleFactors);
|
||||||
var ruleCollect = AllocateFactor(total, ruleFactors.RuleId);
|
var ruleCollect = AllocateFactor(total, ruleFactors.RuleId);
|
||||||
|
Assignment(ruleCollect, total, ruleFactors.Tracks, (item, value) =>
|
||||||
|
{
|
||||||
|
item.TrackEnd = value.End;
|
||||||
|
item.TrackStart = value.Start;
|
||||||
|
});
|
||||||
Assignment(ruleCollect, total, ruleFactors.CargoTypes, (item, value) => item.CargoType = value);
|
Assignment(ruleCollect, total, ruleFactors.CargoTypes, (item, value) => item.CargoType = value);
|
||||||
Assignment(ruleCollect, total, ruleFactors.Months, (item, value) => item.Month = value);
|
Assignment(ruleCollect, total, ruleFactors.Months, (item, value) => item.Month = value);
|
||||||
Assignment(ruleCollect, total, ruleFactors.Areas, (item, value) => item.Area = value);
|
Assignment(ruleCollect, total, ruleFactors.Areas, (item, value) => item.Area = value);
|
||||||
@ -54,7 +59,7 @@ public class ForewarningFactorHelper
|
|||||||
|
|
||||||
internal static int Factorial(RuleFactorEntity ruleFactors)
|
internal static int Factorial(RuleFactorEntity ruleFactors)
|
||||||
{
|
{
|
||||||
return ruleFactors.CargoTypes.Count * ruleFactors.Months.Count * ruleFactors.Areas.Count *
|
return ruleFactors.Tracks.Count* ruleFactors.CargoTypes.Count * ruleFactors.Months.Count * ruleFactors.Areas.Count *
|
||||||
ruleFactors.IsTransit.Count * ruleFactors.DeparturePorts.Count * ruleFactors.ProductCodes.Count;
|
ruleFactors.IsTransit.Count * ruleFactors.DeparturePorts.Count * ruleFactors.ProductCodes.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,9 +9,9 @@ namespace SJZY.Track.Application.Services.ForewarningServices;
|
|||||||
public class ForewarningService : ApplicationService
|
public class ForewarningService : ApplicationService
|
||||||
{
|
{
|
||||||
readonly IRuleRepository _ruleRepository;
|
readonly IRuleRepository _ruleRepository;
|
||||||
IRuleFactorRepository _ruleFactorRepository;
|
readonly IRuleFactorRepository _ruleFactorRepository;
|
||||||
private IRuleItemRepository _ruleItemRepository;
|
private readonly IRuleItemRepository _ruleItemRepository;
|
||||||
|
|
||||||
public ForewarningService(IRuleRepository ruleRepository
|
public ForewarningService(IRuleRepository ruleRepository
|
||||||
, IRuleFactorRepository ruleFactorRepository
|
, IRuleFactorRepository ruleFactorRepository
|
||||||
, IRuleItemRepository ruleItemRepository)
|
, IRuleItemRepository ruleItemRepository)
|
||||||
|
|||||||
@ -95,7 +95,6 @@ public class KpiAreaService : ApplicationService
|
|||||||
if (input.Id <= 0)
|
if (input.Id <= 0)
|
||||||
return new UnifyResultDto(false, "id不能为空");
|
return new UnifyResultDto(false, "id不能为空");
|
||||||
|
|
||||||
//todo 测试不存在id的情况
|
|
||||||
var areaInfo = await _ruleAreaRepository.GetAreaInfoById(input.Id);
|
var areaInfo = await _ruleAreaRepository.GetAreaInfoById(input.Id);
|
||||||
if (areaInfo == null)
|
if (areaInfo == null)
|
||||||
return new UnifyResultDto(false, "未找到该区域信息");
|
return new UnifyResultDto(false, "未找到该区域信息");
|
||||||
|
|||||||
@ -16,9 +16,5 @@ public class RuleTrackStateModel
|
|||||||
/// Gets or sets the user to notify.
|
/// Gets or sets the user to notify.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NotifyUser { get; set; }
|
public string NotifyUser { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the notification template.
|
|
||||||
/// </summary>
|
|
||||||
public string NotifyTemplate { get; set; }
|
|
||||||
}
|
}
|
||||||
@ -4,17 +4,35 @@ namespace SJZY.Track.Domain.Dtos.Forewarning;
|
|||||||
|
|
||||||
public class AddRuleAreaInfoRequest
|
public class AddRuleAreaInfoRequest
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 国家名称,必填项。
|
||||||
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public string Country { get; set; }
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? Province { get; set; }
|
public string? Province { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市名称,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? City { get; set; }
|
public string? City { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 左侧邮政编码,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? LeftPostCode { get; set; }
|
public string? LeftPostCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 右侧邮政编码,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? RightPostCode { get; set; }
|
public string? RightPostCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 区域ID,必填项。
|
||||||
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public int AreaId { get; set; }
|
public int AreaId { get; set; }
|
||||||
}
|
}
|
||||||
@ -2,6 +2,9 @@ namespace SJZY.Track.Domain.Dtos.Forewarning;
|
|||||||
|
|
||||||
public class ModifyTimelinessRequest
|
public class ModifyTimelinessRequest
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 规则详情中的时效相关信息
|
||||||
|
/// </summary>
|
||||||
public List<TimelinessDto> Items { get; set; }
|
public List<TimelinessDto> Items { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -10,6 +13,9 @@ public class ModifyTimelinessRequest
|
|||||||
public int RuleId { get; set; }
|
public int RuleId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 规则详情时效
|
||||||
|
/// </summary>
|
||||||
public class TimelinessDto
|
public class TimelinessDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -28,7 +34,7 @@ public class TimelinessDto
|
|||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 规则id
|
/// 规则详情id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
}
|
}
|
||||||
@ -2,5 +2,8 @@ namespace SJZY.Track.Domain.Dtos.Forewarning;
|
|||||||
|
|
||||||
public class QueryAreaInfoRequest: PageInfoInput
|
public class QueryAreaInfoRequest: PageInfoInput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 区域id
|
||||||
|
/// </summary>
|
||||||
public int AreaId { get; set; }
|
public int AreaId { get; set; }
|
||||||
}
|
}
|
||||||
@ -2,21 +2,39 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
|
|
||||||
namespace SJZY.Track.Domain.Dtos.Forewarning;
|
namespace SJZY.Track.Domain.Dtos.Forewarning;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新规则区域信息请求
|
||||||
|
/// </summary>
|
||||||
public class UpdateRuleAreaInfoRequest
|
public class UpdateRuleAreaInfoRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分区信息id
|
/// 区域信息ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 国家名称,必填项。
|
||||||
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public string Country { get; set; }
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? Province { get; set; }
|
public string? Province { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市名称,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? City { get; set; }
|
public string? City { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 左侧邮政编码,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? LeftPostCode { get; set; }
|
public string? LeftPostCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 右侧邮政编码,可为空。
|
||||||
|
/// </summary>
|
||||||
public string? RightPostCode { get; set; }
|
public string? RightPostCode { get; set; }
|
||||||
}
|
}
|
||||||
@ -11,7 +11,7 @@ public class UpdateRuleAreaRequest
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分区id
|
/// 区域id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user