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 1/3] =?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 2/3] =?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 3/3] =?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 } /// - /// 分页获取轨迹模版 + /// 分页获取轨迹状态 /// /// ///