fmt&clear

This commit is contained in:
xiaolipro 2024-08-20 14:34:59 +08:00
parent 4ddad722e1
commit 3471c1eade
313 changed files with 808 additions and 758 deletions

View File

@ -1,233 +1,69 @@
# Top-most EditorConfig file
root = true root = true
# EditorConfig is awesome: https://EditorConfig.org
# Please feel free to update it (by considering the code style of ABP Team).
# top-most EditorConfig file
# All files
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = crlf end_of_line = crlf
trim_trailing_whitespace = false insert_final_newline = true
insert_final_newline = false trim_trailing_whitespace = true
# C# files
[*.cs]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
tab_width = 4 # 新行前的成员初始化
[*.json]
indent_size = 2
[*.cs]
# diagnostic规则配置 各个项目自己定义
# CS8618 表示在定义非空属性时,没有在构造函数、初始化器或默认值中对其进行初始化。
dotnet_diagnostic.cs8618.severity = none
# CS8618 表示方法的返回类型的可空性与目标委托的不匹配。
dotnet_diagnostic.cs8613.severity = none
# CS1591 表示缺少XML注释
dotnet_diagnostic.cs1591.severity = none
#Namespace设置
csharp_style_namespace_declarations = file_scoped:silent
# 设置每行的最大列数
max_line_length = 120
#缩进switch case内容
csharp_indent_case_contents = true
#缩进switch标签
csharp_indent_switch_labels = true
#Formatting - new line options
#在新行上放置catch语句
csharp_new_line_before_catch = true
#在新行上放置else语句
csharp_new_line_before_else = true
#要求对象初始化器的成员在单独的行上
csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_object_initializers = true
#要求在对象集合数组初始化器、方法、控制块、类型和lambda表达式的花括号前换行(也称为“Allman”风格) # 使用 var 关键字
csharp_new_line_before_open_brace = object_collection_array_initializers, methods, control_blocks, types, lambdas
#Formatting - organize using options
#按字母顺序排序System.*using指令,并将它们放在其他using指令之前
dotnet_sort_system_directives_first = true
#Formatting - spacing options
#要求在类型转换和值之间不留空格
csharp_space_after_cast = false
#在类型声明中要求在基类或接口的冒号前留空格
csharp_space_after_colon_in_inheritance_clause = true
#在控制流语句(如for循环)中的关键字后要求留空格
csharp_space_after_keywords_in_control_flow_statements = true
#在类型声明中要求在基类或接口的冒号前留空格
csharp_space_before_colon_in_inheritance_clause = true
#删除空参数列表括号内的空格
csharp_space_between_method_call_empty_parameter_list_parentheses = false
#删除方法调用名称和左括号之间的空格
csharp_space_between_method_call_name_and_opening_parenthesis = false
#在方法调用的左括号后和右括号前不要留空格
csharp_space_between_method_call_parameter_list_parentheses = false
#删除方法声明中空参数列表括号内的空格
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
#在方法声明参数列表的左括号后和右括号前留空格
csharp_space_between_method_declaration_parameter_list_parentheses = false
#Formatting - wrapping options
#将代码块留在单行上
csharp_preserve_single_line_blocks = true
#Style - Code block preferences
#即使是单行代码也使用花括号
csharp_prefer_braces = true:suggestion
#Style - expression bodied member options
#构造函数使用块体
csharp_style_expression_bodied_constructors = false:suggestion
#方法使用块体
csharp_style_expression_bodied_methods = false:suggestion
#属性使用表达式体
csharp_style_expression_bodied_properties = true:suggestion
#Style - expression level options
#尽可能在方法调用的参数列表中内联声明out变量
csharp_style_inlined_variable_declaration = true:suggestion
#对于有关键字表示的类型,成员访问表达式使用语言关键字而不是类型名
dotnet_style_predefined_type_for_member_access = true:suggestion
#Style - Expression-level preferences
#使用default而不是default(T)
csharp_prefer_simple_default_expression = true:suggestion
#尽可能使用对象初始化器初始化对象
dotnet_style_object_initializer = true:suggestion
#使用推断的元组元素名称
dotnet_style_prefer_inferred_tuple_names = true:suggestion
#Style - implicit and explicit types
#在所有情况下都使用var代替显式类型,除非被其他代码样式规则覆盖
csharp_style_var_elsewhere = true:suggestion
#使用var声明内置系统类型(如int)的变量
csharp_style_var_for_built_in_types = true:suggestion csharp_style_var_for_built_in_types = true:suggestion
#当类型已经在声明表达式的右侧提及时,使用var
csharp_style_var_when_type_is_apparent = true:suggestion csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# 命名约定
dotnet_naming_rule.private_members_should_be_camel_case.severity = suggestion
dotnet_naming_rule.private_members_should_be_camel_case.symbols = private_members
dotnet_naming_rule.private_members_should_be_camel_case.style = camel_case
#Style - language keyword and framework type options dotnet_naming_symbols.private_members.applicable_accessibilities = private
dotnet_naming_symbols.private_members.applicable_kinds = field
dotnet_naming_symbols.private_members.required_modifiers = readonly
#对于有关键字表示的类型,局部变量、方法参数和类成员使用语言关键字而不是类型名 dotnet_naming_style.camel_case.capitalization = camel_case
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion dotnet_naming_style.camel_case.required_prefix = _
dotnet_naming_style.camel_case.required_suffix =
#Style - Miscellaneous preferences # 空格和换行
csharp_space_after_cast = true
#使用局部函数而不是匿名函数 csharp_space_after_colon_in_inheritance_clause = true
csharp_style_pattern_local_over_anonymous_function = true:suggestion
#Style - modifier options
#除了公共接口成员外,偏好声明访问修饰符。这目前不会与“总是”不同,并且将在C#添加默认接口方法时作为未来的保护措施。
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
#Style - Modifier preferences
#当此规则设置为修饰符列表时,偏好指定的顺序。
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
#Style - Pattern matching
#使用模式匹配而不是带有类型转换的is表达式
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
#Style - qualification options
#偏好字段前不加this. 或 Me.(在Visual Basic中)
dotnet_style_qualification_for_field = false:suggestion
#偏好方法前不加this. 或 Me.(在Visual Basic中)
dotnet_style_qualification_for_method = false:suggestion
#偏好属性前不加this. 或 Me.(在Visual Basic中)
dotnet_style_qualification_for_property = false:suggestion
# Microsoft .NET properties
csharp_style_prefer_utf8_string_literals = true:suggestion
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
dotnet_style_qualification_for_event = false:suggestion
# ReSharper properties
resharper_autodetect_indent_settings = true
resharper_braces_for_for = not_required
resharper_braces_for_foreach = not_required
resharper_braces_for_ifelse = not_required_for_both
resharper_braces_for_while = not_required
resharper_braces_redundant = true
resharper_csharp_keep_existing_enum_arrangement = false
resharper_formatter_off_tag = @formatter:off
resharper_formatter_on_tag = @formatter:on
resharper_formatter_tags_enabled = true
resharper_keep_existing_declaration_block_arrangement = false
resharper_keep_existing_embedded_block_arrangement = false
resharper_use_heuristics_for_body_style = true
resharper_use_indent_from_vs = false
# ReSharper inspection severities
resharper_arrange_accessor_owner_body_highlighting = suggestion
resharper_arrange_constructor_or_destructor_body_highlighting = none
resharper_arrange_method_or_operator_body_highlighting = none
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_arrange_type_member_modifiers_highlighting = hint
resharper_arrange_type_modifiers_highlighting = hint
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
resharper_built_in_type_reference_style_highlighting = hint
resharper_enforce_do_while_statement_braces_highlighting = none
resharper_enforce_fixed_statement_braces_highlighting = none
resharper_enforce_foreach_statement_braces_highlighting = none
resharper_enforce_for_statement_braces_highlighting = none
resharper_enforce_if_statement_braces_highlighting = none
resharper_enforce_lock_statement_braces_highlighting = none
resharper_enforce_using_statement_braces_highlighting = none
resharper_enforce_while_statement_braces_highlighting = none
resharper_mvc_action_not_resolved_highlighting = warning
resharper_mvc_area_not_resolved_highlighting = warning
resharper_mvc_controller_not_resolved_highlighting = warning
resharper_mvc_masterpage_not_resolved_highlighting = warning
resharper_mvc_partial_view_not_resolved_highlighting = warning
resharper_mvc_template_not_resolved_highlighting = warning
resharper_mvc_view_component_not_resolved_highlighting = warning
resharper_mvc_view_component_view_not_resolved_highlighting = warning
resharper_mvc_view_not_resolved_highlighting = warning
resharper_razor_assembly_not_resolved_highlighting = warning
resharper_redundant_base_qualifier_highlighting = warning
resharper_remove_redundant_braces_highlighting = none
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = hint
resharper_suggest_var_or_type_simple_types_highlighting = hint
resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after csharp_space_around_binary_operators = before_and_after
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_before_open_square_bracket = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_empty_method_call_parentheses = false
csharp_space_between_empty_method_declaration_parentheses = false
# 花括号
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
# 缩进规则
csharp_indent_case_contents = true
csharp_indent_block_contents = true
csharp_indent_braces = false
# 其他设置
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# resharper兼容
# 对象初始化收缩问题 https://youtrack.jetbrains.com/issue/RSRP-486359
resharper_wrap_object_and_collection_initializer_style = chop_always
# 条件表达式花括号收缩问题
resharper_csharp_case_block_braces = next_line_shifted_2
resharper_indent_braces_inside_statement_conditions = false

View File

@ -10,7 +10,8 @@ public class GetTrackInput : OrderNosInfo
/// </summary> /// </summary>
private float? _timeZone; private float? _timeZone;
public float? TimeZone { public float? TimeZone
{
get => _timeZone ?? 8; get => _timeZone ?? 8;
set => _timeZone = value; set => _timeZone = value;
} }

View File

@ -1,5 +1,4 @@
using SJZY.Track.Application.Contract.Dtos.Forewarning; using SJZY.Track.Application.Contract.Dtos.Forewarning;
using SJZY.Track.Domain.Dtos.Forewarning;
namespace SJZY.Track.Application.Contract.Services; namespace SJZY.Track.Application.Contract.Services;

View File

@ -51,7 +51,7 @@ public class OrderAutoMapperProfile : Profile
string enumDescription = string.Empty; string enumDescription = string.Empty;
if (type == 1) if (type == 1)
{ {
TrackProblemType trackProblem = (TrackProblemType)value; // 将int值转换为枚举 TrackProblemType trackProblem = (TrackProblemType) value; // 将int值转换为枚举
if (trackProblem.GetDescription().IsNullOrWhiteSpace()) if (trackProblem.GetDescription().IsNullOrWhiteSpace())
enumDescription = ""; enumDescription = "";
else else
@ -59,7 +59,7 @@ public class OrderAutoMapperProfile : Profile
} }
else else
{ {
OrderType orderType = (OrderType)value; // 将int值转换为枚举 OrderType orderType = (OrderType) value; // 将int值转换为枚举
if (orderType.GetDescription().IsNullOrWhiteSpace()) if (orderType.GetDescription().IsNullOrWhiteSpace())
enumDescription = ""; enumDescription = "";
else else

View File

@ -1,4 +1,4 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using SJZY.Expand.ABP.Core.Logger; using SJZY.Expand.ABP.Core.Logger;
using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.Track.Application.Contract.Events; using SJZY.Track.Application.Contract.Events;

View File

@ -68,26 +68,39 @@ public class TrackPushCompletedEventHandler : ITransientDependency, ICapSubscrib
// tips:只有新增会影响推送进度? // tips:只有新增会影响推送进度?
if (log.OptionType != OptionType.新增.ToString()) return; if (log.OptionType != OptionType.新增.ToString()) return;
var order = new OrderEntity { Id = log.OrderId }; var order = new OrderEntity
{
Id = log.OrderId
};
/* /*
* 异常:最近一条推送是失败 * 异常:最近一条推送是失败
*/ */
if (!log.IsSuccess) if (!log.IsSuccess)
{ {
order.QuestionType = (int)TrackProblemType.Error; order.QuestionType = (int) TrackProblemType.Error;
order.LatestPushError = log.Message; order.LatestPushError = log.Message;
await _orderRepository.UpdateColumnAsync(order, x => new { x.QuestionType, x.LatestPushError }); await _orderRepository.UpdateColumnAsync(order, x => new
{
x.QuestionType,
x.LatestPushError
});
} }
else else
{ {
// 还原成正常态 // 还原成正常态
order.QuestionType = (int)TrackProblemType.None; order.QuestionType = (int) TrackProblemType.None;
order.LatestPushError = null; order.LatestPushError = null;
order.LatestPushTrackCode = log.TrackCode; order.LatestPushTrackCode = log.TrackCode;
order.LatestPushTime = log.CreateTime; order.LatestPushTime = log.CreateTime;
await _orderRepository.UpdateColumnAsync(order, await _orderRepository.UpdateColumnAsync(order,
x => new { x.LatestPushTrackCode, x.LatestPushTime, x.QuestionType, x.LatestPushError }); x => new
{
x.LatestPushTrackCode,
x.LatestPushTime,
x.QuestionType,
x.LatestPushError
});
} }
} }
} }

View File

@ -1,4 +1,4 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using Newtonsoft.Json; using Newtonsoft.Json;
using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.InterfaceRelay.Application.Contracts; using SJZY.InterfaceRelay.Application.Contracts;
@ -50,7 +50,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
@event.OrderIds.Contains(x.Id), @event.OrderIds.Contains(x.Id),
x => new OrderEntity x => new OrderEntity
{ {
Id = x.Id, OrderNo = x.OrderNo, LatestPushTrackCode = x.LatestPushTrackCode, OrderType = x.OrderType Id = x.Id,
OrderNo = x.OrderNo,
LatestPushTrackCode = x.LatestPushTrackCode,
OrderType = x.OrderType
}); });
if (orders.Count == 0) return; if (orders.Count == 0) return;
_orders = orders; _orders = orders;
@ -81,7 +84,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
{ {
foreach (var order in _orders) foreach (var order in _orders)
{ {
if (order.QuestionType == (int)TrackProblemType.Error) continue; // 系统不推异常单,只能人工操作 if (order.QuestionType == (int) TrackProblemType.Error) continue; // 系统不推异常单,只能人工操作
// 推送新增,需要根据上一次的推送 推断 本次推送 是否可行 // 推送新增,需要根据上一次的推送 推断 本次推送 是否可行
config = GetValidPushConfigAsync(_pushConfigs, order.LatestPushTrackCode, @event.TrackCode); config = GetValidPushConfigAsync(_pushConfigs, order.LatestPushTrackCode, @event.TrackCode);
if (config == null) continue; if (config == null) continue;
@ -218,7 +221,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
Extra = config.ExpandFieldsValue Extra = config.ExpandFieldsValue
}; };
var body = new TrackUpdateInput { OrderNo = log.OrderNo, }; var body = new TrackUpdateInput
{
OrderNo = log.OrderNo,
};
body.Data.Add(track); body.Data.Add(track);
log.PushContent = body.ToJson(); log.PushContent = body.ToJson();
@ -243,7 +249,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
Extra = config.ExpandFieldsValue Extra = config.ExpandFieldsValue
}; };
var body = new TrackPushInput { OrderNo = log.OrderNo, }; var body = new TrackPushInput
{
OrderNo = log.OrderNo,
};
body.Data.Add(track); body.Data.Add(track);
if (config.IsAllPush) if (config.IsAllPush)

View File

@ -49,7 +49,11 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
{ {
// 理论上小包在这不会分组 // 理论上小包在这不会分组
foreach (var group in linkedOrders.Where(x => x.OwnerOrderId == order.OrderId) foreach (var group in linkedOrders.Where(x => x.OwnerOrderId == order.OrderId)
.GroupBy(x => new { x.SubSystemId, x.CustomId })) .GroupBy(x => new
{
x.SubSystemId,
x.CustomId
}))
{ {
var nextEvent = @event.DeepCopy(); var nextEvent = @event.DeepCopy();
nextEvent.Visited.AddRange(orderIds); nextEvent.Visited.AddRange(orderIds);
@ -82,7 +86,9 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
var identifiers = group.Select(x => new OrderIdentifier var identifiers = group.Select(x => new OrderIdentifier
{ {
OrderId = x.OrderId, OrderNo = x.OrderNo, OrderType = x.OrderType, OrderId = x.OrderId,
OrderNo = x.OrderNo,
OrderType = x.OrderType,
}).ToList(); }).ToList();
var idx = 0; var idx = 0;
while (idx < identifiers.Count) while (idx < identifiers.Count)

View File

@ -1,4 +1,4 @@
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.Reflection;
using DotNetCore.CAP; using DotNetCore.CAP;
using DotNetCore.CAP.Diagnostics; using DotNetCore.CAP.Diagnostics;
@ -146,7 +146,9 @@ public class MySubscribeExecutor : ISubscribeExecutor
{ {
_options.FailedThresholdCallback?.Invoke(new FailedInfo _options.FailedThresholdCallback?.Invoke(new FailedInfo
{ {
ServiceProvider = _provider, MessageType = MessageType.Subscribe, Message = message.Origin ServiceProvider = _provider,
MessageType = MessageType.Subscribe,
Message = message.Origin
}); });
_logger.ConsumerExecutedAfterThreshold(message.DbId, _options.FailedRetryCount); _logger.ConsumerExecutedAfterThreshold(message.DbId, _options.FailedRetryCount);

View File

@ -32,7 +32,7 @@ public static class DateTimeHelper
public static string TimezoneFormat(double timezone, string format) public static string TimezoneFormat(double timezone, string format)
{ {
//时区是整数丢掉浮点数部分 //时区是整数丢掉浮点数部分
return format.Replace("hh", ((int)timezone).ToString()); return format.Replace("hh", ((int) timezone).ToString());
} }
/// <summary> /// <summary>

View File

@ -199,7 +199,7 @@ public class ForewarningHelper
foreach (var rule in rules) foreach (var rule in rules)
{ {
dynamic dynamicRule = new ExpandoObject(); dynamic dynamicRule = new ExpandoObject();
var dynamicRuleDict = (IDictionary<string, object?>)dynamicRule; var dynamicRuleDict = (IDictionary<string, object?>) dynamicRule;
dynamicRuleDict[nameof(Id)] = rule.Id; dynamicRuleDict[nameof(Id)] = rule.Id;
dynamicRuleDict[nameof(rule.StartTrackStatus)] = rule.StartTrackStatus; dynamicRuleDict[nameof(rule.StartTrackStatus)] = rule.StartTrackStatus;

View File

@ -116,7 +116,12 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
var order = await _orderRepository.GetFirstAsync(x => var order = await _orderRepository.GetFirstAsync(x =>
x.OrderType == attach.OrderType && x.OrderNo == orderNo, x.OrderType == attach.OrderType && x.OrderNo == orderNo,
x => new { x.Id, x.LatestPushTrackCode, x.CustomId }); x => new
{
x.Id,
x.LatestPushTrackCode,
x.CustomId
});
if (order == default) return; if (order == default) return;
var context = new TrackRefreshContext var context = new TrackRefreshContext
@ -246,7 +251,9 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
{ {
new OrderIdentifier new OrderIdentifier
{ {
OrderId = context.OrderId, OrderNo = context.OrderNo, OrderType = context.OrderType, OrderId = context.OrderId,
OrderNo = context.OrderNo,
OrderType = context.OrderType,
} }
}, },
TrackRefreshData = new TrackRefreshStruct TrackRefreshData = new TrackRefreshStruct
@ -398,7 +405,7 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
private Task<string?> GetPlaceByOrder(int trackValue, int orderId) private Task<string?> GetPlaceByOrder(int trackValue, int orderId)
{ {
Expression<Func<OrderEntity, string?>> resultExpression = Expression<Func<OrderEntity, string?>> resultExpression =
(TrackLocationValue)trackValue switch (TrackLocationValue) trackValue switch
{ {
TrackLocationValue.ArrivalPort => x => x.ArrivalPort, TrackLocationValue.ArrivalPort => x => x.ArrivalPort,
TrackLocationValue.ArriveCity => x => x.ArrivalCity, TrackLocationValue.ArriveCity => x => x.ArrivalCity,
@ -423,8 +430,8 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
string timezone = null; string timezone = null;
if (!string.IsNullOrEmpty(placeOrCode)) if (!string.IsNullOrEmpty(placeOrCode))
{ {
if (matchedContentConfig!.TrackZonePlaceValue.Value == (int)TrackLocationValue.ArrivalPort if (matchedContentConfig!.TrackZonePlaceValue.Value == (int) TrackLocationValue.ArrivalPort
|| matchedContentConfig!.TrackZonePlaceValue.Value == (int)TrackLocationValue.LeavePort) || matchedContentConfig!.TrackZonePlaceValue.Value == (int) TrackLocationValue.LeavePort)
{ {
timezone = await _timezoneQueries.GetPortTimezone(placeOrCode); timezone = await _timezoneQueries.GetPortTimezone(placeOrCode);
return DateTimeHelper.ConvertTimeZoneToFloat(timezone); return DateTimeHelper.ConvertTimeZoneToFloat(timezone);

View File

@ -59,7 +59,10 @@ public class ForewarningCacheService : IForewarningCacheService, ISingletonDepen
await RedisHelper.Client.DelAsync(WarningKey(subSystemId, customerId)); await RedisHelper.Client.DelAsync(WarningKey(subSystemId, customerId));
var eventModel = new ClearRulCacheEvent var eventModel = new ClearRulCacheEvent
{ {
Items = new List<RuleAreaBaseInfo>() { new RuleAreaBaseInfo(subSystemId, customerId) } Items = new List<RuleAreaBaseInfo>()
{
new RuleAreaBaseInfo(subSystemId, customerId)
}
}; };
await PublishEvent(eventModel); await PublishEvent(eventModel);
@ -74,7 +77,10 @@ public class ForewarningCacheService : IForewarningCacheService, ISingletonDepen
var willDelKeys = baseInfos.Select(val => WarningKey(val.SystemId, val.CustomerId)).ToArray(); var willDelKeys = baseInfos.Select(val => WarningKey(val.SystemId, val.CustomerId)).ToArray();
await RedisHelper.Client.DelAsync(willDelKeys); await RedisHelper.Client.DelAsync(willDelKeys);
await RedisHelper.Client.DelAsync(AreaKey(areaId)); await RedisHelper.Client.DelAsync(AreaKey(areaId));
var eventModel = new ClearRulCacheEvent { Items = baseInfos }; var eventModel = new ClearRulCacheEvent
{
Items = baseInfos
};
await PublishEvent(eventModel); await PublishEvent(eventModel);
} }

View File

@ -102,7 +102,11 @@ public class ForewarningNotifyService : IForewarningNotifyService, ITransientDep
{起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder {起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder
{清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder {清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder
*/ */
foreach (var group in notifyRules.GroupBy(x => new { x.NotifyMode, x.NotifyUserId })) foreach (var group in notifyRules.GroupBy(x => new
{
x.NotifyMode,
x.NotifyUserId
}))
{ {
var notifyContent = new StringBuilder(); var notifyContent = new StringBuilder();

View File

@ -77,7 +77,11 @@ public class ForewarningService : ApplicationService
} }
var statusList = await statusQuery.GetListAsync(x => x.SubSystemId == warning.SubSystemId, x => var statusList = await statusQuery.GetListAsync(x => x.SubSystemId == warning.SubSystemId, x =>
new IdWithNameDto { Id = x.Id, Name = x.Status }); new IdWithNameDto
{
Id = x.Id,
Name = x.Status
});
return ForewarningHelper.MapWarningSummary(warning, statusList); return ForewarningHelper.MapWarningSummary(warning, statusList);
} }

View File

@ -27,7 +27,12 @@ public partial class OrderService
public async Task<UnifyResultDto> LinkOrderAsync(LinkOrderInput input) public async Task<UnifyResultDto> LinkOrderAsync(LinkOrderInput input)
{ {
var order = await _orderRepository.GetFirstAsync(x => var order = await _orderRepository.GetFirstAsync(x =>
x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => new { x.Id, x.SubSystemId }); x.OrderType == input.OrderType && x.OrderNo == input.OrderNo,
x => new
{
x.Id,
x.SubSystemId
});
if (order == default) if (order == default)
{ {
throw new BusinessException(message: $"订单:{input.OrderNo}不存在"); throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
@ -97,7 +102,11 @@ public partial class OrderService
var tracks = await _trackDetailsRepository.GetListAsync(orderId); var tracks = await _trackDetailsRepository.GetListAsync(orderId);
// 补轨迹 // 补轨迹
foreach (var group in existedOrders.GroupBy(x => new { x.SubSystemId, x.CustomId })) foreach (var group in existedOrders.GroupBy(x => new
{
x.SubSystemId,
x.CustomId
}))
{ {
foreach (var track in tracks) foreach (var track in tracks)
{ {
@ -107,7 +116,12 @@ public partial class OrderService
CustomId = group.Key.CustomId, CustomId = group.Key.CustomId,
OrderIdentifiers = OrderIdentifiers =
group.Select(x => group.Select(x =>
new OrderIdentifier { OrderId = x.Id, OrderNo = x.OrderNo, OrderType = x.OrderType, }) new OrderIdentifier
{
OrderId = x.Id,
OrderNo = x.OrderNo,
OrderType = x.OrderType,
})
.ToArray(), .ToArray(),
TrackCode = track.TrackCode, TrackCode = track.TrackCode,
TrackPlace = track.TrackPlace, TrackPlace = track.TrackPlace,

View File

@ -42,7 +42,12 @@ public partial class OrderService : ApplicationService, IOrderService
// 订单已存在则视为更新 // 订单已存在则视为更新
await UpdateOrderAsync(input, order); await UpdateOrderAsync(input, order);
return new UnifyResultDto() { Code = "200", Msg = "操作成功", Data = "创建成功" }; return new UnifyResultDto()
{
Code = "200",
Msg = "操作成功",
Data = "创建成功"
};
} }
order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input); order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input);
@ -51,7 +56,12 @@ public partial class OrderService : ApplicationService, IOrderService
order.OrderFlights = ObjectMapper.Map<List<OrderFlightInfo>, List<OrderFlightEntity>>(input.FlightInfos); order.OrderFlights = ObjectMapper.Map<List<OrderFlightInfo>, List<OrderFlightEntity>>(input.FlightInfos);
await _orderRepository.CreateOrderAsync(order); await _orderRepository.CreateOrderAsync(order);
return new UnifyResultDto() { Code = "200", Msg = "操作成功", Data = "新增成功" }; return new UnifyResultDto()
{
Code = "200",
Msg = "操作成功",
Data = "新增成功"
};
} }
/// <summary> /// <summary>

View File

@ -56,9 +56,18 @@ public class TrackPullService : ApplicationService
foreach (var group in orders.GroupBy(x => foreach (var group in orders.GroupBy(x =>
new { x.ServiceProviderId, x.ServiceProviderName, x.SubSystemId, x.OrderType })) new
{ {
var data = new List<object>(group.Select(x => new TrackPullPayload { OrderNo = x.OrderNo })); x.ServiceProviderId,
x.ServiceProviderName,
x.SubSystemId,
x.OrderType
}))
{
var data = new List<object>(group.Select(x => new TrackPullPayload
{
OrderNo = x.OrderNo
}));
var serviceProviderCode = group.FirstOrDefault()!.ServiceProviderCode; var serviceProviderCode = group.FirstOrDefault()!.ServiceProviderCode;
var attach = Base64Helper.SerializeObject(group.Key); var attach = Base64Helper.SerializeObject(group.Key);
@ -123,9 +132,16 @@ public class TrackPullService : ApplicationService
var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode; var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode;
var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName; var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName;
foreach (var group in orders.GroupBy(x => new { x.SubSystemId, x.OrderType })) foreach (var group in orders.GroupBy(x => new
{ {
var data = new List<object>(group.Select(x => new TrackPullPayload { OrderNo = x.OrderNo })); x.SubSystemId,
x.OrderType
}))
{
var data = new List<object>(group.Select(x => new TrackPullPayload
{
OrderNo = x.OrderNo
}));
var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId, var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId,
serviceProviderName!, group.Key.SubSystemId, group.Key.OrderType)); serviceProviderName!, group.Key.SubSystemId, group.Key.OrderType));
var res = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( var res = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(

View File

@ -45,7 +45,12 @@ public class TrackPushService : ApplicationService
var orders = await _orderRepository.GetArrayAsync(x => var orders = await _orderRepository.GetArrayAsync(x =>
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo), x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo),
x => new { x.Id, x.SubSystemId, x.CustomId }); x => new
{
x.Id,
x.SubSystemId,
x.CustomId
});
if (!orders.Any()) if (!orders.Any())
{ {
@ -61,7 +66,11 @@ public class TrackPushService : ApplicationService
var name = userInfo.Data.UserName; var name = userInfo.Data.UserName;
foreach (var group in orders.GroupBy(x => new { x.SubSystemId, x.CustomId })) foreach (var group in orders.GroupBy(x => new
{
x.SubSystemId,
x.CustomId
}))
{ {
var trackPushEvent = new TrackPushEvent var trackPushEvent = new TrackPushEvent
{ {
@ -88,7 +97,10 @@ public class TrackPushService : ApplicationService
[HttpPost("Track/PushWarnForTask")] [HttpPost("Track/PushWarnForTask")]
public async Task<string> PushWarnForTaskAsync() public async Task<string> PushWarnForTaskAsync()
{ {
await _capPublisher.PublishAsync(GlobalConst.TrackPushWarning, new PushWarningEvent { PageSize = 1000 }); await _capPublisher.PublishAsync(GlobalConst.TrackPushWarning, new PushWarningEvent
{
PageSize = 1000
});
return "推送预警任务已启动"; return "推送预警任务已启动";
} }

View File

@ -74,7 +74,12 @@ public partial class TrackService : ApplicationService, ITrackService
@event.CustomId = order.CustomId; @event.CustomId = order.CustomId;
@event.OrderIdentifiers = new[] @event.OrderIdentifiers = new[]
{ {
new OrderIdentifier { OrderId = order.Id, OrderNo = order.OrderNo, OrderType = order.OrderType, } new OrderIdentifier
{
OrderId = order.Id,
OrderNo = order.OrderNo,
OrderType = order.OrderType,
}
}; };
@event.OperationMan = name; @event.OperationMan = name;
await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, @event); await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, @event);
@ -90,14 +95,22 @@ public partial class TrackService : ApplicationService, ITrackService
[HttpPost("Track/Delete")] [HttpPost("Track/Delete")]
public async Task<UnifyResultDto> DeleteTrackAsync(DeleteTrackInput input) public async Task<UnifyResultDto> DeleteTrackAsync(DeleteTrackInput input)
{ {
var order = await _orderRepository.GetFirstAsync(x => var order = await _orderRepository.GetFirstAsync(
x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => new { x.Id, x.SubSystemId }); x => x.OrderType == input.OrderType && x.OrderNo == input.OrderNo,
x => new
{
x.Id,
x.SubSystemId
});
if (order == default) if (order == default)
{ {
throw new BusinessException(message: $"订单:{input.OrderNo}不存在"); throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
} }
var codes = await _provideQueries.GetCanDeleteTrackCodesAsync(new List<int> { order.Id }, input.TrackCodes); var codes = await _provideQueries.GetCanDeleteTrackCodesAsync(new List<int>
{
order.Id
}, input.TrackCodes);
if (codes.Count == 0) if (codes.Count == 0)
{ {
@ -137,7 +150,12 @@ public partial class TrackService : ApplicationService, ITrackService
{ {
var orders = await _orderRepository.GetListAsync(x => var orders = await _orderRepository.GetListAsync(x =>
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo) x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo)
, x => new { x.Id, x.SubSystemId }); , x => new
{
x.Id,
x.SubSystemId
}
);
var codes = await _provideQueries.GetCanDeleteTrackCodesAsync( var codes = await _provideQueries.GetCanDeleteTrackCodesAsync(
orders.Select(x => x.Id).ToList(), input.TrackCodes orders.Select(x => x.Id).ToList(), input.TrackCodes
@ -190,7 +208,13 @@ public partial class TrackService : ApplicationService, ITrackService
var orders = await _orderRepository.GetListAsync(x => var orders = await _orderRepository.GetListAsync(x =>
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo), x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo),
x => new { x.Id, x.OrderNo, x.SubSystemId, x.CustomId }); x => new
{
x.Id,
x.OrderNo,
x.SubSystemId,
x.CustomId
});
var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync(); var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync();
if (userInfo.Code != "200" || userInfo.Data is null) if (userInfo.Code != "200" || userInfo.Data is null)
@ -201,7 +225,11 @@ public partial class TrackService : ApplicationService, ITrackService
var name = userInfo.Data.UserName; var name = userInfo.Data.UserName;
foreach (var group in orders.GroupBy(x => new { x.SubSystemId, x.CustomId })) foreach (var group in orders.GroupBy(x => new
{
x.SubSystemId,
x.CustomId
}))
{ {
// 新增/更新轨迹 // 新增/更新轨迹
var @event = new TrackUpsertEvent var @event = new TrackUpsertEvent
@ -211,7 +239,9 @@ public partial class TrackService : ApplicationService, ITrackService
OrderIdentifiers = OrderIdentifiers =
group.Select(order => new OrderIdentifier group.Select(order => new OrderIdentifier
{ {
OrderId = order.Id, OrderNo = order.OrderNo, OrderType = input.OrderType, OrderId = order.Id,
OrderNo = order.OrderNo,
OrderType = input.OrderType,
}).ToArray(), }).ToArray(),
IsAdd = input.IsAdd, IsAdd = input.IsAdd,
TrackCode = input.TrackCode, TrackCode = input.TrackCode,

View File

@ -129,22 +129,18 @@ public class TrackContentService : ApplicationService
switch (input.Options) switch (input.Options)
{ {
case OptionTypeNoNull.新增: case OptionTypeNoNull.新增:
{
var trackContentMapEntity = ObjectMapper.Map<EditTrackContentMapInput, TrackContentMapEntity>(input); var trackContentMapEntity = ObjectMapper.Map<EditTrackContentMapInput, TrackContentMapEntity>(input);
await _trackContentRepository.InsertMapAsync(trackContentMapEntity); await _trackContentRepository.InsertMapAsync(trackContentMapEntity);
}
break; break;
case OptionTypeNoNull.修改: case OptionTypeNoNull.修改:
{
var oldTrackContentMapEntity = await _trackContentRepository.GetMapByIdAsync(input.Id!.Value) ?? var oldTrackContentMapEntity = await _trackContentRepository.GetMapByIdAsync(input.Id!.Value) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
ObjectMapper.Map(input, oldTrackContentMapEntity); ObjectMapper.Map(input, oldTrackContentMapEntity);
await _trackContentRepository.UpdateMapAsync(oldTrackContentMapEntity); await _trackContentRepository.UpdateMapAsync(oldTrackContentMapEntity);
}
break; break;
case OptionTypeNoNull.删除: case OptionTypeNoNull.删除:
@ -242,13 +238,18 @@ public class TrackContentService : ApplicationService
if (templateEntity.SubSystemId != input.SubSystemId || templateEntity.Code != input.Code) if (templateEntity.SubSystemId != input.SubSystemId || templateEntity.Code != input.Code)
{ {
await _trackContentRepository.UpdateMapAsync( await _trackContentRepository.UpdateMapAsync(
x => new TrackContentMapEntity { SubSystemId = input.SubSystemId, TrackContentCode = input.Code }, x => new TrackContentMapEntity
{
SubSystemId = input.SubSystemId,
TrackContentCode = input.Code
},
x => x.TrackContentId == input.Id); x => x.TrackContentId == input.Id);
await _trackContentRepository.UpdateMapAsync( await _trackContentRepository.UpdateMapAsync(
x => new TrackContentMapEntity x => new TrackContentMapEntity
{ {
MapSubSystemId = input.SubSystemId, MapTrackContentCode = input.Code MapSubSystemId = input.SubSystemId,
MapTrackContentCode = input.Code
}, x => x.MapTrackContentId == input.Id); }, x => x.MapTrackContentId == input.Id);
} }

View File

@ -66,7 +66,10 @@ public class TrackOrderService : ApplicationService
order.IsCompleted = input.IsCompleted; order.IsCompleted = input.IsCompleted;
return await _orderRepository.UpdateColumnAsync(order, x => new { x.IsCompleted }); return await _orderRepository.UpdateColumnAsync(order, x => new
{
x.IsCompleted
});
} }
/// <summary> /// <summary>
@ -81,8 +84,8 @@ public class TrackOrderService : ApplicationService
return new GetTrackCounterOutput return new GetTrackCounterOutput
{ {
TotalCount = counts.Sum(x => x.Count), TotalCount = counts.Sum(x => x.Count),
ErrorCount = counts.FirstOrDefault(x => x.ProblemType == (int)TrackProblemType.Error)?.Count ?? 0, ErrorCount = counts.FirstOrDefault(x => x.ProblemType == (int) TrackProblemType.Error)?.Count ?? 0,
WarnCount = counts.FirstOrDefault(x => x.ProblemType == (int)TrackProblemType.Warn)?.Count ?? 0, WarnCount = counts.FirstOrDefault(x => x.ProblemType == (int) TrackProblemType.Warn)?.Count ?? 0,
}; };
} }
@ -100,8 +103,8 @@ public class TrackOrderService : ApplicationService
res.ForEach(x => res.ForEach(x =>
{ {
int hours = (int)x.TrackTimeZone; // 提取整数部分作为小时 int hours = (int) x.TrackTimeZone; // 提取整数部分作为小时
int minutes = (int)((x.TrackTimeZone - hours) * 60); // 将小数部分乘以 60 转换为分钟 int minutes = (int) ((x.TrackTimeZone - hours) * 60); // 将小数部分乘以 60 转换为分钟
x.TrackGTMTimeZone = x.TrackGTMTimeZone =
$"GTM {(x.TrackTimeZone >= 0 ? "+" : "-")}{new TimeSpan(hours, minutes, 0).ToString().RemovePostFix(":00")}"; $"GTM {(x.TrackTimeZone >= 0 ? "+" : "-")}{new TimeSpan(hours, minutes, 0).ToString().RemovePostFix(":00")}";
}); });
@ -166,8 +169,8 @@ public class TrackOrderService : ApplicationService
else else
{ {
// 将小数形式的小时转换为时区偏移量 // 将小数形式的小时转换为时区偏移量
int hours = (int)a.TrackTimeZoneValue; // 提取整数部分作为小时 int hours = (int) a.TrackTimeZoneValue; // 提取整数部分作为小时
int minutes = (int)((a.TrackTimeZoneValue - hours) * 60); // 将小数部分乘以 60 转换为分钟 int minutes = (int) ((a.TrackTimeZoneValue - hours) * 60); // 将小数部分乘以 60 转换为分钟
TimeSpan offset = new TimeSpan(hours, minutes, 0); TimeSpan offset = new TimeSpan(hours, minutes, 0);
string timeZoneStr = offset.ToString(); string timeZoneStr = offset.ToString();
string flag = a.TrackTimeZoneValue > 0f ? "+" : ""; string flag = a.TrackTimeZoneValue > 0f ? "+" : "";

View File

@ -1,4 +1,4 @@
using System.Linq.Expressions; using System.Linq.Expressions;
using SJZY.Expand.ABP.Core; using SJZY.Expand.ABP.Core;
using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Contract.Dtos.TrackPull;
using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Contract.Services;
@ -29,7 +29,9 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
return await _trackPullConfigRepository.GetListAsync(x => true, return await _trackPullConfigRepository.GetListAsync(x => true,
x => new TrackPullConfigDto x => new TrackPullConfigDto
{ {
SubSystemId = x.SubSystemId, ServiceProviderId = x.ServiceProviderId, PullInterval = x.PullInterval SubSystemId = x.SubSystemId,
ServiceProviderId = x.ServiceProviderId,
PullInterval = x.PullInterval
}); });
} }

View File

@ -1,4 +1,4 @@
using System.Linq.Expressions; using System.Linq.Expressions;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.Localization;
using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Expand.ABP.Core.PublicMethords;
@ -224,7 +224,8 @@ public class TrackPullService : ApplicationService
case OptionTypeNoNull.修改: case OptionTypeNoNull.修改:
{ {
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id!.Value) ?? var oldTrackPullContentEntity =
await _trackPullConfigRepository.GetContentByIdAsync(input.Id!.Value) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
ObjectMapper.Map(input, oldTrackPullContentEntity); ObjectMapper.Map(input, oldTrackPullContentEntity);
@ -237,7 +238,8 @@ public class TrackPullService : ApplicationService
case OptionTypeNoNull.删除: case OptionTypeNoNull.删除:
{ {
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id!.Value) ?? var oldTrackPullContentEntity =
await _trackPullConfigRepository.GetContentByIdAsync(input.Id!.Value) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.Id == input.Id); await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.Id == input.Id);

View File

@ -1,4 +1,4 @@
using SJZY.Expand.ABP.Core; using SJZY.Expand.ABP.Core;
using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Contract.Dtos.TrackPush;
using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Contract.Services;
using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate;

View File

@ -100,17 +100,14 @@ public class TrackPushService : ApplicationService
switch (input.Options) switch (input.Options)
{ {
case OptionTypeNoNull.新增: case OptionTypeNoNull.新增:
{
var trackPushEntity = ObjectMapper.Map<EditTrackPushConfigInput, TrackPushConfigEntity>(input); var trackPushEntity = ObjectMapper.Map<EditTrackPushConfigInput, TrackPushConfigEntity>(input);
await _trackPushConfigRepository.InsertReturnIdentityAsync(trackPushEntity); await _trackPushConfigRepository.InsertReturnIdentityAsync(trackPushEntity);
await _trackPushCacheService.SetPushContentConfigsAsync(trackPushEntity.SubSystemId, await _trackPushCacheService.SetPushContentConfigsAsync(trackPushEntity.SubSystemId,
trackPushEntity.CustomId); trackPushEntity.CustomId);
}
break; break;
case OptionTypeNoNull.修改: case OptionTypeNoNull.修改:
{
var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
@ -118,18 +115,15 @@ public class TrackPushService : ApplicationService
await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity); await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity);
await _trackPushCacheService.SetPushContentConfigsAsync(oldTrackPushEntity.SubSystemId, await _trackPushCacheService.SetPushContentConfigsAsync(oldTrackPushEntity.SubSystemId,
oldTrackPushEntity.CustomId); oldTrackPushEntity.CustomId);
}
break; break;
case OptionTypeNoNull.删除: case OptionTypeNoNull.删除:
{
var entity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? var entity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id); await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id);
await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id); await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id);
await _trackPushCacheService.SetPushContentConfigsAsync(entity.SubSystemId, entity.CustomId); await _trackPushCacheService.SetPushContentConfigsAsync(entity.SubSystemId, entity.CustomId);
}
break; break;
default: default:

View File

@ -153,15 +153,13 @@ public class TrackTemplateService : ApplicationService
var entity = await _trackTemplateRepository.GetContentByIdAsync(input.Id!.Value) ?? var entity = await _trackTemplateRepository.GetContentByIdAsync(input.Id!.Value) ??
throw new BusinessException(message: _stringLocalizer["NotFindData"]); throw new BusinessException(message: _stringLocalizer["NotFindData"]);
using (var ts = TransactionScopeHelper.Create()) using var ts = TransactionScopeHelper.Create();
{
await _trackTemplateRepository.SoftDeleteContentAsync(input.Id!.Value); await _trackTemplateRepository.SoftDeleteContentAsync(input.Id!.Value);
await _trackTemplateRepository.UpdateContentAsync(x => x.Sort == x.Sort - 1, await _trackTemplateRepository.UpdateContentAsync(x => x.Sort == x.Sort - 1,
x => x.TrackTemplateId == entity.TrackTemplateId && x.Sort > entity.Sort); x => x.TrackTemplateId == entity.TrackTemplateId && x.Sort > entity.Sort);
ts.Complete(); ts.Complete();
}
break; break;
} }

View File

@ -1,4 +1,4 @@
using FluentValidation; using FluentValidation;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.Localization;
using SJZY.Track.Application.Contract.Dtos.TrackContents; using SJZY.Track.Application.Contract.Dtos.TrackContents;

View File

@ -1,4 +1,4 @@
using FluentValidation; using FluentValidation;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.Localization;
using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Contract.Dtos.TrackPull;

View File

@ -1,4 +1,4 @@
using FluentValidation; using FluentValidation;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.Localization;
using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Contract.Dtos.TrackPull;

View File

@ -1,4 +1,4 @@
using FluentValidation; using FluentValidation;
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.Localization;
using SJZY.Track.Application.Contract.Dtos.TrackTemplates; using SJZY.Track.Application.Contract.Dtos.TrackTemplates;

View File

@ -1,4 +1,4 @@
using SJZY.Track.Domain.Dtos.TrackContents; using SJZY.Track.Domain.Dtos.TrackContents;
using SJZY.Track.Domain.Dtos.TrackTemplate; using SJZY.Track.Domain.Dtos.TrackTemplate;
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate; namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;

View File

@ -1,5 +1,4 @@
using SJZY.Expand.ElasticSearch.Services; using SJZY.Expand.ElasticSearch.Services;
using SJZY.Track.Domain.Dtos.TrackDetails;
namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;

View File

@ -1,4 +1,4 @@
using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPull; using SJZY.Track.Domain.Dtos.TrackPull;
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate; namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;

View File

@ -1,4 +1,4 @@
using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.Dtos.TrackPush;
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate; namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;

View File

@ -1,6 +1,5 @@
namespace SJZY.Track.Domain.Dtos.Forewarning; namespace SJZY.Track.Domain.Dtos.Forewarning;
public class ClearRulCacheEvent public class ClearRulCacheEvent
{ {
public List<RuleAreaBaseInfo> Items { get; set; } public List<RuleAreaBaseInfo> Items { get; set; }

View File

@ -2,9 +2,6 @@ namespace SJZY.Track.Domain.Dtos.Forewarning;
public class RuleAreaBaseInfo public class RuleAreaBaseInfo
{ {
public int SystemId { get; set; }
public int CustomerId { get; set; }
public RuleAreaBaseInfo() public RuleAreaBaseInfo()
{ {
} }
@ -14,4 +11,7 @@ public class RuleAreaBaseInfo
SystemId = systemId; SystemId = systemId;
CustomerId = customerId; CustomerId = customerId;
} }
public int SystemId { get; set; }
public int CustomerId { get; set; }
} }

View File

@ -1,4 +1,4 @@
using System.ComponentModel; using System.ComponentModel;
namespace SJZY.Track.Domain.Enums; namespace SJZY.Track.Domain.Enums;

View File

@ -1,4 +1,4 @@
using System.ComponentModel; using System.ComponentModel;
namespace SJZY.Track.Domain.Enums; namespace SJZY.Track.Domain.Enums;

View File

@ -1,5 +1,3 @@
using SJZY.Track.Domain.Dtos.Common;
namespace SJZY.Track.Domain.Queries; namespace SJZY.Track.Domain.Queries;
public interface ITimezoneQueries public interface ITimezoneQueries

View File

@ -11,7 +11,10 @@ public class TransactionHelper
public static TransactionScope GetReadCommitted() public static TransactionScope GetReadCommitted()
{ {
return new TransactionScope(TransactionScopeOption.Required, return new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }, new TransactionOptions
{
IsolationLevel = IsolationLevel.ReadCommitted
},
TransactionScopeAsyncFlowOption.Enabled); TransactionScopeAsyncFlowOption.Enabled);
} }
} }

View File

@ -31,7 +31,11 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
return await Context.Queryable<OrderEntity>() return await Context.Queryable<OrderEntity>()
.LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId) .LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
.Where(a => a.OrderType == orderType && orderNumbers.Contains(a.OrderNo)) .Where(a => a.OrderType == orderType && orderNumbers.Contains(a.OrderNo))
.Select((a, b) => new OrderTemplateLinkDto { OrderNo = a.OrderNo, TemplateId = b.TrackTemplateId }) .Select((a, b) => new OrderTemplateLinkDto
{
OrderNo = a.OrderNo,
TemplateId = b.TrackTemplateId
})
.ToListAsync(); .ToListAsync();
} }
@ -45,7 +49,10 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
.OrderBy((a, b) => b.Sort) .OrderBy((a, b) => b.Sort)
.Select((a, b, c) => new OrderedTrackCodeDto .Select((a, b, c) => new OrderedTrackCodeDto
{ {
TemplateId = a.Id, ShowOrigin = a.ShowOrigin, Code = c.Code, IsExternal = b.IsExternal TemplateId = a.Id,
ShowOrigin = a.ShowOrigin,
Code = c.Code,
IsExternal = b.IsExternal
}) })
.ToListAsync(); .ToListAsync();
} }
@ -80,7 +87,11 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
.LeftJoin<TrackContentEntity>((x, a, b) => a.TrackContentId == b.Id) .LeftJoin<TrackContentEntity>((x, a, b) => a.TrackContentId == b.Id)
.Where((x, a, b) => orderIds.Contains(x.OrderId) .Where((x, a, b) => orderIds.Contains(x.OrderId)
&& trackCodes.Contains(b.Code) && a.IsCanDelete) && trackCodes.Contains(b.Code) && a.IsCanDelete)
.Select((x, a, b) => new CanDeleteTrackCodeVO { OrderId = x.OrderId, TrackCode = b.Code }) .Select((x, a, b) => new CanDeleteTrackCodeVO
{
OrderId = x.OrderId,
TrackCode = b.Code
})
.ToListAsync(); .ToListAsync();
} }
@ -144,7 +155,9 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
.Where((a, b) => orderIds.Contains(a.Id) && !a.IsCompleted) .Where((a, b) => orderIds.Contains(a.Id) && !a.IsCompleted)
.Select((a, b) => new OrderTransportDto .Select((a, b) => new OrderTransportDto
{ {
OrderId = a.Id, ServiceProviderId = b.ServiceProviderId, SubSystemId = a.SubSystemId OrderId = a.Id,
ServiceProviderId = b.ServiceProviderId,
SubSystemId = a.SubSystemId
}) })
.ToListAsync(); .ToListAsync();
} }

View File

@ -80,7 +80,11 @@ public class TimezoneQueries : ITimezoneQueries, ISugarRepository, ITransientDep
private Task<CityTimezoneDto> GetTimezoneByCityName(string cityEnName) private Task<CityTimezoneDto> GetTimezoneByCityName(string cityEnName)
{ {
return Context.Queryable<VCityEntity>().Where(val => !val.IsDeleted && val.EnName == cityEnName) return Context.Queryable<VCityEntity>().Where(val => !val.IsDeleted && val.EnName == cityEnName)
.Select(val => new CityTimezoneDto() { CityEnName = val.EnName, Timezone = val.TimeZone }) .Select(val => new CityTimezoneDto()
{
CityEnName = val.EnName,
Timezone = val.TimeZone
})
.FirstAsync(); .FirstAsync();
} }
@ -89,7 +93,11 @@ public class TimezoneQueries : ITimezoneQueries, ISugarRepository, ITransientDep
return Context.Queryable<VCityEntity>() return Context.Queryable<VCityEntity>()
.InnerJoin<VAirportEntity>((city, airport) => city.Id == airport.CityId) .InnerJoin<VAirportEntity>((city, airport) => city.Id == airport.CityId)
.Where((city, airport) => !airport.IsDeleted && !city.IsDeleted && airport.Code == airCode) .Where((city, airport) => !airport.IsDeleted && !city.IsDeleted && airport.Code == airCode)
.Select((city, airport) => new PortTimezoneDto() { PortCode = airport.Code, Timezone = city.TimeZone }) .Select((city, airport) => new PortTimezoneDto()
{
PortCode = airport.Code,
Timezone = city.TimeZone
})
.FirstAsync(); .FirstAsync();
} }
} }

View File

@ -1,4 +1,4 @@
using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.OrderAggregate;
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
using SJZY.Track.Domain.Dtos.Order; using SJZY.Track.Domain.Dtos.Order;
using SJZY.Track.Domain.Enums; using SJZY.Track.Domain.Enums;
@ -38,7 +38,7 @@ public class TrackOrderQueries : ISugarRepository, ITrackOrderQueries,
.WhereIF(input.CustomerId > 0, (a, b, c) => a.CustomId == input.CustomerId) .WhereIF(input.CustomerId > 0, (a, b, c) => a.CustomId == input.CustomerId)
.WhereIF(input.TrackOrderType > 0, (a, b, c) => a.OrderType == input.TrackOrderType) .WhereIF(input.TrackOrderType > 0, (a, b, c) => a.OrderType == input.TrackOrderType)
.WhereIF(input.TabType > 0, (a, b, c) => a.QuestionType == input.TabType) .WhereIF(input.TabType > 0, (a, b, c) => a.QuestionType == input.TabType)
.WhereIF(input.TabType == (int)TrackProblemType.Warn, (a, b, c) => !a.IsCompleted) .WhereIF(input.TabType == (int) TrackProblemType.Warn, (a, b, c) => !a.IsCompleted)
.OrderByDescending((a, b, c) => a.CreateTime) .OrderByDescending((a, b, c) => a.CreateTime)
.Select((a, b, c) => new TrackOrderVO .Select((a, b, c) => new TrackOrderVO
{ {
@ -68,7 +68,12 @@ public class TrackOrderQueries : ISugarRepository, ITrackOrderQueries,
var trackTemplateList = await Context.Queryable<OrderTemplateEntity>() var trackTemplateList = await Context.Queryable<OrderTemplateEntity>()
.LeftJoin<TrackTemplateEntity>((a, b) => a.TrackTemplateId == b.Id) .LeftJoin<TrackTemplateEntity>((a, b) => a.TrackTemplateId == b.Id)
.Where((a, b) => orderIds.Contains(a.OrderId)) .Where((a, b) => orderIds.Contains(a.OrderId))
.Select((a, b) => new { a.OrderId, b.Name, TemplateId = b.Id }) .Select((a, b) => new
{
a.OrderId,
b.Name,
TemplateId = b.Id
})
.ToListAsync(); .ToListAsync();
pageList.List.ForEach(a => pageList.List.ForEach(a =>
{ {
@ -86,7 +91,11 @@ public class TrackOrderQueries : ISugarRepository, ITrackOrderQueries,
{ {
return await Context.Queryable<OrderEntity>() return await Context.Queryable<OrderEntity>()
.GroupBy(x => x.QuestionType) .GroupBy(x => x.QuestionType)
.Select(x => new GetTrackCounterVO { ProblemType = x.QuestionType, Count = SqlFunc.AggregateCount(1) }) .Select(x => new GetTrackCounterVO
{
ProblemType = x.QuestionType,
Count = SqlFunc.AggregateCount(1)
})
.ToListAsync(); .ToListAsync();
} }
} }

View File

@ -79,7 +79,11 @@ public class WarningQueries : ISugarRepository, IWarningQueries,
return Context.Queryable<WarningRuleEntity>() return Context.Queryable<WarningRuleEntity>()
.InnerJoin<WarningEntity>((a, b) => a.WarningId == b.Id) .InnerJoin<WarningEntity>((a, b) => a.WarningId == b.Id)
.Where((a, b) => b.IsEnable && a.AreaId == areaId) .Where((a, b) => b.IsEnable && a.AreaId == areaId)
.Select((a, b) => new RuleAreaBaseInfo { CustomerId = b.CustomerId, SystemId = b.SubSystemId }) .Select((a, b) => new RuleAreaBaseInfo
{
CustomerId = b.CustomerId,
SystemId = b.SubSystemId
})
.ToListAsync(); .ToListAsync();
} }
} }

View File

@ -24,7 +24,10 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
var idsString = string.Join(",", ids); var idsString = string.Join(",", ids);
return Context.Ado.ExecuteCommandAsync( return Context.Ado.ExecuteCommandAsync(
$"UPDATE `t_order` SET `DeficiencyTag` = @newValue ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})", $"UPDATE `t_order` SET `DeficiencyTag` = @newValue ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})",
new { newValue }); new
{
newValue
});
} }
public async Task UpdateOrderAsync(OrderEntity order) public async Task UpdateOrderAsync(OrderEntity order)
@ -32,7 +35,11 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
using var tran = TransactionHelper.GetReadCommitted(); using var tran = TransactionHelper.GetReadCommitted();
// 更新订单主表 // 更新订单主表
await UpdateAsync(order, x => new { x.CustomId, x.SubSystemId }); await UpdateAsync(order, x => new
{
x.CustomId,
x.SubSystemId
});
// 更新订单模板 // 更新订单模板
await Context.Deleteable<OrderTemplateEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync(); await Context.Deleteable<OrderTemplateEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync();
@ -70,7 +77,11 @@ SET `b`.`QuestionType` = CASE
WHEN `b`.`LatestPushTime` < DATE_SUB(NOW(), INTERVAL 12 HOUR) THEN 2 WHEN `b`.`LatestPushTime` < DATE_SUB(NOW(), INTERVAL 12 HOUR) THEN 2
ELSE 0 END ELSE 0 END
WHERE `b`.`IsCompleted` = 0 AND `b`.`QuestionType` != 1 AND `b`.`CreateTime` < @createTime WHERE `b`.`IsCompleted` = 0 AND `b`.`QuestionType` != 1 AND `b`.`CreateTime` < @createTime
AND `a`.`IsDeleted` = 0 AND `b`.`IsDeleted` = 0 limit @pageSize", new { pageSize, createTime }); AND `a`.`IsDeleted` = 0 AND `b`.`IsDeleted` = 0 limit @pageSize", new
{
pageSize,
createTime
});
} }
/// <summary> /// <summary>
@ -85,7 +96,12 @@ AND `a`.`IsDeleted` = 0 AND `b`.`IsDeleted` = 0 limit @pageSize", new { pageSize
.Where((b) => !b.IsCompleted .Where((b) => !b.IsCompleted
&& b.QuestionType != 1 && b.QuestionType != 1
&& !b.IsDeleted) && !b.IsDeleted)
.Select(b => new { b.LatestPushTime, b.Id, b.QuestionType }) .Select(b => new
{
b.LatestPushTime,
b.Id,
b.QuestionType
})
.ToPageListAsync(pageindex, pageSize); .ToPageListAsync(pageindex, pageSize);
var latestPushTimeIds = new List<int>(); var latestPushTimeIds = new List<int>();
@ -110,7 +126,10 @@ AND `a`.`IsDeleted` = 0 AND `b`.`IsDeleted` = 0 limit @pageSize", new { pageSize
var idsString = string.Join(",", ids); var idsString = string.Join(",", ids);
return Context.Ado.ExecuteCommand( return Context.Ado.ExecuteCommand(
$"UPDATE `t_order` SET `QuestionType` = @questionType ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})", $"UPDATE `t_order` SET `QuestionType` = @questionType ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})",
new { questionType }); new
{
questionType
});
} }
#region 订单关联 #region 订单关联

View File

@ -131,7 +131,11 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
.LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id == b.TrackContentId && b.IsDeleted == false) .LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id == b.TrackContentId && b.IsDeleted == false)
.LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId == c.Id && c.IsDeleted == false) .LeftJoin<TrackTemplateEntity>((a, b, c) => b.TrackTemplateId == c.Id && c.IsDeleted == false)
.Where((a, b, c) => a.Id == trackContentId) .Where((a, b, c) => a.Id == trackContentId)
.Select((a, b, c) => new { TrackContentId = a.Id, TemplateId = c.Id }) .Select((a, b, c) => new
{
TrackContentId = a.Id,
TemplateId = c.Id
})
.ToListAsync(); .ToListAsync();
if (trackContentEntities.Any(a => a.TemplateId > 0)) if (trackContentEntities.Any(a => a.TemplateId > 0))

View File

@ -40,7 +40,12 @@ public class TrackNodeRepository : BasicRepository<TrackNodeEntity>, ITrackNodeR
.WhereIF(!string.IsNullOrEmpty(queryParam.KeyWord), .WhereIF(!string.IsNullOrEmpty(queryParam.KeyWord),
(t) => t.NodeName!.Contains(queryParam.KeyWord) || t.NodeEnName!.Contains(queryParam.KeyWord)) (t) => t.NodeName!.Contains(queryParam.KeyWord) || t.NodeEnName!.Contains(queryParam.KeyWord))
.WhereIF(queryParam.SystemId.HasValue, (t) => t.SubSystemId == queryParam.SystemId.Value) .WhereIF(queryParam.SystemId.HasValue, (t) => t.SubSystemId == queryParam.SystemId.Value)
.Select(t => new TrackNodeDicDto() { Id = t.Id, NodeName = t.NodeName, EnName = t.NodeEnName, }) .Select(t => new TrackNodeDicDto()
{
Id = t.Id,
NodeName = t.NodeName,
EnName = t.NodeEnName,
})
.ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize); .ToPagedListAsync(queryParam.PageIndex, queryParam.PageSize);
return result; return result;

View File

@ -1,4 +1,4 @@
using System.Linq.Expressions; using System.Linq.Expressions;
using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
@ -47,7 +47,11 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
.OrderBy(pullContent => pullContent.CreateTime) .OrderBy(pullContent => pullContent.CreateTime)
.Select( .Select(
(pullContent, trackContent, enumValue) => (pullContent, trackContent, enumValue) =>
new GetTrackPullContentPageOutputVO { Id = pullContent.Id, TrackPlaceValue = enumValue.Disp }, true) new GetTrackPullContentPageOutputVO
{
Id = pullContent.Id,
TrackPlaceValue = enumValue.Disp
}, true)
.ToPagedListAsync(input.PageIndex, input.PageSize); .ToPagedListAsync(input.PageIndex, input.PageSize);
} }
@ -58,7 +62,10 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
.Where(pullContent => pullContent.TrackPullConfigId == trackPullConfigId) .Where(pullContent => pullContent.TrackPullConfigId == trackPullConfigId)
.Select( .Select(
(pullContent, trackContent) => (pullContent, trackContent) =>
new GetTrackPullContentListCacheVO { TrackContentCode = trackContent.Code }, true) new GetTrackPullContentListCacheVO
{
TrackContentCode = trackContent.Code
}, true)
.ToListAsync(); .ToListAsync();
} }

View File

@ -50,7 +50,9 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
.Select( .Select(
(pushContent, trackContent, enumValue) => new GetTrackPushContentPageOutputVO (pushContent, trackContent, enumValue) => new GetTrackPushContentPageOutputVO
{ {
Id = pushContent.Id, Sort = pushContent.Sort, OrderNoType = enumValue.Disp Id = pushContent.Id,
Sort = pushContent.Sort,
OrderNoType = enumValue.Disp
}, true) }, true)
.ToPagedListAsync(input.PageIndex, input.PageSize); .ToPagedListAsync(input.PageIndex, input.PageSize);
} }
@ -86,7 +88,10 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
{ {
return await Context.Queryable<TrackPushContentConfigEntity>() return await Context.Queryable<TrackPushContentConfigEntity>()
.Where(pushContent => pushContent.Id == id) .Where(pushContent => pushContent.Id == id)
.Select(pushContent => new GetTrackPushContentDetailOutputVO { Id = pushContent.Id }, true) .Select(pushContent => new GetTrackPushContentDetailOutputVO
{
Id = pushContent.Id
}, true)
.SingleAsync(); .SingleAsync();
} }

View File

@ -1,4 +1,4 @@
using Nest; using Nest;
using SJZY.Expand.ABP.Core.Logger; using SJZY.Expand.ABP.Core.Logger;
using SJZY.Expand.ElasticSearch.Services; using SJZY.Expand.ElasticSearch.Services;
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
@ -21,7 +21,7 @@ public class TrackPushRecordsRepository : ElasticSearchContextAbstract<TrackDeta
// 按天写入es // 按天写入es
var r = await Context.IndexAsync(index, request => request var r = await Context.IndexAsync(index, request => request
.Index(index.IndexName) .Index(index.IndexName)
//.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见 // .Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见
); );
if (!r.IsValid) if (!r.IsValid)

View File

@ -22,8 +22,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
var detail = await Context.Queryable<TrackTemplateEntity>() var detail = await Context.Queryable<TrackTemplateEntity>()
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) .LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
.Where((a, b) => a.Id == id) .Where((a, b) => a.Id == id)
.Select((a, b) => new .Select((a, b) => new GetTrackTemplateDetailVO
GetTrackTemplateDetailVO
{ {
Id = a.Id, Id = a.Id,
Code = a.Code, Code = a.Code,

View File

@ -68,7 +68,12 @@ public class WarningRepository : BasicRepository<WarningEntity>, IWarningReposit
.Where(a => a.WarningId == warningId) .Where(a => a.WarningId == warningId)
.Select( .Select(
(a, b, c, d) => (a, b, c, d) =>
new WarningRuleVo { StartTrackStatus = b.Status, EndTrackStatus = c.Status, Area = d.Name }, true) new WarningRuleVo
{
StartTrackStatus = b.Status,
EndTrackStatus = c.Status,
Area = d.Name
}, true)
.ToListAsync(); .ToListAsync();
} }
@ -111,7 +116,12 @@ public class WarningRepository : BasicRepository<WarningEntity>, IWarningReposit
public async Task<bool> TurnWarningAsync(WarningEntity warning) public async Task<bool> TurnWarningAsync(WarningEntity warning)
{ {
return await Context.Updateable(warning) return await Context.Updateable(warning)
.UpdateColumns(x => new { x.IsEnable, x.UpdateTime, x.UpdateUserId }) .UpdateColumns(x => new
{
x.IsEnable,
x.UpdateTime,
x.UpdateUserId
})
.ExecuteCommandAsync() > 0; .ExecuteCommandAsync() > 0;
} }

View File

@ -1,4 +1,4 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SJZY.Expand.ABP.Core.SqlSugar.Options; using SJZY.Expand.ABP.Core.SqlSugar.Options;
using SJZY.Expand.ElasticSearch; using SJZY.Expand.ElasticSearch;

View File

@ -1,6 +1,5 @@
namespace SJZY.Track.Share.Enums; namespace SJZY.Track.Share.Enums;
/// <summary> /// <summary>
/// 枚举表示不同类型的规则因素。 /// 枚举表示不同类型的规则因素。
/// </summary> /// </summary>