From d37722dfb251db65ca348b3db51b8982afbd6c61 Mon Sep 17 00:00:00 2001 From: yunwei Date: Thu, 29 Feb 2024 11:26:06 +0800 Subject: [PATCH 01/34] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20src/SJZY.Track.Api/a?= =?UTF-8?q?ppsettings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Api/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Api/appsettings.json b/src/SJZY.Track.Api/appsettings.json index 850809ba..c501b7d4 100644 --- a/src/SJZY.Track.Api/appsettings.json +++ b/src/SJZY.Track.Api/appsettings.json @@ -1,7 +1,7 @@ { "Configuration": { - "UseLocalConfiguration": true, // 是否使用本地配置文件 - "ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启 UseLocalConfiguration 时生效 + "UseLocalConfiguration": true, //是否使用本地配置文件 + "ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启UseLocalConfiguration 时生效 "Apollo": { "AppId": "SJZY.Track.Configuration", "Env": "DEV", From 93b694b5b73c60b7c67bb9da333cc8a953c353d4 Mon Sep 17 00:00:00 2001 From: yunwei Date: Thu, 29 Feb 2024 11:29:07 +0800 Subject: [PATCH 02/34] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20src/SJZY.Track.Api/a?= =?UTF-8?q?ppsettings.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Api/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SJZY.Track.Api/appsettings.json b/src/SJZY.Track.Api/appsettings.json index c501b7d4..17cba222 100644 --- a/src/SJZY.Track.Api/appsettings.json +++ b/src/SJZY.Track.Api/appsettings.json @@ -1,7 +1,7 @@ { "Configuration": { "UseLocalConfiguration": true, //是否使用本地配置文件 - "ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启UseLocalConfiguration 时生效 + "ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启UseLocalConfiguration时生效 "Apollo": { "AppId": "SJZY.Track.Configuration", "Env": "DEV", From a2e458e57fbb5dec5d4173095a6d0e500ae2c534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 10:14:49 +0800 Subject: [PATCH 03/34] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=A5=91=E7=BA=A6=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SJZY.Track.Api.sln | 2 +- .../Dtos/Demo/ComplexAutomapperDemoInput.cs | 6 +- .../Dtos/Demo/DemoDetailInput.cs | 4 +- .../Dtos/Demo/DemoInput.cs | 2 +- .../Dtos/Demo/ExcelImportOuput.cs | 10 ++ .../Dtos/Demo/GetDemoListByPageInput.cs | 9 ++ .../Dtos/Demo/GetDemoListByPageOutput.cs | 4 +- .../Dtos/Demo/MyCustomerResultOutput.cs | 4 +- .../Dtos/Demo/OssUploadOutput.cs | 4 +- .../Dtos/Demo}/RemoteDemoInput.cs | 4 +- .../Dtos/Demo}/RemoteDemoOutput.cs | 4 +- .../Dtos/Demo/SwaggerDemoInput.cs | 13 +- .../Dtos/Demo/ValidateExecuteInput.cs | 5 +- .../Dtos/Demo/ValidateExecuteOutput.cs | 6 + .../Dtos/ProvideServices/DeleteOrderInput.cs | 5 + .../ProvideServices/GetOrderDetailsInput.cs | 12 +- .../ProvideServices/GetPageTrackOrderInput.cs | 95 +++++++++++++ .../Dtos/ProvideServices/GetTrackInput.cs | 2 +- .../Dtos/ProvideServices/GetTrackOutput.cs | 2 +- .../Dtos/ProvideServices/LinkOrderInput.cs | 2 +- .../Dtos/ProvideServices/OrderNoInfo.cs | 2 +- .../Dtos/ProvideServices/UpdateOrderInput.cs | 2 +- .../Dtos/ProvideServices/UpsertOrderInput.cs | 2 +- .../Dtos/ProvideServices/UpsertTrackInput.cs | 2 +- .../TrackContents/EditTrackContentInput.cs | 19 +-- .../TrackContents/GetPageTrackContentInput.cs | 10 +- .../Dtos/TrackFlags/EditTrackFlagInput.cs | 12 +- .../Dtos/TrackFlags/GetTrackFlagListDto.cs | 10 +- .../TrackPull/EditTrackPullConfigInput.cs | 2 +- .../TrackPull/UpdateTrackPullContentInput.cs | 2 +- .../Dtos/TrackStatus/EditTrackStatusInput.cs | 10 +- .../TrackStatus/GetTrackStatusDetailDto.cs | 20 +-- .../Dtos/TrackStatus/GetTrackStatusListDto.cs | 10 +- .../EditTrackTemplateContentInput.cs | 2 +- .../GetPageTrackTemplateInput.cs | 4 +- .../Dtos/TrackTemplates/GetTrackDetailDto.cs | 4 +- .../GlobalUsings.cs | 4 + .../SJZY.Track.Application.Contract.csproj} | 0 .../Services/IRemoteDemoService.cs | 13 ++ .../Services/ITrackContentService.cs | 5 + .../Services/ITrackFlagService.cs | 5 + .../Services/ITrackStatusService.cs | 5 + .../TrackHttpApiModule.cs | 3 +- .../AutoMapper/AutoMapperProfile.cs | 2 +- .../AutoMapper/DemoAutoMapperProfile.cs | 19 +-- .../AutoMapper/OrderAutoMapperProfile.cs | 6 +- .../TrackContentAutoMapperProfile.cs | 16 +-- .../AutoMapper/TrackFlagAutoMapperProfile.cs | 18 +-- .../AutoMapper/TrackPullAutoMapperProfile.cs | 2 +- .../TrackStatusAutoMapperProfile.cs | 23 ++-- .../TrackTemplateAutoMapperProfile.cs | 7 +- .../Dtos/Demo/ExcelImportOuput.cs | 11 -- .../Dtos/Demo/GetDemoListByPageInput.cs | 10 -- .../Dtos/Demo/ValidateExecuteOutput.cs | 6 - .../Dtos/ProvideServices/DeleteOrderInput.cs | 5 - .../ProvideServices/GetPageTrackOrderInput.cs | 102 -------------- .../SJZY.Track.Application.csproj | 2 +- .../Services/Demo/InterFaceDemoService.cs | 2 +- .../ProvideServices/OrderLinkService.cs | 2 +- .../Services/ProvideServices/OrderService.cs | 6 +- .../Services/ProvideServices/TrackCustomer.cs | 9 ++ .../ProvideServices/TrackQueryService.cs | 2 +- .../Services/ProvideServices/TrackService.cs | 2 +- .../TrackContents/ITrackContentService.cs | 13 -- .../TrackContents/TrackContentService.cs | 39 +++--- .../Services/TrackFlags/ITrackFlagService.cs | 12 -- .../Services/TrackFlags/TrackFlagService.cs | 36 ++--- .../Services/TrackPull/TrackPullService.cs | 127 ++++++++++-------- .../TrackStatus/ITrackStatusService.cs | 12 -- .../TrackStatus/TrackStatusService.cs | 27 ++-- .../TrackTemplates/TrackTemplateService.cs | 17 ++- .../Demo/SimpleValidateInputValidation.cs | 31 +++-- .../Demo/UserInfoInputValidation.cs | 6 +- .../Demo/UserRoleInputValidation.cs | 4 +- .../EditTrackContentInputValidation.cs | 22 +-- .../EditTrackFlagInputValidation.cs | 21 +-- .../EditTrackStatusInputValidation.cs | 21 +-- .../EditTrackTemplateInputValidation.cs | 16 +-- .../Services/IRemoteDemoService.cs | 15 --- test/SJZY.Track.Test/Demo/DemoTest.cs | 9 +- 80 files changed, 453 insertions(+), 570 deletions(-) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/ComplexAutomapperDemoInput.cs (97%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/DemoDetailInput.cs (94%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/DemoInput.cs (94%) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs create mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/GetDemoListByPageOutput.cs (90%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/MyCustomerResultOutput.cs (71%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/OssUploadOutput.cs (82%) rename src/{SJZY.Track.HttpApi/Dtos => SJZY.Track.Application.Contract/Dtos/Demo}/RemoteDemoInput.cs (76%) rename src/{SJZY.Track.HttpApi/Dtos => SJZY.Track.Application.Contract/Dtos/Demo}/RemoteDemoOutput.cs (64%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/SwaggerDemoInput.cs (77%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/Demo/ValidateExecuteInput.cs (97%) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs create mode 100644 src/SJZY.Track.Application.Contract/Dtos/ProvideServices/DeleteOrderInput.cs rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/GetOrderDetailsInput.cs (85%) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/GetTrackInput.cs (92%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/GetTrackOutput.cs (87%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/LinkOrderInput.cs (90%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/OrderNoInfo.cs (84%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/UpdateOrderInput.cs (93%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/UpsertOrderInput.cs (91%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/ProvideServices/UpsertTrackInput.cs (87%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackContents/EditTrackContentInput.cs (85%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackContents/GetPageTrackContentInput.cs (90%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackFlags/EditTrackFlagInput.cs (86%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackFlags/GetTrackFlagListDto.cs (88%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackPull/EditTrackPullConfigInput.cs (96%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackPull/UpdateTrackPullContentInput.cs (94%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackStatus/EditTrackStatusInput.cs (83%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackStatus/GetTrackStatusDetailDto.cs (61%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackStatus/GetTrackStatusListDto.cs (89%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs (91%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs (89%) rename src/{SJZY.Track.Application => SJZY.Track.Application.Contract}/Dtos/TrackTemplates/GetTrackDetailDto.cs (96%) create mode 100644 src/SJZY.Track.Application.Contract/GlobalUsings.cs rename src/{SJZY.Track.HttpApi/SJZY.Track.HttpApi.csproj => SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj} (100%) create mode 100644 src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs create mode 100644 src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs create mode 100644 src/SJZY.Track.Application.Contract/Services/ITrackFlagService.cs create mode 100644 src/SJZY.Track.Application.Contract/Services/ITrackStatusService.cs rename src/{SJZY.Track.HttpApi => SJZY.Track.Application.Contract}/TrackHttpApiModule.cs (82%) delete mode 100644 src/SJZY.Track.Application/Dtos/Demo/ExcelImportOuput.cs delete mode 100644 src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageInput.cs delete mode 100644 src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteOutput.cs delete mode 100644 src/SJZY.Track.Application/Dtos/ProvideServices/DeleteOrderInput.cs delete mode 100644 src/SJZY.Track.Application/Dtos/ProvideServices/GetPageTrackOrderInput.cs create mode 100644 src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs delete mode 100644 src/SJZY.Track.Application/Services/TrackContents/ITrackContentService.cs delete mode 100644 src/SJZY.Track.Application/Services/TrackFlags/ITrackFlagService.cs delete mode 100644 src/SJZY.Track.Application/Services/TrackStatus/ITrackStatusService.cs delete mode 100644 src/SJZY.Track.HttpApi/Services/IRemoteDemoService.cs diff --git a/SJZY.Track.Api.sln b/SJZY.Track.Api.sln index c1408517..3de8a025 100644 --- a/SJZY.Track.Api.sln +++ b/SJZY.Track.Api.sln @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0E2537C3-6 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Infrastructure", "src\SJZY.Track.Infrastructure\SJZY.Track.Infrastructure.csproj", "{D9CF5706-1972-414F-821E-AA32C13B8570}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.HttpApi", "src\SJZY.Track.HttpApi\SJZY.Track.HttpApi.csproj", "{390A44FB-0DB5-4B66-86AB-7712DC3030F5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Application.Contract", "src\SJZY.Track.Application.Contract\SJZY.Track.Application.Contract.csproj", "{390A44FB-0DB5-4B66-86AB-7712DC3030F5}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Test", "test\SJZY.Track.Test\SJZY.Track.Test.csproj", "{3A53539C-4A85-4E5D-A071-7B4B193AB0E0}" EndProject diff --git a/src/SJZY.Track.Application/Dtos/Demo/ComplexAutomapperDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs similarity index 97% rename from src/SJZY.Track.Application/Dtos/Demo/ComplexAutomapperDemoInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs index de4bc495..f2162eb5 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/ComplexAutomapperDemoInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { /// /// automapper 复杂转换样例 @@ -43,7 +43,6 @@ { return "辽宁省沈阳市..."; } - } public class ComplexAutomapperDemoOutput @@ -83,7 +82,4 @@ /// public int[] RoleIds { get; set; } } - - - } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/DemoDetailInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs similarity index 94% rename from src/SJZY.Track.Application/Dtos/Demo/DemoDetailInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs index 30da5896..e80c4745 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/DemoDetailInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class DemoDetailSaveInput { @@ -45,4 +45,4 @@ /// public string OtherInfo { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/DemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs similarity index 94% rename from src/SJZY.Track.Application/Dtos/Demo/DemoInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs index 1b46a3e1..87f95820 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/DemoInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class DemoInput { diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs new file mode 100644 index 00000000..b2afbc57 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs @@ -0,0 +1,10 @@ +namespace SJZY.Track.Application.Contract.Dtos.Demo; + +public class ExcelImportOuput +{ + // [MiniExcelLibs.Attributes.ExcelColumnName("姓名")] + public string Name { get; set; } + + // [MiniExcelLibs.Attributes.ExcelColumnName("年龄")] + public int Age { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs new file mode 100644 index 00000000..a49e420a --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs @@ -0,0 +1,9 @@ +namespace SJZY.Track.Application.Contract.Dtos.Demo; + +public class GetDemoListByPageInput : PageInfoInput +{ + /// + /// 姓名 + /// + public string Name { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs similarity index 90% rename from src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageOutput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs index 3c5bd96d..fd91bc62 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class GetDemoListByPageOutput { @@ -24,4 +24,4 @@ public DateTime CreateTime { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/MyCustomerResultOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs similarity index 71% rename from src/SJZY.Track.Application/Dtos/Demo/MyCustomerResultOutput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs index 8d6896ac..f1a5288c 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/MyCustomerResultOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class MyCustomerResultOutput { @@ -6,4 +6,4 @@ public string Message { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/OssUploadOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs similarity index 82% rename from src/SJZY.Track.Application/Dtos/Demo/OssUploadOutput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs index 367d2c54..68b3abcf 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/OssUploadOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class OssUploadOutput { @@ -12,4 +12,4 @@ /// public string Url { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.HttpApi/Dtos/RemoteDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs similarity index 76% rename from src/SJZY.Track.HttpApi/Dtos/RemoteDemoInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs index b010b6bd..2f43a8fa 100644 --- a/src/SJZY.Track.HttpApi/Dtos/RemoteDemoInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.HttpApi.Dtos +namespace SJZY.Track.Application.Contract.Dtos { public class RemoteDemoInput { @@ -7,4 +7,4 @@ /// public DateTime CurrentTime { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.HttpApi/Dtos/RemoteDemoOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs similarity index 64% rename from src/SJZY.Track.HttpApi/Dtos/RemoteDemoOutput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs index 44cd1f41..0cd20796 100644 --- a/src/SJZY.Track.HttpApi/Dtos/RemoteDemoOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs @@ -1,7 +1,7 @@ -namespace SJZY.Track.HttpApi.Dtos +namespace SJZY.Track.Application.Contract.Dtos { public class RemoteDemoOutput { public string Context { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/SwaggerDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs similarity index 77% rename from src/SJZY.Track.Application/Dtos/Demo/SwaggerDemoInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs index f521c50e..eefc7559 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/SwaggerDemoInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Text.Json.Serialization; -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class SwaggerDemoInput { @@ -30,13 +30,10 @@ namespace SJZY.Track.Application.Dtos.Demo public enum Gender { - [Description("纯爷们")] - 男 = 2, + [Description("纯爷们")] 男 = 2, - [Description("大姑娘")] - 女 = 5, + [Description("大姑娘")] 女 = 5, - [Description("你憋问")] - 未知 = 8 + [Description("你憋问")] 未知 = 8 } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs similarity index 97% rename from src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs index f1c3fc45..2de0afdf 100644 --- a/src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.Demo +namespace SJZY.Track.Application.Contract.Dtos.Demo { public class ValidateExecuteInput { @@ -56,7 +56,6 @@ /// 用户角色 /// public List UserRoleInputList { get; set; } - } public class UserInfoInput @@ -95,4 +94,4 @@ /// public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs new file mode 100644 index 00000000..1ea87d0f --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs @@ -0,0 +1,6 @@ +namespace SJZY.Track.Application.Contract.Dtos.Demo +{ + public class ValidateExecuteOutput + { + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/DeleteOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/DeleteOrderInput.cs new file mode 100644 index 00000000..7d8d79c0 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/DeleteOrderInput.cs @@ -0,0 +1,5 @@ +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; + +public class DeleteOrderInput : OrderNoInfo +{ +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/GetOrderDetailsInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs similarity index 85% rename from src/SJZY.Track.Application/Dtos/ProvideServices/GetOrderDetailsInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs index d1b7cb92..c82bf122 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/GetOrderDetailsInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.ProvideServices +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices { public class GetOrderDetailsInput { @@ -30,7 +24,7 @@ namespace SJZY.Track.Application.Dtos.ProvideServices /// 轨迹内容 /// public string Content { get; set; } - + /// /// 轨迹内容英文 /// @@ -51,4 +45,4 @@ namespace SJZY.Track.Application.Dtos.ProvideServices /// public string TrackTimeZone { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs new file mode 100644 index 00000000..2f8d31e0 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs @@ -0,0 +1,95 @@ +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; + +public class GetPageTrackOrderInput : PageInfoInput +{ + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 单号 + /// + public List? OrderNos { get; set; } + + /// + /// 创建时间开始 + /// + public DateTime? CreateTimeStart { get; set; } + + /// + /// 创建时间截止 + /// + public DateTime? CreateTimeEnd { get; set; } +} + +/// +/// 轨迹订单Dto +/// +public class TrackOrderDto +{ + /// + /// 轨迹订单id + /// + public int Id { get; set; } + + /// + /// 订单类型id + /// + public int OrderType { get; set; } + + /// + /// 订单号 + /// + public string? OrderNumber { get; set; } + + /// + /// 轨迹模版 + /// + public string? TrackTemplateNames { get; set; } + + /// + /// 客户简称 + /// + public string? CustomerShortName { get; set; } + + /// + /// 客户代码 + /// + public string? CustomerCode { get; set; } + + /// + /// 订单明细(json) + /// + public string? OrderDetails { get; set; } + + /// + /// 最新轨迹内容 + /// + public string? NewestTrackContent { get; set; } + + /// + /// 最新轨迹内容英文 + /// + public string? NewestTrackEnContent { get; set; } + + /// + /// 最新轨迹发生地 + /// + public string? NewestTrackPlace { get; set; } + + /// + /// 是否完结 + /// + public bool IsFinish { get; set; } + + /// + /// 创建时间 + /// + public DateTime? CreateTime { get; set; } + + /// + /// 子系统 + /// + public string SubSystem { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackInput.cs similarity index 92% rename from src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackInput.cs index d455a5b2..578c31b2 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class GetTrackInput { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackOutput.cs similarity index 87% rename from src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackOutput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackOutput.cs index b6b77862..eda7ecbc 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/GetTrackOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackOutput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class GetTrackOutput { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/LinkOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/LinkOrderInput.cs similarity index 90% rename from src/SJZY.Track.Application/Dtos/ProvideServices/LinkOrderInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/LinkOrderInput.cs index ae3dfd9d..cf3e5b79 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/LinkOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/LinkOrderInput.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class LinkOrderInput { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/OrderNoInfo.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs similarity index 84% rename from src/SJZY.Track.Application/Dtos/ProvideServices/OrderNoInfo.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs index 6f98fafc..b4283022 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/OrderNoInfo.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class OrderNoInfo { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/UpdateOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs similarity index 93% rename from src/SJZY.Track.Application/Dtos/ProvideServices/UpdateOrderInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs index d614db45..a6faf08b 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/UpdateOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class UpdateOrderInput : OrderNoInfo { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/UpsertOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs similarity index 91% rename from src/SJZY.Track.Application/Dtos/ProvideServices/UpsertOrderInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs index c03d2478..f6c7cb78 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/UpsertOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class UpsertOrderInput : UpdateOrderInput { diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/UpsertTrackInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs similarity index 87% rename from src/SJZY.Track.Application/Dtos/ProvideServices/UpsertTrackInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs index fa2112ee..91d5429c 100644 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/UpsertTrackInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.ProvideServices; +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class UpsertTrackInput : OrderNoInfo { diff --git a/src/SJZY.Track.Application/Dtos/TrackContents/EditTrackContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentInput.cs similarity index 85% rename from src/SJZY.Track.Application/Dtos/TrackContents/EditTrackContentInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentInput.cs index 9879ffb8..d2a829ca 100644 --- a/src/SJZY.Track.Application/Dtos/TrackContents/EditTrackContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackContents +namespace SJZY.Track.Application.Contract.Dtos.TrackContents { public class EditTrackContentInput { @@ -79,12 +73,12 @@ namespace SJZY.Track.Application.Dtos.TrackContents /// /// 轨迹内容代码 /// - public string Code { get; set; } + public string Code { get; set; } /// /// 轨迹内容 /// - public string Content { get; set; } + public string Content { get; set; } /// /// 轨迹内容英文 @@ -94,12 +88,11 @@ namespace SJZY.Track.Application.Dtos.TrackContents /// /// 轨迹标记id /// - public int TrackFlagId { get; set; } + public int TrackFlagId { get; set; } /// /// 轨迹标记 /// - public string TrackFlag { get; set; } + public string TrackFlag { get; set; } } -} - +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackContents/GetPageTrackContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs similarity index 90% rename from src/SJZY.Track.Application/Dtos/TrackContents/GetPageTrackContentInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs index 7a009ccb..9628067c 100644 --- a/src/SJZY.Track.Application/Dtos/TrackContents/GetPageTrackContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackContents +namespace SJZY.Track.Application.Contract.Dtos.TrackContents { public class GetPageTrackContentInput : PageInfoInput { @@ -81,4 +75,4 @@ namespace SJZY.Track.Application.Dtos.TrackContents /// public string UpdateUser { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackFlags/EditTrackFlagInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/EditTrackFlagInput.cs similarity index 86% rename from src/SJZY.Track.Application/Dtos/TrackFlags/EditTrackFlagInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackFlags/EditTrackFlagInput.cs index 901f5e5a..f4c1083e 100644 --- a/src/SJZY.Track.Application/Dtos/TrackFlags/EditTrackFlagInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/EditTrackFlagInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackFlags +namespace SJZY.Track.Application.Contract.Dtos.TrackFlags { public class EditTrackFlagInput { @@ -54,7 +48,7 @@ namespace SJZY.Track.Application.Dtos.TrackFlags /// /// 子系统 /// - public string SubSystem { get; set; } + public string SubSystem { get; set; } /// /// 代码 @@ -71,4 +65,4 @@ namespace SJZY.Track.Application.Dtos.TrackFlags /// public bool IsFinish { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackFlags/GetTrackFlagListDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs similarity index 88% rename from src/SJZY.Track.Application/Dtos/TrackFlags/GetTrackFlagListDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs index 714203f2..1ca2c4df 100644 --- a/src/SJZY.Track.Application/Dtos/TrackFlags/GetTrackFlagListDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackFlags +namespace SJZY.Track.Application.Contract.Dtos.TrackFlags { public class GetTrackFlagListDto { @@ -66,4 +60,4 @@ namespace SJZY.Track.Application.Dtos.TrackFlags ///// //public string Keywords { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackPull/EditTrackPullConfigInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs similarity index 96% rename from src/SJZY.Track.Application/Dtos/TrackPull/EditTrackPullConfigInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs index 71fe55cf..61e15c3e 100644 --- a/src/SJZY.Track.Application/Dtos/TrackPull/EditTrackPullConfigInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.TrackPull; +namespace SJZY.Track.Application.Contract.Dtos.TrackPull; public class EditTrackPullConfigInput { diff --git a/src/SJZY.Track.Application/Dtos/TrackPull/UpdateTrackPullContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs similarity index 94% rename from src/SJZY.Track.Application/Dtos/TrackPull/UpdateTrackPullContentInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs index 74a54567..84d7e335 100644 --- a/src/SJZY.Track.Application/Dtos/TrackPull/UpdateTrackPullContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.TrackPull; +namespace SJZY.Track.Application.Contract.Dtos.TrackPull; public class UpdateTrackPullContentInput { diff --git a/src/SJZY.Track.Application/Dtos/TrackStatus/EditTrackStatusInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/EditTrackStatusInput.cs similarity index 83% rename from src/SJZY.Track.Application/Dtos/TrackStatus/EditTrackStatusInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackStatus/EditTrackStatusInput.cs index ce9a0ebf..61a9d98e 100644 --- a/src/SJZY.Track.Application/Dtos/TrackStatus/EditTrackStatusInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/EditTrackStatusInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackStatus +namespace SJZY.Track.Application.Contract.Dtos.TrackStatus { public class EditTrackStatusInput { @@ -43,4 +37,4 @@ namespace SJZY.Track.Application.Dtos.TrackStatus /// public string? EntrackStatus { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusDetailDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusDetailDto.cs similarity index 61% rename from src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusDetailDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusDetailDto.cs index 6779d6da..fe39c418 100644 --- a/src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusDetailDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusDetailDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackStatus +namespace SJZY.Track.Application.Contract.Dtos.TrackStatus { public class GetTrackStatusDetailDto { @@ -21,26 +15,26 @@ namespace SJZY.Track.Application.Dtos.TrackStatus /// /// 子系统 /// - public string SubSystem { get; set; } + public string SubSystem { get; set; } /// /// 节点id /// - public int NodeId { get; set; } + public int NodeId { get; set; } /// /// 所属轨迹状态 /// - public string TrackStatus { get; set; } + public string TrackStatus { get; set; } /// /// 轨迹状态代码 /// - public string Code { get; set; } + public string Code { get; set; } /// /// 轨迹内容英文 /// - public string EntrackStatus { get; set; } + public string EntrackStatus { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusListDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs similarity index 89% rename from src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusListDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs index ecdb123d..8cadc1ea 100644 --- a/src/SJZY.Track.Application/Dtos/TrackStatus/GetTrackStatusListDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.TrackStatus +namespace SJZY.Track.Application.Contract.Dtos.TrackStatus { public class GetTrackStatusListDto { @@ -72,4 +66,4 @@ namespace SJZY.Track.Application.Dtos.TrackStatus /// public string Keywords { get; set; } = ""; } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs similarity index 91% rename from src/SJZY.Track.Application/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs index bb45dc74..0c7144fc 100644 --- a/src/SJZY.Track.Application/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/EditTrackTemplateContentInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.TrackTemplates; +namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates; /// public class EditTrackTemplateContentInput diff --git a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs similarity index 89% rename from src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs index 3be009ac..ba54db15 100644 --- a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.TrackTemplates +namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates { /// /// 获取轨迹模版分页输入 @@ -20,4 +20,4 @@ /// public int TrackTemplateId { get; set; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetTrackDetailDto.cs similarity index 96% rename from src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetTrackDetailDto.cs index f4ac73d8..86e5db45 100644 --- a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetTrackDetailDto.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Dtos.TrackTemplates +namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates { /// /// 获取轨迹模版详情 @@ -92,4 +92,4 @@ /// public string? Code { set; get; } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/GlobalUsings.cs b/src/SJZY.Track.Application.Contract/GlobalUsings.cs new file mode 100644 index 00000000..99b0e5e1 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/GlobalUsings.cs @@ -0,0 +1,4 @@ +// Global using directives + +global using SJZY.Expand.ABP.Common.Enums; +global using SJZY.Expand.ABP.Core.Common.Dto; \ No newline at end of file diff --git a/src/SJZY.Track.HttpApi/SJZY.Track.HttpApi.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj similarity index 100% rename from src/SJZY.Track.HttpApi/SJZY.Track.HttpApi.csproj rename to src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj diff --git a/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs b/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs new file mode 100644 index 00000000..841cae19 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs @@ -0,0 +1,13 @@ +using SJZY.Track.Application.Contract.Dtos; +using Volo.Abp; +using Volo.Abp.DependencyInjection; + +namespace SJZY.Track.Application.Contract.Services; + +/// +/// 客户端连接测试接口 +/// +public interface IRemoteDemoService : IRemoteService, IScopedDependency +{ + Task> ConnectionTest(RemoteDemoInput input); +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs new file mode 100644 index 00000000..08ce5194 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs @@ -0,0 +1,5 @@ +namespace SJZY.Track.Application.Contract.Services; + +public interface ITrackContentService +{ +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackFlagService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackFlagService.cs new file mode 100644 index 00000000..a7d780b9 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Services/ITrackFlagService.cs @@ -0,0 +1,5 @@ +namespace SJZY.Track.Application.Contract.Services; + +public interface ITrackFlagService +{ +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackStatusService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackStatusService.cs new file mode 100644 index 00000000..b350cb93 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Services/ITrackStatusService.cs @@ -0,0 +1,5 @@ +namespace SJZY.Track.Application.Contract.Services; + +public interface ITrackStatusService +{ +} \ No newline at end of file diff --git a/src/SJZY.Track.HttpApi/TrackHttpApiModule.cs b/src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs similarity index 82% rename from src/SJZY.Track.HttpApi/TrackHttpApiModule.cs rename to src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs index 522c4cf8..a76ed6da 100644 --- a/src/SJZY.Track.HttpApi/TrackHttpApiModule.cs +++ b/src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs @@ -1,12 +1,11 @@ using Volo.Abp.Modularity; -namespace SJZY.Track.HttpApi +namespace SJZY.Track.Application.Contract { public class TrackHttpApiModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - } } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs index b315446d..87914d8e 100644 --- a/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs @@ -1,5 +1,5 @@ using AutoMapper; -using SJZY.Track.Application.Dtos.Demo; +using SJZY.Track.Application.Contract.Dtos.Demo; using SJZY.Track.Domain.Aggregates.DemoAggregate; using SJZY.Track.Domain.Dtos.Demo; diff --git a/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs index 8e04d1ce..ba28b16e 100644 --- a/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs @@ -1,7 +1,6 @@ using AutoMapper; using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Dtos.Demo; - +using SJZY.Track.Application.Contract.Dtos.Demo; namespace SJZY.Track.Application.AutoMapper { @@ -20,12 +19,14 @@ namespace SJZY.Track.Application.AutoMapper //一些简单计算的场景,酌情使用... .ForMember(dest => dest.Age, opt => opt.MapFrom(source => GetAgeByBirthdate(source.UserInfo.BirthDay))) //结构不一致的场景 - .ForMember(dest => dest.RoleIds, opt => opt.MapFrom(source => source.UserRoleInputList.Select(m => m.Id).ToArray())) + .ForMember(dest => dest.RoleIds, + opt => opt.MapFrom(source => source.UserRoleInputList.Select(m => m.Id).ToArray())) //条件映射(这里只是举例,日常开发时sqlsugar在新增时会避开自增主键) - .ForMember(dest => dest.Id, opt => - { - opt.Condition(src => src.OptionType == OptionType.删除 || src.OptionType == OptionType.修改); - }); + .ForMember(dest => dest.Id, + opt => + { + opt.Condition(src => src.OptionType == OptionType.删除 || src.OptionType == OptionType.修改); + }); } public int GetAgeByBirthdate(DateTime birthdate) @@ -36,8 +37,8 @@ namespace SJZY.Track.Application.AutoMapper { age--; } + return age < 0 ? 0 : age; } - } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs index a8d93386..8ea57e0e 100644 --- a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs @@ -1,9 +1,7 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; -using SJZY.Track.Application.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Dtos.Order; -using System.Diagnostics; namespace SJZY.Track.Application.AutoMapper; @@ -21,6 +19,6 @@ public class OrderAutoMapperProfile : Profile CreateMap(MemberList.None); CreateMap(MemberList.None); - CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap, UnifyPageResultDto>(MemberList.None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs index e9346eff..25f17ab6 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs @@ -1,16 +1,7 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; -using SJZY.Track.Application.Dtos.TrackContents; -using SJZY.Track.Application.Dtos.TrackTemplates; +using SJZY.Track.Application.Contract.Dtos.TrackContents; using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Dtos.TrackContents; -using SJZY.Track.Domain.Dtos.TrackTemplate; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.AutoMapper { @@ -22,7 +13,8 @@ namespace SJZY.Track.Application.AutoMapper CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap(MemberList.None); - CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap, UnifyPageResultDto>( + MemberList.None); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/TrackFlagAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackFlagAutoMapperProfile.cs index acc0102a..a08aa0a0 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackFlagAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackFlagAutoMapperProfile.cs @@ -1,16 +1,7 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; -using SJZY.Track.Application.Dtos.TrackFlags; -using SJZY.Track.Application.Dtos.TrackStatus; +using SJZY.Track.Application.Contract.Dtos.TrackFlags; using SJZY.Track.Domain.Aggregates.TrackFlagAggregate; using SJZY.Track.Domain.Dtos.TrackFlags; -using SJZY.Track.Domain.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.AutoMapper { @@ -18,10 +9,9 @@ namespace SJZY.Track.Application.AutoMapper { public TrackFlagAutoMapperProfile() { - CreateMap(MemberList.None) - .ForMember(dest => dest.Name, opt => opt.MapFrom(source => source.Flag)) - .ForMember(dest => dest.IsCompleted, opt => opt.MapFrom(source => source.IsFinish)); + .ForMember(dest => dest.Name, opt => opt.MapFrom(source => source.Flag)) + .ForMember(dest => dest.IsCompleted, opt => opt.MapFrom(source => source.IsFinish)); CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap, UnifyPageResultDto>(MemberList.None); @@ -32,4 +22,4 @@ namespace SJZY.Track.Application.AutoMapper // resultDto); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs index da6207a5..2af35a86 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs @@ -1,5 +1,5 @@ using AutoMapper; -using SJZY.Track.Application.Dtos.TrackPull; +using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using Volo.Abp.AutoMapper; diff --git a/src/SJZY.Track.Application/AutoMapper/TrackStatusAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackStatusAutoMapperProfile.cs index c66d09e7..49796f47 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackStatusAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackStatusAutoMapperProfile.cs @@ -1,15 +1,7 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; -using SJZY.Track.Application.Dtos.Demo; -using SJZY.Track.Application.Dtos.TrackStatus; +using SJZY.Track.Application.Contract.Dtos.TrackStatus; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.AutoMapper { @@ -18,14 +10,15 @@ namespace SJZY.Track.Application.AutoMapper public TrackStatusAutoMapperProfile() { CreateMap(MemberList.None) - //层级不一致的场景 - .ForMember(dest => dest.Status, opt => opt.MapFrom(source => source.TrackStatus)) - .ForMember(dest => dest.EnStatus, opt => opt.MapFrom(source => source.EntrackStatus)) - .ForMember(dest => dest.Node, opt => opt.MapFrom(source => source.NodeId)); + //层级不一致的场景 + .ForMember(dest => dest.Status, opt => opt.MapFrom(source => source.TrackStatus)) + .ForMember(dest => dest.EnStatus, opt => opt.MapFrom(source => source.EntrackStatus)) + .ForMember(dest => dest.Node, opt => opt.MapFrom(source => source.NodeId)); CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap(MemberList.None); - CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap, UnifyPageResultDto>(MemberList + .None); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs index cec240ac..36f0e498 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs @@ -1,9 +1,7 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; -using SJZY.Track.Application.Dtos.TrackTemplates; +using SJZY.Track.Application.Contract.Dtos.TrackTemplates; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.TrackTemplate; -using Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.AutoMapper; @@ -19,6 +17,7 @@ public class TrackTemplateAutoMapperProfile : Profile CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap(MemberList.None); - CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap, UnifyPageResultDto>(MemberList + .None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/ExcelImportOuput.cs b/src/SJZY.Track.Application/Dtos/Demo/ExcelImportOuput.cs deleted file mode 100644 index 46ef9d04..00000000 --- a/src/SJZY.Track.Application/Dtos/Demo/ExcelImportOuput.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace SJZY.Track.Application.Dtos.Demo -{ - public class ExcelImportOuput - { - [MiniExcelLibs.Attributes.ExcelColumnName("姓名")] - public string Name { get; set; } - - [MiniExcelLibs.Attributes.ExcelColumnName("年龄")] - public int Age { get; set; } - } -} diff --git a/src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageInput.cs b/src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageInput.cs deleted file mode 100644 index 55d86e2c..00000000 --- a/src/SJZY.Track.Application/Dtos/Demo/GetDemoListByPageInput.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SJZY.Track.Application.Dtos.Demo -{ - public class GetDemoListByPageInput : PageInfoInput - { - /// - /// 姓名 - /// - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteOutput.cs b/src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteOutput.cs deleted file mode 100644 index 13cede57..00000000 --- a/src/SJZY.Track.Application/Dtos/Demo/ValidateExecuteOutput.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SJZY.Track.Application.Dtos.Demo -{ - public class ValidateExecuteOutput - { - } -} diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/DeleteOrderInput.cs b/src/SJZY.Track.Application/Dtos/ProvideServices/DeleteOrderInput.cs deleted file mode 100644 index c4fba2a8..00000000 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/DeleteOrderInput.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace SJZY.Track.Application.Dtos.ProvideServices; - -public class DeleteOrderInput : OrderNoInfo -{ -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application/Dtos/ProvideServices/GetPageTrackOrderInput.cs deleted file mode 100644 index 06335e34..00000000 --- a/src/SJZY.Track.Application/Dtos/ProvideServices/GetPageTrackOrderInput.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Dtos.ProvideServices -{ - public class GetPageTrackOrderInput : PageInfoInput - { - /// - /// 子系统id - /// - public int SubSystemId { get; set; } - - /// - /// 单号 - /// - public List? OrderNos { get; set; } - - /// - /// 创建时间开始 - /// - public DateTime? CreateTimeStart { get; set; } - - /// - /// 创建时间截止 - /// - public DateTime? CreateTimeEnd { get; set; } - } - - /// - /// 轨迹订单Dto - /// - public class TrackOrderDto - { - /// - /// 轨迹订单id - /// - public int Id { get; set; } - - /// - /// 订单类型id - /// - public int OrderType { get; set; } - - /// - /// 订单号 - /// - public string? OrderNumber { get; set; } - - /// - /// 轨迹模版 - /// - public string? TrackTemplateNames { get; set; } - - /// - /// 客户简称 - /// - public string? CustomerShortName { get; set; } - - /// - /// 客户代码 - /// - public string? CustomerCode { get; set; } - - /// - /// 订单明细(json) - /// - public string? OrderDetails { get; set; } - - /// - /// 最新轨迹内容 - /// - public string? NewestTrackContent { get; set; } - - /// - /// 最新轨迹内容英文 - /// - public string? NewestTrackEnContent { get; set; } - - /// - /// 最新轨迹发生地 - /// - public string? NewestTrackPlace { get; set; } - - /// - /// 是否完结 - /// - public bool IsFinish { get; set; } - - /// - /// 创建时间 - /// - public DateTime? CreateTime { get; set; } - - /// - /// 子系统 - /// - public string SubSystem { get; set; } - } -} diff --git a/src/SJZY.Track.Application/SJZY.Track.Application.csproj b/src/SJZY.Track.Application/SJZY.Track.Application.csproj index ccc853da..93d801c4 100644 --- a/src/SJZY.Track.Application/SJZY.Track.Application.csproj +++ b/src/SJZY.Track.Application/SJZY.Track.Application.csproj @@ -27,6 +27,6 @@ - + diff --git a/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs b/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs index 6402f596..39d63fc8 100644 --- a/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs +++ b/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs @@ -1,5 +1,5 @@ using SJZY.Expand.ABP.Core.Common; -using SJZY.Track.Application.Dtos.Demo; +using SJZY.Track.Application.Contract.Dtos.Demo; using SJZY.Track.Domain.Aggregates.DemoAggregate; using SJZY.Track.Domain.Dtos.Demo; diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderLinkService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderLinkService.cs index e21ca538..f0261697 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderLinkService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderLinkService.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Application.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Queries; diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs index 8b6b8e19..38eb9466 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs @@ -1,5 +1,4 @@ -using SJZY.Expand.ABP.Core.Common.Dto; -using SJZY.Track.Application.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Dtos.Order; @@ -93,7 +92,8 @@ public class OrderService : ApplicationService { var vo = ObjectMapper.Map(input); var pageList = await _orderRepository.GetPageTrackOrder(vo); - var pageResultDto = ObjectMapper.Map, UnifyPageResultDto>(pageList); + var pageResultDto = + ObjectMapper.Map, UnifyPageResultDto>(pageList); return pageResultDto; } diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs new file mode 100644 index 00000000..d4c57f4c --- /dev/null +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs @@ -0,0 +1,9 @@ +using DotNetCore.CAP; +using Volo.Abp.DependencyInjection; + +namespace SJZY.Track.Application.Services.ProvideServices; + +public class TrackCustomer : ITransientDependency, ICapSubscribe +{ + public const string CapSubscribe = "SJZY.FMC.VoucherRedundantCalc"; +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackQueryService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackQueryService.cs index 587c316b..79f0cb2e 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackQueryService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackQueryService.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Application.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Queries; diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index 7077cfb3..a6a5f932 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -1,5 +1,5 @@ using DotNetCore.CAP; -using SJZY.Track.Application.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Queries; diff --git a/src/SJZY.Track.Application/Services/TrackContents/ITrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/ITrackContentService.cs deleted file mode 100644 index 8747af44..00000000 --- a/src/SJZY.Track.Application/Services/TrackContents/ITrackContentService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Services.TrackContents -{ - public interface ITrackContentService - { - - } -} diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 3245d2ce..c7493cec 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -1,16 +1,8 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Localization; -using SJZY.Track.Application.Dtos.TrackContents; -using SJZY.Track.Application.Dtos.TrackStatus; +using Microsoft.Extensions.Localization; +using SJZY.Track.Application.Contract.Dtos.TrackContents; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Dtos.TrackContents; -using SJZY.Track.Domain.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace SJZY.Track.Application.Services.TrackContents @@ -28,10 +20,10 @@ namespace SJZY.Track.Application.Services.TrackContents public TrackContentService( IStringLocalizer stringLocalizer, ITrackContentRepository trackContentRepository - ) + ) { - this._stringLocalizer=stringLocalizer; - this._trackContentRepository=trackContentRepository; + this._stringLocalizer = stringLocalizer; + this._trackContentRepository = trackContentRepository; } /// @@ -74,7 +66,8 @@ namespace SJZY.Track.Application.Services.TrackContents /// /// [HttpPost("GetList")] - public async Task> GetPageTrackContent(GetPageTrackContentInput input) + public async Task> GetPageTrackContent( + GetPageTrackContentInput input) { var vo = ObjectMapper.Map(input); var resultDto = await _trackContentRepository.GetPageTrackContent(vo); @@ -86,15 +79,19 @@ namespace SJZY.Track.Application.Services.TrackContents } #region 私有方法 + private async Task AddAsync(EditTrackContentInput input) { #region 业务逻辑校验 - var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&&(a.Code==input.Code || - a.Content==input.Content || a.EnContent==input.EnContent)); + + var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => + a.SubSystemId == input.SubSystemId && (a.Code == input.Code || + a.Content == input.Content || a.EnContent == input.EnContent)); if (trackContentEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } + #endregion var entity = ObjectMapper.Map(input); @@ -106,12 +103,15 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task UpdateAsync(EditTrackContentInput input) { #region 业务逻辑校验 - var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id!=input.Id && a.SubSystemId==input.SubSystemId && (a.Code==input.Code || - a.Content==input.Content || a.EnContent==input.EnContent)); + + var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id && + a.SubSystemId == input.SubSystemId && (a.Code == input.Code || + a.Content == input.Content || a.EnContent == input.EnContent)); if (trackContentEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } + #endregion var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); @@ -127,6 +127,7 @@ namespace SJZY.Track.Application.Services.TrackContents return new UnifyResultDto("200", "删除成功", isTrue); } + #endregion } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackFlags/ITrackFlagService.cs b/src/SJZY.Track.Application/Services/TrackFlags/ITrackFlagService.cs deleted file mode 100644 index 1e745341..00000000 --- a/src/SJZY.Track.Application/Services/TrackFlags/ITrackFlagService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Services.TrackFlags -{ - public interface ITrackFlagService - { - } -} diff --git a/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs b/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs index 112345e2..a6117f0d 100644 --- a/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs +++ b/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs @@ -1,16 +1,8 @@ using Microsoft.Extensions.Localization; -using SJZY.Track.Application.Dtos.TrackFlags; -using SJZY.Track.Application.Dtos.TrackStatus; +using SJZY.Track.Application.Contract.Dtos.TrackFlags; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackFlagAggregate; -using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackFlags; -using SJZY.Track.Domain.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace SJZY.Track.Application.Services.TrackFlags @@ -28,10 +20,10 @@ namespace SJZY.Track.Application.Services.TrackFlags public TrackFlagService( IStringLocalizer stringLocalizer, ITrackFlagRepository trackFlagRepository - ) + ) { - this._stringLocalizer=stringLocalizer; - this._trackFlagRepository=trackFlagRepository; + this._stringLocalizer = stringLocalizer; + this._trackFlagRepository = trackFlagRepository; } /// @@ -86,14 +78,18 @@ namespace SJZY.Track.Application.Services.TrackFlags } #region 私有方法 + private async Task AddAsync(EditTrackFlagInput input) { #region 业务校验 - var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&& (a.Code==input.Code || a.Name==input.Flag)); - if (trackStatusEntity!=null) + + var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => + a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag)); + if (trackStatusEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]); } + #endregion var entity = ObjectMapper.Map(input); @@ -105,12 +101,15 @@ namespace SJZY.Track.Application.Services.TrackFlags private async Task UpdateAsync(EditTrackFlagInput input) { #region 业务校验 - var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id !=input.Id && a.SubSystemId==input.SubSystemId&& (a.Code==input.Code || - a.Name ==input.Flag)); - if (trackStatusEntity!=null) + + var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id != input.Id && + a.SubSystemId == input.SubSystemId && (a.Code == input.Code || + a.Name == input.Flag)); + if (trackStatusEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]); } + #endregion var templateEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id == input.Id); @@ -126,6 +125,7 @@ namespace SJZY.Track.Application.Services.TrackFlags return new UnifyResultDto("200", "删除成功", isTrue); } + #endregion } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs index fcd56e92..4210a46c 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs @@ -1,13 +1,13 @@ -using Microsoft.Extensions.Localization; +using System.Linq.Expressions; +using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Dtos.TrackPull; +using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPull; -using System.Linq.Expressions; using Volo.Abp.DependencyInjection; namespace SJZY.Track.Application.Services.TrackPull; @@ -50,7 +50,8 @@ public class TrackPullService : ApplicationService, ITransientDependency /// /// [HttpPost("GetContentPage")] - public async Task> GetContentPageAsync([FromBody] GetTrackPullContentPageInputVO input) + public async Task> GetContentPageAsync( + [FromBody] GetTrackPullContentPageInputVO input) { return await _trackPullConfigRepository.GetContentPageAsync(input); } @@ -88,7 +89,8 @@ public class TrackPullService : ApplicationService, ITransientDependency if (input.Options != OptionTypeNoNull.删除) { Expression> isAnyExp = x => - x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId && x.ServiceProviderId == input.ServiceProviderId; + x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId && + x.ServiceProviderId == input.ServiceProviderId; if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id); if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp)) @@ -98,86 +100,96 @@ public class TrackPullService : ApplicationService, ITransientDependency switch (input.Options) { case OptionTypeNoNull.新增: + { + var trackPullEntity = ObjectMapper.Map(input); + var trackPullParamsEntity = + ObjectMapper.Map(input); + + var trackTemplateContentEntities = + await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId); + + var trackPullContentEntities = new List(); + + using (var ts = TransactionScopeHelper.Create()) { - var trackPullEntity = ObjectMapper.Map(input); - var trackPullParamsEntity = ObjectMapper.Map(input); + int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity); - var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId); + trackPullParamsEntity.PullOrPushConfigId = id; + await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity); - var trackPullContentEntities = new List(); - - using (var ts = TransactionScopeHelper.Create()) + foreach (var item in trackTemplateContentEntities) { - int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity); - - trackPullParamsEntity.PullOrPushConfigId = id; - await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity); - - foreach (var item in trackTemplateContentEntities) + trackPullContentEntities.Add(new() { - trackPullContentEntities.Add(new() - { - TrackPullConfigId = id, - TrackContentId = item.TrackContentId - }); - } - await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); - - ts.Complete(); + TrackPullConfigId = id, + TrackContentId = item.TrackContentId + }); } + + await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); + + ts.Complete(); } + } break; case OptionTypeNoNull.修改: + { + var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? + throw new BusinessException(message: _stringLocalizer["NotFindData"]); + + var oldTrackPullParamsEntity = + await _trackPullConfigRepository.GetParamsSingleAsync(x => + x.PullOrPushConfigId == input.Id && !x.IsPush); + + var trackPullContentEntities = new List(); + + if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) { - var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + var trackTemplateContentEntities = + await _trackTemplateRepository.GetContentListAsync(x => + x.TrackTemplateId == input.TrackTemplateId); - var oldTrackPullParamsEntity = await _trackPullConfigRepository.GetParamsSingleAsync(x => x.PullOrPushConfigId == input.Id && !x.IsPush); + foreach (var item in trackTemplateContentEntities) + { + trackPullContentEntities.Add(new() + { + TrackPullConfigId = oldTrackPullEntity.Id, + TrackContentId = item.TrackContentId + }); + } + } - var trackPullContentEntities = new List(); + ObjectMapper.Map(input, oldTrackPullEntity); + ObjectMapper.Map(input, oldTrackPullParamsEntity); + + using (var ts = TransactionScopeHelper.Create()) + { + await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity); + await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity); if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) { - var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId); - - foreach (var item in trackTemplateContentEntities) - { - trackPullContentEntities.Add(new() - { - TrackPullConfigId = oldTrackPullEntity.Id, - TrackContentId = item.TrackContentId - }); - } + await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id); + await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); } - ObjectMapper.Map(input, oldTrackPullEntity); - ObjectMapper.Map(input, oldTrackPullParamsEntity); - - using (var ts = TransactionScopeHelper.Create()) - { - await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity); - await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity); - - if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) - { - await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id); - await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); - } - - ts.Complete(); - } + ts.Complete(); } + } break; case OptionTypeNoNull.删除: using (var ts = TransactionScopeHelper.Create()) { await _trackPullConfigRepository.SoftDeleteAsync(x => x.Id == input.Id); - await _trackPullConfigRepository.SoftDeleteParamsAsync(x => x.PullOrPushConfigId == input.Id && !x.IsPush); + await _trackPullConfigRepository.SoftDeleteParamsAsync(x => + x.PullOrPushConfigId == input.Id && !x.IsPush); await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id); ts.Complete(); } + break; default: @@ -196,7 +208,8 @@ public class TrackPullService : ApplicationService, ITransientDependency [HttpPost("UpdateContent")] public async Task UpdateContentAsync([FromBody] UpdateTrackPullContentInput input) { - var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ?? + throw new BusinessException(message: _stringLocalizer["NotFindData"]); ObjectMapper.Map(input, oldTrackPullContentEntity); diff --git a/src/SJZY.Track.Application/Services/TrackStatus/ITrackStatusService.cs b/src/SJZY.Track.Application/Services/TrackStatus/ITrackStatusService.cs deleted file mode 100644 index eef632b7..00000000 --- a/src/SJZY.Track.Application/Services/TrackStatus/ITrackStatusService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Application.Services.TrackStatus -{ - public interface ITrackStatusService - { - } -} diff --git a/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs index bd58470f..f7ba0720 100644 --- a/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs +++ b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs @@ -1,6 +1,5 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Localization; -using SJZY.Track.Application.Dtos.TrackStatus; +using Microsoft.Extensions.Localization; +using SJZY.Track.Application.Contract.Dtos.TrackStatus; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackStatus; @@ -23,7 +22,7 @@ public class TrackStatusService : ApplicationService, ITransientDependency ITrackStatusRepository trackStatusRepository ) { - this._stringLocalizer=stringLocalizer; + this._stringLocalizer = stringLocalizer; this._trackStatusRepository = trackStatusRepository; } @@ -79,15 +78,19 @@ public class TrackStatusService : ApplicationService, ITransientDependency } #region 私有方法 + private async Task AddAsync(EditTrackStatusInput input) { #region 业务校验 - var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&& (a.Code==input.Code || - a.Status==input.TrackStatus || a.EnStatus==input.EntrackStatus)); - if (trackStatusEntity!=null) + + var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.SubSystemId == input.SubSystemId && + (a.Code == input.Code || + a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus)); + if (trackStatusEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]); } + #endregion var entity = ObjectMapper.Map(input); @@ -99,12 +102,15 @@ public class TrackStatusService : ApplicationService, ITransientDependency private async Task UpdateAsync(EditTrackStatusInput input) { #region 业务校验 - var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id !=input.Id && a.SubSystemId==input.SubSystemId&& (a.Code==input.Code || - a.Status==input.TrackStatus || a.EnStatus==input.EntrackStatus)); - if (trackStatusEntity!=null) + + var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id != input.Id && + a.SubSystemId == input.SubSystemId && (a.Code == input.Code || + a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus)); + if (trackStatusEntity != null) { throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]); } + #endregion var templateEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id == input.Id); @@ -120,5 +126,6 @@ public class TrackStatusService : ApplicationService, ITransientDependency return new UnifyResultDto("200", "删除成功", isTrue); } + #endregion } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs index e77a574d..5afc3992 100644 --- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs +++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs @@ -1,8 +1,7 @@ using System.Linq.Expressions; -using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Localization; -using SJZY.Track.Application.Dtos.TrackTemplates; +using SJZY.Track.Application.Contract.Dtos.TrackTemplates; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.TrackTemplate; @@ -85,12 +84,16 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task AddAsync(EditTrackTemplateInput input) { #region 业务校验 + //校验模版代码唯一性 - var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.SubSystemId == input.SubSystemId &&a.Code==input.Code); + var templateEntity = + await _trackTemplateRepository.GetFirstAsync( + a => a.SubSystemId == input.SubSystemId && a.Code == input.Code); if (templateEntity != null) { throw new BusinessException(message: _stringLocalizer["TemplateExist"]); } + #endregion var entity = ObjectMapper.Map(input); @@ -102,11 +105,14 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task UpdateAsync(EditTrackTemplateInput input) { #region 业务校验 - var isExist = await _trackTemplateRepository.GetFirstAsync(a => a.Id!=input.Id && a.SubSystemId == input.SubSystemId &&a.Code==input.Code); + + var isExist = await _trackTemplateRepository.GetFirstAsync(a => + a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code); if (isExist != null) { throw new BusinessException(message: _stringLocalizer["TemplateExist"]); } + #endregion var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id); @@ -119,8 +125,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task DeleteAsync(EditTrackTemplateInput input) { #region 业务校验 + //到时候,得判断这个模版有没有在轨迹映射里面被使用过,如果被使用就抛出提示 + #endregion + var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue); diff --git a/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs index db26be85..a14bc02f 100644 --- a/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs @@ -1,9 +1,8 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.Demo; +using SJZY.Track.Application.Contract.Dtos.Demo; namespace SJZY.Track.Application.Validations.Demo { - public class SimpleValidateInputValidation : AbstractValidator, IValidationEnabled { public SimpleValidateInputValidation() @@ -31,14 +30,14 @@ namespace SJZY.Track.Application.Validations.Demo RuleFor(x => x.LoginName).MinimumLength(6).WithMessage("登录账号不能小于6个字符!"); //正则表达式 - RuleFor(x => x.PassWord).Matches("^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$\\%\\^\\&\\*\\(\\)])[0-9a-zA-Z!@#$\\%\\^\\&\\*\\(\\)]{6,10}") + RuleFor(x => x.PassWord) + .Matches( + "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$\\%\\^\\&\\*\\(\\)])[0-9a-zA-Z!@#$\\%\\^\\&\\*\\(\\)]{6,10}") .WithMessage("密码必须同时包含数字、英文字母、特殊字符,且长度必须在6-10位之间"); //自定义校验规则,注意这里的校验仅限于模型参数级的校验,更复杂的业务校验应在业务层完成 - RuleFor(x => x.PassWordAgain).Must((data, context) => - { - return data.PassWord == data.PassWordAgain; - }).WithMessage("两次输入密码不一致!"); + RuleFor(x => x.PassWordAgain).Must((data, context) => { return data.PassWord == data.PassWordAgain; }) + .WithMessage("两次输入密码不一致!"); //数字类型校验 RuleFor(x => x.MiniCount).LessThan(100).WithMessage("最小数量必须小于100"); @@ -50,19 +49,19 @@ namespace SJZY.Track.Application.Validations.Demo RuleFor(x => x.TotalQuota).ScalePrecision(2, 4, true).WithMessage("最大额度金额【整数位+小数位】不能超过4位,且小数位不能超过2位"); //条件分支 - When(x => x.Option == OptionType.修改 || x.Option == OptionType.删除, () => - { - RuleFor(x => x.Id).NotNull().WithMessage("修改或删除时Id为必填参数!").GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); - }); + When(x => x.Option == OptionType.修改 || x.Option == OptionType.删除, + () => + { + RuleFor(x => x.Id).NotNull().WithMessage("修改或删除时Id为必填参数!").GreaterThan(0) + .WithMessage("修改或删除时Id必须大于0!"); + }); //单个实体校验 - RuleFor(x => x.UserInfoInput).NotNull().WithMessage("用户信息为必填参数!").SetValidator(new UserInfoInputValidation()); + RuleFor(x => x.UserInfoInput).NotNull().WithMessage("用户信息为必填参数!") + .SetValidator(new UserInfoInputValidation()); //集合校验 RuleForEach(x => x.UserRoleInputList).SetValidator(new UserRoleInputValidation()); } - } - - -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs index b8e5268f..68c7441b 100644 --- a/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs @@ -1,6 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.Demo; - +using SJZY.Track.Application.Contract.Dtos.Demo; namespace SJZY.Track.Application.Validations.Demo { @@ -10,6 +9,5 @@ namespace SJZY.Track.Application.Validations.Demo { RuleFor(x => x.QQ).NotNull().WithMessage("QQ号码不能为空"); } - } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs index fa0307a2..dda21ddf 100644 --- a/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs @@ -1,5 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.Demo; +using SJZY.Track.Application.Contract.Dtos.Demo; namespace SJZY.Track.Application.Validations.Demo { @@ -10,4 +10,4 @@ namespace SJZY.Track.Application.Validations.Demo RuleFor(m => m.Id).GreaterThan(0).WithMessage("角色ID必须大于0!"); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/TrackContents/EditTrackContentInputValidation.cs b/src/SJZY.Track.Application/Validations/TrackContents/EditTrackContentInputValidation.cs index 0faf7a0c..af97fc37 100644 --- a/src/SJZY.Track.Application/Validations/TrackContents/EditTrackContentInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/TrackContents/EditTrackContentInputValidation.cs @@ -1,11 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.TrackContents; -using SJZY.Track.Application.Dtos.TrackTemplates; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using SJZY.Track.Application.Contract.Dtos.TrackContents; namespace SJZY.Track.Application.Validations.TrackContents { @@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackContents public EditTrackContentInputValidation() { //条件分支 - When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () => - { - RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); - }); + When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, + () => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); }); - When(x => x.Options == OptionType.新增, () => - { - RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); - }); + When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); }); When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () => { @@ -33,6 +22,5 @@ namespace SJZY.Track.Application.Validations.TrackContents RuleFor(x => x.EnContent).NotNull().WithMessage("轨迹内容英文必填!").NotEmpty().WithMessage("轨迹内容英文不能为空!"); }); } - } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/TrackFlags/EditTrackFlagInputValidation.cs b/src/SJZY.Track.Application/Validations/TrackFlags/EditTrackFlagInputValidation.cs index da5faec2..6a06da65 100644 --- a/src/SJZY.Track.Application/Validations/TrackFlags/EditTrackFlagInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/TrackFlags/EditTrackFlagInputValidation.cs @@ -1,11 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.TrackFlags; -using SJZY.Track.Application.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using SJZY.Track.Application.Contract.Dtos.TrackFlags; namespace SJZY.Track.Application.Validations.TrackFlags { @@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackFlags public EditTrackFlagInputValidation() { //条件分支 - When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () => - { - RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); - }); + When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, + () => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); }); - When(x => x.Options == OptionType.新增, () => - { - RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); - }); + When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); }); When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () => { @@ -32,4 +21,4 @@ namespace SJZY.Track.Application.Validations.TrackFlags }); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/TrackStatus/EditTrackStatusInputValidation.cs b/src/SJZY.Track.Application/Validations/TrackStatus/EditTrackStatusInputValidation.cs index beb1df54..e492a542 100644 --- a/src/SJZY.Track.Application/Validations/TrackStatus/EditTrackStatusInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/TrackStatus/EditTrackStatusInputValidation.cs @@ -1,11 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.TrackContents; -using SJZY.Track.Application.Dtos.TrackStatus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using SJZY.Track.Application.Contract.Dtos.TrackStatus; namespace SJZY.Track.Application.Validations.TrackStatus { @@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackStatus public EditTrackStatusInputValidation() { //条件分支 - When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () => - { - RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); - }); + When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, + () => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); }); - When(x => x.Options == OptionType.新增, () => - { - RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); - }); + When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); }); When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () => { @@ -34,4 +23,4 @@ namespace SJZY.Track.Application.Validations.TrackStatus }); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs b/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs index 8768b688..aa4bdad8 100644 --- a/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs @@ -1,5 +1,5 @@ using FluentValidation; -using SJZY.Track.Application.Dtos.TrackTemplates; +using SJZY.Track.Application.Contract.Dtos.TrackTemplates; namespace SJZY.Track.Application.Validations.TrackTemplates { @@ -11,16 +11,10 @@ namespace SJZY.Track.Application.Validations.TrackTemplates public EditTrackTemplateInputValidation() { //条件分支 - When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () => - { - RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); - }); + When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, + () => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); }); - When(x => x.Options == OptionType.新增, () => - { - RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); - - }); + When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); }); When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () => { @@ -30,4 +24,4 @@ namespace SJZY.Track.Application.Validations.TrackTemplates }); } } -} +} \ No newline at end of file diff --git a/src/SJZY.Track.HttpApi/Services/IRemoteDemoService.cs b/src/SJZY.Track.HttpApi/Services/IRemoteDemoService.cs deleted file mode 100644 index 6ea693bf..00000000 --- a/src/SJZY.Track.HttpApi/Services/IRemoteDemoService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using SJZY.Expand.ABP.Core.Common.Dto; -using SJZY.Track.HttpApi.Dtos; -using Volo.Abp; -using Volo.Abp.DependencyInjection; - -namespace SJZY.Track.HttpApi.Services -{ - /// - /// 客户端连接测试接口 - /// - public interface IRemoteDemoService : IRemoteService, IScopedDependency - { - Task> ConnectionTest(RemoteDemoInput input); - } -} diff --git a/test/SJZY.Track.Test/Demo/DemoTest.cs b/test/SJZY.Track.Test/Demo/DemoTest.cs index da9cd4f2..47e60be3 100644 --- a/test/SJZY.Track.Test/Demo/DemoTest.cs +++ b/test/SJZY.Track.Test/Demo/DemoTest.cs @@ -1,5 +1,4 @@ - -using SJZY.Track.Application.Dtos.Demo; +using SJZY.Track.Application.Contract.Dtos.Demo; using SJZY.Track.Application.Services.Demo; namespace SJZY.OpenApi.Test.Demo @@ -7,11 +6,14 @@ namespace SJZY.OpenApi.Test.Demo public class DemoTest : TestModuleTestBase { #region 构造函数 + private InterFaceDemoService _interFaceDemoService; + public DemoTest() { _interFaceDemoService = GetRequiredService(); } + #endregion [Fact] @@ -23,6 +25,5 @@ namespace SJZY.OpenApi.Test.Demo Assert.NotNull(res); } - } -} +} \ No newline at end of file From 7f14abe02767464964306547e9e9d03cb83d6da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 10:27:55 +0800 Subject: [PATCH 04/34] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Api/Program.cs | 4 +- src/SJZY.Track.Api/SJZY.Track.Api.csproj | 46 ++-- ...rackApiModule.cs => SjzyTrackApiModule.cs} | 6 +- .../Dtos/Demo/ComplexAutomapperDemoInput.cs | 85 ------ .../Dtos/Demo/DemoDetailInput.cs | 48 ---- .../Dtos/Demo/DemoInput.cs | 42 --- .../Dtos/Demo/ExcelImportOuput.cs | 10 - .../Dtos/Demo/GetDemoListByPageInput.cs | 9 - .../Dtos/Demo/GetDemoListByPageOutput.cs | 27 -- .../Dtos/Demo/MyCustomerResultOutput.cs | 9 - .../Dtos/Demo/OssUploadOutput.cs | 15 -- .../Dtos/Demo/RemoteDemoInput.cs | 10 - .../Dtos/Demo/RemoteDemoOutput.cs | 7 - .../Dtos/Demo/SwaggerDemoInput.cs | 39 --- .../Dtos/Demo/ValidateExecuteInput.cs | 97 ------- .../Dtos/Demo/ValidateExecuteOutput.cs | 6 - .../SJZY.Track.Application.Contract.csproj | 8 +- .../Services/IRemoteDemoService.cs | 13 - .../SjzyTrackApplicationContractModule.cs | 10 + .../TrackHttpApiModule.cs | 11 - .../AutoMapper/AutoMapperProfile.cs | 33 --- .../AutoMapper/DemoAutoMapperProfile.cs | 44 --- src/SJZY.Track.Application/GlobalUsing.cs | 1 + src/SJZY.Track.Application/GlobalUsings.cs | 3 - .../SJZY.Track.Application.csproj | 41 ++- .../Services/Demo/InterFaceDemoService.cs | 251 ------------------ ...odule.cs => SjzyTrackApplicationModule.cs} | 14 +- .../Demo/SimpleValidateInputValidation.cs | 67 ----- .../Demo/UserInfoInputValidation.cs | 13 - .../Demo/UserRoleInputValidation.cs | 13 - src/SJZY.Track.Domain/IBasicRepository.cs | 4 +- .../SJZY.Track.Domain.csproj | 4 - .../SJZYTrackDomainModule.cs | 2 +- .../Repositories/BasicRepository.cs | 8 +- .../Repositories/TrackStatusRepository.cs | 14 +- .../SJZY.Track.Infrastructure.csproj | 47 ++-- .../SJZYTrackInfrastructureModule.cs | 14 +- .../Entitys/TrackPushRecordEntity.cs | 6 +- test/SJZY.Track.Test/Demo/DemoTest.cs | 29 -- test/SJZY.Track.Test/TestModule.cs | 9 +- 40 files changed, 102 insertions(+), 1017 deletions(-) rename src/SJZY.Track.Api/{SJZYTrackApiModule.cs => SjzyTrackApiModule.cs} (96%) delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs delete mode 100644 src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs create mode 100644 src/SJZY.Track.Application.Contract/SjzyTrackApplicationContractModule.cs delete mode 100644 src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs delete mode 100644 src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs delete mode 100644 src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs delete mode 100644 src/SJZY.Track.Application/GlobalUsings.cs delete mode 100644 src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs rename src/SJZY.Track.Application/{ApplicationModule.cs => SjzyTrackApplicationModule.cs} (83%) delete mode 100644 src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs delete mode 100644 src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs delete mode 100644 src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs delete mode 100644 test/SJZY.Track.Test/Demo/DemoTest.cs diff --git a/src/SJZY.Track.Api/Program.cs b/src/SJZY.Track.Api/Program.cs index 9d6d0ed4..db266046 100644 --- a/src/SJZY.Track.Api/Program.cs +++ b/src/SJZY.Track.Api/Program.cs @@ -10,10 +10,10 @@ try .AddConfigurationContainer() .AddOptionsFromConfiguration() .UseSerilogDefault() - .Host.AddAppSettingsSecretsJson() + .Host.AddAppSettingsSecretsJson() .UseAutofac(); - await builder.AddApplicationAsync(); + await builder.AddApplicationAsync(); var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/src/SJZY.Track.Api/SJZY.Track.Api.csproj b/src/SJZY.Track.Api/SJZY.Track.Api.csproj index 0dd07648..a2a8fad3 100644 --- a/src/SJZY.Track.Api/SJZY.Track.Api.csproj +++ b/src/SJZY.Track.Api/SJZY.Track.Api.csproj @@ -1,34 +1,26 @@  - - net7.0 - enable - enable - True - Linux - ..\.. - + - - - - - - + + net7.0 + True + Linux + ..\.. + - - - - - - - + + + + + + + + + + + + - - - - - - diff --git a/src/SJZY.Track.Api/SJZYTrackApiModule.cs b/src/SJZY.Track.Api/SjzyTrackApiModule.cs similarity index 96% rename from src/SJZY.Track.Api/SJZYTrackApiModule.cs rename to src/SJZY.Track.Api/SjzyTrackApiModule.cs index 07bb3fee..443495ce 100644 --- a/src/SJZY.Track.Api/SJZYTrackApiModule.cs +++ b/src/SJZY.Track.Api/SjzyTrackApiModule.cs @@ -27,10 +27,10 @@ namespace SJZY.Track.Api typeof(SjzyAbpCodeModule), typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreSerilogModule), - typeof(ApplicationModule), - typeof(SJZYTrackInfrastructureModule) + typeof(SjzyTrackApplicationModule), + typeof(SjzyTrackInfrastructureModule) )] - public class SJZYTrackApiModule : AbpModule + public class SjzyTrackApiModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs deleted file mode 100644 index f2162eb5..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/ComplexAutomapperDemoInput.cs +++ /dev/null @@ -1,85 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - /// - /// automapper 复杂转换样例 - /// - public class ComplexAutomapperDemoInput - { - /// - /// 编号 - /// - public int Id { get; set; } - - /// - /// 操作类型 - /// - public OptionType OptionType { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } - - /// - /// 性别 - /// - public Gender Gender { get; set; } - - /// - /// 用户信息 - /// - public UserInfoInput UserInfo { get; set; } - - /// - /// 用户角色 - /// - public List UserRoleInputList { get; set; } - - /// - /// 拓展演示,目前大家共同约定,暂时不使用充血模型 - /// - /// - public string GetAddress() - { - return "辽宁省沈阳市..."; - } - } - - public class ComplexAutomapperDemoOutput - { - /// - /// 编号 - /// - public int Id { get; set; } - - /// - /// 性别 - /// - public string Gender { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } - - /// - /// 年龄 - /// - public int Age { get; set; } - - /// - /// qq号码 - /// - public string QQ { get; set; } - - /// - /// 地址 - /// - public string Address { get; set; } - - /// - /// 角色编号 - /// - public int[] RoleIds { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs deleted file mode 100644 index e80c4745..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoDetailInput.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class DemoDetailSaveInput - { - /// - /// - /// - public int Id { get; set; } - - /// - /// 姓名 - /// - public string Name { get; set; } - - /// - /// 年龄 - /// - public int Age { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } - - /// - /// 详情合集 - /// - public List DemoDetailList { get; set; } - } - - public class DemoDetailInput - { - /// - /// Id - /// - public int Id { get; set; } - - /// - /// t_demo.id - /// - public int DemoId { get; set; } - - /// - /// 一些说明.. - /// - public string OtherInfo { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs deleted file mode 100644 index 87f95820..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/DemoInput.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class DemoInput - { - /// - /// 操作类型 - /// - public OptionType Option { get; set; } - - /// - /// - /// - public int Id { get; set; } - - /// - /// 姓名 - /// - public string Name { get; set; } - - /// - /// 年龄 - /// - public int Age { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } - - //以下两个属性用来说明类型转换 - - /// - /// 创建人id - /// - public string CreateUserId { get; set; } - - /// - /// 创建时间 - /// - public string CreateTime { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs deleted file mode 100644 index b2afbc57..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/ExcelImportOuput.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo; - -public class ExcelImportOuput -{ - // [MiniExcelLibs.Attributes.ExcelColumnName("姓名")] - public string Name { get; set; } - - // [MiniExcelLibs.Attributes.ExcelColumnName("年龄")] - public int Age { get; set; } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs deleted file mode 100644 index a49e420a..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageInput.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo; - -public class GetDemoListByPageInput : PageInfoInput -{ - /// - /// 姓名 - /// - public string Name { get; set; } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs deleted file mode 100644 index fd91bc62..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/GetDemoListByPageOutput.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class GetDemoListByPageOutput - { - /// - /// - /// - public int Id { get; set; } - - /// - /// 姓名 - /// - public string Name { get; set; } - - /// - /// 年龄 - /// - public int Age { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } - - public DateTime CreateTime { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs deleted file mode 100644 index f1a5288c..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/MyCustomerResultOutput.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class MyCustomerResultOutput - { - public string Code { get; set; } - - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs deleted file mode 100644 index 68b3abcf..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/OssUploadOutput.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class OssUploadOutput - { - /// - /// 文件key - /// - public string Key { get; set; } - - /// - /// 文件路径 - /// - public string Url { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs deleted file mode 100644 index 2f43a8fa..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoInput.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos -{ - public class RemoteDemoInput - { - /// - /// 当前时间 - /// - public DateTime CurrentTime { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs deleted file mode 100644 index 0cd20796..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/RemoteDemoOutput.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos -{ - public class RemoteDemoOutput - { - public string Context { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs deleted file mode 100644 index eefc7559..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/SwaggerDemoInput.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel; -using System.Text.Json.Serialization; - -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class SwaggerDemoInput - { - /// - /// 年龄 - /// - /// 18 这里可以写一些初始值 - public int Age { get; set; } - - /// - /// 姓名 - /// - public string Name { get; set; } - - /// - /// 性别(枚举的展示样例) - /// - public Gender Gender { get; set; } - - /// - /// 隐藏属性 - /// - [JsonIgnore] - public int MyProperty { get; set; } - } - - public enum Gender - { - [Description("纯爷们")] 男 = 2, - - [Description("大姑娘")] 女 = 5, - - [Description("你憋问")] 未知 = 8 - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs deleted file mode 100644 index 2de0afdf..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteInput.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class ValidateExecuteInput - { - /// - /// 操作类型 - /// - public OptionType Option { get; set; } - - /// - /// 主键编号 - /// - public int Id { get; set; } - - /// - /// 雪花ID - /// - public long SnowId { get; set; } - - /// - /// 登录账号 - /// - public string LoginName { get; set; } - - /// - /// 登录密码 - /// - public string? PassWord { get; set; } - - /// - /// 登录密码确认 - /// - public string PassWordAgain { get; set; } - - /// - /// 最大金额额度 - /// - public decimal TotalQuota { get; set; } - - /// - /// 最大数量 - /// - public int MaxCount { get; set; } - - /// - /// 最小数量 - /// - public int MiniCount { get; set; } - - /// - /// 用户信息 - /// - public UserInfoInput UserInfoInput { get; set; } - - /// - /// 用户角色 - /// - public List UserRoleInputList { get; set; } - } - - public class UserInfoInput - { - /// - /// 生日 - /// - public DateTime BirthDay { get; set; } - - /// - /// qq号码 - /// - public string QQ { get; set; } - - /// - /// 电子邮箱 - /// - public string Email { get; set; } - - /// - /// 用户姓名 - /// - public string UserName { get; set; } - } - - - public class UserRoleInput - { - /// - /// 角色编号 - /// - public int Id { get; set; } - - /// - /// 角色名称 - /// - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs deleted file mode 100644 index 1ea87d0f..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Demo/ValidateExecuteOutput.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.Demo -{ - public class ValidateExecuteOutput - { - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index 1d376964..a7a570d0 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -1,14 +1,14 @@ + + net7.0 - enable - enable 0.0.2 - - + + diff --git a/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs b/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs deleted file mode 100644 index 841cae19..00000000 --- a/src/SJZY.Track.Application.Contract/Services/IRemoteDemoService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using SJZY.Track.Application.Contract.Dtos; -using Volo.Abp; -using Volo.Abp.DependencyInjection; - -namespace SJZY.Track.Application.Contract.Services; - -/// -/// 客户端连接测试接口 -/// -public interface IRemoteDemoService : IRemoteService, IScopedDependency -{ - Task> ConnectionTest(RemoteDemoInput input); -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/SjzyTrackApplicationContractModule.cs b/src/SJZY.Track.Application.Contract/SjzyTrackApplicationContractModule.cs new file mode 100644 index 00000000..0da04423 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/SjzyTrackApplicationContractModule.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace SJZY.Track.Application.Contract; + +public class SjzyTrackApplicationContractModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs b/src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs deleted file mode 100644 index a76ed6da..00000000 --- a/src/SJZY.Track.Application.Contract/TrackHttpApiModule.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.Abp.Modularity; - -namespace SJZY.Track.Application.Contract -{ - public class TrackHttpApiModule : AbpModule - { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs deleted file mode 100644 index 87914d8e..00000000 --- a/src/SJZY.Track.Application/AutoMapper/AutoMapperProfile.cs +++ /dev/null @@ -1,33 +0,0 @@ -using AutoMapper; -using SJZY.Track.Application.Contract.Dtos.Demo; -using SJZY.Track.Domain.Aggregates.DemoAggregate; -using SJZY.Track.Domain.Dtos.Demo; - -namespace SJZY.Track.Application.AutoMapper; - -internal class AutoMapperProfile : Profile -{ - public AutoMapperProfile() - { - CreateMap, UnifyPageResultDto>(MemberList.None); - - CreateMap(MemberList.None).ReverseMap(); - CreateMap, UnifyPageResultDto>(MemberList.None) - .ReverseMap(); - /* - 代码说明: - MemberList.None的意思是,忽略源对象和目标对象的属性匹配检查,其他可选值:MemberList.Source(检查是否映射了所有源成员)、MemberList.Destination(检查是否映射了所有目标成员) - .ReverseMap()的意思是配置双向调用关系,既一行代码既支持从 GetDemoListByPageInput -> DemoValueObject 的映射,同时也支持从 DemoValueObject -> GetDemoListByPageInput 的映射 - - - 如果对一对模型多次配置规则,会以最后一次为准,配置了这样规则后,最终执行结果是 Name + 444 - CreateMap().ForMember(dest => dest.Description, opt => opt.MapFrom(m => m.Name + "22")); - CreateMap().ForMember(dest => dest.Description, opt => opt.MapFrom(m => m.Name + "444")); - - */ - - CreateMap(MemberList.None).ReverseMap(); - CreateMap(MemberList.None); - CreateMap(MemberList.None).ReverseMap(); - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs deleted file mode 100644 index ba28b16e..00000000 --- a/src/SJZY.Track.Application/AutoMapper/DemoAutoMapperProfile.cs +++ /dev/null @@ -1,44 +0,0 @@ -using AutoMapper; -using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Contract.Dtos.Demo; - -namespace SJZY.Track.Application.AutoMapper -{ - /// - /// 稍复杂的配置类 - /// - internal class DemoAutoMapperProfile : Profile - { - public DemoAutoMapperProfile() - { - CreateMap(MemberList.None) - //层级不一致的场景 - .ForMember(dest => dest.QQ, opt => opt.MapFrom(source => source.UserInfo.QQ)) - //数据类型不一致的场景,这里如果不指定映射规则会直接取枚举的key值 - .ForMember(dest => dest.Gender, opt => opt.MapFrom(source => source.Gender.GetDescription())) - //一些简单计算的场景,酌情使用... - .ForMember(dest => dest.Age, opt => opt.MapFrom(source => GetAgeByBirthdate(source.UserInfo.BirthDay))) - //结构不一致的场景 - .ForMember(dest => dest.RoleIds, - opt => opt.MapFrom(source => source.UserRoleInputList.Select(m => m.Id).ToArray())) - //条件映射(这里只是举例,日常开发时sqlsugar在新增时会避开自增主键) - .ForMember(dest => dest.Id, - opt => - { - opt.Condition(src => src.OptionType == OptionType.删除 || src.OptionType == OptionType.修改); - }); - } - - public int GetAgeByBirthdate(DateTime birthdate) - { - DateTime now = DateTime.Now; - int age = now.Year - birthdate.Year; - if (now.Month < birthdate.Month || (now.Month == birthdate.Month && now.Day < birthdate.Day)) - { - age--; - } - - return age < 0 ? 0 : age; - } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/GlobalUsing.cs b/src/SJZY.Track.Application/GlobalUsing.cs index e21f1746..e4968bf8 100644 --- a/src/SJZY.Track.Application/GlobalUsing.cs +++ b/src/SJZY.Track.Application/GlobalUsing.cs @@ -5,3 +5,4 @@ global using SJZY.Expand.ABP.Core.Common.Dto; global using Volo.Abp; global using Volo.Abp.Application.Services; global using Volo.Abp.Validation; +global using SJZY.Track.Domain; \ No newline at end of file diff --git a/src/SJZY.Track.Application/GlobalUsings.cs b/src/SJZY.Track.Application/GlobalUsings.cs deleted file mode 100644 index 63eef9f8..00000000 --- a/src/SJZY.Track.Application/GlobalUsings.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Global using directives - -global using SJZY.Track.Domain; \ No newline at end of file diff --git a/src/SJZY.Track.Application/SJZY.Track.Application.csproj b/src/SJZY.Track.Application/SJZY.Track.Application.csproj index 93d801c4..fa25c565 100644 --- a/src/SJZY.Track.Application/SJZY.Track.Application.csproj +++ b/src/SJZY.Track.Application/SJZY.Track.Application.csproj @@ -1,32 +1,21 @@  - - - - net7.0 - True - + - - - - - - - - + + net7.0 + True + - - - - - - - - + + + + + + - - - - + + + + diff --git a/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs b/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs deleted file mode 100644 index 39d63fc8..00000000 --- a/src/SJZY.Track.Application/Services/Demo/InterFaceDemoService.cs +++ /dev/null @@ -1,251 +0,0 @@ -using SJZY.Expand.ABP.Core.Common; -using SJZY.Track.Application.Contract.Dtos.Demo; -using SJZY.Track.Domain.Aggregates.DemoAggregate; -using SJZY.Track.Domain.Dtos.Demo; - -namespace SJZY.Track.Application.Services.Demo; - -/// -/// 接口请求完整样例 -/// -[ApiExplorerSettings(GroupName = "Demo")] -public class InterFaceDemoService : ApplicationService -{ - #region 构造函数 - - private readonly IDemoRepository _demoRepository; - - public InterFaceDemoService(IDemoRepository demoRepository) - { - _demoRepository = demoRepository; - } - - #endregion - - #region 增删改 - - /// - /// 增删改 - /// - /// - /// - [HttpPost("InterFace/Edit")] - public async Task Edit(DemoInput input) - { - var res = new LongIdBaseDto(); - - if (input.Option == OptionType.新增) - { - var entity = ObjectMapper.Map(input); - res.Id = await _demoRepository.InsertReturnIdentityAsync(entity); - } - else if (input.Option == OptionType.修改 || input.Option == OptionType.删除) - { - var demoInfo = await _demoRepository.GetById1(input.Id); - if (demoInfo == null) - { - //校验数据是否存在... - throw new BusinessException(message: "未找到指定编号下的数据"); - } - - res.Id = demoInfo.Id; - if (input.Option == OptionType.删除) - { - //await _demoRepository.DeleteAsync(demoInfo); //真删除 - - //软删除 - demoInfo.IsDeleted = true; - await _demoRepository.UpdateAsync(demoInfo); - } - else - { - var entity = ObjectMapper.Map(input, demoInfo); - await _demoRepository.UpdateAsync(entity); - } - } - - return res; - } - - #endregion - - #region 局部更新最佳实践 - - /// - /// 局部更新最佳实践 - /// - /// - /// - /// - [HttpPost("InterFace/UpdatePartColumns")] - public async Task UpdatePartColumns(DemoInput input) - { - var demoInfo = await _demoRepository.GetById1(input.Id); - if (demoInfo == null) - { - //校验数据是否存在... - throw new BusinessException(message: "未找到指定编号下的数据"); - } - - //更新同时忽略某几项参数 - await _demoRepository.UpdatePartColumns(demoInfo); - - return new IdBaseDto() { Id = input.Id }; - } - - #endregion - - #region 分页查询接口 - - /// - /// 分页查询 - /// - /// - /// - [HttpPost("InterFace/GetListByPage")] - public async Task> GetListByPage(GetDemoListByPageInput input) - { - //分页时返回值统一用 PageResultDto<> 类型 - var list = await _demoRepository.GetListByPage(input.PageSize, input.PageIndex, input.Name); - - var res = ObjectMapper.Map, UnifyPageResultDto>(list); - - return res; - } - - #endregion - - #region 入参转换 - - /// - /// 入参转换 - /// - /// - /// - [HttpPost("InterFace/InputToValueObject")] - public async Task> InputToValueObject(GetDemoListByPageInput input) - { - var obj = ObjectMapper.Map(input); - var list = await _demoRepository.InputToValueObject(obj); - - var res = ObjectMapper.Map, List>(list); - return res; - } - - #endregion - - #region 原生sql - - /// - /// 原生sql - /// - /// - /// - [HttpPost("InterFace/OriginalSql")] - public async Task> OriginalSql(DemoValueObject obj) - { - var list = await _demoRepository.OriginalSql(obj); - return list; - } - - #endregion - - #region 自定义返回结果格式 - - /// - /// 自定义返回结果格式 - /// - /// - /// - [HttpPost("Demo/CustomerResult")] - [CustomerResult] - public async Task GetListAsync() - { - /* - 说明: - 理论上我们有全公司级别的返回值约定,不管是前端调后端,还是后端微服务间的调用,都应完全遵循该规范。 - 但不排除有些特殊情况下,必须要返回自定义格式的场景。 - */ - - var res = new MyCustomerResultOutput(); - res.Code = "200"; - res.Message = "这是一个自定义返回结果"; - - return res; - } - - #endregion - - #region 约定类型下返回null - - /// - /// 约定类型下返回null - /// - /// - /// - [HttpPost("Demo/ReturnNull")] - public async Task ReturnNull() - { - MyCustomerResultOutput res = null; - return res; - } - - #endregion - - #region - - /// - /// 没有返回值 - /// - /// - /// - [HttpPost("Demo/WithoutReturnObject")] - public async Task WithoutReturnObject() - { - return null; - } - - #endregion - - #region 主从关系实体存储 - - /// - /// 主从关系实体存储 - /// - /// - /// - [HttpPost("InterFace/EntityRelationSave")] - public async Task EntityRelationSave(DemoDetailSaveInput input) - { - var obj = ObjectMapper.Map(input); - var res = await _demoRepository.EntityRelationSave(obj); - - return new UnifyResultDto(res); - } - - #endregion - - #region 数据缓存 - - /// - /// 数据缓存 - /// - /// - /// - [HttpPost("InterFace/GetDataCache")] - public async Task GetDataCache(IdBaseDto input) - { - var res = await _demoRepository.GetDataCache(input.Id); - return res; - } - - #endregion - - //[HttpPost("InterFace/AAAA")] - //public async Task AAAA() - //{ - // var result = await _httpClientProxy.Service.GetSystemTokenAsync("Track"); - - // return result; - //} -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/ApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs similarity index 83% rename from src/SJZY.Track.Application/ApplicationModule.cs rename to src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index 94127ff2..97b9337f 100644 --- a/src/SJZY.Track.Application/ApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -1,4 +1,5 @@ using SJZY.Expand.ABP.Core.Localization; +using SJZY.Track.Application.Contract; using SJZY.Track.Application.Localization; using SJZY.UserCenter.Contracts; using SJZY.UserCenter.SharedModel; @@ -19,25 +20,26 @@ namespace SJZY.Track.Application typeof(AbpLocalizationModule), typeof(AbpVirtualFileSystemModule), typeof(AbpHttpClientModule), - typeof(SJZYTrackDomainModule), - typeof(SjzyUserCenterHttpApiModule) + typeof(SjzyUserCenterHttpApiModule), + typeof(SjzyTrackDomainModule), + typeof(SjzyTrackApplicationContractModule) )] - public class ApplicationModule : AbpModule + public class SjzyTrackApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); - Configure(options => { options.AddMaps(true); }); + Configure(options => { options.AddMaps(true); }); Configure(options => { - options.ConventionalControllers.Create(typeof(ApplicationModule).Assembly); //创建动态api + options.ConventionalControllers.Create(typeof(SjzyTrackApplicationModule).Assembly); //创建动态api }); //添加虚拟文件系统 Configure(options => { - options.FileSets.AddEmbedded("SJZY.Track.Application"); + options.FileSets.AddEmbedded("SJZY.Track.Application"); }); //添加多语言 diff --git a/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs deleted file mode 100644 index a14bc02f..00000000 --- a/src/SJZY.Track.Application/Validations/Demo/SimpleValidateInputValidation.cs +++ /dev/null @@ -1,67 +0,0 @@ -using FluentValidation; -using SJZY.Track.Application.Contract.Dtos.Demo; - -namespace SJZY.Track.Application.Validations.Demo -{ - public class SimpleValidateInputValidation : AbstractValidator, IValidationEnabled - { - public SimpleValidateInputValidation() - { - /* - 非空校验 - NotNull 和 NotEmpty 的区别? - NotNull:请求中没找到指定参数 - NotEmpty:请求中没找到指定参数 或 参数值为初始值(0/"") - 关于字符串的最佳实践: - 参数定义成可空字符串 string?,校验规则只用isempty - - */ - RuleFor(x => x.PassWord).NotNull().WithMessage("操作密码为必填参数!").NotEmpty().WithMessage("操作密码不能为空!"); - - //雪花id - RuleFor(x => x.SnowId).NotNull().WithMessage("雪花ID为必填参数!").NotEmpty().WithMessage("雪花ID不能为空!"); - - //枚举校验 - RuleFor(x => x.Option).IsInEnum().WithMessage("操作类型不在可选范围!"); - - //字符串长度校验,长度不分中文、字符、数值 - RuleFor(x => x.LoginName).Length(6, 10).WithMessage("登录账号必须在6-10位之间!"); - RuleFor(x => x.LoginName).MaximumLength(10).WithMessage("登录账号不能超过10个字符!"); - RuleFor(x => x.LoginName).MinimumLength(6).WithMessage("登录账号不能小于6个字符!"); - - //正则表达式 - RuleFor(x => x.PassWord) - .Matches( - "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$\\%\\^\\&\\*\\(\\)])[0-9a-zA-Z!@#$\\%\\^\\&\\*\\(\\)]{6,10}") - .WithMessage("密码必须同时包含数字、英文字母、特殊字符,且长度必须在6-10位之间"); - - //自定义校验规则,注意这里的校验仅限于模型参数级的校验,更复杂的业务校验应在业务层完成 - RuleFor(x => x.PassWordAgain).Must((data, context) => { return data.PassWord == data.PassWordAgain; }) - .WithMessage("两次输入密码不一致!"); - - //数字类型校验 - RuleFor(x => x.MiniCount).LessThan(100).WithMessage("最小数量必须小于100"); - RuleFor(x => x.MiniCount).LessThanOrEqualTo(100).WithMessage("最小数量必须小于或等于100"); - RuleFor(x => x.MaxCount).GreaterThan(100).WithMessage("最大数量必须大于100"); - RuleFor(x => x.MaxCount).GreaterThanOrEqualTo(100).WithMessage("最大数量必须大于或等于100"); - - //小数类型校验,10.56 - RuleFor(x => x.TotalQuota).ScalePrecision(2, 4, true).WithMessage("最大额度金额【整数位+小数位】不能超过4位,且小数位不能超过2位"); - - //条件分支 - When(x => x.Option == OptionType.修改 || x.Option == OptionType.删除, - () => - { - RuleFor(x => x.Id).NotNull().WithMessage("修改或删除时Id为必填参数!").GreaterThan(0) - .WithMessage("修改或删除时Id必须大于0!"); - }); - - //单个实体校验 - RuleFor(x => x.UserInfoInput).NotNull().WithMessage("用户信息为必填参数!") - .SetValidator(new UserInfoInputValidation()); - - //集合校验 - RuleForEach(x => x.UserRoleInputList).SetValidator(new UserRoleInputValidation()); - } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs deleted file mode 100644 index 68c7441b..00000000 --- a/src/SJZY.Track.Application/Validations/Demo/UserInfoInputValidation.cs +++ /dev/null @@ -1,13 +0,0 @@ -using FluentValidation; -using SJZY.Track.Application.Contract.Dtos.Demo; - -namespace SJZY.Track.Application.Validations.Demo -{ - public class UserInfoInputValidation : AbstractValidator, IValidationEnabled - { - public UserInfoInputValidation() - { - RuleFor(x => x.QQ).NotNull().WithMessage("QQ号码不能为空"); - } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs b/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs deleted file mode 100644 index dda21ddf..00000000 --- a/src/SJZY.Track.Application/Validations/Demo/UserRoleInputValidation.cs +++ /dev/null @@ -1,13 +0,0 @@ -using FluentValidation; -using SJZY.Track.Application.Contract.Dtos.Demo; - -namespace SJZY.Track.Application.Validations.Demo -{ - public class UserRoleInputValidation : AbstractValidator, IValidationEnabled - { - public UserRoleInputValidation() - { - RuleFor(m => m.Id).GreaterThan(0).WithMessage("角色ID必须大于0!"); - } - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/IBasicRepository.cs b/src/SJZY.Track.Domain/IBasicRepository.cs index 8e9baed2..3824c2eb 100644 --- a/src/SJZY.Track.Domain/IBasicRepository.cs +++ b/src/SJZY.Track.Domain/IBasicRepository.cs @@ -10,7 +10,7 @@ public interface IBasicRepository : IBasicQuery where T : IAggregateRoot /// /// 要忽略更新的列 /// - Task UpdateAsync(T entity, Expression> ignoreColumns); + Task UpdateAsync(T entity, Expression>? ignoreColumns); /// /// update @@ -18,7 +18,7 @@ public interface IBasicRepository : IBasicQuery where T : IAggregateRoot /// /// 要更新的列 /// - Task UpdateColumnAsync(T entity, Expression> updateColumns); + Task UpdateColumnAsync(T entity, Expression>? updateColumns); /// /// update diff --git a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj index aac0e12d..b1f4dc63 100644 --- a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj +++ b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj @@ -10,9 +10,5 @@ - - - - diff --git a/src/SJZY.Track.Domain/SJZYTrackDomainModule.cs b/src/SJZY.Track.Domain/SJZYTrackDomainModule.cs index e9c743d8..792e7844 100644 --- a/src/SJZY.Track.Domain/SJZYTrackDomainModule.cs +++ b/src/SJZY.Track.Domain/SJZYTrackDomainModule.cs @@ -2,6 +2,6 @@ namespace SJZY.Track.Domain; -public class SJZYTrackDomainModule : AbpModule +public class SjzyTrackDomainModule : AbpModule { } \ No newline at end of file diff --git a/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs index a776fd88..7480b9f3 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs @@ -12,14 +12,14 @@ namespace SJZY.Track.Infrastructure.Repositories; /// public class BasicRepository : BasicQuery, IBasicRepository where T : class, IAggregateRoot, new() { - public async Task UpdateAsync(T entity, Expression> ignoreColumns) + public async Task UpdateAsync(T entity, Expression>? ignoreColumns) { return await Context.Updateable(entity) .IgnoreColumnsIF(ignoreColumns != null, ignoreColumns) .ExecuteCommandHasChangeAsync(); } - public async Task UpdateColumnAsync(T entity, Expression> updateColumns) + public async Task UpdateColumnAsync(T entity, Expression>? updateColumns) { return await Context.Updateable(entity) .UpdateColumnsIF(updateColumns != null, updateColumns) @@ -40,15 +40,13 @@ public class BasicRepository : BasicQuery, IBasicRepository where T : c .ExecuteCommandHasChangeAsync(); } + // tips: required where public async Task SoftDeleteAsync(Expression> where) { if (!typeof(T).IsAssignableTo()) throw new BusinessException( message: $"实体没有实现{nameof(ISoftDeleteBasicEntity)}不能调用{nameof(SoftDeleteAsync)}"); - // tips: required where - if (where == default) return false; - return await Context.Updateable() .Where(where) .SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), 1) diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs index a9218613..bf0325bc 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs @@ -6,10 +6,6 @@ namespace SJZY.Track.Infrastructure.Repositories; public class TrackStatusRepository : BasicRepository, ITrackStatusRepository, IScopedDependency { - public TrackStatusRepository() - { - } - /// /// 获取轨迹状态明细 /// @@ -41,8 +37,7 @@ public class TrackStatusRepository : BasicRepository, ITrackS /// public async Task> GetPageTrackStatus(GetPageTrackStatusVO input) { - UnifyPageResultDto pagedList = new UnifyPageResultDto(); - pagedList = await Context.Queryable() + UnifyPageResultDto pagedList = await Context.Queryable() .LeftJoin((a, b) => a.SubSystemId == b.Id) .LeftJoin((a, b, c) => a.CreateUserId == c.Id) .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id) @@ -57,9 +52,10 @@ public class TrackStatusRepository : BasicRepository, ITrackS EntrackStatus = a.EnStatus, TrackStatus = a.Status, NodeId = a.Node, - Node = SqlFunc.IF(a.Node == 1).Return("揽收").ElseIF(a.Node == 2).Return("干线").ElseIF(a.Node == 3).Return("清关") - .ElseIF(a.Node == 4).Return("中转").ElseIF(a.Node == 5).Return("派送") - .End(""), + Node = SqlFunc.IF(a.Node == 1).Return("揽收").ElseIF(a.Node == 2).Return("干线").ElseIF(a.Node == 3) + .Return("清关") + .ElseIF(a.Node == 4).Return("中转").ElseIF(a.Node == 5).Return("派送") + .End(""), CreateTime = a.CreateTime, CreateUser = c.Name, UpdateTime = a.UpdateTime, diff --git a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj b/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj index f1e677f8..f9bee800 100644 --- a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj +++ b/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj @@ -1,37 +1,20 @@  - - - net7.0 - True - preview - + + + net7.0 + True + preview + - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + diff --git a/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs b/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs index c412b69c..048d60fb 100644 --- a/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs +++ b/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs @@ -15,8 +15,8 @@ namespace SJZY.Track.Infrastructure; /// 仓储模块 /// [DependsOn(typeof(AbpAutofacModule))] -[DependsOn(typeof(SJZYTrackDomainModule))] -public class SJZYTrackInfrastructureModule : AbpModule +[DependsOn(typeof(SjzyTrackDomainModule))] +public class SjzyTrackInfrastructureModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { @@ -28,7 +28,7 @@ public class SJZYTrackInfrastructureModule : AbpModule { new() { - ConnectionString = configuration["ConnectionStrings:DefaultConnection"], + ConnectionString = configuration["ConnectionStrings:DefaultConnection"]!, DbType = DbType.MySql, IsAutoCloseConnection = true, ConfigId = "default", OpenSqlLog = true @@ -39,10 +39,10 @@ public class SJZYTrackInfrastructureModule : AbpModule context.Services.AddElasticSearch(options => { - options.NodeUrls = configuration.GetSection("ElasticSearch:NodeUrls").Get>(); - options.LoginName = configuration["ElasticSearch:LoginName"]; - options.Password = configuration["ElasticSearch:Password"]; - options.Base64PassPassword = configuration["ElasticSearch:Base64PassPassword"]; + options.NodeUrls = configuration.GetSection("ElasticSearch:NodeUrls").Get>()!; + options.LoginName = configuration["ElasticSearch:LoginName"]!; + options.Password = configuration["ElasticSearch:Password"]!; + options.Base64PassPassword = configuration["ElasticSearch:Base64PassPassword"]!; }); } diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs b/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs index 32615bba..345e7335 100644 --- a/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs +++ b/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs @@ -36,13 +36,13 @@ namespace SJZY.Track.Infrastructure.TrackPushRecord.Entitys /// 推送内容 /// [SugarColumn(ColumnName = "PushContent")] - public string PushContent { get; set; } + public string PushContent { get; set; } = null!; /// /// 接口通请求id /// [SugarColumn(ColumnName = "RequestId")] - public string RequestId { get; set; } + public string RequestId { get; set; } = null!; /// /// 服务商id @@ -54,6 +54,6 @@ namespace SJZY.Track.Infrastructure.TrackPushRecord.Entitys /// 推送轨迹总数 /// [SugarColumn(ColumnName = "TrackTotal")] - public string TrackTotal { get; set; } + public int TrackTotal { get; set; } } } \ No newline at end of file diff --git a/test/SJZY.Track.Test/Demo/DemoTest.cs b/test/SJZY.Track.Test/Demo/DemoTest.cs deleted file mode 100644 index 47e60be3..00000000 --- a/test/SJZY.Track.Test/Demo/DemoTest.cs +++ /dev/null @@ -1,29 +0,0 @@ -using SJZY.Track.Application.Contract.Dtos.Demo; -using SJZY.Track.Application.Services.Demo; - -namespace SJZY.OpenApi.Test.Demo -{ - public class DemoTest : TestModuleTestBase - { - #region 构造函数 - - private InterFaceDemoService _interFaceDemoService; - - public DemoTest() - { - _interFaceDemoService = GetRequiredService(); - } - - #endregion - - [Fact] - public async Task Test() - { - var data = new DemoInput(); - - var res = await _interFaceDemoService.Edit(data); - - Assert.NotNull(res); - } - } -} \ No newline at end of file diff --git a/test/SJZY.Track.Test/TestModule.cs b/test/SJZY.Track.Test/TestModule.cs index 43bc8f71..6bace7fa 100644 --- a/test/SJZY.Track.Test/TestModule.cs +++ b/test/SJZY.Track.Test/TestModule.cs @@ -13,22 +13,21 @@ using Volo.Abp.Modularity; using Volo.Abp.Threading; [assembly: HostingStartup(typeof(SJZY.Expand.ABP.Core.HostingStartup))] + namespace SJZY.Track.Test; [DependsOn( typeof(AbpAspNetCoreTestBaseModule), typeof(AbpAutofacModule), typeof(AbpAuthorizationModule), - typeof(SJZYTrackInfrastructureModule), - typeof(ApplicationModule), - typeof(SJZYTrackApiModule), + typeof(SjzyTrackInfrastructureModule), + typeof(SjzyTrackApplicationModule), + typeof(SjzyTrackApiModule), typeof(AbpHttpClientModule) //添加abp的http代理模块 )] - [assembly: HostingStartup(typeof(Expand.ABP.Core.HostingStartup))] public class TestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAlwaysAllowAuthorization(); From 2ea78adbb7bcd42d7fee2e6d9e9bb7b4b13c02f4 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 10:36:25 +0800 Subject: [PATCH 05/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoMapper/OrderAutoMapperProfile.cs | 3 +- .../Dtos/Order/GetPageTrackOrderInputVO.cs | 12 +++--- .../Repositories/OrderRepository.cs | 43 +++++++++++-------- .../Repositories/TrackStatusRepository.cs | 2 +- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs index a8d93386..57ad4da9 100644 --- a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs @@ -4,6 +4,7 @@ using SJZY.Track.Application.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Dtos.Order; using System.Diagnostics; +using Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.AutoMapper; @@ -21,6 +22,6 @@ public class OrderAutoMapperProfile : Profile CreateMap(MemberList.None); CreateMap(MemberList.None); - CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap, UnifyPageResultDto>(MemberList.None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs index c95fae3e..44027d12 100644 --- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs @@ -16,7 +16,7 @@ namespace SJZY.Track.Domain.Dtos.Order /// /// 单号 /// - public List OrderNos { get; set; } + public List? OrderNos { get; set; } /// /// 创建时间开始 @@ -26,7 +26,7 @@ namespace SJZY.Track.Domain.Dtos.Order /// /// 创建时间截止 /// - public DateTime? createTimeEnd { get; set; } + public DateTime? CreateTimeEnd { get; set; } } /// @@ -64,10 +64,10 @@ namespace SJZY.Track.Domain.Dtos.Order /// public string? CustomerCode { get; set; } - /// - /// 订单明细(json) - /// - public string? OrderDetails { get; set; } + ///// + ///// 订单明细(json) + ///// + //public string? OrderDetails { get; set; } /// /// 最新轨迹内容 diff --git a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs index 9b556ecb..2771e10c 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs @@ -88,6 +88,11 @@ public class OrderRepository : BasicRepository, IOrderRepository, I var pageList = await Context.Queryable() .LeftJoin((a, b) => a.CustomId==b.Id) .LeftJoin((a, b, c) => a.SubSystemId==c.Id) + .WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId) + .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), (a, b, c) => a.CreateTime>= input.CreateTimeStart) + .WhereIF((!input.CreateTimeStart.HasValue)&& input.CreateTimeEnd.HasValue, (a, b, c) => a.CreateTime<= input.CreateTimeEnd) .Select((a, b, c) => new TrackOrderVO { Id = a.Id, @@ -95,8 +100,8 @@ public class OrderRepository : BasicRepository, IOrderRepository, I OrderType = a.OrderType, CustomerShortName= b.Abbreviation, CustomerCode= b.Code, - TrackTemplateNames = "", - OrderDetails="", + TrackTemplateNames = SqlFunc.Subqueryable().LeftJoin((aa, bb) => aa.TrackTemplateId==bb.Id) + .Where((aa, bb) => a.Id==aa.OrderId).SelectStringJoin((aa, bb) => bb.Name, ","), NewestTrackContent= a.LatestTrackContent, NewestTrackEnContent= a.LatestTrackEnContent, NewestTrackPlace= a.LatestTrackPlace, @@ -105,26 +110,26 @@ public class OrderRepository : BasicRepository, IOrderRepository, I SubSystem= c.CnName }) .ToPagedListAsync(input.PageIndex, input.PageSize); - - if (pageList.List.Any()) - { - var orderIds = pageList.List.Select(a => a.Id); - //查询轨迹模版 + #region 暂时注释 + //if (pageList.List.Any()) + //{ + // var orderIds = pageList.List.Select(a => a.Id); + // //查询轨迹模版 - var trackTemplateList = await Context.Queryable() - .LeftJoin((a, b) => a.TrackTemplateId==b.Id) - .Where((a, b) => orderIds.Contains(a.OrderId)) - .Select((a, b) => new { OrderId = a.OrderId, Name = b.Name }) - .ToListAsync(); - - pageList.List.ForEach(a => - { - var templateListOfOrderId = trackTemplateList.Where(b => b.OrderId== a.Id); - a.TrackTemplateNames = templateListOfOrderId.Select(c => c.Name).JoinAsString(","); - }); - } + // var trackTemplateList = await Context.Queryable() + // .LeftJoin((a, b) => a.TrackTemplateId==b.Id) + // .Where((a, b) => orderIds.Contains(a.OrderId)) + // .Select((a, b) => new { OrderId = a.OrderId, Name = b.Name }) + // .ToListAsync(); + // pageList.List.ForEach(a => + // { + // var templateListOfOrderId = trackTemplateList.Where(b => b.OrderId== a.Id); + // a.TrackTemplateNames = templateListOfOrderId.Select(c => c.Name).JoinAsString(","); + // }); + //} + #endregion return pageList; } diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs index a9218613..f87df9ee 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs @@ -35,7 +35,7 @@ public class TrackStatusRepository : BasicRepository, ITrackS } /// - /// 分页获取轨迹模版 + /// 分页获取轨迹状态 /// /// /// From 8161c8bca27f00c1182fa02981cd1020d03639e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 11:50:41 +0800 Subject: [PATCH 06/34] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs index 9cf11c60..2e58c378 100644 --- a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs @@ -10,7 +10,7 @@ public class KeywordsInputVO : PageInfoInput /// /// 关键字 /// - public string Keywords { get; set; } + public string? Keywords { get; set; } /// /// 选中项 From ee05cc8cff6155541f4e108bf98a5cf47afcbfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 11:53:29 +0800 Subject: [PATCH 07/34] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Api/SjzyTrackApiModule.cs | 2 +- .../Dtos/ProvideServices/TrackUpsertEvent.cs | 6 ++ .../Services/ProvideServices/TrackCustomer.cs | 2 +- .../Services/ProvideServices/TrackService.cs | 1 + .../OrderAggregate/IOrderRepository.cs | 38 +++++--- .../OrderAggregate/OrderLinkEntity.cs | 13 +++ .../Repositories/OrderRepository.cs | 92 +++++++++++-------- .../SJZY.Track.Infrastructure.csproj | 1 + 8 files changed, 104 insertions(+), 51 deletions(-) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs diff --git a/src/SJZY.Track.Api/SjzyTrackApiModule.cs b/src/SJZY.Track.Api/SjzyTrackApiModule.cs index 443495ce..102be9d7 100644 --- a/src/SJZY.Track.Api/SjzyTrackApiModule.cs +++ b/src/SJZY.Track.Api/SjzyTrackApiModule.cs @@ -37,6 +37,7 @@ namespace SJZY.Track.Api var environment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); context.Services.AddSwagger(); + //过滤器相关配置 context.Services.AddMvc(options => { @@ -60,7 +61,6 @@ namespace SJZY.Track.Api Configure(options => options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss"); Configure(options => { options.IsEnabled = false; }); - context.Services.AddRedis(); } diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs new file mode 100644 index 00000000..b6f64a7a --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs @@ -0,0 +1,6 @@ +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; + +public class TrackUpsertEvent +{ + public int Order { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs index d4c57f4c..9f722217 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs @@ -5,5 +5,5 @@ namespace SJZY.Track.Application.Services.ProvideServices; public class TrackCustomer : ITransientDependency, ICapSubscribe { - public const string CapSubscribe = "SJZY.FMC.VoucherRedundantCalc"; + public const string CapSubscribe = "SJZY.Track.Upsert"; } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index a6a5f932..0210a0ac 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -81,6 +81,7 @@ public class TrackService : ApplicationService } // 根据订单关联关系向下刷,不同子系统还需要做内容映射 + var links = await _orderRepository.GetLinkedOrderIdsAsync(orderId); // 推送 return true; diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs index 93d162e2..136375c5 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs @@ -20,6 +20,30 @@ public interface IOrderRepository : IBasicRepository /// Task> GetPageTrackOrder(GetPageTrackOrderInputVO input); + /// + /// 更新订单 + /// + /// + /// + Task UpdateOrderAsync(OrderEntity order); + + /// + /// 删除订单 + /// + /// + /// + Task DeleteOrderAsync(int orderId); + + + #region 订单关联 + + /// + /// 根据订单id,获取关联的订单id集合 + /// + /// + /// + Task> GetLinkedOrderIdsAsync(int orderId); + /// /// 关联订单 /// @@ -34,17 +58,5 @@ public interface IOrderRepository : IBasicRepository /// Task UnLinkByIdsAsync(List linkIds); - /// - /// 更新订单 - /// - /// - /// - Task UpdateOrderAsync(OrderEntity order); - - /// - /// 删除订单 - /// - /// - /// - Task DeleteOrderAsync(int orderId); + #endregion } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderLinkEntity.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderLinkEntity.cs index 112fc472..71231e99 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderLinkEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderLinkEntity.cs @@ -12,6 +12,18 @@ public class OrderLinkEntity : ICreateBaicEntity, ISoftDeleteBasicEntity, IEntit [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } + /// + /// 订单id + /// + [SugarColumn(ColumnName = "OrderId")] + public int OrderId { get; set; } + + /// + /// 关联的订单id + /// + [SugarColumn(ColumnName = "LinkOrderId")] + public int LinkOrderId { get; set; } + /// /// 订单类型 /// @@ -24,6 +36,7 @@ public class OrderLinkEntity : ICreateBaicEntity, ISoftDeleteBasicEntity, IEntit [SugarColumn(ColumnName = "OrderNo")] public string OrderNo { get; set; } = null!; + /// /// 关联的订单类型 /// diff --git a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs index 2771e10c..7fb36b99 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs @@ -1,5 +1,4 @@ -using Nest; -using SJZY.Track.Domain; +using SJZY.Track.Domain; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Order; @@ -18,16 +17,6 @@ public class OrderRepository : BasicRepository, IOrderRepository, I .ExecuteCommandAsync(); } - public async Task LinkOrderAsync(List orderLinkEntities) - { - await Context.Insertable(orderLinkEntities).ExecuteCommandAsync(); - } - - public async Task UnLinkByIdsAsync(List linkIds) - { - await Context.Deleteable(linkIds).ExecuteCommandAsync(); - } - public async Task UpdateOrderAsync(OrderEntity order) { using var tran = TransactionHelper.GetReadCommitted(); @@ -62,6 +51,29 @@ public class OrderRepository : BasicRepository, IOrderRepository, I tran.Complete(); } + #region 订单关联 + + public async Task> GetLinkedOrderIdsAsync(int orderId) + { + return await Context.Queryable() + .LeftJoin((a, b) => a.Id == b.OrderId) + .Where(a => a.Id == orderId) + .Select((a, b) => b.LinkOrderId) + .ToListAsync(); + } + + public async Task LinkOrderAsync(List orderLinkEntities) + { + await Context.Insertable(orderLinkEntities).ExecuteCommandAsync(); + } + + public async Task UnLinkByIdsAsync(List linkIds) + { + await Context.Deleteable(linkIds).ExecuteCommandAsync(); + } + + #endregion + #region 轨迹订单明细 /// @@ -86,31 +98,37 @@ public class OrderRepository : BasicRepository, IOrderRepository, I public async Task> GetPageTrackOrder(GetPageTrackOrderInputVO input) { var pageList = await Context.Queryable() - .LeftJoin((a, b) => a.CustomId==b.Id) - .LeftJoin((a, b, c) => a.SubSystemId==c.Id) - .WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId) - .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), (a, b, c) => a.CreateTime>= input.CreateTimeStart) - .WhereIF((!input.CreateTimeStart.HasValue)&& input.CreateTimeEnd.HasValue, (a, b, c) => a.CreateTime<= input.CreateTimeEnd) - .Select((a, b, c) => new TrackOrderVO - { - Id = a.Id, - OrderNumber= a.OrderNo, - OrderType = a.OrderType, - CustomerShortName= b.Abbreviation, - CustomerCode= b.Code, - TrackTemplateNames = SqlFunc.Subqueryable().LeftJoin((aa, bb) => aa.TrackTemplateId==bb.Id) - .Where((aa, bb) => a.Id==aa.OrderId).SelectStringJoin((aa, bb) => bb.Name, ","), - NewestTrackContent= a.LatestTrackContent, - NewestTrackEnContent= a.LatestTrackEnContent, - NewestTrackPlace= a.LatestTrackPlace, - IsFinish=a.IsCompleted, - CreateTime=a.CreateTime, - SubSystem= c.CnName - }) - .ToPagedListAsync(input.PageIndex, input.PageSize); + .LeftJoin((a, b) => a.CustomId == b.Id) + .LeftJoin((a, b, c) => a.SubSystemId == c.Id) + .WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId) + .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), + (a, b, c) => a.CreateTime >= input.CreateTimeStart) + .WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue, + (a, b, c) => a.CreateTime <= input.CreateTimeEnd) + .Select((a, b, c) => new TrackOrderVO + { + Id = a.Id, + OrderNumber = a.OrderNo, + OrderType = a.OrderType, + CustomerShortName = b.Abbreviation, + CustomerCode = b.Code, + TrackTemplateNames = SqlFunc.Subqueryable() + .LeftJoin((aa, bb) => aa.TrackTemplateId == bb.Id) + .Where((aa, bb) => a.Id == aa.OrderId).SelectStringJoin((aa, bb) => bb.Name, ","), + NewestTrackContent = a.LatestTrackContent, + NewestTrackEnContent = a.LatestTrackEnContent, + NewestTrackPlace = a.LatestTrackPlace, + IsFinish = a.IsCompleted, + CreateTime = a.CreateTime, + SubSystem = c.CnName + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + #region 暂时注释 + //if (pageList.List.Any()) //{ // var orderIds = pageList.List.Select(a => a.Id); @@ -129,7 +147,9 @@ public class OrderRepository : BasicRepository, IOrderRepository, I // a.TrackTemplateNames = templateListOfOrderId.Select(c => c.Name).JoinAsString(","); // }); //} + #endregion + return pageList; } diff --git a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj b/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj index f9bee800..938fe9a1 100644 --- a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj +++ b/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj @@ -4,6 +4,7 @@ net7.0 True preview + SJZY.Track.Repository From 6580831a4ad1425ae947e0ac420ec3601c81626b Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 11:54:22 +0800 Subject: [PATCH 08/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AE=A2=E5=8D=95id=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ITrackDetailsRepository.cs | 1 + .../Repositories/TrackDetailsRepository.cs | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs index 444dd072..89d812a1 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs @@ -13,4 +13,5 @@ public interface ITrackDetailsRepository Task> GetListAsync(int orderType, List orderNos); Task<(List list, long total)> GetListAsync(TrackDetailsQueryInput input); + Task> GetListAsync(int orderId); } \ No newline at end of file diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs index 2737c39d..c23a28fd 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs @@ -37,7 +37,7 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract(index.Id, u => u .Index(IndexName) .Doc(index) - //.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见 + //.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见 ); if (!response.IsValid) throw new Exception($"数据修改失败,原因:{response.DebugInformation}"); @@ -73,6 +73,21 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract> GetListAsync(int orderId) + { + var data = await Context.SearchAsync(x => x + .Source(s => s.Includes(fd => fd + .Field(f => f.TrackStatus) + .Field(f => f.TrackCode) + .Field(f => f.TrackContent) + .Field(f => f.TrackPlace) + .Field(f => f.TrackTime) + .Field(f => f.TraceTimeZone) + )).Query(q => q.Terms(t => t.Field(f => f.OrderId).Terms(orderId)))); + + return data?.Documents?.ToList(); + } + public async Task<(List list, long total)> GetListAsync(TrackDetailsQueryInput input) { if (input.OrderNos.Count < 1) return default; From a54f071769f720133534afe85df5c1b3fad93f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 14:10:37 +0800 Subject: [PATCH 09/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPush/TrackPushService.cs | 11 ++++ .../ITrackPushConfigRepository.cs | 2 + .../GetTrackPushContentDetailOutputVO.cs | 61 +++++++++++++++++++ .../Repositories/TrackPushConfigRepository.cs | 13 ++++ 4 files changed, 87 insertions(+) create mode 100644 src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index f303cc4c..a862e224 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -57,4 +57,15 @@ public class TrackPushService : ApplicationService, ITransientDependency { return await _trackPushConfigRepository.GetDetailAsync(id); } + + /// + /// 轨迹推送配置内容详情 + /// + /// + /// + [HttpGet("GetContentDetail")] + public async Task GetContentDetailAsync(int id) + { + return await _trackPushConfigRepository.GetContentDetailAsync(id); + } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 9050f090..39b19ad2 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -10,4 +10,6 @@ public interface ITrackPushConfigRepository : IBasicRepository> GetContentPageAsync(GetTrackPushContentPageInputVO input); Task GetDetailAsync(int id); + + Task GetContentDetailAsync(int id); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs new file mode 100644 index 00000000..2bad0d5a --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs @@ -0,0 +1,61 @@ +namespace SJZY.Track.Domain.Dtos.TrackPush; + +public class GetTrackPushContentDetailOutputVO +{ + /// + /// 轨迹内容代码 + /// + public string Code { get; set; } + + /// + /// 推送扩展字段 + /// + public string ExpandFieldsValue { get; set; } + + public int Id { get; set; } + + /// + /// 推送单号类型 + /// + public int OrderNoType { get; set; } + + /// + /// 推送轨迹排序 + /// + public int Sort { get; set; } + + /// + /// 推送轨迹内容代码 + /// + public string TrackContentCodeValue { get; set; } + + /// + /// 轨迹内容id + /// + public int TrackContentId { get; set; } + + /// + /// 推送轨迹内容 + /// + public string TrackContentValue { get; set; } + + /// + /// 推送轨迹内容英文 + /// + public string TrackEnContentValue { get; set; } + + /// + /// 轨迹推送配置id + /// + public int TrackPullConfigId { get; set; } + + /// + /// 推送轨迹状态 + /// + public string TrackStatusValue { get; set; } + + /// + /// 推送轨迹时区 + /// + public string TrackTimeZone { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs index d5180da1..d1ce352b 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs @@ -69,4 +69,17 @@ public class TrackPushConfigRepository : BasicRepository, }, true) .SingleAsync(); } + + public async Task GetContentDetailAsync(int id) + { + return await Context.Queryable() + .InnerJoin((pushContent, trackContent) => pushContent.TrackContentId == trackContent.Id) + .Where(pushContent => pushContent.Id == id) + .Select((pushContent, trackContent) => new GetTrackPushContentDetailOutputVO + { + Id = pushContent.Id, + Code = trackContent.Code + "-" + trackContent.Content, + }, true) + .SingleAsync(); + } } \ No newline at end of file From 60c2b221eaa2975064811b0c412663a4a5fee538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 14:21:54 +0800 Subject: [PATCH 10/34] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Events/TrackUpsertEvent.cs | 6 ++++++ .../Services/ProvideServices/TrackService.cs | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs diff --git a/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs new file mode 100644 index 00000000..48784974 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs @@ -0,0 +1,6 @@ +namespace SJZY.Track.Application.Contract.Events; + +public class TrackUpsertEvent +{ + public int OrderId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index 0210a0ac..fad211a8 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -81,7 +81,12 @@ public class TrackService : ApplicationService } // 根据订单关联关系向下刷,不同子系统还需要做内容映射 - var links = await _orderRepository.GetLinkedOrderIdsAsync(orderId); + var linkedOrderIds = await _orderRepository.GetLinkedOrderIdsAsync(orderId); + + if (linkedOrderIds.Count > 0) + { + await _capPublisher.PublishAsync(TrackCustomer.CapSubscribe, new TrackUpsertEvent { }); + } // 推送 return true; From 766e243ca0aa1d6ae093539c1bc08d359c92bd99 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 14:26:52 +0800 Subject: [PATCH 11/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/ProvideServices/OrderService.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs index 38eb9466..0f5fa583 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs @@ -1,6 +1,8 @@ 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 Volo.Abp.ObjectMapping; namespace SJZY.Track.Application.Services.ProvideServices; @@ -11,10 +13,14 @@ namespace SJZY.Track.Application.Services.ProvideServices; public class OrderService : ApplicationService { private readonly IOrderRepository _orderRepository; + private readonly ITrackDetailsRepository _trackDetailsRepository; - public OrderService(IOrderRepository orderRepository) + public OrderService(IOrderRepository orderRepository, + ITrackDetailsRepository trackDetailsRepository + ) { _orderRepository = orderRepository; + this._trackDetailsRepository=trackDetailsRepository; } /// @@ -75,7 +81,14 @@ public class OrderService : ApplicationService [HttpPost("/Order/GetDetails")] public async Task> GetOrderDetails(GetOrderDetailsInput input) { - return null; + var trackDetails = await _trackDetailsRepository.GetListAsync(input.OrderId); + if (!trackDetails.IsNullOrEmpty()) + { + var list = ObjectMapper.Map, List>(trackDetails); + return list; + } + + return new List(); } #endregion From ef8ee7acb660defe115315041480a82a82f14209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 15:07:40 +0800 Subject: [PATCH 12/34] =?UTF-8?q?=E9=80=82=E9=85=8Dvs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SJZY.Track.Api.sln | 2 +- src/SJZY.Track.Api/SJZY.Track.Api.csproj | 16 ++++++++-------- src/SJZY.Track.Api/SjzyTrackApiModule.cs | 4 ++-- .../Services/ITrackPushRecordRepository.cs | 8 -------- .../Services/TrackPushRecordRepository.cs | 10 ---------- .../ITrackPushRecordDetailsRepository.cs | 8 -------- .../Services/TrackPushRecordDetailsRepository.cs | 10 ---------- .../DataBaseContext.cs | 2 +- .../GlobalUsing.cs | 0 .../Queries/BasicQuery.cs | 2 +- .../Queries/TrackQueries.cs | 2 +- .../Repositories/BasicRepository.cs | 4 ++-- .../Repositories/DemoRepository.cs | 2 +- .../Repositories/OrderRepository.cs | 2 +- .../Repositories/TrackContentRepository.cs | 2 +- .../Repositories/TrackDetailsRepository.cs | 2 +- .../Repositories/TrackFlagRepository.cs | 2 +- .../Repositories/TrackPullConfigRepository.cs | 2 +- .../Repositories/TrackPushConfigRepository.cs | 2 +- .../Repositories/TrackStatusRepository.cs | 2 +- .../Repositories/TrackTemplateRepository.cs | 2 +- .../SJZY.Track.Repository.csproj} | 13 ++++++------- .../SjzyTrackRepositoryModule.cs} | 8 ++++---- .../Entitys/TrackPushRecordEntity.cs | 2 +- .../Services/ITrackPushRecordRepository.cs | 8 ++++++++ .../Services/TrackPushRecordRepository.cs | 10 ++++++++++ .../Entitys/TrackPushRecordDetailsEntity.cs | 2 +- .../ITrackPushRecordDetailsRepository.cs | 8 ++++++++ .../Services/TrackPushRecordDetailsRepository.cs | 10 ++++++++++ test/SJZY.Track.Test/TestModule.cs | 4 ++-- 30 files changed, 75 insertions(+), 76 deletions(-) delete mode 100644 src/SJZY.Track.Infrastructure/TrackPushRecord/Services/ITrackPushRecordRepository.cs delete mode 100644 src/SJZY.Track.Infrastructure/TrackPushRecord/Services/TrackPushRecordRepository.cs delete mode 100644 src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs delete mode 100644 src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/DataBaseContext.cs (98%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/GlobalUsing.cs (100%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Queries/BasicQuery.cs (95%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Queries/TrackQueries.cs (98%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/BasicRepository.cs (95%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/DemoRepository.cs (99%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/OrderRepository.cs (99%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackContentRepository.cs (98%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackDetailsRepository.cs (98%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackFlagRepository.cs (97%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackPullConfigRepository.cs (99%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackPushConfigRepository.cs (99%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackStatusRepository.cs (98%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/Repositories/TrackTemplateRepository.cs (99%) rename src/{SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj => SJZY.Track.Repository/SJZY.Track.Repository.csproj} (78%) rename src/{SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs => SJZY.Track.Repository/SjzyTrackRepositoryModule.cs} (91%) rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/TrackPushRecord/Entitys/TrackPushRecordEntity.cs (96%) create mode 100644 src/SJZY.Track.Repository/TrackPushRecord/Services/ITrackPushRecordRepository.cs create mode 100644 src/SJZY.Track.Repository/TrackPushRecord/Services/TrackPushRecordRepository.cs rename src/{SJZY.Track.Infrastructure => SJZY.Track.Repository}/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs (94%) create mode 100644 src/SJZY.Track.Repository/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs create mode 100644 src/SJZY.Track.Repository/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs diff --git a/SJZY.Track.Api.sln b/SJZY.Track.Api.sln index 3de8a025..0c457eb0 100644 --- a/SJZY.Track.Api.sln +++ b/SJZY.Track.Api.sln @@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DAC93270-5A2 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0E2537C3-6EF3-4085-9BD2-CF923E53F82A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Infrastructure", "src\SJZY.Track.Infrastructure\SJZY.Track.Infrastructure.csproj", "{D9CF5706-1972-414F-821E-AA32C13B8570}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Repository", "src\SJZY.Track.Repository\SJZY.Track.Repository.csproj", "{D9CF5706-1972-414F-821E-AA32C13B8570}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Application.Contract", "src\SJZY.Track.Application.Contract\SJZY.Track.Application.Contract.csproj", "{390A44FB-0DB5-4B66-86AB-7712DC3030F5}" EndProject diff --git a/src/SJZY.Track.Api/SJZY.Track.Api.csproj b/src/SJZY.Track.Api/SJZY.Track.Api.csproj index a2a8fad3..be47c0cf 100644 --- a/src/SJZY.Track.Api/SJZY.Track.Api.csproj +++ b/src/SJZY.Track.Api/SJZY.Track.Api.csproj @@ -1,6 +1,6 @@  - + net7.0 @@ -10,16 +10,16 @@ - - - - - + + + + + - - + + diff --git a/src/SJZY.Track.Api/SjzyTrackApiModule.cs b/src/SJZY.Track.Api/SjzyTrackApiModule.cs index 102be9d7..13d9633a 100644 --- a/src/SJZY.Track.Api/SjzyTrackApiModule.cs +++ b/src/SJZY.Track.Api/SjzyTrackApiModule.cs @@ -9,7 +9,7 @@ using SJZY.Expand.ABP.Core.Prometheus; using SJZY.Expand.ABP.Core.Redis; using SJZY.Expand.ABP.Core.Swagger; using SJZY.Track.Application; -using SJZY.Track.Infrastructure; +using SJZY.Track.Repository; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Serilog; @@ -28,7 +28,7 @@ namespace SJZY.Track.Api typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreSerilogModule), typeof(SjzyTrackApplicationModule), - typeof(SjzyTrackInfrastructureModule) + typeof(SjzyTrackRepositoryModule) )] public class SjzyTrackApiModule : AbpModule { diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/ITrackPushRecordRepository.cs b/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/ITrackPushRecordRepository.cs deleted file mode 100644 index 7b2e515e..00000000 --- a/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/ITrackPushRecordRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -using SJZY.Track.Infrastructure.TrackPushRecord.Entitys; - -namespace SJZY.Track.Infrastructure.TrackPushRecord.Services -{ - public interface ITrackPushRecordRepository : ISimpleClient - { - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/TrackPushRecordRepository.cs b/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/TrackPushRecordRepository.cs deleted file mode 100644 index 22529060..00000000 --- a/src/SJZY.Track.Infrastructure/TrackPushRecord/Services/TrackPushRecordRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using SJZY.Track.Infrastructure.Repositories; -using SJZY.Track.Infrastructure.TrackPushRecord.Entitys; - -namespace SJZY.Track.Infrastructure.TrackPushRecord.Services -{ - public class TrackPushRecordRepository : BasicRepository, ITrackPushRecordRepository, IScopedDependency - { - - } -} diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs b/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs deleted file mode 100644 index 6f29bbc3..00000000 --- a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -using SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys; - -namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Services -{ - public interface ITrackPushRecordDetailsRepository : ISimpleClient - { - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs b/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs deleted file mode 100644 index 157dc8bd..00000000 --- a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using SJZY.Track.Infrastructure.Repositories; -using SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys; - -namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Services -{ - public class TrackPushRecordDetailsRepository : BasicRepository, ITrackPushRecordDetailsRepository, IScopedDependency - { - - } -} diff --git a/src/SJZY.Track.Infrastructure/DataBaseContext.cs b/src/SJZY.Track.Repository/DataBaseContext.cs similarity index 98% rename from src/SJZY.Track.Infrastructure/DataBaseContext.cs rename to src/SJZY.Track.Repository/DataBaseContext.cs index 9fbb7d44..88539836 100644 --- a/src/SJZY.Track.Infrastructure/DataBaseContext.cs +++ b/src/SJZY.Track.Repository/DataBaseContext.cs @@ -2,7 +2,7 @@ #pragma warning disable 1591 -namespace SJZY.Track.Infrastructure; +namespace SJZY.Track.Repository; /// /// Sqlsugar 上下文对象 diff --git a/src/SJZY.Track.Infrastructure/GlobalUsing.cs b/src/SJZY.Track.Repository/GlobalUsing.cs similarity index 100% rename from src/SJZY.Track.Infrastructure/GlobalUsing.cs rename to src/SJZY.Track.Repository/GlobalUsing.cs diff --git a/src/SJZY.Track.Infrastructure/Queries/BasicQuery.cs b/src/SJZY.Track.Repository/Queries/BasicQuery.cs similarity index 95% rename from src/SJZY.Track.Infrastructure/Queries/BasicQuery.cs rename to src/SJZY.Track.Repository/Queries/BasicQuery.cs index fbb511c7..60a234ef 100644 --- a/src/SJZY.Track.Infrastructure/Queries/BasicQuery.cs +++ b/src/SJZY.Track.Repository/Queries/BasicQuery.cs @@ -2,7 +2,7 @@ using SJZY.Track.Domain.Queries; using SJZY.Track.Domain.SeedWork; -namespace SJZY.Track.Infrastructure.Queries; +namespace SJZY.Track.Repository.Queries; #pragma warning disable CS8613 public class BasicQuery : SimpleClient, IBasicQuery where T : class, IEntity, new() diff --git a/src/SJZY.Track.Infrastructure/Queries/TrackQueries.cs b/src/SJZY.Track.Repository/Queries/TrackQueries.cs similarity index 98% rename from src/SJZY.Track.Infrastructure/Queries/TrackQueries.cs rename to src/SJZY.Track.Repository/Queries/TrackQueries.cs index 413c38fe..da7c4dab 100644 --- a/src/SJZY.Track.Infrastructure/Queries/TrackQueries.cs +++ b/src/SJZY.Track.Repository/Queries/TrackQueries.cs @@ -7,7 +7,7 @@ using SJZY.Track.Domain.Dtos.TrackDetails; using SJZY.Track.Domain.Dtos.TrackTemplate; using SJZY.Track.Domain.Queries; -namespace SJZY.Track.Infrastructure.Queries; +namespace SJZY.Track.Repository.Queries; public class TrackQueries : ISugarRepository, ITrackQueries, ITransientDependency diff --git a/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs b/src/SJZY.Track.Repository/Repositories/BasicRepository.cs similarity index 95% rename from src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs rename to src/SJZY.Track.Repository/Repositories/BasicRepository.cs index 7480b9f3..965bd5d7 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/BasicRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/BasicRepository.cs @@ -1,10 +1,10 @@ using System.Linq.Expressions; using SJZY.Track.Domain; using SJZY.Track.Domain.SeedWork; -using SJZY.Track.Infrastructure.Queries; +using SJZY.Track.Repository.Queries; using Volo.Abp; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; /// /// 仓储基类实现 diff --git a/src/SJZY.Track.Infrastructure/Repositories/DemoRepository.cs b/src/SJZY.Track.Repository/Repositories/DemoRepository.cs similarity index 99% rename from src/SJZY.Track.Infrastructure/Repositories/DemoRepository.cs rename to src/SJZY.Track.Repository/Repositories/DemoRepository.cs index 9acceca7..8334ea44 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/DemoRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/DemoRepository.cs @@ -2,7 +2,7 @@ using SJZY.Track.Domain.Aggregates.DemoAggregate; using SJZY.Track.Domain.Dtos.Demo; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class DemoRepository : BasicRepository, IDemoRepository, IScopedDependency { diff --git a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs similarity index 99% rename from src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs rename to src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 7fb36b99..8e9106da 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -5,7 +5,7 @@ using SJZY.Track.Domain.Dtos.Order; using SJZY.Track.Domain.VEntities; using SJZY.Track.Repository.VData.Entitys; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class OrderRepository : BasicRepository, IOrderRepository, ITransientDependency { diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs similarity index 98% rename from src/SJZY.Track.Infrastructure/Repositories/TrackContentRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index eac2265f..bbde4d6f 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -4,7 +4,7 @@ using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackContents; using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackContentRepository : BasicRepository, ITrackContentRepository, IScopedDependency { diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs similarity index 98% rename from src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs index c23a28fd..b5632055 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackDetailsRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs @@ -3,7 +3,7 @@ using SJZY.Expand.ElasticSearch.Services; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Dtos.TrackDetails; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; internal class TrackDetailsRepository : ElasticSearchContextAbstract, ITrackDetailsRepository, ITransientDependency diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackFlagRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs similarity index 97% rename from src/SJZY.Track.Infrastructure/Repositories/TrackFlagRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs index 12c29447..2a2a4ba6 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackFlagRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs @@ -2,7 +2,7 @@ using SJZY.Track.Domain.Dtos.TrackFlags; using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackFlagRepository : BasicRepository, ITrackFlagRepository, IScopedDependency { diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackPullConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPullConfigRepository.cs similarity index 99% rename from src/SJZY.Track.Infrastructure/Repositories/TrackPullConfigRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackPullConfigRepository.cs index 796e6778..076671d5 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackPullConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPullConfigRepository.cs @@ -6,7 +6,7 @@ using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPull; using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackPullConfigRepository : BasicRepository, ITrackPullConfigRepository, IScopedDependency diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs similarity index 99% rename from src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index d1ce352b..999a2732 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -7,7 +7,7 @@ using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.VEntities; using SJZY.Track.Repository.VData.Entitys; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackPushConfigRepository : BasicRepository, ITrackPushConfigRepository, IScopedDependency diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs similarity index 98% rename from src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs index 6ac36ade..703eb8c4 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs @@ -2,7 +2,7 @@ using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackStatus; using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackStatusRepository : BasicRepository, ITrackStatusRepository, IScopedDependency { diff --git a/src/SJZY.Track.Infrastructure/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs similarity index 99% rename from src/SJZY.Track.Infrastructure/Repositories/TrackTemplateRepository.cs rename to src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index d4ae27a6..04cd6e0e 100644 --- a/src/SJZY.Track.Infrastructure/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -8,7 +8,7 @@ using SJZY.Track.Domain.Dtos.TrackTemplate; using SJZY.Track.Domain.Enums; using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Infrastructure.Repositories; +namespace SJZY.Track.Repository.Repositories; public class TrackTemplateRepository : BasicRepository, ITrackTemplateRepository, IScopedDependency { diff --git a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj b/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj similarity index 78% rename from src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj rename to src/SJZY.Track.Repository/SJZY.Track.Repository.csproj index 938fe9a1..b2285e0b 100644 --- a/src/SJZY.Track.Infrastructure/SJZY.Track.Infrastructure.csproj +++ b/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj @@ -1,21 +1,20 @@  - + net7.0 True preview - SJZY.Track.Repository - - - - + + + + - + diff --git a/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs b/src/SJZY.Track.Repository/SjzyTrackRepositoryModule.cs similarity index 91% rename from src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs rename to src/SJZY.Track.Repository/SjzyTrackRepositoryModule.cs index 048d60fb..546d80d9 100644 --- a/src/SJZY.Track.Infrastructure/SJZYTrackInfrastructureModule.cs +++ b/src/SJZY.Track.Repository/SjzyTrackRepositoryModule.cs @@ -4,19 +4,19 @@ using SJZY.Expand.ABP.Core.SqlSugar.Options; using SJZY.Expand.ElasticSearch; using SJZY.Track.Domain; using SJZY.Track.Domain.Queries; -using SJZY.Track.Infrastructure.Queries; -using SJZY.Track.Infrastructure.Repositories; +using SJZY.Track.Repository.Queries; +using SJZY.Track.Repository.Repositories; using Volo.Abp.Autofac; using Volo.Abp.Modularity; -namespace SJZY.Track.Infrastructure; +namespace SJZY.Track.Repository; /// /// 仓储模块 /// [DependsOn(typeof(AbpAutofacModule))] [DependsOn(typeof(SjzyTrackDomainModule))] -public class SjzyTrackInfrastructureModule : AbpModule +public class SjzyTrackRepositoryModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs b/src/SJZY.Track.Repository/TrackPushRecord/Entitys/TrackPushRecordEntity.cs similarity index 96% rename from src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs rename to src/SJZY.Track.Repository/TrackPushRecord/Entitys/TrackPushRecordEntity.cs index 345e7335..b3c2ff5b 100644 --- a/src/SJZY.Track.Infrastructure/TrackPushRecord/Entitys/TrackPushRecordEntity.cs +++ b/src/SJZY.Track.Repository/TrackPushRecord/Entitys/TrackPushRecordEntity.cs @@ -1,6 +1,6 @@ using SJZY.Track.Domain.SeedWork; -namespace SJZY.Track.Infrastructure.TrackPushRecord.Entitys +namespace SJZY.Track.Repository.TrackPushRecord.Entitys { /// /// 轨迹推送记录 diff --git a/src/SJZY.Track.Repository/TrackPushRecord/Services/ITrackPushRecordRepository.cs b/src/SJZY.Track.Repository/TrackPushRecord/Services/ITrackPushRecordRepository.cs new file mode 100644 index 00000000..686a3402 --- /dev/null +++ b/src/SJZY.Track.Repository/TrackPushRecord/Services/ITrackPushRecordRepository.cs @@ -0,0 +1,8 @@ +using SJZY.Track.Repository.TrackPushRecord.Entitys; + +namespace SJZY.Track.Repository.TrackPushRecord.Services +{ + public interface ITrackPushRecordRepository : ISimpleClient + { + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/TrackPushRecord/Services/TrackPushRecordRepository.cs b/src/SJZY.Track.Repository/TrackPushRecord/Services/TrackPushRecordRepository.cs new file mode 100644 index 00000000..e8e16ab9 --- /dev/null +++ b/src/SJZY.Track.Repository/TrackPushRecord/Services/TrackPushRecordRepository.cs @@ -0,0 +1,10 @@ +using SJZY.Track.Repository.Repositories; +using SJZY.Track.Repository.TrackPushRecord.Entitys; + +namespace SJZY.Track.Repository.TrackPushRecord.Services +{ + public class TrackPushRecordRepository : BasicRepository, ITrackPushRecordRepository, IScopedDependency + { + + } +} diff --git a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs b/src/SJZY.Track.Repository/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs similarity index 94% rename from src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs rename to src/SJZY.Track.Repository/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs index 796e3e47..64208102 100644 --- a/src/SJZY.Track.Infrastructure/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs +++ b/src/SJZY.Track.Repository/TrackPushRecordDetails/Entitys/TrackPushRecordDetailsEntity.cs @@ -1,6 +1,6 @@ using SJZY.Track.Domain.SeedWork; -namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys +namespace SJZY.Track.Repository.TrackPushRecordDetails.Entitys { /// /// 轨迹推送明细表 diff --git a/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs b/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs new file mode 100644 index 00000000..f84fafa7 --- /dev/null +++ b/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/ITrackPushRecordDetailsRepository.cs @@ -0,0 +1,8 @@ +using SJZY.Track.Repository.TrackPushRecordDetails.Entitys; + +namespace SJZY.Track.Repository.TrackPushRecordDetails.Services +{ + public interface ITrackPushRecordDetailsRepository : ISimpleClient + { + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs b/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs new file mode 100644 index 00000000..3a8c025b --- /dev/null +++ b/src/SJZY.Track.Repository/TrackPushRecordDetails/Services/TrackPushRecordDetailsRepository.cs @@ -0,0 +1,10 @@ +using SJZY.Track.Repository.Repositories; +using SJZY.Track.Repository.TrackPushRecordDetails.Entitys; + +namespace SJZY.Track.Repository.TrackPushRecordDetails.Services +{ + public class TrackPushRecordDetailsRepository : BasicRepository, ITrackPushRecordDetailsRepository, IScopedDependency + { + + } +} diff --git a/test/SJZY.Track.Test/TestModule.cs b/test/SJZY.Track.Test/TestModule.cs index 6bace7fa..aa5f8d90 100644 --- a/test/SJZY.Track.Test/TestModule.cs +++ b/test/SJZY.Track.Test/TestModule.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using SJZY.Track.Api; using SJZY.Track.Application; -using SJZY.Track.Infrastructure; +using SJZY.Track.Repository; using Volo.Abp; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Authorization; @@ -20,7 +20,7 @@ namespace SJZY.Track.Test; typeof(AbpAspNetCoreTestBaseModule), typeof(AbpAutofacModule), typeof(AbpAuthorizationModule), - typeof(SjzyTrackInfrastructureModule), + typeof(SjzyTrackRepositoryModule), typeof(SjzyTrackApplicationModule), typeof(SjzyTrackApiModule), typeof(AbpHttpClientModule) //添加abp的http代理模块 From 205526e37023253feed289670477ad476fec7175 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 15:40:33 +0800 Subject: [PATCH 13/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=A8=A1=E7=89=88?= =?UTF-8?q?=EF=BC=8C=E8=BD=A8=E8=BF=B9=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=89=E4=B8=AD=E7=9A=84id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackStatus/GetTrackStatusListDto.cs | 7 ++++++- .../Dtos/TrackTemplates/GetPageTrackTemplateInput.cs | 9 +++++++-- .../Dtos/TrackStatus/GetPageTrackStatusVO.cs | 7 ++++++- .../Dtos/TrackTemplate/GetPageTrackTemplateVO.cs | 10 ++-------- .../Repositories/TrackStatusRepository.cs | 1 + .../Repositories/TrackTemplateRepository.cs | 8 ++++---- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs index 8cadc1ea..c505aa72 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackStatus/GetTrackStatusListDto.cs @@ -64,6 +64,11 @@ /// /// 关键字 /// - public string Keywords { get; set; } = ""; + public string? Keywords { get; set; } + + /// + /// 选中的轨迹状态id + /// + public List? SelectIds { get; set;} } } \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs index ba54db15..e4e901df 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs @@ -15,9 +15,14 @@ /// public string Keywords { get; set; } = ""; + ///// + ///// 轨迹模版id,轨迹映射的查询使用 + ///// + //public int TrackTemplateId { get; set; } + /// - /// 轨迹模版id,轨迹映射的查询使用 + /// 选中的轨迹模版id /// - public int TrackTemplateId { get; set; } + public List? SelectIds { get; set; } } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackStatus/GetPageTrackStatusVO.cs b/src/SJZY.Track.Domain/Dtos/TrackStatus/GetPageTrackStatusVO.cs index 6c5d3b46..f19fb8c5 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackStatus/GetPageTrackStatusVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackStatus/GetPageTrackStatusVO.cs @@ -10,5 +10,10 @@ public class GetPageTrackStatusVO : PageInfoInput /// /// 关键字 /// - public string Keywords { get; set; } + public string? Keywords { get; set; } + + /// + /// 选中的轨迹状态id + /// + public List? SelectIds { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs index e4fa7963..99005db7 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs @@ -12,13 +12,7 @@ public class GetPageTrackTemplateVO : PageInfoInput /// public string Keywords { get; set; } - ///// - ///// 是否置顶 - ///// - //public bool IsTop { get; set; }=false; - - /// - /// 轨迹模版id + /// 选中的轨迹模版id /// - public int TrackTemplateId { get; set; } + public List? SelectIds { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs index 703eb8c4..831e80e5 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs @@ -45,6 +45,7 @@ public class TrackStatusRepository : BasicRepository, ITrackS .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d) => a.Status.Contains(input.Keywords) || a.EnStatus.Contains(input.Keywords) || a.Code.Contains(input.Keywords)) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b, c, d) => new GetTrackStatusListVO { Id = a.Id, diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index 04cd6e0e..6e254c16 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -47,9 +47,7 @@ public class TrackTemplateRepository : BasicRepository, ITr .WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords)) - .OrderByIF(input.TrackTemplateId > 0, - (a, b) => SqlFunc.IIF(a.Id == input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1), - a.CreateTime), OrderByType.Desc) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(),(a,b)=> SqlFunc.IIF(input.SelectIds.Contains(a.Id),SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b) => new GetTrackTemplateListVO { Id = a.Id, @@ -59,7 +57,9 @@ public class TrackTemplateRepository : BasicRepository, ITr SubSystem = b.CnName }) .ToPagedListAsync(input.PageIndex, input.PageSize); - + //.OrderByIF(input.TrackTemplateId > 0, + // (a, b) => SqlFunc.IIF(a.Id == input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1), + //a.CreateTime), OrderByType.Desc) return pagedList; } From b0bdc7111bf5ae5f828359cd6cc6787322a37bef Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 15:45:39 +0800 Subject: [PATCH 14/34] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=3F=E5=8F=AF?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackContents/GetPageTrackContentInput.cs | 2 +- .../Dtos/TrackTemplates/GetPageTrackTemplateInput.cs | 2 +- .../Dtos/TrackContents/GetPageTrackContentVO.cs | 2 +- .../Dtos/TrackTemplate/GetPageTrackTemplateVO.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs index 9628067c..22b646d3 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs @@ -10,7 +10,7 @@ /// /// 关键字 /// - public string Keywords { get; set; } = ""; + public string? Keywords { get; set; }; } public class GetTrackContentListDto diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs index e4e901df..b75213fd 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs @@ -13,7 +13,7 @@ /// /// 关键字 /// - public string Keywords { get; set; } = ""; + public string? Keywords { get; set; }; ///// ///// 轨迹模版id,轨迹映射的查询使用 diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs index f093836d..4f62c3a9 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs @@ -16,7 +16,7 @@ namespace SJZY.Track.Domain.Dtos.TrackContents /// /// 关键字 /// - public string Keywords { get; set; } + public string? Keywords { get; set; } } public class GetTrackContentListVO diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs index 99005db7..35c4fe8a 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetPageTrackTemplateVO.cs @@ -10,7 +10,7 @@ public class GetPageTrackTemplateVO : PageInfoInput /// /// 关键字 /// - public string Keywords { get; set; } + public string? Keywords { get; set; } /// 选中的轨迹模版id /// From 2c28dafdb62423ffaab91bf07803d3db24102adf Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 15:46:07 +0800 Subject: [PATCH 15/34] =?UTF-8?q?bug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackContents/GetPageTrackContentInput.cs | 2 +- .../Dtos/TrackTemplates/GetPageTrackTemplateInput.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs index 22b646d3..9f7d68f2 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs @@ -10,7 +10,7 @@ /// /// 关键字 /// - public string? Keywords { get; set; }; + public string? Keywords { get; set; } } public class GetTrackContentListDto diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs index b75213fd..27d3dfc3 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs @@ -13,7 +13,7 @@ /// /// 关键字 /// - public string? Keywords { get; set; }; + public string? Keywords { get; set; } ///// ///// 轨迹模版id,轨迹映射的查询使用 From e3a8a94e1e1b6ca86eba27e72d30f3adc82c4d77 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 16:38:41 +0800 Subject: [PATCH 16/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E4=B9=9F=E6=B7=BB=E5=8A=A0=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackFlags/GetTrackFlagListDto.cs | 5 +++++ .../Dtos/TrackFlags/GetPageTrackFlagVO.cs | 5 +++++ .../Repositories/TrackContentRepository.cs | 1 + .../Repositories/TrackFlagRepository.cs | 5 +++-- .../Repositories/TrackStatusRepository.cs | 3 ++- .../Repositories/TrackTemplateRepository.cs | 17 +++++++++-------- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs index 1ca2c4df..4280f8d2 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackFlags/GetTrackFlagListDto.cs @@ -55,6 +55,11 @@ /// public int SubSystemId { get; set; } + /// + /// 选中的轨迹标记id + /// + public List? SelectIds { get; set; } + ///// ///// 关键字 ///// diff --git a/src/SJZY.Track.Domain/Dtos/TrackFlags/GetPageTrackFlagVO.cs b/src/SJZY.Track.Domain/Dtos/TrackFlags/GetPageTrackFlagVO.cs index 20f7c40f..d3699b75 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackFlags/GetPageTrackFlagVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackFlags/GetPageTrackFlagVO.cs @@ -13,6 +13,11 @@ namespace SJZY.Track.Domain.Dtos.TrackFlags /// public int SubSystemId { get; set; } + /// + /// 选中的轨迹标记id + /// + public List? SelectIds { get; set; } + ///// ///// 关键字 ///// diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index bbde4d6f..a7bb1b6a 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -62,6 +62,7 @@ public class TrackContentRepository : BasicRepository, ITrac (a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords) || a.EnContent.Contains(input.Keywords) ) + .OrderByDescending((a, b, c, d, e, f) => a.CreateTime) .Select((a, b, c, d, e, f) => new GetTrackContentListVO { Id = a.Id, diff --git a/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs index 2a2a4ba6..2a710641 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs @@ -46,6 +46,8 @@ public class TrackFlagRepository : BasicRepository, ITrackFlagR .LeftJoin((a, b, c) => a.CreateUserId == c.Id) .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id) .WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId) + .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b, c, d) => new GetTrackFlagListVO { Id = a.Id, @@ -56,8 +58,7 @@ public class TrackFlagRepository : BasicRepository, ITrackFlagR CreateTime = a.CreateTime, CreateUser = c.Name, UpdateTime = a.UpdateTime, - UpdateUser = d.Name, - + UpdateUser = d.Name }) .ToPagedListAsync(input.PageIndex, input.PageSize); diff --git a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs index 831e80e5..dacc6947 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs @@ -45,7 +45,8 @@ public class TrackStatusRepository : BasicRepository, ITrackS .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d) => a.Status.Contains(input.Keywords) || a.EnStatus.Contains(input.Keywords) || a.Code.Contains(input.Keywords)) - .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) + .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b, c, d) => new GetTrackStatusListVO { Id = a.Id, diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index 6e254c16..57d3ab38 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -24,13 +24,13 @@ public class TrackTemplateRepository : BasicRepository, ITr .Where((a, b) => a.Id == id) .Select((a, b) => new GetTrackTemplateDetailVO - { - Id = a.Id, - Code = a.Code, - Name = a.Name, - SubSystemId = a.SubSystemId, - SubSystem = b.CnName - }).FirstAsync(); + { + Id = a.Id, + Code = a.Code, + Name = a.Name, + SubSystemId = a.SubSystemId, + SubSystem = b.CnName + }).FirstAsync(); return detail; } @@ -47,7 +47,8 @@ public class TrackTemplateRepository : BasicRepository, ITr .WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords)) - .OrderByIF(!input.SelectIds.IsNullOrEmpty(),(a,b)=> SqlFunc.IIF(input.SelectIds.Contains(a.Id),SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) + .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b) => a.CreateTime,OrderByType.Desc) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b) => new GetTrackTemplateListVO { Id = a.Id, From 3505a4dbcc97195d92fa28b342caba48dee538e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 17:07:11 +0800 Subject: [PATCH 17/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=85=8D=E7=BD=AE=E7=BC=96=E8=BE=91=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackPush/EditTrackPushConfigInput.cs | 81 +++++++++++++ .../SJZY.Track.Application.Contract.csproj | 6 +- .../AutoMapper/TrackPushAutoMapperProfile.cs | 8 ++ .../Services/TrackPush/TrackPushService.cs | 110 +++++++++++++++++- .../ITrackPushConfigRepository.cs | 2 + .../GetTrackPushConfigDetailOutputVO.cs | 2 +- .../Repositories/TrackPushConfigRepository.cs | 9 ++ 7 files changed, 211 insertions(+), 7 deletions(-) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs new file mode 100644 index 00000000..cf3cb8ee --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs @@ -0,0 +1,81 @@ +namespace SJZY.Track.Application.Contract.Dtos.TrackPush; + +public class EditTrackPushConfigInput +{ + /// + /// 客户id + /// + public int CustomId { get; set; } + + /// + /// 推送扩展字段 + /// + public string ExpandFieldsName { get; set; } + + public int? Id { get; set; } + + /// + /// 是否自动推送 + /// + public bool IsAutoPush { get; set; } + + /// + /// 操作类型 + /// + public OptionTypeNoNull Options { get; set; } + + /// + /// 推送轨迹订单号 + /// + public string OrderNoName { get; set; } + + /// + /// 服务商id + /// + public int ServiceProviderId { get; set; } + + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 推送轨迹时区 + /// + public string TackTimeZoneName { get; set; } + + /// + /// 推送轨迹内容代码 + /// + public string TrackContentCodeName { get; set; } + + /// + /// 推送轨迹内容 + /// + public string TrackContentName { get; set; } + + /// + /// 推送轨迹内容英文 + /// + public string TrackEnContentName { get; set; } + + /// + /// 推送轨迹发生地 + /// + public string TrackPlaceName { get; set; } + + /// + /// 推送轨迹状态 + /// + public string TrackStatusName { get; set; } + + /// + /// 轨迹模板id + /// + public List TrackTemplateIds { get; set; } + + /// + /// 推送轨迹发生时间 + /// + public string TrackTimeName { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index a7a570d0..de5d1421 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -1,14 +1,14 @@ - + net7.0 0.0.2 - - + + diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs index 420b0e23..351f5321 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs @@ -1,4 +1,8 @@ using AutoMapper; +using SJZY.Track.Application.Contract.Dtos.TrackPush; +using SJZY.Track.Domain.Aggregates.TrackPullAggregate; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using Volo.Abp.AutoMapper; namespace SJZY.Track.Application.AutoMapper; @@ -6,5 +10,9 @@ public class TrackPushAutoMapperProfile : Profile { public TrackPushAutoMapperProfile() { + CreateMap(MemberList.None) + .ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(source => string.Join(',', source.TrackTemplateIds))); + CreateMap(MemberList.None).Ignore(dest => dest.Id) + .ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true)); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index a862e224..cd4567f6 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -1,8 +1,15 @@ using Microsoft.Extensions.Localization; +using SJZY.Expand.ABP.Core.Localization; +using SJZY.Expand.ABP.Core.PublicMethords; +using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Localization; +using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; +using SqlSugar; +using System.Linq.Expressions; using Volo.Abp.DependencyInjection; namespace SJZY.Track.Application.Services.TrackPush; @@ -16,13 +23,19 @@ public class TrackPushService : ApplicationService, ITransientDependency { private readonly IStringLocalizer _stringLocalizer; private readonly ITrackPushConfigRepository _trackPushConfigRepository; + private readonly ITrackTemplateRepository _trackTemplateRepository; + private readonly ITrackPullConfigRepository _trackPullConfigRepository; public TrackPushService( IStringLocalizer stringLocalizer, - ITrackPushConfigRepository trackPushConfigRepository) + ITrackPushConfigRepository trackPushConfigRepository, + ITrackTemplateRepository trackTemplateRepository, + ITrackPullConfigRepository trackPullConfigRepository) { _stringLocalizer = stringLocalizer; _trackPushConfigRepository = trackPushConfigRepository; + _trackTemplateRepository = trackTemplateRepository; + _trackPullConfigRepository = trackPullConfigRepository; } /// @@ -53,9 +66,18 @@ public class TrackPushService : ApplicationService, ITransientDependency /// /// [HttpGet("GetDetail")] - public async Task GetDetailAsync(int id) + public async Task GetDetailAsync(int id) { - return await _trackPushConfigRepository.GetDetailAsync(id); + var res = await _trackPushConfigRepository.GetDetailAsync(id); + if (res is null) return null; + + List trackTemplateIds = res.TrackTemplateId.Split(',').Select(int.Parse).ToList(); + + var trackTemplateEntities = await _trackTemplateRepository.GetListAsync(x => trackTemplateIds.Contains(x.Id)); + + trackTemplateEntities.ForEach(item => { (res.TrackTemplate ??= new()).Add(new() { Value = item.Id, Key = item.Name }); }); + + return res; } /// @@ -68,4 +90,86 @@ public class TrackPushService : ApplicationService, ITransientDependency { return await _trackPushConfigRepository.GetContentDetailAsync(id); } + + /// + /// 轨迹推送配置编辑 + /// + /// + /// + [HttpPost("Edit")] + public async Task EditAsync([FromBody] EditTrackPushConfigInput input) + { + if (input.Options != OptionTypeNoNull.删除) + { + Expression> isAnyExp = x => + x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId; + if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id); + + var trackTemplateIdExp = Expressionable.Create(); + foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); } + + if (await _trackPushConfigRepository.IsAnyAsync(isAnyExp.And(trackTemplateIdExp.ToExpression()))) + throw new BusinessException(message: _stringLocalizer["IsTrackPushConfigAny"]); + } + + switch (input.Options) + { + case OptionTypeNoNull.新增: + { + var trackPushEntity = ObjectMapper.Map(input); + var trackPushParamsEntity = ObjectMapper.Map(input); + + using (var ts = TransactionScopeHelper.Create()) + { + int id = await _trackPushConfigRepository.InsertReturnIdentityAsync(trackPushEntity); + + trackPushParamsEntity.PullOrPushConfigId = id; + await _trackPullConfigRepository.InsertParamsAsync(trackPushParamsEntity); + + ts.Complete(); + } + } + break; + + case OptionTypeNoNull.修改: + { + var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + + var oldTrackPushParamsEntity = + await _trackPullConfigRepository.GetParamsSingleAsync(x => + x.PullOrPushConfigId == input.Id && x.IsPush); + + ObjectMapper.Map(input, oldTrackPushEntity); + ObjectMapper.Map(input, oldTrackPushParamsEntity); + + using (var ts = TransactionScopeHelper.Create()) + { + await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity); + await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPushParamsEntity); + + ts.Complete(); + } + } + break; + + case OptionTypeNoNull.删除: + using (var ts = TransactionScopeHelper.Create()) + { + await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id); + await _trackPullConfigRepository.SoftDeleteParamsAsync(x => + x.PullOrPushConfigId == input.Id && x.IsPush); + await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id); + + ts.Complete(); + } + + break; + + default: + throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, + nameof(EditTrackPushConfigInput.Options)]); + } + + return true; + } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 39b19ad2..9c82ef1c 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -12,4 +12,6 @@ public interface ITrackPushConfigRepository : IBasicRepository GetDetailAsync(int id); Task GetContentDetailAsync(int id); + + Task SoftDeleteContentAsync(Expression> whereExpression); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs index 6e9cd961..900c74bc 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs @@ -89,7 +89,7 @@ public class GetTrackPushConfigDetailOutputVO /// /// 轨迹模板id /// - public int TrackTemplateId { get; set; } + public string TrackTemplateId { get; set; } /// /// 推送轨迹发生时间 diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 999a2732..07cbedc7 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -6,6 +6,7 @@ using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.VEntities; using SJZY.Track.Repository.VData.Entitys; +using System.Linq.Expressions; namespace SJZY.Track.Repository.Repositories; @@ -82,4 +83,12 @@ public class TrackPushConfigRepository : BasicRepository, }, true) .SingleAsync(); } + + public async Task SoftDeleteContentAsync(Expression> whereExpression) + { + return await Context.Updateable() + .Where(whereExpression) + .SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true) + .ExecuteCommandHasChangeAsync(); + } } \ No newline at end of file From 545efbeaf3636c89860fa248d080cc4ec93275bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 17:49:20 +0800 Subject: [PATCH 18/34] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/TrackUpsertEvent.cs | 6 - .../Dtos/ProvideServices/UpsertTrackInput.cs | 4 +- .../Events/TrackUpsertEvent.cs | 19 ++- .../SJZY.Track.Application.Contract.csproj | 6 +- .../AutoMapper/TrackAutoMapperProfile.cs | 13 +++ .../EventHandlers/TrackUpsertEventHandler.cs | 108 ++++++++++++++++++ .../SJZY.Track.Application.csproj | 14 +-- .../Services/ProvideServices/TrackCustomer.cs | 9 -- .../ProvideServices/TrackPushService.cs | 10 ++ .../Services/ProvideServices/TrackService.cs | 79 +++---------- .../OrderAggregate/IOrderRepository.cs | 4 +- .../Aggregates/OrderAggregate/OrderEntity.cs | 6 + .../TrackContentMapEntity.cs | 30 ++++- .../ITrackDetailsRepository.cs | 4 +- .../TrackDetailsIndex.cs | 22 ++-- .../Dtos/Order/LinkedOrderVO.cs | 14 +++ .../Dtos/TrackDetails/MatchTrackContentDto.cs | 6 +- src/SJZY.Track.Domain/GlobalConst.cs | 14 +++ .../Queries/ITrackQueries.cs | 9 ++ .../Queries/TrackQueries.cs | 9 ++ .../Repositories/OrderRepository.cs | 8 +- .../Repositories/TrackDetailsRepository.cs | 17 +-- 22 files changed, 284 insertions(+), 127 deletions(-) delete mode 100644 src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs create mode 100644 src/SJZY.Track.Application/AutoMapper/TrackAutoMapperProfile.cs create mode 100644 src/SJZY.Track.Application/EventHandlers/TrackUpsertEventHandler.cs delete mode 100644 src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs create mode 100644 src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs create mode 100644 src/SJZY.Track.Domain/Dtos/Order/LinkedOrderVO.cs create mode 100644 src/SJZY.Track.Domain/GlobalConst.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs deleted file mode 100644 index b6f64a7a..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/TrackUpsertEvent.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; - -public class TrackUpsertEvent -{ - public int Order { get; set; } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs index 91d5429c..ef0e67a4 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs @@ -5,12 +5,12 @@ public class UpsertTrackInput : OrderNoInfo /// /// 轨迹内容代码 /// - public string TrackCode { get; set; } + public string TrackCode { get; set; } = null!; /// /// 轨迹发生地 /// - public string TrackPlace { get; set; } + public string TrackPlace { get; set; } = null!; /// /// 轨迹发生时间 diff --git a/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs index 48784974..ad0fe356 100644 --- a/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs +++ b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs @@ -1,6 +1,21 @@ -namespace SJZY.Track.Application.Contract.Events; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; -public class TrackUpsertEvent +namespace SJZY.Track.Application.Contract.Events; + +public class TrackUpsertEvent : UpsertTrackInput { + /// + /// 订单id + /// public int OrderId { get; set; } + + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 上游子系统id + /// + public int UpSubSystemId { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index a7a570d0..de5d1421 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -1,14 +1,14 @@ - + net7.0 0.0.2 - - + + diff --git a/src/SJZY.Track.Application/AutoMapper/TrackAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackAutoMapperProfile.cs new file mode 100644 index 00000000..b9c185d7 --- /dev/null +++ b/src/SJZY.Track.Application/AutoMapper/TrackAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Events; + +namespace SJZY.Track.Application.AutoMapper; + +public class TrackAutoMapperProfile:Profile +{ + public TrackAutoMapperProfile() + { + CreateMap(MemberList.None); + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/EventHandlers/TrackUpsertEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/TrackUpsertEventHandler.cs new file mode 100644 index 00000000..220607ab --- /dev/null +++ b/src/SJZY.Track.Application/EventHandlers/TrackUpsertEventHandler.cs @@ -0,0 +1,108 @@ +using DotNetCore.CAP; +using SJZY.Expand.ABP.Core.PublicMethords; +using SJZY.Track.Application.Contract.Events; +using SJZY.Track.Domain.Aggregates.OrderAggregate; +using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; +using SJZY.Track.Domain.Queries; +using SJZY.UserCenter.HttpApi.Services; +using Volo.Abp.DependencyInjection; + +namespace SJZY.Track.Application.EventHandlers; + +public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe +{ + private readonly IOrderRepository _orderRepository; + private readonly ITrackQueries _trackQueries; + private readonly ITrackDetailsRepository _trackDetailsRepository; + private readonly ICapPublisher _capPublisher; + + public TrackUpsertEventHandler(IOrderRepository orderRepository, ICapPublisher capPublisher, + ITrackQueries trackQueries, ITrackDetailsRepository trackDetailsRepository) + { + _orderRepository = orderRepository; + _capPublisher = capPublisher; + _trackQueries = trackQueries; + _trackDetailsRepository = trackDetailsRepository; + } + + [NonAction] + [CapSubscribe(GlobalConst.TrackUpsertSubscribe)] + public async Task ConsumerAsync(TrackUpsertEvent @event) + { + // 不同子系统需要做内容映射 + if (@event.UpSubSystemId != @event.SubSystemId) + { + var mapCode = await _trackQueries.MapTrackContentCodeAsync(@event.UpSubSystemId, @event.SubSystemId, @event.TrackCode); + + if (mapCode == default) + { + throw new BusinessException(message: "订单跨子系统,未配置内容映射,请联系管理员"); + } + + @event.TrackCode = mapCode; + } + + await UpsertTrackAsync(@event); + } + + internal async Task UpsertTrackAsync(TrackUpsertEvent @event) + { + // 不存在则新增轨迹,存在则更新 + var track = await _trackDetailsRepository.GetFirstOrDefaultAsync(@event.OrderId, @event.TrackCode); + + var isPush = false; // 推送只做新增的,更新和删除的不做先 + if (track == default) + { + // 根据轨迹code在订单模板内容中寻找匹配的 + var trackContent = await _trackQueries.MatchTrackContentAsync(@event.OrderId, @event.TrackCode); + if (trackContent == default) + { + throw new BusinessException(message: $"订单:{@event.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{@event.TrackCode}"); + } + + track = new TrackDetailsIndex + { + OrderId = @event.OrderId, + OrderNo = @event.OrderNo, + OrderType = @event.OrderType, + TrackStatus = trackContent.Status, + TrackCode = @event.TrackCode, + TrackContent = trackContent.Content, + TrackEnContent = trackContent.EnContent, + TrackPlace = @event.TrackPlace, + TrackTime = @event.TrackTime, + TraceTimeZone = @event.TraceTimeZone, + CreateUserId = CurrentUserRequest.CurrentUser.UserId, + CreateTime = DateTime.Now + }; + + isPush = true; + } + else + { + track.TrackPlace = @event.TrackPlace; + track.TrackTime = @event.TrackTime; + track.TraceTimeZone = @event.TraceTimeZone; + track.UpdateUserId = CurrentUserRequest.CurrentUser.UserId; + track.UpdateTime = DateTime.Now; + } + + await _trackDetailsRepository.UpsertAsync(track); + + // 根据订单关联关系异步向下刷 + var linkedOrders = await _orderRepository.GetLinkedOrdersAsync(@event.OrderId); + foreach (var linkedOrder in linkedOrders) + { + var nextEvent = @event.DeepCopy(); + nextEvent.OrderId = linkedOrder.OrderId; + nextEvent.SubSystemId = linkedOrder.SubSystemId; + nextEvent.UpSubSystemId = @event.SubSystemId; + await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, nextEvent); + } + + if (isPush) + { + //await PushTrack(); + } + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/SJZY.Track.Application.csproj b/src/SJZY.Track.Application/SJZY.Track.Application.csproj index fa25c565..cb744d89 100644 --- a/src/SJZY.Track.Application/SJZY.Track.Application.csproj +++ b/src/SJZY.Track.Application/SJZY.Track.Application.csproj @@ -1,6 +1,6 @@  - + net7.0 @@ -8,14 +8,14 @@ - - - - + + + + - - + + diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs deleted file mode 100644 index 9f722217..00000000 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackCustomer.cs +++ /dev/null @@ -1,9 +0,0 @@ -using DotNetCore.CAP; -using Volo.Abp.DependencyInjection; - -namespace SJZY.Track.Application.Services.ProvideServices; - -public class TrackCustomer : ITransientDependency, ICapSubscribe -{ - public const string CapSubscribe = "SJZY.Track.Upsert"; -} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs new file mode 100644 index 00000000..5474a9be --- /dev/null +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs @@ -0,0 +1,10 @@ +namespace SJZY.Track.Application.Services.ProvideServices; + +/// +/// 轨迹推送服务 +/// +[ApiExplorerSettings(GroupName = "提供接口")] +public class TrackPushService: ApplicationService +{ + +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index fad211a8..d7cc59e3 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -1,9 +1,7 @@ -using DotNetCore.CAP; -using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Events; +using SJZY.Track.Application.EventHandlers; using SJZY.Track.Domain.Aggregates.OrderAggregate; -using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; -using SJZY.Track.Domain.Queries; -using SJZY.UserCenter.HttpApi.Services; namespace SJZY.Track.Application.Services.ProvideServices; @@ -14,17 +12,12 @@ namespace SJZY.Track.Application.Services.ProvideServices; public class TrackService : ApplicationService { private readonly IOrderRepository _orderRepository; - private readonly ITrackDetailsRepository _trackDetailsRepository; - private readonly ITrackQueries _trackQueries; - private readonly ICapPublisher _capPublisher; + private readonly TrackUpsertEventHandler _trackUpsertEventHandler; - public TrackService(ITrackQueries trackQueries, IOrderRepository orderRepository, - ITrackDetailsRepository trackDetailsRepository, ICapPublisher capPublisher) + public TrackService(IOrderRepository orderRepository, TrackUpsertEventHandler trackUpsertEventHandler) { - _trackQueries = trackQueries; _orderRepository = orderRepository; - _trackDetailsRepository = trackDetailsRepository; - _capPublisher = capPublisher; + _trackUpsertEventHandler = trackUpsertEventHandler; } /// @@ -36,59 +29,21 @@ public class TrackService : ApplicationService [HttpPost("Track/Upsert")] public async Task UpsertTrackAsync(UpsertTrackInput input) { - var orderId = await _orderRepository.GetFirstAsync(x => - x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => x.Id); - if (orderId == default) + var order = await _orderRepository.GetFirstAsync(x => + x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => new + { + x.Id, x.SubSystemId, x.IsPushCompleted + }); + if (order == default) { throw new BusinessException(message: $"订单:{input.OrderNo}不存在"); } - // 不存在则新增轨迹,存在则更新 - var track = await _trackDetailsRepository.GetFirstOrDefaultAsync(orderId, input.TrackCode); - if (track == default) - { - var trackContent = await _trackQueries.MatchTrackContentAsync(orderId, input.TrackCode); - if (trackContent == default) - { - throw new BusinessException(message: $"订单:{input.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{input.TrackCode}"); - } - - track = new TrackDetailsIndex - { - OrderId = orderId, - OrderNo = input.OrderNo, - OrderType = input.OrderType, - TrackStatus = trackContent.Status, - TrackCode = input.TrackCode, - TrackContent = trackContent.Content, - TrackEnContent = trackContent.EnContent, - TrackPlace = input.TrackPlace, - TrackTime = input.TrackTime, - TraceTimeZone = input.TraceTimeZone, - CreateUserId = CurrentUserRequest.CurrentUser.UserId, - CreateTime = DateTime.Now - }; - await _trackDetailsRepository.CreateAsync(track); - } - else - { - track.UpdateUserId = CurrentUserRequest.CurrentUser.UserId; - track.UpdateTime = DateTime.Now; - track.TrackPlace = input.TrackPlace; - track.TrackTime = input.TrackTime; - track.TraceTimeZone = input.TraceTimeZone; - await _trackDetailsRepository.UpdateAsync(track); - } - - // 根据订单关联关系向下刷,不同子系统还需要做内容映射 - var linkedOrderIds = await _orderRepository.GetLinkedOrderIdsAsync(orderId); - - if (linkedOrderIds.Count > 0) - { - await _capPublisher.PublishAsync(TrackCustomer.CapSubscribe, new TrackUpsertEvent { }); - } - - // 推送 + // 新增/更新轨迹 + var @event = ObjectMapper.Map(input); + @event.OrderId = order.Id; + @event.SubSystemId = order.SubSystemId; + await _trackUpsertEventHandler.UpsertTrackAsync(@event); return true; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs index 136375c5..29b8ae37 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs @@ -38,11 +38,11 @@ public interface IOrderRepository : IBasicRepository #region 订单关联 /// - /// 根据订单id,获取关联的订单id集合 + /// 根据订单id,获取关联的订单集合 /// /// /// - Task> GetLinkedOrderIdsAsync(int orderId); + Task> GetLinkedOrdersAsync(int orderId); /// /// 关联订单 diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs index 33e44303..88de3765 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs @@ -41,6 +41,12 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot /// [SugarColumn(ColumnName = "IsCompleted")] public bool IsCompleted { get; set; } + + /// + /// 订单是否推送完成(异步维护) + /// + [SugarColumn(ColumnName = "IsPushCompleted")] + public bool IsPushCompleted { get; set; } /// /// 最新轨迹内容(异步维护) diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs index fbeb2e9c..2ce468ed 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs @@ -13,14 +13,38 @@ public class TrackContentMapEntity : IFullAuditedBasicEntitys, IEntity public int Id { get; set; } /// - /// 映射轨迹内容id + /// 源子系统id /// - [SugarColumn(ColumnName = "MapTrackContentId")] - public int MapTrackContentId { get; set; } + [SugarColumn(ColumnName = "SubSystemId")] + public int SubSystemId { get; set; } /// /// 源轨迹内容id /// [SugarColumn(ColumnName = "TrackContentId")] public int TrackContentId { get; set; } + + /// + /// 源轨迹内容code + /// + [SugarColumn(ColumnName = "TrackContentCode")] + public string TrackContentCode { get; set; } = null!; + + /// + /// 映射子系统id + /// + [SugarColumn(ColumnName = "MapSubSystemId")] + public int MapSubSystemId { get; set; } + + /// + /// 映射轨迹内容id + /// + [SugarColumn(ColumnName = "MapTrackContentId")] + public int MapTrackContentId { get; set; } + + /// + /// 映射轨迹内容code + /// + [SugarColumn(ColumnName = "MapTrackContentCode")] + public string MapTrackContentCode { get; set; } = null!; } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs index 89d812a1..3ab152d1 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsRepository.cs @@ -6,9 +6,7 @@ public interface ITrackDetailsRepository { Task GetFirstOrDefaultAsync(int orderId, string inputTrackCode); - Task UpdateAsync(TrackDetailsIndex index); - - Task CreateAsync(TrackDetailsIndex index); + Task UpsertAsync(TrackDetailsIndex index); Task> GetListAsync(int orderType, List orderNos); diff --git a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/TrackDetailsIndex.cs b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/TrackDetailsIndex.cs index a8160da6..35857507 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/TrackDetailsIndex.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/TrackDetailsIndex.cs @@ -3,11 +3,9 @@ using SJZY.Expand.ElasticSearch; namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; -[ElasticsearchType(RelationName = IndexName)] +[ElasticsearchType(RelationName = GlobalConst.TrackIndex)] public class TrackDetailsIndex : IdBaseIndex { - public const string IndexName = "sjzy_track_details"; - /// /// 订单Id /// @@ -16,7 +14,7 @@ public class TrackDetailsIndex : IdBaseIndex /// /// 订单号 /// - public string OrderNo { get; set; } + public string OrderNo { get; set; } = null!; /// /// 订单类型(主数据枚举TrackOrderType) @@ -26,42 +24,42 @@ public class TrackDetailsIndex : IdBaseIndex /// /// 轨迹状态 /// - public string TrackStatus { get; set; } + public string TrackStatus { get; set; } = null!; /// /// 原轨迹状态 /// - public string OriginTrackStatus { get; set; } + public string? OriginTrackStatus { get; set; } /// /// 轨迹内容代码 /// - public string TrackCode { get; set; } + public string TrackCode { get; set; } = null!; /// /// 轨迹内容 /// - public string TrackContent { get; set; } + public string TrackContent { get; set; } = null!; /// /// 原轨迹内容 /// - public string OriginTrackContent { get; set; } + public string? OriginTrackContent { get; set; } /// /// 原轨迹报文 /// - public string OriginTrackData { get; set; } + public string? OriginTrackData { get; set; } /// /// 轨迹内容英文 /// - public string TrackEnContent { get; set; } + public string TrackEnContent { get; set; } = null!; /// /// 轨迹发生地 /// - public string TrackPlace { get; set; } + public string? TrackPlace { get; set; } /// /// 轨迹发生时间 diff --git a/src/SJZY.Track.Domain/Dtos/Order/LinkedOrderVO.cs b/src/SJZY.Track.Domain/Dtos/Order/LinkedOrderVO.cs new file mode 100644 index 00000000..5d1c7327 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/Order/LinkedOrderVO.cs @@ -0,0 +1,14 @@ +namespace SJZY.Track.Domain.Dtos.Order; + +public class LinkedOrderVO +{ + /// + /// 关联订单id + /// + public int OrderId { get; set; } + + /// + /// 子系统id + /// + public int SubSystemId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackDetails/MatchTrackContentDto.cs b/src/SJZY.Track.Domain/Dtos/TrackDetails/MatchTrackContentDto.cs index c6e07352..ced59e19 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackDetails/MatchTrackContentDto.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackDetails/MatchTrackContentDto.cs @@ -5,15 +5,15 @@ public class MatchTrackContentDto /// /// 轨迹内容 /// - public string Content { get; set; } + public string Content { get; set; } = null!; /// /// 轨迹内容英文 /// - public string EnContent { get; set; } + public string EnContent { get; set; } = null!; /// /// 轨迹状态 /// - public string Status { get; set; } + public string Status { get; set; } = null!; } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/GlobalConst.cs b/src/SJZY.Track.Domain/GlobalConst.cs new file mode 100644 index 00000000..77881f20 --- /dev/null +++ b/src/SJZY.Track.Domain/GlobalConst.cs @@ -0,0 +1,14 @@ +namespace SJZY.Track.Domain; + +public class GlobalConst +{ + /// + /// 轨迹明细es索引名称 + /// + public const string TrackIndex = "sjzy_track_details"; + + /// + /// 轨迹新增/更新cap订阅名称 + /// + public const string TrackUpsertSubscribe = "SJZY.Track.Upsert"; +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Queries/ITrackQueries.cs b/src/SJZY.Track.Domain/Queries/ITrackQueries.cs index df41882c..53a9720e 100644 --- a/src/SJZY.Track.Domain/Queries/ITrackQueries.cs +++ b/src/SJZY.Track.Domain/Queries/ITrackQueries.cs @@ -31,4 +31,13 @@ public interface ITrackQueries /// 轨迹代码 /// Task MatchTrackContentAsync(int orderId, string code); + + /// + /// 根据子系统内容映射,得到映射后的轨迹code + /// + /// + /// + /// + /// + Task MapTrackContentCodeAsync(int upSubSystemId, int subSystemId, string trackCode); } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Queries/TrackQueries.cs b/src/SJZY.Track.Repository/Queries/TrackQueries.cs index da7c4dab..a1e5168a 100644 --- a/src/SJZY.Track.Repository/Queries/TrackQueries.cs +++ b/src/SJZY.Track.Repository/Queries/TrackQueries.cs @@ -75,4 +75,13 @@ public class TrackQueries : ISugarRepository, ITrackQueries, }) .FirstAsync(); } + + public async Task MapTrackContentCodeAsync(int upSubSystemId, int subSystemId, string trackCode) + { + return await Context.Queryable() + .Where(x => x.SubSystemId == upSubSystemId && x.MapSubSystemId == subSystemId && + x.TrackContentCode == trackCode) + .Select(x => x.MapTrackContentCode) + .FirstAsync(); + } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 8e9106da..8be1ec1a 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -53,12 +53,16 @@ public class OrderRepository : BasicRepository, IOrderRepository, I #region 订单关联 - public async Task> GetLinkedOrderIdsAsync(int orderId) + public async Task> GetLinkedOrdersAsync(int orderId) { return await Context.Queryable() .LeftJoin((a, b) => a.Id == b.OrderId) .Where(a => a.Id == orderId) - .Select((a, b) => b.LinkOrderId) + .Select((a, b) => new LinkedOrderVO + { + OrderId = b.LinkOrderId, + SubSystemId = a.SubSystemId + }) .ToListAsync(); } diff --git a/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs index b5632055..c0ca92e4 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs @@ -1,5 +1,6 @@ using Nest; using SJZY.Expand.ElasticSearch.Services; +using SJZY.Track.Domain; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Dtos.TrackDetails; @@ -8,7 +9,7 @@ namespace SJZY.Track.Repository.Repositories; internal class TrackDetailsRepository : ElasticSearchContextAbstract, ITrackDetailsRepository, ITransientDependency { - public string IndexName => $"{TrackDetailsIndex.IndexName}-{DateTime.Now:yyyy.MM.dd}"; + public string IndexName => $"{GlobalConst.TrackIndex}-{DateTime.Now:yyyy.MM.dd}"; public TrackDetailsRepository(ConnectionFactory connectionFactory) : base(connectionFactory) { @@ -17,7 +18,7 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract GetFirstOrDefaultAsync(int orderId, string trackCode) { var r = await Context.SearchAsync(s => s - .Index($"{TrackDetailsIndex.IndexName}-{DateTime.Now:yyyy.MM.dd}") + .Index(IndexName) .Query(q => q.Term(t => t.Field(f => f.OrderId).Value(orderId)) && q.Term(t => t.Field(f => f.TrackCode).Value(trackCode)) @@ -32,24 +33,18 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract(index.Id, u => u .Index(IndexName) .Doc(index) - //.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见 + .DocAsUpsert() + //.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见 ); if (!response.IsValid) throw new Exception($"数据修改失败,原因:{response.DebugInformation}"); } - public async Task CreateAsync(TrackDetailsIndex index) - { - var response = await Context.IndexAsync(index, request => request.Index(IndexName)); - if (!response.IsValid) - throw new Exception($"数据添加失败,原因:{response.DebugInformation}"); - } - public async Task> GetListAsync(int orderType, List orderNos) { if (orderNos.Count < 1) return new List(); From d8065bb9d12906243db66ff3194be78ad4c501d2 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 17:53:15 +0800 Subject: [PATCH 19/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/GetPageTrackContentInput.cs | 5 +++++ .../Localization/Resources/en.json | 5 ++++- .../Localization/Resources/zh.json | 5 ++++- .../Services/TrackFlags/TrackFlagService.cs | 13 ++++++++++++- .../Services/TrackStatus/TrackStatusService.cs | 13 ++++++++++++- .../TrackTemplates/TrackTemplateService.cs | 18 ++++++++++++------ .../TrackContents/GetPageTrackContentVO.cs | 5 +++++ .../Repositories/TrackContentRepository.cs | 3 ++- 8 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs index 9f7d68f2..de3844b5 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetPageTrackContentInput.cs @@ -11,6 +11,11 @@ /// 关键字 /// public string? Keywords { get; set; } + + /// + /// 选中的轨迹内容id + /// + public List? SelectIds { get; set; } } public class GetTrackContentListDto diff --git a/src/SJZY.Track.Application/Localization/Resources/en.json b/src/SJZY.Track.Application/Localization/Resources/en.json index 9e31fad8..c7d369bc 100644 --- a/src/SJZY.Track.Application/Localization/Resources/en.json +++ b/src/SJZY.Track.Application/Localization/Resources/en.json @@ -7,6 +7,9 @@ "TemplateExist": "The template code already exists under the currently selected subsystem", "TrackContentExist": "The trace code or trace content or trace content in the current subsystem is repeated in English", "TrackStatusExist": "The trajectory status code or trajectory status or trajectory status in English is repeated under the current subsystem", - "TrackFlagExist": "Duplicate code or flag in the current subsystem" + "TrackFlagExist": "Duplicate code or flag in the current subsystem", + "IsExistTrackPullConfig": "Track Pull The template has been bound. Delete the track pull before deleting the template", + "IsExistTrackStatus": "The trajectory content has been bound to the trajectory status. Delete the trajectory content before deleting the trajectory status", + "IsExistTrackFlag": "The track content has been bound to the track mark. Delete the track content before deleting the track mark" } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Localization/Resources/zh.json b/src/SJZY.Track.Application/Localization/Resources/zh.json index 24a80165..38db9ebb 100644 --- a/src/SJZY.Track.Application/Localization/Resources/zh.json +++ b/src/SJZY.Track.Application/Localization/Resources/zh.json @@ -7,6 +7,9 @@ "TemplateExist": "模板代码已存在于当前选择的子系统下", "TrackContentExist": "当前子系统下轨迹代码或轨迹内容或轨迹内容英文重复", "TrackStatusExist": "当前子系统下轨迹状态代码或轨迹状态或轨迹状态英文重复", - "TrackFlagExist": "当前子系统下代码或标记重复" + "TrackFlagExist": "当前子系统下代码或标记重复", + "IsExistTrackPullConfig": "轨迹拉取已绑定了该模版,请先删除轨迹拉取再删除该模版", + "IsExistTrackStatus": "轨迹内容已经绑定了该轨迹状态,请先删除轨迹内容后再删除该轨迹状态", + "IsExistTrackFlag": "轨迹内容已经绑定了该轨迹标记,请先删除轨迹内容后再删除该轨迹标记" } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs b/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs index a6117f0d..01e9acd4 100644 --- a/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs +++ b/src/SJZY.Track.Application/Services/TrackFlags/TrackFlagService.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Localization; using SJZY.Track.Application.Contract.Dtos.TrackFlags; using SJZY.Track.Application.Localization; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Aggregates.TrackFlagAggregate; using SJZY.Track.Domain.Dtos.TrackFlags; using Volo.Abp.DependencyInjection; @@ -16,14 +17,17 @@ namespace SJZY.Track.Application.Services.TrackFlags { private readonly IStringLocalizer _stringLocalizer; private readonly ITrackFlagRepository _trackFlagRepository; + private readonly ITrackContentRepository _trackContentRepository; public TrackFlagService( IStringLocalizer stringLocalizer, - ITrackFlagRepository trackFlagRepository + ITrackFlagRepository trackFlagRepository, + ITrackContentRepository trackContentRepository ) { this._stringLocalizer = stringLocalizer; this._trackFlagRepository = trackFlagRepository; + this._trackContentRepository=trackContentRepository; } /// @@ -121,6 +125,13 @@ namespace SJZY.Track.Application.Services.TrackFlags private async Task DeleteAsync(EditTrackFlagInput input) { + #region 业务校验 + var isExistContent = await _trackContentRepository.GetFirstAsync(a => a.TrackFlagId==input.Id); + if (isExistContent!=null) + { + throw new BusinessException(message: _stringLocalizer["IsExistTrackFlag"]); + } + #endregion var isTrue = await _trackFlagRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue); diff --git a/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs index f7ba0720..686854db 100644 --- a/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs +++ b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Localization; using SJZY.Track.Application.Contract.Dtos.TrackStatus; using SJZY.Track.Application.Localization; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackStatus; using Volo.Abp.DependencyInjection; @@ -16,14 +17,17 @@ public class TrackStatusService : ApplicationService, ITransientDependency { private readonly IStringLocalizer _stringLocalizer; private readonly ITrackStatusRepository _trackStatusRepository; + private readonly ITrackContentRepository _trackContentRepository; public TrackStatusService( IStringLocalizer stringLocalizer, - ITrackStatusRepository trackStatusRepository + ITrackStatusRepository trackStatusRepository, + ITrackContentRepository trackContentRepository ) { this._stringLocalizer = stringLocalizer; this._trackStatusRepository = trackStatusRepository; + this._trackContentRepository=trackContentRepository; } /// @@ -122,6 +126,13 @@ public class TrackStatusService : ApplicationService, ITransientDependency private async Task DeleteAsync(EditTrackStatusInput input) { + #region 业务校验 + var isExistStatus = await _trackContentRepository.GetFirstAsync(a => a.TrackStatusId==input.Id); + if (isExistStatus!=null) + { + throw new BusinessException(message: _stringLocalizer["IsExistTrackStatus"]); + } + #endregion var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue); diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs index 5afc3992..367f2cda 100644 --- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs +++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Localization; using SJZY.Track.Application.Contract.Dtos.TrackTemplates; using SJZY.Track.Application.Localization; +using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.TrackTemplate; using Volo.Abp.DependencyInjection; @@ -18,14 +19,18 @@ public class TrackTemplateService : ApplicationService, ITransientDependency { private readonly IStringLocalizer _stringLocalizer; private readonly ITrackTemplateRepository _trackTemplateRepository; + private readonly ITrackPullConfigRepository _trackPullConfigRepository; /// public TrackTemplateService( IStringLocalizer stringLocalizer, - ITrackTemplateRepository trackTemplateRepository) + ITrackTemplateRepository trackTemplateRepository, + ITrackPullConfigRepository trackPullConfigRepository + ) { _stringLocalizer = stringLocalizer; _trackTemplateRepository = trackTemplateRepository; + _trackPullConfigRepository=trackPullConfigRepository; } /// @@ -105,14 +110,12 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task UpdateAsync(EditTrackTemplateInput input) { #region 业务校验 - var isExist = await _trackTemplateRepository.GetFirstAsync(a => a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code); if (isExist != null) { throw new BusinessException(message: _stringLocalizer["TemplateExist"]); } - #endregion var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id); @@ -125,9 +128,12 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task DeleteAsync(EditTrackTemplateInput input) { #region 业务校验 - - //到时候,得判断这个模版有没有在轨迹映射里面被使用过,如果被使用就抛出提示 - + //查询看看在轨迹拉取里面有没有被占用 + var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId==input.Id); + if (isExisistTrackPullConfig!=null) + { + throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]); + } #endregion var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id); diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs index 4f62c3a9..f4b3c65c 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetPageTrackContentVO.cs @@ -17,6 +17,11 @@ namespace SJZY.Track.Domain.Dtos.TrackContents /// 关键字 /// public string? Keywords { get; set; } + + /// + /// 选中的轨迹内容id + /// + public List? SelectIds { get; set; } } public class GetTrackContentListVO diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index a7bb1b6a..f177629e 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -62,7 +62,8 @@ public class TrackContentRepository : BasicRepository, ITrac (a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords) || a.EnContent.Contains(input.Keywords) ) - .OrderByDescending((a, b, c, d, e, f) => a.CreateTime) + .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => a.CreateTime, OrderByType.Desc) + .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b, c, d, e, f) => new GetTrackContentListVO { Id = a.Id, From a8b0892ab601f9f4ba78520a33ed21e5df92f658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 18:00:15 +0800 Subject: [PATCH 20/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E7=BC=96?= =?UTF-8?q?=E8=BE=91=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackPush/EditTrackPushContentInput.cs | 61 +++++++++++++++++++ .../AutoMapper/TrackPushAutoMapperProfile.cs | 1 + .../Services/TrackPush/TrackPushService.cs | 58 +++++++++++++++++- .../ITrackPushConfigRepository.cs | 8 +++ .../Repositories/TrackPushConfigRepository.cs | 20 ++++++ 5 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs new file mode 100644 index 00000000..0773f3dc --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs @@ -0,0 +1,61 @@ +namespace SJZY.Track.Application.Contract.Dtos.TrackPush; + +public class EditTrackPushContentInput +{ + /// + /// 扩展字段参数值 + /// + public string ExpandFieldsValue { get; set; } + + public int? Id { get; set; } + + /// + /// 操作类型 + /// + public OptionTypeNoNull Options { get; set; } + + /// + /// 推送单号类型 + /// + public int OrderNoType { get; set; } + + /// + /// 推送轨迹排序 + /// + public int Sort { get; set; } + + /// + /// 轨迹代码参数值 + /// + public string TrackContentCodeValue { get; set; } + + /// + /// 轨迹内容id + /// + public int TrackContentId { get; set; } + + /// + /// 轨迹内容参数值 + /// + public string TrackContentValue { get; set; } + + /// + /// 轨迹内容英文参数值 + /// + public string TrackEnContentValue { get; set; } + + /// + /// 轨迹推送配置id + /// + public int TrackPushConfigId { get; set; } + + /// + /// 轨迹状态参数值 + /// + public string TrackStatusValue { get; set; } + + /// + /// 轨迹时区GMT + /// + public string TrackTimeZone { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs index 351f5321..3a42d0e4 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs @@ -14,5 +14,6 @@ public class TrackPushAutoMapperProfile : Profile .ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(source => string.Join(',', source.TrackTemplateIds))); CreateMap(MemberList.None).Ignore(dest => dest.Id) .ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true)); + CreateMap(MemberList.None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index cd4567f6..46d10cce 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -1,6 +1,9 @@ -using Microsoft.Extensions.Localization; +using AutoMapper.Internal.Mappers; +using Microsoft.Extensions.Localization; +using Nito.AsyncEx; using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.PublicMethords; +using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; @@ -102,7 +105,7 @@ public class TrackPushService : ApplicationService, ITransientDependency if (input.Options != OptionTypeNoNull.删除) { Expression> isAnyExp = x => - x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId; + x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId; if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id); var trackTemplateIdExp = Expressionable.Create(); @@ -172,4 +175,55 @@ public class TrackPushService : ApplicationService, ITransientDependency return true; } + + /// + /// 轨迹推送配置内容编辑 + /// + /// + /// + [HttpPost("EditContent")] + public async Task EditContentAsync([FromBody] EditTrackPushContentInput input) + { + if (input.Options != OptionTypeNoNull.删除) + { + Expression> isContentAnyExp = x => + x.TrackPushConfigId == input.TrackPushConfigId && x.TrackContentId == input.TrackContentId; + if (input.Options == OptionTypeNoNull.修改) isContentAnyExp.And(x => x.Id != input.Id); + + if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp)) + throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]); + } + + switch (input.Options) + { + case OptionTypeNoNull.新增: + { + var trackPushContentEntity = ObjectMapper.Map(input); + + await _trackPushConfigRepository.InsertContentAsync(trackPushContentEntity); + } + break; + + case OptionTypeNoNull.修改: + { + var oldTrackPushContentEntity = await _trackPushConfigRepository.GetContentByIdAsync(input.Id!.Value) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + + ObjectMapper.Map(input, oldTrackPushContentEntity); + + await _trackPushConfigRepository.UpdateContentAsync(oldTrackPushContentEntity); + } + break; + + case OptionTypeNoNull.删除: + await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.Id == input.Id); + + break; + + default: + throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, + nameof(EditTrackPushContentInput.Options)]); + } + + return true; + } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 9c82ef1c..808cc3ac 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -14,4 +14,12 @@ public interface ITrackPushConfigRepository : IBasicRepository GetContentDetailAsync(int id); Task SoftDeleteContentAsync(Expression> whereExpression); + + Task IsContentAnyAsync(Expression> whereExpression); + + Task InsertContentAsync(TrackPushContentConfigEntity insertObj); + + Task GetContentByIdAsync(int id); + + Task UpdateContentAsync(TrackPushContentConfigEntity updateObj); } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 07cbedc7..9c2cb3d2 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -91,4 +91,24 @@ public class TrackPushConfigRepository : BasicRepository, .SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true) .ExecuteCommandHasChangeAsync(); } + + public async Task IsContentAnyAsync(Expression> whereExpression) + { + return await Context.Queryable().Where(whereExpression).AnyAsync(); + } + + public async Task InsertContentAsync(TrackPushContentConfigEntity insertObj) + { + return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0; + } + + public async Task GetContentByIdAsync(int id) + { + return await Context.Queryable().InSingleAsync(id); + } + + public async Task UpdateContentAsync(TrackPushContentConfigEntity updateObj) + { + return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync(); + } } \ No newline at end of file From 8ac687a9be59cc74a7210c77ae043bfbe7875a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 18:09:00 +0800 Subject: [PATCH 21/34] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackPull/UpdateTrackPullContentInput.cs | 2 +- .../TrackPush/EditTrackPushContentInput.cs | 2 +- .../Services/TrackPull/TrackPullService.cs | 116 +++++++++--------- .../Services/TrackPush/TrackPushService.cs | 5 +- .../TrackContentMapEntity.cs | 2 +- .../TrackPullContentConfigEntity.cs | 2 +- .../TrackPushContentConfigEntity.cs | 2 +- .../GetTrackPullContentDetailOutputVO.cs | 2 +- .../GetTrackPushContentDetailOutputVO.cs | 2 +- 9 files changed, 66 insertions(+), 69 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs index 84d7e335..077f8e0a 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/UpdateTrackPullContentInput.cs @@ -47,5 +47,5 @@ public class UpdateTrackPullContentInput /// /// 轨迹时区GMT /// - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs index 0773f3dc..ef22fc85 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs @@ -57,5 +57,5 @@ public class EditTrackPushContentInput /// /// 轨迹时区GMT /// - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs index 4210a46c..7f1ad2de 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs @@ -100,83 +100,83 @@ public class TrackPullService : ApplicationService, ITransientDependency switch (input.Options) { case OptionTypeNoNull.新增: - { - var trackPullEntity = ObjectMapper.Map(input); - var trackPullParamsEntity = - ObjectMapper.Map(input); - - var trackTemplateContentEntities = - await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId); - - var trackPullContentEntities = new List(); - - using (var ts = TransactionScopeHelper.Create()) { - int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity); + var trackPullEntity = ObjectMapper.Map(input); + var trackPullParamsEntity = + ObjectMapper.Map(input); - trackPullParamsEntity.PullOrPushConfigId = id; - await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity); + var trackTemplateContentEntities = + await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId); - foreach (var item in trackTemplateContentEntities) + var trackPullContentEntities = new List(); + + using (var ts = TransactionScopeHelper.Create()) { - trackPullContentEntities.Add(new() + int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity); + + trackPullParamsEntity.PullOrPushConfigId = id; + await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity); + + foreach (var item in trackTemplateContentEntities) { - TrackPullConfigId = id, - TrackContentId = item.TrackContentId - }); + trackPullContentEntities.Add(new() + { + TrackPullConfigId = id, + TrackContentId = item.TrackContentId + }); + } + + await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); + + ts.Complete(); } - - await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); - - ts.Complete(); } - } break; case OptionTypeNoNull.修改: - { - var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? - throw new BusinessException(message: _stringLocalizer["NotFindData"]); - - var oldTrackPullParamsEntity = - await _trackPullConfigRepository.GetParamsSingleAsync(x => - x.PullOrPushConfigId == input.Id && !x.IsPush); - - var trackPullContentEntities = new List(); - - if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) { - var trackTemplateContentEntities = - await _trackTemplateRepository.GetContentListAsync(x => - x.TrackTemplateId == input.TrackTemplateId); + var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? + throw new BusinessException(message: _stringLocalizer["NotFindData"]); - foreach (var item in trackTemplateContentEntities) - { - trackPullContentEntities.Add(new() - { - TrackPullConfigId = oldTrackPullEntity.Id, - TrackContentId = item.TrackContentId - }); - } - } + var oldTrackPullParamsEntity = + await _trackPullConfigRepository.GetParamsSingleAsync(x => + x.PullOrPushConfigId == input.Id && !x.IsPush); - ObjectMapper.Map(input, oldTrackPullEntity); - ObjectMapper.Map(input, oldTrackPullParamsEntity); - - using (var ts = TransactionScopeHelper.Create()) - { - await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity); - await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity); + var trackPullContentEntities = new List(); if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) { - await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id); - await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); + var trackTemplateContentEntities = + await _trackTemplateRepository.GetContentListAsync(x => + x.TrackTemplateId == input.TrackTemplateId); + + foreach (var item in trackTemplateContentEntities) + { + trackPullContentEntities.Add(new() + { + TrackPullConfigId = oldTrackPullEntity.Id, + TrackContentId = item.TrackContentId + }); + } } - ts.Complete(); + ObjectMapper.Map(input, oldTrackPullEntity); + ObjectMapper.Map(input, oldTrackPullParamsEntity); + + using (var ts = TransactionScopeHelper.Create()) + { + await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity); + await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity); + + if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId) + { + await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id); + await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities); + } + + ts.Complete(); + } } - } break; case OptionTypeNoNull.删除: diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index 46d10cce..7c8489ed 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -1,9 +1,6 @@ -using AutoMapper.Internal.Mappers; -using Microsoft.Extensions.Localization; -using Nito.AsyncEx; +using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs index 2ce468ed..1c20048f 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/TrackContentMapEntity.cs @@ -41,7 +41,7 @@ public class TrackContentMapEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "MapTrackContentId")] public int MapTrackContentId { get; set; } - + /// /// 映射轨迹内容code /// diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/TrackPullContentConfigEntity.cs b/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/TrackPullContentConfigEntity.cs index f9de867c..2a9d53ab 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/TrackPullContentConfigEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/TrackPullContentConfigEntity.cs @@ -64,5 +64,5 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity /// 轨迹时区GMT /// [SugarColumn(ColumnName = "TrackTimeZone")] - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushContentConfigEntity.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushContentConfigEntity.cs index a1223bb0..1c392d52 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushContentConfigEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushContentConfigEntity.cs @@ -70,5 +70,5 @@ public class TrackPushContentConfigEntity : IFullAuditedBasicEntitys, IEntity /// 轨迹时区GMT /// [SugarColumn(ColumnName = "TrackTimeZone")] - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentDetailOutputVO.cs index af51f0cf..f29ab75f 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentDetailOutputVO.cs @@ -52,5 +52,5 @@ public class GetTrackPullContentDetailOutputVO /// /// 拉取轨迹时区 /// - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs index 2bad0d5a..f0980524 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs @@ -57,5 +57,5 @@ public class GetTrackPushContentDetailOutputVO /// /// 推送轨迹时区 /// - public string TrackTimeZone { get; set; } + public double? TrackTimeZone { get; set; } } \ No newline at end of file From 6e487a60c380b1ca12cf58426cf996f8a6d11473 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 18:34:05 +0800 Subject: [PATCH 22/34] =?UTF-8?q?=E5=B7=A6=E8=BF=9E=E6=8E=A5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8A=A0isdeleted=3D=3Dfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/TrackContentService.cs | 5 +++-- .../Repositories/OrderRepository.cs | 4 ++-- .../Repositories/TrackContentRepository.cs | 20 +++++++++++-------- .../Repositories/TrackFlagRepository.cs | 8 ++++---- .../Repositories/TrackStatusRepository.cs | 8 ++++---- .../Repositories/TrackTemplateRepository.cs | 6 +++--- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index c7493cec..dfd3d7dd 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -20,6 +20,7 @@ namespace SJZY.Track.Application.Services.TrackContents public TrackContentService( IStringLocalizer stringLocalizer, ITrackContentRepository trackContentRepository + ) { this._stringLocalizer = stringLocalizer; @@ -103,7 +104,6 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task UpdateAsync(EditTrackContentInput input) { #region 业务逻辑校验 - var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id && a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Content == input.Content || a.EnContent == input.EnContent)); @@ -111,7 +111,8 @@ namespace SJZY.Track.Application.Services.TrackContents { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } - + //更新的时候需要覆盖内容映射轨迹代码 + #endregion var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 8be1ec1a..7d4e4c90 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -102,8 +102,8 @@ public class OrderRepository : BasicRepository, IOrderRepository, I public async Task> GetPageTrackOrder(GetPageTrackOrderInputVO input) { var pageList = await Context.Queryable() - .LeftJoin((a, b) => a.CustomId == b.Id) - .LeftJoin((a, b, c) => a.SubSystemId == c.Id) + .LeftJoin((a, b) => a.CustomId == b.Id && b.IsDeleted == false) + .LeftJoin((a, b, c) => a.SubSystemId == c.Id && c.IsDeleted == false) .WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.OrderNos.IsNullOrEmpty(), (a, b, c) => input.OrderNos.Contains(a.OrderNo)) .WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue, diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index f177629e..e4f2e387 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -22,9 +22,9 @@ public class TrackContentRepository : BasicRepository, ITrac public async Task GetDetailAsync(int id) { var detail = await Context.Queryable() - .LeftJoin((a, b) => a.TrackStatusId==b.Id) - .LeftJoin((a, b, c) => a.TrackFlagId==c.Id) - .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id) + .LeftJoin((a, b) => a.TrackStatusId == b.Id && b.IsDeleted == false) + .LeftJoin((a, b, c) => a.TrackFlagId == c.Id && c.IsDeleted == false) + .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id&&d.IsDeleted==false) .Where((a, b, c, d) => a.Id == id) .Select((a, b, c, d) => new GetTrackContentDetailVO { @@ -52,11 +52,11 @@ public class TrackContentRepository : BasicRepository, ITrac { UnifyPageResultDto pagedList = new UnifyPageResultDto(); pagedList = await Context.Queryable() - .LeftJoin((a, b) => a.TrackStatusId==b.Id) - .LeftJoin((a, b, c) => a.TrackFlagId==c.Id) - .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id) - .LeftJoin((a, b, c, d, e) => a.CreateUserId == e.Id) - .LeftJoin((a, b, c, d, e, f) => a.UpdateUserId == f.Id) + .LeftJoin((a, b) => a.TrackStatusId==b.Id&&b.IsDeleted==false) + .LeftJoin((a, b, c) => a.TrackFlagId==c.Id&&c.IsDeleted==false) + .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id && d.IsDeleted == false) + .LeftJoin((a, b, c, d, e) => a.CreateUserId == e.Id && e.IsDeleted == false) + .LeftJoin((a, b, c, d, e, f) => a.UpdateUserId == f.Id && f.IsDeleted == false) .WhereIF(input.SubSystemId > 0, (a, b, c, d, e, f) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords) @@ -83,6 +83,10 @@ public class TrackContentRepository : BasicRepository, ITrac }) .ToPagedListAsync(input.PageIndex, input.PageSize); + var ff = await Context.Queryable().Where(a => 1==1).ToListAsync(); + + + return pagedList; } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs index 2a710641..eb6b8ca1 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackFlagRepository.cs @@ -18,7 +18,7 @@ public class TrackFlagRepository : BasicRepository, ITrackFlagR public async Task GetDetailAsync(int id) { var detail = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) .Where((a, b) => a.Id == id) .Select((a, b) => new GetTrackFlagDetailVO { @@ -42,9 +42,9 @@ public class TrackFlagRepository : BasicRepository, ITrackFlagR { UnifyPageResultDto pagedList = new UnifyPageResultDto(); pagedList = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) - .LeftJoin((a, b, c) => a.CreateUserId == c.Id) - .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) + .LeftJoin((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false) + .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false) .WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId) .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc) .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) diff --git a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs index dacc6947..7279e1e1 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackStatusRepository.cs @@ -14,7 +14,7 @@ public class TrackStatusRepository : BasicRepository, ITrackS public async Task GetDetailAsync(int id) { var detail = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id&&b.IsDeleted==false) .Where((a, b) => a.Id == id) .Select((a, b) => new GetTrackStatusDetailVO { @@ -38,9 +38,9 @@ public class TrackStatusRepository : BasicRepository, ITrackS public async Task> GetPageTrackStatus(GetPageTrackStatusVO input) { UnifyPageResultDto pagedList = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) - .LeftJoin((a, b, c) => a.CreateUserId == c.Id) - .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) + .LeftJoin((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false) + .LeftJoin((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false) .WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d) => a.Status.Contains(input.Keywords) || a.EnStatus.Contains(input.Keywords) || diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index 57d3ab38..6fe279f7 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -20,7 +20,7 @@ public class TrackTemplateRepository : BasicRepository, ITr public async Task GetDetailAsync(int id) { var detail = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id&&b.IsDeleted==false) .Where((a, b) => a.Id == id) .Select((a, b) => new GetTrackTemplateDetailVO @@ -43,11 +43,11 @@ public class TrackTemplateRepository : BasicRepository, ITr public async Task> GetPageTrackTemplate(GetPageTrackTemplateVO input) { UnifyPageResultDto pagedList = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id) + .LeftJoin((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) .WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords)) - .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b) => a.CreateTime,OrderByType.Desc) + .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b) => a.CreateTime, OrderByType.Desc) .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc) .Select((a, b) => new GetTrackTemplateListVO { From 56875e923a0564a8d9f4cf5fcb0697c562b1f29d Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 18:36:43 +0800 Subject: [PATCH 23/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=8E=BB=E6=8E=89=E8=BD=A8=E8=BF=B9=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoMapper/OrderAutoMapperProfile.cs | 3 +++ .../OrderAggregate/IOrderRepository.cs | 2 +- .../Repositories/OrderRepository.cs | 18 +++++++++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs index b176cf6e..d0ead552 100644 --- a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs @@ -1,6 +1,8 @@ using AutoMapper; +using AutoMapper.Internal.Mappers; 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 System.Diagnostics; @@ -21,5 +23,6 @@ public class OrderAutoMapperProfile : Profile CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap, UnifyPageResultDto>(MemberList.None); + CreateMap(MemberList.None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs index 29b8ae37..225605cc 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/IOrderRepository.cs @@ -11,7 +11,7 @@ public interface IOrderRepository : IBasicRepository /// Task CreateOrderAsync(OrderEntity order); - Task> GetOrderDetails(GetOrderDetailsInputVO input); + //Task> GetOrderDetails(GetOrderDetailsInputVO input); /// /// 获取分页的轨迹订单 diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 7d4e4c90..935a4c51 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -80,15 +80,15 @@ public class OrderRepository : BasicRepository, IOrderRepository, I #region 轨迹订单明细 - /// - /// 根据轨迹订单id获取轨迹明细列表 - /// - /// - /// - public async Task> GetOrderDetails(GetOrderDetailsInputVO input) - { - return null; - } + ///// + ///// 根据轨迹订单id获取轨迹明细列表 + ///// + ///// + ///// + //public async Task> GetOrderDetails(GetOrderDetailsInputVO input) + //{ + // return null; + //} #endregion From 61cc6aafc5d6a35aaf13bb0e216d4c90f4911248 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 19:02:21 +0800 Subject: [PATCH 24/34] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackContents/TrackContentService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index dfd3d7dd..281fed37 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -20,7 +20,7 @@ namespace SJZY.Track.Application.Services.TrackContents public TrackContentService( IStringLocalizer stringLocalizer, ITrackContentRepository trackContentRepository - + ) { this._stringLocalizer = stringLocalizer; @@ -111,10 +111,8 @@ namespace SJZY.Track.Application.Services.TrackContents { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } - //更新的时候需要覆盖内容映射轨迹代码 - #endregion - + //更新的时候需要覆盖内容映射轨迹代码 var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); ObjectMapper.Map(input, templateEntity); var isTrue = await _trackContentRepository.UpdateAsync(templateEntity); @@ -124,6 +122,9 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task DeleteAsync(EditTrackContentInput input) { + #region 业务校验 + //需要加个判断,存在内容映射,则出提示 + #endregion var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue); From 375de5268d177297d433f99f5473bf7877d1659c Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 19:14:20 +0800 Subject: [PATCH 25/34] =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=9A=84=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs | 5 +++++ src/SJZY.Track.Repository/Repositories/OrderRepository.cs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs index 44027d12..44567900 100644 --- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs @@ -44,6 +44,11 @@ namespace SJZY.Track.Domain.Dtos.Order /// public int OrderType { get; set; } + /// + /// 订单名称 + /// + public string OrderTypeName { get; set; } + /// /// 订单号 /// diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index 935a4c51..05fc2db1 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -117,6 +117,8 @@ public class OrderRepository : BasicRepository, IOrderRepository, I Id = a.Id, OrderNumber = a.OrderNo, OrderType = a.OrderType, + OrderTypeName = SqlFunc.IF(a.OrderType == 1).Return("干线提单").ElseIF(a.OrderType == 2).Return("小包运单").ElseIF(a.OrderType == 3) + .Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""), CustomerShortName = b.Abbreviation, CustomerCode = b.Code, TrackTemplateNames = SqlFunc.Subqueryable() From 81a8e077fc1663c3ad72a46dda742343a757da48 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 1 Mar 2024 19:18:23 +0800 Subject: [PATCH 26/34] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95=E7=B1=BB=E5=9E=8B=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/GetPageTrackOrderInput.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs index 2f8d31e0..be5dbb69 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs @@ -38,6 +38,11 @@ public class TrackOrderDto /// public int OrderType { get; set; } + /// + /// 订单名称 + /// + public string? OrderTypeName { get; set; } + /// /// 订单号 /// From 3d91f9c632c80e9a5c503122732be25b625ade80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 20:30:17 +0800 Subject: [PATCH 27/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=A0=E5=B0=84=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/TrackContentService.cs | 26 +++++++-- .../ITrackContentRepository.cs | 4 +- .../GetTrackContentMapPageInputVO.cs | 11 ++++ .../GetTrackContentMapPageOutputVO.cs | 56 +++++++++++++++++++ .../Repositories/TrackContentRepository.cs | 56 ++++++++++++++----- 5 files changed, 134 insertions(+), 19 deletions(-) create mode 100644 src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageInputVO.cs create mode 100644 src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageOutputVO.cs diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 281fed37..52c01e40 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Localization; +using SJZY.Expand.ABP.Core.Common.Dto; using SJZY.Track.Application.Contract.Dtos.TrackContents; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackContentAggregate; @@ -93,7 +94,7 @@ namespace SJZY.Track.Application.Services.TrackContents throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } - #endregion + #endregion 业务逻辑校验 var entity = ObjectMapper.Map(input); var isTrue = await _trackContentRepository.InsertAsync(entity); @@ -104,6 +105,7 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task UpdateAsync(EditTrackContentInput input) { #region 业务逻辑校验 + var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id && a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Content == input.Content || a.EnContent == input.EnContent)); @@ -111,7 +113,9 @@ namespace SJZY.Track.Application.Services.TrackContents { throw new BusinessException(message: _stringLocalizer["TrackContentExist"]); } - #endregion + + #endregion 业务逻辑校验 + //更新的时候需要覆盖内容映射轨迹代码 var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); ObjectMapper.Map(input, templateEntity); @@ -123,13 +127,27 @@ namespace SJZY.Track.Application.Services.TrackContents private async Task DeleteAsync(EditTrackContentInput input) { #region 业务校验 + //需要加个判断,存在内容映射,则出提示 - #endregion + + #endregion 业务校验 + var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id); return new UnifyResultDto("200", "删除成功", isTrue); } - #endregion + #endregion 私有方法 + + /// + /// 轨迹内容映射列表 + /// + /// + /// + [HttpPost("GetMapPage")] + public async Task> GetMapPageAsync([FromBody] GetTrackContentMapPageInputVO input) + { + return await _trackContentRepository.GetMapPageAsync(input); + } } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs index fbd0e412..fe1ab55c 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs @@ -1,10 +1,12 @@ using SJZY.Track.Domain.Dtos.TrackContents; -using SJZY.Track.Domain.Dtos.TrackStatus; namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate; public interface ITrackContentRepository : IBasicRepository { Task GetDetailAsync(int id); + Task> GetPageTrackContent(GetPageTrackContentVO input); + + Task> GetMapPageAsync(GetTrackContentMapPageInputVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageInputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageInputVO.cs new file mode 100644 index 00000000..e6cd19e6 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageInputVO.cs @@ -0,0 +1,11 @@ +using SJZY.Track.Domain.Dtos.Common; + +namespace SJZY.Track.Domain.Dtos.TrackContents; + +public class GetTrackContentMapPageInputVO : KeywordsInputVO +{ + /// + /// 映射子系统id + /// + public int? MapSubSystemId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageOutputVO.cs new file mode 100644 index 00000000..e291b71f --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapPageOutputVO.cs @@ -0,0 +1,56 @@ +namespace SJZY.Track.Domain.Dtos.TrackContents; + +public class GetTrackContentMapPageOutputVO +{ + /// + /// 轨迹内容代码 + /// + public string Code { get; set; } + + /// + /// 轨迹内容 + /// + public string Content { get; set; } + + /// + /// 轨迹内容英文 + /// + public string EnContent { get; set; } + + public int Id { get; set; } + + /// + /// 映射轨迹内容代码 + /// + public string MapCode { get; set; } + + /// + /// 映射内容 + /// + public string MapContent { get; set; } + + /// + /// 映射内容英文 + /// + public string MapEnContent { get; set; } + + /// + /// 映射子系统 + /// + public string MapSubSystem { get; set; } + + /// + /// 映射轨迹状态 + /// + public string MapTrackStatus { get; set; } + + /// + /// 子系统 + /// + public string SubSystem { get; set; } + + /// + /// 轨迹状态 + /// + public string TrackStatus { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index e4f2e387..50f6a2d2 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -8,10 +8,8 @@ namespace SJZY.Track.Repository.Repositories; public class TrackContentRepository : BasicRepository, ITrackContentRepository, IScopedDependency { - public TrackContentRepository() { - } /// @@ -24,20 +22,20 @@ public class TrackContentRepository : BasicRepository, ITrac var detail = await Context.Queryable() .LeftJoin((a, b) => a.TrackStatusId == b.Id && b.IsDeleted == false) .LeftJoin((a, b, c) => a.TrackFlagId == c.Id && c.IsDeleted == false) - .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id&&d.IsDeleted==false) + .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id && d.IsDeleted == false) .Where((a, b, c, d) => a.Id == id) .Select((a, b, c, d) => new GetTrackContentDetailVO { Id = a.Id, SubSystemId = a.SubSystemId, SubSystem = d.CnName, - TrackStatusId=a.TrackStatusId, - TrackStatus= b.Status, + TrackStatusId = a.TrackStatusId, + TrackStatus = b.Status, Code = a.Code, Content = a.Content, EnContent = a.EnContent, - TrackFlagId=a.TrackFlagId, - TrackFlag=c.Name + TrackFlagId = a.TrackFlagId, + TrackFlag = c.Name }) .FirstAsync(); return detail; @@ -52,8 +50,8 @@ public class TrackContentRepository : BasicRepository, ITrac { UnifyPageResultDto pagedList = new UnifyPageResultDto(); pagedList = await Context.Queryable() - .LeftJoin((a, b) => a.TrackStatusId==b.Id&&b.IsDeleted==false) - .LeftJoin((a, b, c) => a.TrackFlagId==c.Id&&c.IsDeleted==false) + .LeftJoin((a, b) => a.TrackStatusId == b.Id && b.IsDeleted == false) + .LeftJoin((a, b, c) => a.TrackFlagId == c.Id && c.IsDeleted == false) .LeftJoin((a, b, c, d) => a.SubSystemId == d.Id && d.IsDeleted == false) .LeftJoin((a, b, c, d, e) => a.CreateUserId == e.Id && e.IsDeleted == false) .LeftJoin((a, b, c, d, e, f) => a.UpdateUserId == f.Id && f.IsDeleted == false) @@ -71,11 +69,11 @@ public class TrackContentRepository : BasicRepository, ITrac Code = a.Code, Content = a.Content, EnContent = a.EnContent, - TrackStatus= b.Status, + TrackStatus = b.Status, Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("干线").ElseIF(b.Node == 3).Return("清关") .ElseIF(b.Node == 4).Return("中转").ElseIF(b.Node == 5).Return("派送") .End(""), - TrackFlag= c.Name, + TrackFlag = c.Name, CreateTime = a.CreateTime, CreateUser = e.Name, UpdateTime = a.UpdateTime, @@ -83,10 +81,40 @@ public class TrackContentRepository : BasicRepository, ITrac }) .ToPagedListAsync(input.PageIndex, input.PageSize); - var ff = await Context.Queryable().Where(a => 1==1).ToListAsync(); - - + var ff = await Context.Queryable().Where(a => 1 == 1).ToListAsync(); return pagedList; } + + public async Task> GetMapPageAsync(GetTrackContentMapPageInputVO input) + { + return await Context.Queryable() + .InnerJoin((contentMap, sourceContent) => contentMap.TrackContentId == sourceContent.Id && !sourceContent.IsDeleted) + .InnerJoin((contentMap, sourceContent, targetContent) => contentMap.MapTrackContentId == targetContent.Id && !targetContent.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem) => contentMap.SubSystemId == sourceSystem.Id && !sourceSystem.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => contentMap.MapSubSystemId == targetSystem.Id && !targetSystem.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus) => sourceContent.TrackStatusId == sourceStatus.Id && !sourceStatus.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus, targetStatus) => targetContent.TrackStatusId == targetStatus.Id && !targetStatus.IsDeleted) + .Filter(null, true) + .Where(contentMap => !contentMap.IsDeleted) + .WhereIF(input.SubSystemId.HasValue, contentMap => contentMap.SubSystemId == input.SubSystemId) + .WhereIF(input.MapSubSystemId.HasValue, contentMap => contentMap.MapSubSystemId == input.MapSubSystemId) + .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (contentMap, sourceContent) => sourceContent.Code.Contains(input.Keywords) || sourceContent.Content.Contains(input.Keywords) || sourceContent.EnContent.Contains(input.Keywords)) + .OrderByDescending(contentMap => contentMap.CreateTime) + .Select((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus, targetStatus) => new GetTrackContentMapPageOutputVO + { + Id = contentMap.Id, + SubSystem = sourceSystem.CnName, + Code = contentMap.TrackContentCode, + TrackStatus = sourceStatus.Status, + Content = sourceContent.Content, + EnContent = sourceContent.EnContent, + MapSubSystem = targetSystem.CnName, + MapCode = contentMap.MapTrackContentCode, + MapTrackStatus = targetStatus.Status, + MapContent = targetContent.Content, + MapEnContent = targetContent.EnContent + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + } } \ No newline at end of file From 867b987f9a79a526f9dae79348fa2574e1dc0e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 20:42:06 +0800 Subject: [PATCH 28/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=A0=E5=B0=84=E8=AF=A6=E6=83=85=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/TrackContentService.cs | 11 +++++ .../ITrackContentRepository.cs | 2 + .../GetTrackContentMapDetailOutputVO.cs | 46 +++++++++++++++++++ .../Repositories/TrackContentRepository.cs | 21 +++++++++ 4 files changed, 80 insertions(+) create mode 100644 src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 52c01e40..542b0612 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -149,5 +149,16 @@ namespace SJZY.Track.Application.Services.TrackContents { return await _trackContentRepository.GetMapPageAsync(input); } + + /// + /// 轨迹内容映射详情 + /// + /// + /// + [HttpGet("GetMapDetail")] + public async Task GetMapDetailAsync(int id) + { + return await _trackContentRepository.GetMapDetailAsync(id); + } } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs index fe1ab55c..cb4c9a4f 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs @@ -9,4 +9,6 @@ public interface ITrackContentRepository : IBasicRepository Task> GetPageTrackContent(GetPageTrackContentVO input); Task> GetMapPageAsync(GetTrackContentMapPageInputVO input); + + Task GetMapDetailAsync(int id); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs new file mode 100644 index 00000000..b5755d21 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs @@ -0,0 +1,46 @@ +namespace SJZY.Track.Domain.Dtos.TrackContents; + +public class GetTrackContentMapDetailOutputVO +{ + public int Id { get; set; } + + /// + /// 映射子系统 + /// + public string MapSubSystem { get; set; } + + /// + /// 映射子系统id + /// + public int MapSubSystemId { get; set; } + + /// + /// 映射轨迹内容 + /// + public string MapTrackContent { get; set; } + + /// + /// 映射轨迹内容id + /// + public int MapTrackContentId { get; set; } + + /// + /// 子系统 + /// + public string SubSystem { get; set; } + + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 源轨迹内容 + /// + public string TrackContent { get; set; } + + /// + /// 源轨迹内容id + /// + public int TrackContentId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index 50f6a2d2..a186543a 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -117,4 +117,25 @@ public class TrackContentRepository : BasicRepository, ITrac }) .ToPagedListAsync(input.PageIndex, input.PageSize); } + + public async Task GetMapDetailAsync(int id) + { + return await Context.Queryable() + .InnerJoin((contentMap, sourceContent) => contentMap.TrackContentId == sourceContent.Id && !sourceContent.IsDeleted) + .InnerJoin((contentMap, sourceContent, targetContent) => contentMap.MapTrackContentId == targetContent.Id && !targetContent.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem) => contentMap.SubSystemId == sourceSystem.Id && !sourceSystem.IsDeleted) + .LeftJoin((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => contentMap.MapSubSystemId == targetSystem.Id && !targetSystem.IsDeleted) + .Filter(null, true) + .Where(contentMap => !contentMap.IsDeleted) + .Select((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => new GetTrackContentMapDetailOutputVO + { + Id = contentMap.Id, + SubSystemId = contentMap.SubSystemId, + SubSystem = sourceSystem.CnName, + TrackContent = contentMap.TrackContentCode + "-" + sourceContent.Content, + MapSubSystem = targetSystem.CnName, + MapTrackContent = contentMap.MapTrackContentCode + "-" + targetContent.Content + }, true) + .SingleAsync(); + } } \ No newline at end of file From 2292b7433d2ffb8db8b85490c2652a7a56a244be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 20:58:48 +0800 Subject: [PATCH 29/34] =?UTF-8?q?=E5=88=9B=E5=BB=BA=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=A0=E5=B0=84=E7=BC=96=E8=BE=91=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/EditTrackContentMapInput.cs | 41 +++++++++++++++++++ .../TrackContents/TrackContentService.cs | 41 +++++++++++++++++++ .../ITrackContentRepository.cs | 2 + .../GetTrackContentMapDetailOutputVO.cs | 10 +++++ .../Repositories/TrackContentRepository.cs | 6 +++ 5 files changed, 100 insertions(+) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentMapInput.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentMapInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentMapInput.cs new file mode 100644 index 00000000..e952cc62 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/EditTrackContentMapInput.cs @@ -0,0 +1,41 @@ +namespace SJZY.Track.Application.Contract.Dtos.TrackContents; + +public class EditTrackContentMapInput +{ + public int? Id { get; set; } + + /// + /// 映射子系统id + /// + public int MapSubSystemId { get; set; } + + /// + /// 映射轨迹内容代码 + /// + public string MapTrackContentCode { get; set; } + + /// + /// 映射轨迹内容id + /// + public int MapTrackContentId { get; set; } + + /// + /// 操作类型 + /// + public OptionTypeNoNull Options { get; set; } + + /// + /// 源子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 源轨迹内容代码 + /// + public string TrackContentCode { get; set; } + + /// + /// 源轨迹内容id + /// + public int TrackContentId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 542b0612..9201b16f 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -1,9 +1,13 @@ using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Common.Dto; +using SJZY.Expand.ABP.Core.Localization; using SJZY.Track.Application.Contract.Dtos.TrackContents; +using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackContentAggregate; +using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Dtos.TrackContents; +using System.Linq.Expressions; using Volo.Abp.DependencyInjection; namespace SJZY.Track.Application.Services.TrackContents @@ -160,5 +164,42 @@ namespace SJZY.Track.Application.Services.TrackContents { return await _trackContentRepository.GetMapDetailAsync(id); } + + /// + /// 轨迹内容映射编辑 + /// + /// + /// + [HttpPost("EditMap")] + public async Task EditMapAsync([FromBody] EditTrackContentMapInput input) + { + if (input.Options != OptionTypeNoNull.删除) + { + Expression> isMapAnyExp = x => + x.TrackContentId == input.TrackContentId && x.MapTrackContentId == input.MapTrackContentId; + if (input.Options == OptionTypeNoNull.修改) isMapAnyExp.And(x => x.Id != input.Id); + + if (await _trackContentRepository.IsMapAnyAsync(isMapAnyExp)) + throw new BusinessException(message: _stringLocalizer["IsTrackContentMapAny"]); + } + + switch (input.Options) + { + case OptionTypeNoNull.新增: + break; + + case OptionTypeNoNull.删除: + break; + + case OptionTypeNoNull.修改: + break; + + default: + throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, + nameof(EditTrackContentMapInput.Options)]); + } + + return true; + } } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs index cb4c9a4f..30439f50 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs @@ -11,4 +11,6 @@ public interface ITrackContentRepository : IBasicRepository Task> GetMapPageAsync(GetTrackContentMapPageInputVO input); Task GetMapDetailAsync(int id); + + Task IsMapAnyAsync(Expression> whereExpression); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs index b5755d21..dce4eff9 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackContents/GetTrackContentMapDetailOutputVO.cs @@ -43,4 +43,14 @@ public class GetTrackContentMapDetailOutputVO /// 源轨迹内容id /// public int TrackContentId { get; set; } + + /// + /// 源轨迹内容代码 + /// + public string TrackContentCode { get; set; } + + /// + /// 映射轨迹内容代码 + /// + public string MapTrackContentCode { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index a186543a..d21dad20 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -3,6 +3,7 @@ using SJZY.Track.Domain.Aggregates.TrackFlagAggregate; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackContents; using SJZY.Track.Domain.VEntities; +using System.Linq.Expressions; namespace SJZY.Track.Repository.Repositories; @@ -138,4 +139,9 @@ public class TrackContentRepository : BasicRepository, ITrac }, true) .SingleAsync(); } + + public async Task IsMapAnyAsync(Expression> whereExpression) + { + return await Context.Queryable().Where(whereExpression).AnyAsync(); + } } \ No newline at end of file From ad56431c397a675fbcdcf889067bb022795521a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 21:11:43 +0800 Subject: [PATCH 30/34] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=A0=E5=B0=84=E7=BC=96=E8=BE=91=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContentAutoMapperProfile.cs | 1 + .../TrackContents/TrackContentService.cs | 17 ++++++++++++-- .../ITrackContentRepository.cs | 8 +++++++ .../Repositories/TrackContentRepository.cs | 23 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs index 25f17ab6..bf20809b 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs @@ -15,6 +15,7 @@ namespace SJZY.Track.Application.AutoMapper CreateMap(MemberList.None); CreateMap, UnifyPageResultDto>( MemberList.None); + CreateMap(MemberList.None); } } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 9201b16f..50546355 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -186,12 +186,25 @@ namespace SJZY.Track.Application.Services.TrackContents switch (input.Options) { case OptionTypeNoNull.新增: - break; + { + var trackContentMapEntity = ObjectMapper.Map(input); - case OptionTypeNoNull.删除: + await _trackContentRepository.InsertMapAsync(trackContentMapEntity); + } break; case OptionTypeNoNull.修改: + { + var oldTrackContentMapEntity = await _trackContentRepository.GetMapByIdAsync(input.Id!.Value) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + + ObjectMapper.Map(input, oldTrackContentMapEntity); + + await _trackContentRepository.UpdateMapAsync(oldTrackContentMapEntity); + } + break; + + case OptionTypeNoNull.删除: + await _trackContentRepository.SoftDeleteMapAsync(x => x.Id == input.Id); break; default: diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs index 30439f50..2f04f35b 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs @@ -13,4 +13,12 @@ public interface ITrackContentRepository : IBasicRepository Task GetMapDetailAsync(int id); Task IsMapAnyAsync(Expression> whereExpression); + + Task InsertMapAsync(TrackContentMapEntity insertObj); + + Task GetMapByIdAsync(int id); + + Task UpdateMapAsync(TrackContentMapEntity updateObj); + + Task SoftDeleteMapAsync(Expression> whereExpression); } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index d21dad20..41c51ae7 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -144,4 +144,27 @@ public class TrackContentRepository : BasicRepository, ITrac { return await Context.Queryable().Where(whereExpression).AnyAsync(); } + + public async Task InsertMapAsync(TrackContentMapEntity insertObj) + { + return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0; + } + + public async Task GetMapByIdAsync(int id) + { + return await Context.Queryable().InSingleAsync(id); + } + + public async Task UpdateMapAsync(TrackContentMapEntity updateObj) + { + return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync(); + } + + public async Task SoftDeleteMapAsync(Expression> whereExpression) + { + return await Context.Updateable() + .Where(whereExpression) + .SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true) + .ExecuteCommandHasChangeAsync(); + } } \ No newline at end of file From e40ea3bdbab25a47ab0facd2577cafc024e69fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 21:42:32 +0800 Subject: [PATCH 31/34] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E5=86=85=E5=AE=B9=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackContents/TrackContentService.cs | 30 +++++++++++++++++-- .../ITrackContentRepository.cs | 2 ++ .../Repositories/TrackContentRepository.cs | 7 +++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 50546355..b746323f 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Common.Dto; using SJZY.Expand.ABP.Core.Localization; +using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Track.Application.Contract.Dtos.TrackContents; using SJZY.Track.Application.Contract.Dtos.TrackPull; using SJZY.Track.Application.Localization; @@ -122,8 +123,33 @@ namespace SJZY.Track.Application.Services.TrackContents //更新的时候需要覆盖内容映射轨迹代码 var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id); - ObjectMapper.Map(input, templateEntity); - var isTrue = await _trackContentRepository.UpdateAsync(templateEntity); + + bool isTrue = false; + + using (var ts = TransactionScopeHelper.Create()) + { + // 如果轨迹内容的子系统和code发生变化,同步到轨迹映射表 + if (templateEntity.SubSystemId != input.SubSystemId || templateEntity.Code != input.Code) + { + await _trackContentRepository.UpdateMapAsync(x => new TrackContentMapEntity + { + SubSystemId = input.SubSystemId, + TrackContentCode = input.Code + }, x => x.TrackContentId == input.Id); + + await _trackContentRepository.UpdateMapAsync(x => new TrackContentMapEntity + { + MapSubSystemId = input.SubSystemId, + MapTrackContentCode = input.Code + }, x => x.MapTrackContentId == input.Id); + } + + ObjectMapper.Map(input, templateEntity); + + isTrue = await _trackContentRepository.UpdateAsync(templateEntity); + + ts.Complete(); + } return new UnifyResultDto("200", "修改成功", isTrue); } diff --git a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs index 2f04f35b..cc7a54e9 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackContentAggregate/ITrackContentRepository.cs @@ -21,4 +21,6 @@ public interface ITrackContentRepository : IBasicRepository Task UpdateMapAsync(TrackContentMapEntity updateObj); Task SoftDeleteMapAsync(Expression> whereExpression); + + Task UpdateMapAsync(Expression> columns, Expression> whereExpression); } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index 41c51ae7..6946391e 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -3,6 +3,7 @@ using SJZY.Track.Domain.Aggregates.TrackFlagAggregate; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackContents; using SJZY.Track.Domain.VEntities; +using System.Linq; using System.Linq.Expressions; namespace SJZY.Track.Repository.Repositories; @@ -167,4 +168,10 @@ public class TrackContentRepository : BasicRepository, ITrac .SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true) .ExecuteCommandHasChangeAsync(); } + + public async Task UpdateMapAsync(Expression> columns, Expression> whereExpression) + { + return await Context.Updateable().SetColumns(columns).Where(whereExpression) + .ExecuteCommandAsync() > 0; + } } \ No newline at end of file From 777cf29baa2695fd3cee06d3c6131973c70743f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 22:11:45 +0800 Subject: [PATCH 32/34] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPush/TrackPushService.cs | 30 ++++++++++++++----- .../GetTrackPushConfigDetailOutputVO.cs | 5 ++++ src/SJZY.Track.Domain/GlobalConst.cs | 7 ++++- .../Repositories/TrackPushConfigRepository.cs | 1 + 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index 7c8489ed..02a09ce4 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -1,8 +1,10 @@ using Microsoft.Extensions.Localization; +using SJZY.Expand.ABP.Core; using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Localization; +using SJZY.Track.Domain.Aggregates.DemoAggregate; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; @@ -66,7 +68,7 @@ public class TrackPushService : ApplicationService, ITransientDependency /// /// [HttpGet("GetDetail")] - public async Task GetDetailAsync(int id) + public async Task GetDetailAsync(int id) { var res = await _trackPushConfigRepository.GetDetailAsync(id); if (res is null) return null; @@ -126,6 +128,8 @@ public class TrackPushService : ApplicationService, ITransientDependency trackPushParamsEntity.PullOrPushConfigId = id; await _trackPullConfigRepository.InsertParamsAsync(trackPushParamsEntity); + if (input.IsAutoPush) await RedisHelper.Client.SAddAsync(GlobalConst.AutoPushRosterRedisKey, input.CustomId); + ts.Complete(); } } @@ -135,6 +139,8 @@ public class TrackPushService : ApplicationService, ITransientDependency { var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); + int oldCustomId = oldTrackPushEntity.CustomId; + var oldTrackPushParamsEntity = await _trackPullConfigRepository.GetParamsSingleAsync(x => x.PullOrPushConfigId == input.Id && x.IsPush); @@ -147,22 +153,30 @@ public class TrackPushService : ApplicationService, ITransientDependency await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity); await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPushParamsEntity); + await RedisHelper.Client.SRemAsync(GlobalConst.AutoPushRosterRedisKey, oldCustomId); + if (input.IsAutoPush) await RedisHelper.Client.SAddAsync(GlobalConst.AutoPushRosterRedisKey, input.CustomId); + ts.Complete(); } } break; case OptionTypeNoNull.删除: - using (var ts = TransactionScopeHelper.Create()) { - await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id); - await _trackPullConfigRepository.SoftDeleteParamsAsync(x => - x.PullOrPushConfigId == input.Id && x.IsPush); - await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id); + var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); - ts.Complete(); + using (var ts = TransactionScopeHelper.Create()) + { + await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id); + await _trackPullConfigRepository.SoftDeleteParamsAsync(x => + x.PullOrPushConfigId == input.Id && x.IsPush); + await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id); + + await RedisHelper.Client.SRemAsync(GlobalConst.AutoPushRosterRedisKey, oldTrackPushEntity.CustomId); + + ts.Complete(); + } } - break; default: diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs index 900c74bc..ced23f75 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs @@ -91,6 +91,11 @@ public class GetTrackPushConfigDetailOutputVO /// public string TrackTemplateId { get; set; } + /// + /// 轨迹模板ids + /// + public List TrackTemplateIds { get; set; } + /// /// 推送轨迹发生时间 /// diff --git a/src/SJZY.Track.Domain/GlobalConst.cs b/src/SJZY.Track.Domain/GlobalConst.cs index 77881f20..8db2300c 100644 --- a/src/SJZY.Track.Domain/GlobalConst.cs +++ b/src/SJZY.Track.Domain/GlobalConst.cs @@ -6,9 +6,14 @@ public class GlobalConst /// 轨迹明细es索引名称 /// public const string TrackIndex = "sjzy_track_details"; - + /// /// 轨迹新增/更新cap订阅名称 /// public const string TrackUpsertSubscribe = "SJZY.Track.Upsert"; + + /// + /// 自动推送名单RedisKey + /// + public const string AutoPushRosterRedisKey = "AutoPushRoster"; } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 9c2cb3d2..1cec950d 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -68,6 +68,7 @@ public class TrackPushConfigRepository : BasicRepository, CustomName = externalSubject.Abbreviation, ServiceProvider = service.Name, }, true) + .Mapper(x => { x.TrackTemplateIds = x.TrackTemplateId.Split(',').Select(int.Parse).ToList(); }) .SingleAsync(); } From a327f0bcbf0209f8ed59a79a1db2e0011f1c0ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 23:08:25 +0800 Subject: [PATCH 33/34] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackPull/EditTrackPullConfigInput.cs | 12 ++++++------ .../Dtos/TrackPush/SortTrackPushContentInput.cs | 9 +++++++++ .../Services/TrackPush/TrackPushService.cs | 11 +++++++++++ .../TrackTemplates/TrackTemplateService.cs | 16 ++++++++++------ .../Dtos/Common/KeywordsInputVO.cs | 2 +- .../TrackPush/GetTrackPushConfigPageOutputVO.cs | 10 ++++++++++ .../GetTrackTemplateContentPageInputVO.cs | 2 +- .../GetTrackTemplateContentPageOutputVO.cs | 5 +++++ .../Repositories/TrackPushConfigRepository.cs | 2 ++ .../Repositories/TrackTemplateRepository.cs | 5 ++--- 10 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs index 61e15c3e..0b69d4a5 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPull/EditTrackPullConfigInput.cs @@ -37,27 +37,27 @@ public class EditTrackPullConfigInput /// /// 拉取轨迹时区 /// - public string TackTimeZoneName { get; set; } + public string? TackTimeZoneName { get; set; } /// /// 拉取轨迹内容代码 /// - public string TrackContentCodeName { get; set; } + public string? TrackContentCodeName { get; set; } /// /// 拉取轨迹内容 /// - public string TrackContentName { get; set; } + public string? TrackContentName { get; set; } /// /// 拉取轨迹发生地 /// - public string TrackPlaceName { get; set; } + public string? TrackPlaceName { get; set; } /// /// 拉取轨迹状态 /// - public string TrackStatusName { get; set; } + public string? TrackStatusName { get; set; } /// /// 轨迹模板id @@ -67,5 +67,5 @@ public class EditTrackPullConfigInput /// /// 拉取轨迹发生时间 /// - public string TrackTimeName { get; set; } + public string? TrackTimeName { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs new file mode 100644 index 00000000..9d68df98 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs @@ -0,0 +1,9 @@ +namespace SJZY.Track.Application.Contract.Dtos.TrackPush; + +public class SortTrackPushContentInput +{ + /// + /// 排序信息 + /// + public List> SortInfo { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index 02a09ce4..cbb9a835 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -237,4 +237,15 @@ public class TrackPushService : ApplicationService, ITransientDependency return true; } + + /// + /// 轨迹推送配置内容排序 + /// + /// + /// + [HttpPost("SortContent")] + public async Task SortContentAsync([FromBody] SortTrackPushContentInput input) + { + return true; + } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs index 367f2cda..78a5401d 100644 --- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs +++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs @@ -30,7 +30,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency { _stringLocalizer = stringLocalizer; _trackTemplateRepository = trackTemplateRepository; - _trackPullConfigRepository=trackPullConfigRepository; + _trackPullConfigRepository = trackPullConfigRepository; } /// @@ -99,7 +99,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency throw new BusinessException(message: _stringLocalizer["TemplateExist"]); } - #endregion + #endregion 业务校验 var entity = ObjectMapper.Map(input); var isTrue = await _trackTemplateRepository.InsertAsync(entity); @@ -110,13 +110,15 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task UpdateAsync(EditTrackTemplateInput input) { #region 业务校验 + var isExist = await _trackTemplateRepository.GetFirstAsync(a => a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code); if (isExist != null) { throw new BusinessException(message: _stringLocalizer["TemplateExist"]); } - #endregion + + #endregion 业务校验 var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id); ObjectMapper.Map(input, templateEntity); @@ -128,13 +130,15 @@ public class TrackTemplateService : ApplicationService, ITransientDependency private async Task DeleteAsync(EditTrackTemplateInput input) { #region 业务校验 + //查询看看在轨迹拉取里面有没有被占用 - var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId==input.Id); - if (isExisistTrackPullConfig!=null) + var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId == input.Id); + if (isExisistTrackPullConfig != null) { throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]); } - #endregion + + #endregion 业务校验 var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id); diff --git a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs index 2e58c378..f46e3c41 100644 --- a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs @@ -15,5 +15,5 @@ public class KeywordsInputVO : PageInfoInput /// /// 选中项 /// - public int? SelectedId { get; set; } + public List? SelectedId { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigPageOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigPageOutputVO.cs index 9b2e3a83..e0095b23 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigPageOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigPageOutputVO.cs @@ -23,4 +23,14 @@ public class GetTrackPushConfigPageOutputVO /// 模板名称 /// public string TrackTemplate { get; set; } + + /// + /// 轨迹模板id + /// + public string TrackTemplateId { get; set; } + + /// + /// 轨迹模板ids + /// + public List TrackTemplateIds { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs index d08ad492..09e8f51f 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs @@ -5,5 +5,5 @@ public class GetTrackTemplateContentPageInputVO : PageInfoInput /// /// 轨迹模板id /// - public int TrackTemplateId { get; set; } + public List TrackTemplateIds { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageOutputVO.cs index dd3a27d4..18d6ddcc 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageOutputVO.cs @@ -68,4 +68,9 @@ public class GetTrackTemplateContentPageOutputVO /// 修改人 /// public string UpdateUser { get; set; } + + /// + /// 轨迹内容id + /// + public int TrackContentId { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 1cec950d..472a8908 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -32,9 +32,11 @@ public class TrackPushConfigRepository : BasicRepository, TrackTemplate = SqlFunc.Subqueryable() .Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted) .SelectStringJoin(template => template.Name, ","), + TrackTemplateId = trackPush.TrackTemplateId, CreateTime = trackPush.CreateTime }) .Distinct() + .Mapper(x => { x.TrackTemplateIds = x.TrackTemplateId.Split(',').Select(int.Parse).ToList(); }) .ToPagedListAsync(input.PageIndex, input.PageSize); } diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index 6fe279f7..af67ce40 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -20,7 +20,7 @@ public class TrackTemplateRepository : BasicRepository, ITr public async Task GetDetailAsync(int id) { var detail = await Context.Queryable() - .LeftJoin((a, b) => a.SubSystemId == b.Id&&b.IsDeleted==false) + .LeftJoin((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false) .Where((a, b) => a.Id == id) .Select((a, b) => new GetTrackTemplateDetailVO @@ -84,8 +84,7 @@ public class TrackTemplateRepository : BasicRepository, ITr (templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) => templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted) .Filter(null, true) - .Where(templateContent => - templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted) + .Where(templateContent => input.TrackTemplateIds.Contains(templateContent.TrackTemplateId) && !templateContent.IsDeleted) .OrderByDescending(templateContent => templateContent.CreateTime) .Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) => new GetTrackTemplateContentPageOutputVO From a4718386f1cad7b0961bdc6e1948bd5a09500a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 23:21:49 +0800 Subject: [PATCH 34/34] =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackPush/SortTrackPushContentInput.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs index 9d68df98..f4ecab4c 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/SortTrackPushContentInput.cs @@ -2,8 +2,4 @@ public class SortTrackPushContentInput { - /// - /// 排序信息 - /// - public List> SortInfo { get; set; } } \ No newline at end of file