From da09dd9f0fb8db307523f1be699f242f52130c07 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 25 Dec 2023 11:01:55 +0800 Subject: [PATCH] =?UTF-8?q?init=20=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 25 ++++ .editorconfig | 141 ++++++++++++++++++ .gitignore | 4 + Dlis.Jinko.Yikatong.sln | 82 ++++++++++ .../Controllers/BusinessPlacesController.cs | 72 +++++++++ .../Request/BusinessPlacePageRequest.cs | 26 ++++ .../Request/BusinessPlaceSaveRequest.cs | 47 ++++++ .../Response/BusinessPlaceResponse.cs | 43 ++++++ .../Services/IBusinessPlaceService.cs | 20 +++ .../Implements/BusinessPlaceService.cs | 81 ++++++++++ .../Controllers/BusinessShiftsController.cs | 46 ++++++ .../Request/BusinessPlaceShiftPageRequest.cs | 7 + .../Request/BusinessPlaceShiftSaveRequest.cs | 39 +++++ .../Response/BusinessPlaceShiftResponse.cs | 41 +++++ .../Services/IBusinessPlaceShiftService.cs | 14 ++ .../Implements/BusinessPlaceShiftService.cs | 136 +++++++++++++++++ .../Device/Controllers/DevicesController.cs | 59 ++++++++ .../Device/Request/DevicePageRequest.cs | 13 ++ .../Device/Request/DeviceSaveRequest.cs | 61 ++++++++ .../Request/DeviceTemplatePageRequest.cs | 8 + .../Request/DeviceTemplateSaveRequest.cs | 21 +++ .../Device/Response/DeviceResponse.cs | 5 + .../Device/Response/DeviceTemplateResponse.cs | 6 + .../Device/Services/IDeviceService.cs | 12 ++ .../Device/Services/IDeviceTemplateService.cs | 11 ++ .../Services/Implements/DeviceService.cs | 49 ++++++ .../Implements/DeviceTemplateService.cs | 61 ++++++++ Src/Dlhis.Basic/Dlhis.Basic.csproj | 26 ++++ Src/Dlhis.Basic/Dockerfile | 22 +++ .../Controllers/MealUsersController.cs | 46 ++++++ .../MealUser/Request/MealUserAddRequest.cs | 20 +++ .../MealUser/Request/MealUserPageRequest.cs | 7 + .../MealUser/Response/MealUserResponse.cs | 6 + .../MealUser/Services/IMealUserService.cs | 14 ++ .../Services/Implements/MealUserService.cs | 53 +++++++ Src/Dlhis.Basic/Program.cs | 17 +++ .../Properties/launchSettings.json | 15 ++ Src/Dlhis.Basic/SqlSugarPack.cs | 25 ++++ Src/Dlhis.Basic/appsettings.Development.json | 8 + Src/Dlhis.Basic/appsettings.json | 74 +++++++++ Src/Dlhis.Canteen/Dlhis.Canteen.csproj | 45 ++++++ Src/Dlhis.Canteen/Dockerfile | 23 +++ .../Order/Controllers/OrdersController.cs | 36 +++++ .../Order/Request/OrderPageRequest.cs | 7 + .../Order/Response/OrderResponse.cs | 5 + .../Order/Services/IOrderService.cs | 11 ++ .../Order/Services/Implements/OrderService.cs | 27 ++++ Src/Dlhis.Canteen/Program.cs | 17 +++ .../Properties/launchSettings.json | 21 +++ .../Setting/Controllers/SettingController.cs | 69 +++++++++ .../Request/CanteenSettingPageRequest.cs | 20 +++ .../Request/CanteenSettingSaveRequest.cs | 38 +++++ .../Request/CanteenSettingSetEnableRequest.cs | 9 ++ .../Response/CanteenSettingResponse.cs | 41 +++++ .../Services/ICanteenSettingService.cs | 23 +++ .../Implements/CanteenSettingService.cs | 116 ++++++++++++++ Src/Dlhis.Canteen/SqlSugarPack.cs | 25 ++++ .../appsettings.Development.json | 11 ++ Src/Dlhis.Canteen/appsettings.json | 71 +++++++++ Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj | 14 ++ Src/Dlhis.Common.Api/IEnumSettingApi.cs | 12 ++ Src/Dlhis.Common/Dlhis.Common.csproj | 31 ++++ Src/Dlhis.Common/Dockerfile | 22 +++ .../EnumSetting/EnumsController.cs | 49 ++++++ Src/Dlhis.Common/Program.cs | 18 +++ .../Properties/launchSettings.json | 21 +++ Src/Dlhis.Common/appsettings.Development.json | 8 + Src/Dlhis.Common/appsettings.json | 62 ++++++++ .../Canteen/Entities/BalanceRecordEntity.cs | 136 +++++++++++++++++ .../Entities/CanteenBusinessPlaceEntity.cs | 55 +++++++ .../Entities/CanteenBusinessShiftEntity.cs | 49 ++++++ .../Canteen/Entities/CanteenOrderEntity.cs | 43 ++++++ .../Canteen/Entities/CanteenSettingEntity.cs | 51 +++++++ .../Canteen/Entities/CanteenUserEntity.cs | 70 +++++++++ .../Entities/OaEMealVoucherDetailEntity.cs | 84 +++++++++++ .../Canteen/Entities/OaEMealVoucherEntity.cs | 122 +++++++++++++++ .../Enums/BalanceRecordSourceEnumType.cs | 60 ++++++++ .../Enums/BalanceRecordStatusEnumType.cs | 23 +++ .../Enums/BalanceRecordTypeEnumType.cs | 22 +++ .../CanteenBusinessPlaceCatalogEnumType.cs | 29 ++++ .../CanteenBusinessPlaceSourceEnumType.cs | 29 ++++ .../CanteenBusinessPlaceStatusEnumType.cs | 22 +++ .../Enums/CanteenOrderStatusEnumType.cs | 22 +++ .../Enums/CanteenSettingItemEnumType.cs | 82 ++++++++++ .../Enums/CanteenSettingUnqiueEnumType.cs | 22 +++ .../Canteen/Enums/CanteenUserEnumType.cs | 30 ++++ .../Device/Entities/DeviceEntity.cs | 106 +++++++++++++ .../Device/Entities/DeviceGroupEntity.cs | 26 ++++ .../Entities/DeviceGroupRelationshipEntity.cs | 26 ++++ .../Device/Entities/DeviceRegistryEntity.cs | 43 ++++++ .../Device/Entities/DeviceTemplateEntity.cs | 38 +++++ .../Device/Enums/DeviceFuncEnumType.cs | 42 ++++++ Src/Dlhis.Entity/Dlhis.Entity.csproj | 17 +++ .../Entities/DevicePermissionEntity.cs | 32 ++++ .../Permission/Entities/MenuEntity.cs | 88 +++++++++++ .../Entities/MenuPermissionEntity.cs | 33 ++++ .../Enums/DevicePermissionTypeEnumType.cs | 22 +++ .../Permission/Enums/MenuEnumType.cs | 28 ++++ .../Enums/MenuPermissionTypeEnumType.cs | 34 +++++ .../Permission/Enums/PlatformEnumType.cs | 22 +++ Src/Dlhis.Permission/Dlhis.Permission.csproj | 32 ++++ Src/Dlhis.Permission/Dockerfile | 21 +++ Src/Dlhis.Permission/Program.cs | 18 +++ .../Properties/launchSettings.json | 20 +++ .../appsettings.Development.json | 8 + Src/Dlhis.Permission/appsettings.json | 62 ++++++++ .../Dlhis.ScheduledTask.csproj | 23 +++ Src/Dlhis.ScheduledTask/Dockerfile | 21 +++ Src/Dlhis.ScheduledTask/Program.cs | 18 +++ .../Properties/launchSettings.json | 19 +++ .../appsettings.Development.json | 8 + Src/Dlhis.ScheduledTask/appsettings.json | 41 +++++ 112 files changed, 4114 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 Dlis.Jinko.Yikatong.sln create mode 100644 Src/Dlhis.Basic/BusinessPlace/Controllers/BusinessPlacesController.cs create mode 100644 Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlacePageRequest.cs create mode 100644 Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlaceSaveRequest.cs create mode 100644 Src/Dlhis.Basic/BusinessPlace/Response/BusinessPlaceResponse.cs create mode 100644 Src/Dlhis.Basic/BusinessPlace/Services/IBusinessPlaceService.cs create mode 100644 Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveRequest.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Response/BusinessPlaceShiftResponse.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs create mode 100644 Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs create mode 100644 Src/Dlhis.Basic/Device/Controllers/DevicesController.cs create mode 100644 Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs create mode 100644 Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs create mode 100644 Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs create mode 100644 Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs create mode 100644 Src/Dlhis.Basic/Device/Response/DeviceResponse.cs create mode 100644 Src/Dlhis.Basic/Device/Response/DeviceTemplateResponse.cs create mode 100644 Src/Dlhis.Basic/Device/Services/IDeviceService.cs create mode 100644 Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs create mode 100644 Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs create mode 100644 Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs create mode 100644 Src/Dlhis.Basic/Dlhis.Basic.csproj create mode 100644 Src/Dlhis.Basic/Dockerfile create mode 100644 Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs create mode 100644 Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs create mode 100644 Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs create mode 100644 Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs create mode 100644 Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs create mode 100644 Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs create mode 100644 Src/Dlhis.Basic/Program.cs create mode 100644 Src/Dlhis.Basic/Properties/launchSettings.json create mode 100644 Src/Dlhis.Basic/SqlSugarPack.cs create mode 100644 Src/Dlhis.Basic/appsettings.Development.json create mode 100644 Src/Dlhis.Basic/appsettings.json create mode 100644 Src/Dlhis.Canteen/Dlhis.Canteen.csproj create mode 100644 Src/Dlhis.Canteen/Dockerfile create mode 100644 Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs create mode 100644 Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs create mode 100644 Src/Dlhis.Canteen/Order/Response/OrderResponse.cs create mode 100644 Src/Dlhis.Canteen/Order/Services/IOrderService.cs create mode 100644 Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs create mode 100644 Src/Dlhis.Canteen/Program.cs create mode 100644 Src/Dlhis.Canteen/Properties/launchSettings.json create mode 100644 Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs create mode 100644 Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs create mode 100644 Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs create mode 100644 Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs create mode 100644 Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs create mode 100644 Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs create mode 100644 Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs create mode 100644 Src/Dlhis.Canteen/SqlSugarPack.cs create mode 100644 Src/Dlhis.Canteen/appsettings.Development.json create mode 100644 Src/Dlhis.Canteen/appsettings.json create mode 100644 Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj create mode 100644 Src/Dlhis.Common.Api/IEnumSettingApi.cs create mode 100644 Src/Dlhis.Common/Dlhis.Common.csproj create mode 100644 Src/Dlhis.Common/Dockerfile create mode 100644 Src/Dlhis.Common/EnumSetting/EnumsController.cs create mode 100644 Src/Dlhis.Common/Program.cs create mode 100644 Src/Dlhis.Common/Properties/launchSettings.json create mode 100644 Src/Dlhis.Common/appsettings.Development.json create mode 100644 Src/Dlhis.Common/appsettings.json create mode 100644 Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessPlaceEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessShiftEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherDetailEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/BalanceRecordSourceEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/BalanceRecordStatusEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceCatalogEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceSourceEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceStatusEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenSettingUnqiueEnumType.cs create mode 100644 Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs create mode 100644 Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs create mode 100644 Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs create mode 100644 Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs create mode 100644 Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs create mode 100644 Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs create mode 100644 Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs create mode 100644 Src/Dlhis.Entity/Dlhis.Entity.csproj create mode 100644 Src/Dlhis.Entity/Permission/Entities/DevicePermissionEntity.cs create mode 100644 Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs create mode 100644 Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs create mode 100644 Src/Dlhis.Entity/Permission/Enums/DevicePermissionTypeEnumType.cs create mode 100644 Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs create mode 100644 Src/Dlhis.Entity/Permission/Enums/MenuPermissionTypeEnumType.cs create mode 100644 Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs create mode 100644 Src/Dlhis.Permission/Dlhis.Permission.csproj create mode 100644 Src/Dlhis.Permission/Dockerfile create mode 100644 Src/Dlhis.Permission/Program.cs create mode 100644 Src/Dlhis.Permission/Properties/launchSettings.json create mode 100644 Src/Dlhis.Permission/appsettings.Development.json create mode 100644 Src/Dlhis.Permission/appsettings.json create mode 100644 Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj create mode 100644 Src/Dlhis.ScheduledTask/Dockerfile create mode 100644 Src/Dlhis.ScheduledTask/Program.cs create mode 100644 Src/Dlhis.ScheduledTask/Properties/launchSettings.json create mode 100644 Src/Dlhis.ScheduledTask/appsettings.Development.json create mode 100644 Src/Dlhis.ScheduledTask/appsettings.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..3729ff0c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..82d445f5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,141 @@ +[*.cs] + +# CS1591: 缺少对公共可见类型或成员的 XML 注释 +dotnet_diagnostic.CS1591.severity = none + +[*.cs] +#### 命名样式 #### + +# 命名规则 + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.private_or_internal_field_should_be__field_camel.severity = suggestion +dotnet_naming_rule.private_or_internal_field_should_be__field_camel.symbols = private_or_internal_field +dotnet_naming_rule.private_or_internal_field_should_be__field_camel.style = _field_camel + +# 符号规范 + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field +dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected +dotnet_naming_symbols.private_or_internal_field.required_modifiers = + +# 命名样式 + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style._field_camel.required_prefix = _ +dotnet_naming_style._field_camel.required_suffix = +dotnet_naming_style._field_camel.word_separator = +dotnet_naming_style._field_camel.capitalization = camel_case +csharp_using_directive_placement = outside_namespace:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent +csharp_style_var_elsewhere = false:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_prefer_static_local_function = true:suggestion + +[*.vb] +#### 命名样式 #### + +# 命名规则 + +dotnet_naming_rule.interface_should_be_以_i_开始.severity = suggestion +dotnet_naming_rule.interface_should_be_以_i_开始.symbols = interface +dotnet_naming_rule.interface_should_be_以_i_开始.style = 以_i_开始 + +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.severity = suggestion +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.symbols = 类型 +dotnet_naming_rule.类型_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 + +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.severity = suggestion +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.symbols = 非字段成员 +dotnet_naming_rule.非字段成员_should_be_帕斯卡拼写法.style = 帕斯卡拼写法 + +# 符号规范 + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.类型.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.类型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.类型.required_modifiers = + +dotnet_naming_symbols.非字段成员.applicable_kinds = property, event, method +dotnet_naming_symbols.非字段成员.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected +dotnet_naming_symbols.非字段成员.required_modifiers = + +# 命名样式 + +dotnet_naming_style.以_i_开始.required_prefix = I +dotnet_naming_style.以_i_开始.required_suffix = +dotnet_naming_style.以_i_开始.word_separator = +dotnet_naming_style.以_i_开始.capitalization = pascal_case + +dotnet_naming_style.帕斯卡拼写法.required_prefix = +dotnet_naming_style.帕斯卡拼写法.required_suffix = +dotnet_naming_style.帕斯卡拼写法.word_separator = +dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case + +dotnet_naming_style.帕斯卡拼写法.required_prefix = +dotnet_naming_style.帕斯卡拼写法.required_suffix = +dotnet_naming_style.帕斯卡拼写法.word_separator = +dotnet_naming_style.帕斯卡拼写法.capitalization = pascal_case + +[*.{cs,vb}] +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +end_of_line = crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore index c7db3142..f8648cd8 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,7 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML + +.idea +.vs +log diff --git a/Dlis.Jinko.Yikatong.sln b/Dlis.Jinko.Yikatong.sln new file mode 100644 index 00000000..ce99c5fe --- /dev/null +++ b/Dlis.Jinko.Yikatong.sln @@ -0,0 +1,82 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34302.85 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basic", "Basic", "{4EBCE46B-CE3A-4A47-9432-82A1854CA58A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Canteen", "Canteen", "{3D8A98C1-83C9-4375-AEAB-4F72AFAF365B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Entity", "Src\Dlhis.Entity\Dlhis.Entity.csproj", "{53884925-C9B9-4965-8B0D-100076CA0F43}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Permission", "Permission", "{57074FD8-1A2F-40C7-8476-001778A3F65D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Permission", "Src\Dlhis.Permission\Dlhis.Permission.csproj", "{5D7096DE-AB81-4423-95AF-6489C0D94CB3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.ScheduledTask", "Src\Dlhis.ScheduledTask\Dlhis.ScheduledTask.csproj", "{0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Canteen", "Src\Dlhis.Canteen\Dlhis.Canteen.csproj", "{B677442F-98D1-4F3A-8859-9F07D30E22E9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Common", "Src\Dlhis.Common\Dlhis.Common.csproj", "{4C1FADD9-8AFB-4087-9E52-EE6D6523ED38}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Common.Api", "Src\Dlhis.Common.Api\Dlhis.Common.Api.csproj", "{FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduled", "Scheduled", "{AA987BDF-EF63-467B-AD04-59F9B10D9000}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8F6420A-3427-4319-AB69-4F9679E05727}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Basic", "Src\Dlhis.Basic\Dlhis.Basic.csproj", "{D1F81CB7-F3EF-4196-A751-468248368020}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {53884925-C9B9-4965-8B0D-100076CA0F43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53884925-C9B9-4965-8B0D-100076CA0F43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53884925-C9B9-4965-8B0D-100076CA0F43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53884925-C9B9-4965-8B0D-100076CA0F43}.Release|Any CPU.Build.0 = Release|Any CPU + {5D7096DE-AB81-4423-95AF-6489C0D94CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D7096DE-AB81-4423-95AF-6489C0D94CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D7096DE-AB81-4423-95AF-6489C0D94CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D7096DE-AB81-4423-95AF-6489C0D94CB3}.Release|Any CPU.Build.0 = Release|Any CPU + {0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}.Release|Any CPU.Build.0 = Release|Any CPU + {B677442F-98D1-4F3A-8859-9F07D30E22E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B677442F-98D1-4F3A-8859-9F07D30E22E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B677442F-98D1-4F3A-8859-9F07D30E22E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B677442F-98D1-4F3A-8859-9F07D30E22E9}.Release|Any CPU.Build.0 = Release|Any CPU + {4C1FADD9-8AFB-4087-9E52-EE6D6523ED38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C1FADD9-8AFB-4087-9E52-EE6D6523ED38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C1FADD9-8AFB-4087-9E52-EE6D6523ED38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C1FADD9-8AFB-4087-9E52-EE6D6523ED38}.Release|Any CPU.Build.0 = Release|Any CPU + {FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC}.Release|Any CPU.Build.0 = Release|Any CPU + {D1F81CB7-F3EF-4196-A751-468248368020}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1F81CB7-F3EF-4196-A751-468248368020}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1F81CB7-F3EF-4196-A751-468248368020}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1F81CB7-F3EF-4196-A751-468248368020}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5D7096DE-AB81-4423-95AF-6489C0D94CB3} = {57074FD8-1A2F-40C7-8476-001778A3F65D} + {0F1F7144-0BA3-4BDC-814E-E57A4E4A6392} = {AA987BDF-EF63-467B-AD04-59F9B10D9000} + {B677442F-98D1-4F3A-8859-9F07D30E22E9} = {3D8A98C1-83C9-4375-AEAB-4F72AFAF365B} + {4C1FADD9-8AFB-4087-9E52-EE6D6523ED38} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} + {FD8D38C5-0827-49D1-A0BA-7707FBFDA2EC} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} + {D1F81CB7-F3EF-4196-A751-468248368020} = {4EBCE46B-CE3A-4A47-9432-82A1854CA58A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7439494A-E2FD-4FEA-8ABF-74AE57A4A5A0} + EndGlobalSection +EndGlobal diff --git a/Src/Dlhis.Basic/BusinessPlace/Controllers/BusinessPlacesController.cs b/Src/Dlhis.Basic/BusinessPlace/Controllers/BusinessPlacesController.cs new file mode 100644 index 00000000..7faea3fc --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Controllers/BusinessPlacesController.cs @@ -0,0 +1,72 @@ +using Dlhis.Basic.BusinessPlace.Request; +using Dlhis.Basic.BusinessPlace.Response; +using Dlhis.Basic.BusinessPlace.Services; +using Dlhis.Basic.BusinessShift.Response; +using Dlhis.Basic.BusinessShift.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Basic.BusinessPlace.Controllers; + +/// +/// 营业点 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class BusinessPlacesController : ControllerBase +{ + private readonly IBusinessPlaceService _businessPlaceService; + private readonly IBusinessPlaceShiftService _businessPlaceShiftService; + + public BusinessPlacesController(IBusinessPlaceService businessPlaceService, + IBusinessPlaceShiftService businessPlaceShiftService) + { + _businessPlaceService = businessPlaceService; + _businessPlaceShiftService = businessPlaceShiftService; + } + + /// + /// 营业点分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] BusinessPlacePageRequest request) + { + return await _businessPlaceService.GetPageAsync(request); + } + + /// + /// 获取启用的营业点 + /// + /// + [HttpGet("list")] + public async Task> GetOpenedListAsync() + { + return await _businessPlaceService.GetOpenedListAsync(); + } + + /// + /// 营业点保存 + /// + /// + /// + [HttpPost("save")] + public async Task SaveAsync(BusinessPlaceSaveRequest request) + { + await _businessPlaceService.SaveAsync(request); + } + + /// + /// 根据手工号获取餐别 + /// + /// + /// + [HttpGet("shifts")] + public async Task> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode) + { + return await _businessPlaceShiftService.GetShiftsByPlaceCustomCodeAsync(placeCustomCode); + } +} diff --git a/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlacePageRequest.cs b/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlacePageRequest.cs new file mode 100644 index 00000000..0107b3ce --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlacePageRequest.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.BusinessPlace.Request; + +public class BusinessPlacePageRequest : PageDto +{ + /// + /// 状态 CanteenBusinessPlaceStatusEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceStatusEnumType))] + public CanteenBusinessPlaceStatusEnumType? Status { get; set; } + + /// + /// 来源 CanteenBusinessPlaceSourceEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceSourceEnumType))] + public CanteenBusinessPlaceSourceEnumType? Source { get; set; } + + /// + /// 分类 CanteenBusinessPlaceCatalogEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceCatalogEnumType))] + public CanteenBusinessPlaceCatalogEnumType? Catalog { get; set; } +} diff --git a/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlaceSaveRequest.cs b/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlaceSaveRequest.cs new file mode 100644 index 00000000..15abe478 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Request/BusinessPlaceSaveRequest.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; + +namespace Dlhis.Basic.BusinessPlace.Request; + +/// +/// 营业点保存参数 +/// +public class BusinessPlaceSaveRequest +{ + /// + /// 为null则更新 + /// + public long? Id { get; set; } + + /// + /// 自定义代号 + /// + [Required(ErrorMessage = "手工号不能为空")] + public string CustomCode { get; set; } + + /// + /// 营业点名称 + /// + [Required(ErrorMessage = "营业点名称不能为空")] + public string Name { get; set; } + + /// + /// 状态 CanteenBusinessPlaceStatusEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceStatusEnumType))] + public CanteenBusinessPlaceStatusEnumType Status { get; set; } + + + /// + /// 来源 CanteenBusinessPlaceSourceEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceSourceEnumType))] + public CanteenBusinessPlaceSourceEnumType Source { get; set; } + + + /// + /// 分类 CanteenBusinessPlaceCatalogEnumType + /// + [EnumDataType(typeof(CanteenBusinessPlaceCatalogEnumType))] + public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; } +} diff --git a/Src/Dlhis.Basic/BusinessPlace/Response/BusinessPlaceResponse.cs b/Src/Dlhis.Basic/BusinessPlace/Response/BusinessPlaceResponse.cs new file mode 100644 index 00000000..9793da56 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Response/BusinessPlaceResponse.cs @@ -0,0 +1,43 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Utils.Extensions; + +namespace Dlhis.Basic.BusinessPlace.Response; + +public class BusinessPlaceResponse +{ + public long Id { get; set; } + + /// + /// 代号 + /// + public Guid Code { get; set; } + + /// + /// 自定义代号 + /// + public string CustomCode { get; set; } + + + /// + /// 营业点名称 + /// + public string Name { get; set; } + + /// + /// 状态,停用/启用 + /// + public CanteenBusinessPlaceStatusEnumType Status { get; set; } + public string StatusDesc => Status.GetDescription(); + + /// + /// 来源,自营/合作/外包 + /// + public CanteenBusinessPlaceSourceEnumType Source { get; set; } + public string SourceDesc => Source.GetDescription(); + + /// + /// 分类,超市/餐厅/食堂 + /// + public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; } + public string CatalogDesc => Catalog.GetDescription(); +} diff --git a/Src/Dlhis.Basic/BusinessPlace/Services/IBusinessPlaceService.cs b/Src/Dlhis.Basic/BusinessPlace/Services/IBusinessPlaceService.cs new file mode 100644 index 00000000..e012ce37 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Services/IBusinessPlaceService.cs @@ -0,0 +1,20 @@ +using Dlhis.Basic.BusinessPlace.Request; +using Dlhis.Basic.BusinessPlace.Response; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Attributes; + +namespace Dlhis.Basic.BusinessPlace.Services; + +public interface IBusinessPlaceService : IScopeDependency +{ + Task> GetPageAsync(BusinessPlacePageRequest request); + + /// + /// 获取可用的营业点 + /// + /// + Task> GetOpenedListAsync(); + + + Task SaveAsync(BusinessPlaceSaveRequest request); +} diff --git a/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs b/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs new file mode 100644 index 00000000..2dde7134 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessPlace/Services/Implements/BusinessPlaceService.cs @@ -0,0 +1,81 @@ +using Dlhis.Basic.BusinessPlace.Request; +using Dlhis.Basic.BusinessPlace.Response; +using Dlhis.Entity.Canteen.Entities; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Utils.Extensions; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Attributes; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; +using Mapster; + +namespace Dlhis.Basic.BusinessPlace.Services.Implements; + +public class BusinessPlaceService : IBusinessPlaceService +{ + private readonly IDbContext _dbContext; + + public BusinessPlaceService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + [IgnoreTenant] + public async Task> GetPageAsync(BusinessPlacePageRequest request) + { + var page = await _dbContext.Queryable() + .WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search)) + .WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog) + .WhereIF(request.Status.HasValue, x => x.Status == request.Status) + .WhereIF(request.Source.HasValue, x => x.Source == request.Source) + .Select() + .ToPageListAsync(request); + + return page; + } + + + public async Task> GetOpenedListAsync() + { + return await _dbContext.Queryable() + .Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened) + .Select() + .ToListAsync(); + } + + public async Task SaveAsync(BusinessPlaceSaveRequest request) + { + await CheckExistsCustomCodeAsync(request); + + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + entity.Code = Guid.NewGuid(); + await _dbContext.InsertAsync(entity); + } + else + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); + request.Adapt(entity); + + await _dbContext.UpdateAsync(entity); + } + } + + //*********************************************** help methods ***************************************************// + + /// + /// 检查重复手工号 + /// + /// + /// + private async Task CheckExistsCustomCodeAsync(BusinessPlaceSaveRequest request) + { + var existsSameCustomCode = await _dbContext.Queryable() + .Where(x => x.CustomCode == request.CustomCode) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .AnyAsync(); + + existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查."); + } +} diff --git a/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs b/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs new file mode 100644 index 00000000..154bb984 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Controllers/BusinessShiftsController.cs @@ -0,0 +1,46 @@ +using Dlhis.Basic.BusinessShift.Request; +using Dlhis.Basic.BusinessShift.Response; +using Dlhis.Basic.BusinessShift.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Basic.BusinessShift.Controllers; + +/// +/// 餐次 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class BusinessShiftsController : ControllerBase +{ + private readonly IBusinessPlaceShiftService _businessPlaceShiftService; + + public BusinessShiftsController(IBusinessPlaceShiftService businessPlaceShiftService) + { + _businessPlaceShiftService = businessPlaceShiftService; + } + + /// + /// 餐次分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] BusinessPlaceShiftPageRequest request) + { + return await _businessPlaceShiftService.GetPageAsync(request); + } + + /// + /// 餐次保存 + /// + /// + /// + [HttpPost("save")] + public async Task SaveAsync(BusinessPlaceShiftSaveRequest request) + { + await _businessPlaceShiftService.SaveAsync(request); + } +} diff --git a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs new file mode 100644 index 00000000..f7789f2b --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftPageRequest.cs @@ -0,0 +1,7 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.BusinessShift.Request; + +public class BusinessPlaceShiftPageRequest : PageDto +{ +} diff --git a/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveRequest.cs b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveRequest.cs new file mode 100644 index 00000000..ad49ea9c --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Request/BusinessPlaceShiftSaveRequest.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using Kurisu.Core.CustomClass; + +namespace Dlhis.Basic.BusinessShift.Request; + +public class BusinessPlaceShiftSaveRequest : IValidatableObject +{ + public long? Id { get; set; } + + /// + /// 营业点代号 + /// + [Required(ErrorMessage = "营业点不能为空")] + public Guid BusinessPlaceCode { get; set; } + + /// + /// 自定义代号 + /// + public string CustomCode { get; set; } + + /// + /// 餐次名称 + /// + [Required(ErrorMessage = "餐次名称不能为空")] + public string Name { get; set; } + + /// + /// 时间段 + /// + public TimePeriod TimePeriod { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + if (TimePeriod.Start == TimePeriod.End) + { + yield return new ValidationResult("时间段设置区间有误,开始时段不能等于结束时段.", new[] { nameof(TimePeriod) }); + } + } +} diff --git a/Src/Dlhis.Basic/BusinessShift/Response/BusinessPlaceShiftResponse.cs b/Src/Dlhis.Basic/BusinessShift/Response/BusinessPlaceShiftResponse.cs new file mode 100644 index 00000000..2edff402 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Response/BusinessPlaceShiftResponse.cs @@ -0,0 +1,41 @@ +namespace Dlhis.Basic.BusinessShift.Response; + +public class BusinessPlaceShiftResponse +{ + public long Id { get; set; } + + /// + /// 营业点代号 + /// + public Guid BusinessPlaceCode { get; set; } + + /// + /// 营业点手工号 + /// + public string BusinessPlaceCustomCode { get; set; } + + /// + /// 代号 + /// + public Guid Code { get; set; } + + /// + /// 自定义代号 + /// + public string CustomCode { get; set; } + + /// + /// 餐次名称 + /// + public string Name { get; set; } + + /// + /// 经营开始时间 + /// + public TimeOnly Start { get; set; } + + /// + /// 经营结束时间 + /// + public TimeOnly End { get; set; } +} diff --git a/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs b/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs new file mode 100644 index 00000000..c74cde40 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Services/IBusinessPlaceShiftService.cs @@ -0,0 +1,14 @@ +using Dlhis.Basic.BusinessShift.Request; +using Dlhis.Basic.BusinessShift.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.BusinessShift.Services; + +public interface IBusinessPlaceShiftService : IScopeDependency +{ + Task> GetPageAsync(BusinessPlaceShiftPageRequest request); + + Task SaveAsync(BusinessPlaceShiftSaveRequest request); + + Task> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode); +} diff --git a/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs new file mode 100644 index 00000000..6562c181 --- /dev/null +++ b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs @@ -0,0 +1,136 @@ +using Dlhis.Basic.BusinessShift.Request; +using Dlhis.Basic.BusinessShift.Response; +using Dlhis.Entity.Canteen.Entities; +using Kurisu.AspNetCore.Utils.Extensions; +using Kurisu.Core.CustomClass; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; +using Mapster; + +namespace Dlhis.Basic.BusinessShift.Services.Implements; + +public class BusinessPlaceShiftService : IBusinessPlaceShiftService +{ + private readonly IDbContext _dbContext; + + public BusinessPlaceShiftService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> GetPageAsync(BusinessPlaceShiftPageRequest request) + { + var page = await _dbContext.Queryable() + .LeftJoin((shift, place) => shift.BusinessPlaceCode == place.Code) + .WhereIF(request.Search.IsPresent(), (shift, place) => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search)) + .Select((shift, place) => new BusinessPlaceShiftResponse + { + Id = shift.Id, + BusinessPlaceCode = place.Code, + BusinessPlaceCustomCode = place.CustomCode, + Code = shift.Code, + CustomCode = shift.CustomCode, + Name = shift.Name, + Start = shift.Start, + End = shift.End + }) + .ToPageListAsync(request); + + return page; + } + + public async Task SaveAsync(BusinessPlaceShiftSaveRequest request) + { + await CheckExistsCustomCodeAsync(request); + await DuplicateTimePeriodAsync(request); + await CheckPlaceExistsAsync(request.BusinessPlaceCode); + + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + + entity.Code = Guid.NewGuid(); + entity.Start = request.TimePeriod.Start.Value; + entity.End = request.TimePeriod.End.Value; + + await _dbContext.InsertAsync(entity); + } + else + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == request.Id); + entity.Adapt(request); + + await _dbContext.UpdateAsync(entity); + } + } + + + public async Task> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode) + { + return await _dbContext.Queryable() + .LeftJoin((shift, place) => shift.BusinessPlaceCode == place.Code) + .Where((shift, place) => place.CustomCode == placeCustomCode) + .OrderBy((shift, place) => shift.Start) + .Select((shift, place) => new BusinessPlaceShiftResponse + { + Id = shift.Id, + BusinessPlaceCode = place.Code, + BusinessPlaceCustomCode = place.CustomCode, + Code = shift.Code, + CustomCode = shift.CustomCode, + Name = shift.Name, + Start = shift.Start, + End = shift.End + }) + .ToListAsync(); + } + + //*********************************************** help methods ***************************************************// + + + private async Task CheckPlaceExistsAsync(Guid code) + { + var existsPlace = await _dbContext.Queryable().AnyAsync(x => x.Code == code); + existsPlace.ThrowIfFalse("营业点不存在,请检查."); + } + + /// + /// 时间段重合检查 + /// + /// + /// + private async Task DuplicateTimePeriodAsync(BusinessPlaceShiftSaveRequest request) + { + var periods = await _dbContext.Queryable() + .Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .Select(x => new TimePeriod + { + Start = x.Start, + End = x.End, + }) + .ToListAsync(); + + foreach (var period in periods) + { + period.IsDuplicate(request.TimePeriod).ThrowIfTrue($"存在时间段重合[{period.Start}-{period.End}]"); + } + } + + + /// + /// 检查重复手工号 + /// + /// + /// + private async Task CheckExistsCustomCodeAsync(BusinessPlaceShiftSaveRequest request) + { + var existsSameCustomCode = await _dbContext.Queryable() + .Where(x => x.CustomCode == request.CustomCode) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .AnyAsync(); + + existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查."); + } +} diff --git a/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs b/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs new file mode 100644 index 00000000..b1fda0b0 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Controllers/DevicesController.cs @@ -0,0 +1,59 @@ +using Dlhis.Basic.Device.Request; +using Dlhis.Basic.Device.Response; +using Dlhis.Basic.Device.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Basic.Device.Controllers; + +/// +/// 设备控制器 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class DevicesController : ControllerBase +{ + private readonly IDeviceService _deviceService; + private readonly IDeviceTemplateService _deviceTemplateService; + + public DevicesController(IDeviceService deviceService, IDeviceTemplateService deviceTemplateService) + { + _deviceService = deviceService; + _deviceTemplateService = deviceTemplateService; + } + + /// + /// 获取设备模板 + /// + /// + /// + [HttpGet("template/page")] + public async Task> GetTemplatePageAsync([FromQuery] DeviceTemplatePageRequest request) + { + return await _deviceTemplateService.GetPageAsync(request); + } + + /// + /// 设备模板保存 + /// + /// + /// + [HttpPost("template")] + public async Task SaveTemplateAsync(DeviceTemplateSaveRequest request) + { + await _deviceTemplateService.SaveTemplateAsync(request); + } + + /// + /// 获取设备分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] DevicePageRequest request) + { + return await _deviceService.GetPageAsync(request); + } +} diff --git a/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs new file mode 100644 index 00000000..6811b1bf --- /dev/null +++ b/Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs @@ -0,0 +1,13 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.Device.Request; + +public class DevicePageRequest : PageDto +{ + /// + /// 平台 + /// + public string Brand { get; set; } + + public string MyProperty { get; set; } +} diff --git a/Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs b/Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs new file mode 100644 index 00000000..08fdcb09 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs @@ -0,0 +1,61 @@ +using Dlhis.Entity.Device.Enums; + +namespace Dlhis.Basic.Device.Request; + +public class DeviceSaveRequest +{ + public long? Id { get; set; } + + + public string Sno { get; set; } + + /// + /// mac地址 + /// + public string Mac { get; set; } + + /// + /// 模板code + /// + public string TemplateCode { get; set; } + + /// + /// 品牌 + /// + public string Brand { get; set; } + + /// + /// 供应商信息 + /// + public string Supplier { get; set; } + + /// + /// 设备功能 + /// + public List Funcs { get; set; } + + /// + /// 部署点 + /// + public string DeployPlace { get; set; } + + /// + /// 部署坐标 + /// + public string DeployPosition { get; set; } + + /// + /// 部署方向 + /// + public string DeployDirection { get; set; } + + /// + /// 连接信息 + /// + public string ConnectionInfo { get; set; } + + /// + /// 是否启用 + /// + public bool Enable { get; set; } +} diff --git a/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs b/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs new file mode 100644 index 00000000..8adf81f2 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Request/DeviceTemplatePageRequest.cs @@ -0,0 +1,8 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.Device.Request; + +public class DeviceTemplatePageRequest : PageDto +{ + +} diff --git a/Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs b/Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs new file mode 100644 index 00000000..8e6d84a1 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs @@ -0,0 +1,21 @@ +namespace Dlhis.Basic.Device.Request; + +public class DeviceTemplateSaveRequest +{ + public long? Id { get; set; } + + /// + /// 品牌 + /// + public string Brand { get; set; } + + /// + /// 模板名称 + /// + public string Name { get; set; } + + /// + /// 模板json + /// + public string Template { get; set; } +} diff --git a/Src/Dlhis.Basic/Device/Response/DeviceResponse.cs b/Src/Dlhis.Basic/Device/Response/DeviceResponse.cs new file mode 100644 index 00000000..720b42a8 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Response/DeviceResponse.cs @@ -0,0 +1,5 @@ +namespace Dlhis.Basic.Device.Response; + +public class DeviceResponse +{ +} diff --git a/Src/Dlhis.Basic/Device/Response/DeviceTemplateResponse.cs b/Src/Dlhis.Basic/Device/Response/DeviceTemplateResponse.cs new file mode 100644 index 00000000..9dd0f5cb --- /dev/null +++ b/Src/Dlhis.Basic/Device/Response/DeviceTemplateResponse.cs @@ -0,0 +1,6 @@ +namespace Dlhis.Basic.Device.Response; + +public class DeviceTemplateResponse +{ + +} diff --git a/Src/Dlhis.Basic/Device/Services/IDeviceService.cs b/Src/Dlhis.Basic/Device/Services/IDeviceService.cs new file mode 100644 index 00000000..dc1af3e6 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Services/IDeviceService.cs @@ -0,0 +1,12 @@ +using Dlhis.Basic.Device.Request; +using Dlhis.Basic.Device.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.Device.Services; + +public interface IDeviceService +{ + Task> GetPageAsync(DevicePageRequest request); + + Task SaveAsync(DeviceSaveRequest request); +} diff --git a/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs b/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs new file mode 100644 index 00000000..e184fad5 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs @@ -0,0 +1,11 @@ +using Dlhis.Basic.Device.Request; +using Dlhis.Basic.Device.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.Device.Services; + +public interface IDeviceTemplateService : IScopeDependency +{ + Task SaveTemplateAsync(DeviceTemplateSaveRequest request); + Task> GetPageAsync(DeviceTemplatePageRequest request); +} diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs new file mode 100644 index 00000000..ec5e2831 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs @@ -0,0 +1,49 @@ +using Dlhis.Basic.Device.Request; +using Dlhis.Basic.Device.Response; +using Dlhis.Entity.Device.Entities; +using Kurisu.AspNetCore.Utils.Extensions; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; +using Mapster; + +namespace Dlhis.Basic.Device.Services.Implements; + +public class DeviceService : IDeviceService +{ + private readonly IDbContext _dbContext; + + public DeviceService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> GetPageAsync(DevicePageRequest request) + { + var page = await _dbContext.Queryable() + .Select() + .ToPageListAsync(request); + + return page; + } + + + public async Task SaveAsync(DeviceSaveRequest request) + { + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + entity.Code = Guid.NewGuid(); + await _dbContext.InsertAsync(entity); + } + else + { + var device = await _dbContext.Queryable().Where(x => x.Id == request.Id).FirstAsync(); + device.ThrowIfNull("设备不存在,无法更新"); + + request.Adapt(device); + + await _dbContext.UpdateAsync(device); + } + } +} diff --git a/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs new file mode 100644 index 00000000..063f2d71 --- /dev/null +++ b/Src/Dlhis.Basic/Device/Services/Implements/DeviceTemplateService.cs @@ -0,0 +1,61 @@ +using Dlhis.Basic.Device.Request; +using Dlhis.Basic.Device.Response; +using Dlhis.Entity.Device.Entities; +using Kurisu.AspNetCore.Utils.Extensions; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; +using Mapster; + +namespace Dlhis.Basic.Device.Services.Implements; + +public class DeviceTemplateService : IDeviceTemplateService +{ + private readonly IDbContext _dbContext; + + public DeviceTemplateService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + + public async Task> GetPageAsync(DeviceTemplatePageRequest request) + { + var page = await _dbContext.Queryable() + .Select() + .ToPageListAsync(request); + + return page; + } + + public async Task SaveTemplateAsync(DeviceTemplateSaveRequest request) + { + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + entity.Code = Guid.NewGuid(); + await _dbContext.InsertAsync(entity); + } + else + { + var entity = await _dbContext.Queryable().Where(x => x.Id == request.Id).FirstAsync(); + await ExistsDeviceUsingTemplateAsync(entity.Code); + await _dbContext.UpdateAsync(entity); + } + } + + + //**********************************************************************************************************/ + + + /// + /// 模板被引用,不能修改 + /// + /// + /// + private async Task ExistsDeviceUsingTemplateAsync(Guid templateCode) + { + var existsUsing = await _dbContext.Queryable().Where(x => x.TemplateCode == templateCode).AnyAsync(); + existsUsing.ThrowIfTrue("存在使用中的设备信息,无法修改"); + } +} diff --git a/Src/Dlhis.Basic/Dlhis.Basic.csproj b/Src/Dlhis.Basic/Dlhis.Basic.csproj new file mode 100644 index 00000000..eba1dc8d --- /dev/null +++ b/Src/Dlhis.Basic/Dlhis.Basic.csproj @@ -0,0 +1,26 @@ + + + + net6.0 + disable + enable + Linux + True + + + + + + + + + + + + + + + + + + diff --git a/Src/Dlhis.Basic/Dockerfile b/Src/Dlhis.Basic/Dockerfile new file mode 100644 index 00000000..e5e76d7e --- /dev/null +++ b/Src/Dlhis.Basic/Dockerfile @@ -0,0 +1,22 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Dlhis.Basic/Dlhis.Basic.csproj", "Dlhis.Basic/"] +COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"] +RUN dotnet restore "Dlhis.Basic/Dlhis.Basic.csproj" +COPY . . +WORKDIR "/src/Dlhis.Basic" +RUN dotnet build "Dlhis.Basic.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Dlhis.Basic.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Dlhis.Basic.dll"] \ No newline at end of file diff --git a/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs b/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs new file mode 100644 index 00000000..02fc4e33 --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs @@ -0,0 +1,46 @@ +using Dlhis.Basic.MealUser.Request; +using Dlhis.Basic.MealUser.Response; +using Dlhis.Basic.MealUser.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Basic.MealUser.Controllers; + +/// +/// 就餐人员 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class MealUsersController : ControllerBase +{ + private readonly IMealUserService _mealUserService; + + public MealUsersController(IMealUserService mealUserService) + { + _mealUserService = mealUserService; + } + + /// + /// 就餐人员分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] MealUserPageRequest request) + { + return await _mealUserService.GetPageAsync(request); + } + + /// + /// 就餐人员保存 + /// + /// + /// + [HttpPost] + public async Task AddAsync(MealUserAddRequest request) + { + await _mealUserService.AddAsync(request); + } +} diff --git a/Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs b/Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs new file mode 100644 index 00000000..8ce9e905 --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; + +namespace Dlhis.Basic.MealUser.Request; + +public class MealUserAddRequest +{ + /// + /// 档案号 + /// + [Required(ErrorMessage = "档案号不能为空")] + public string UserId { get; set; } + + + /// + /// 用户类型 + /// + [EnumDataType(typeof(CanteenUserEnumType))] + public CanteenUserEnumType UserType { get; set; } +} diff --git a/Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs b/Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs new file mode 100644 index 00000000..667a21ed --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs @@ -0,0 +1,7 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.MealUser.Request; + +public class MealUserPageRequest : PageDto +{ +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs b/Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs new file mode 100644 index 00000000..2aee574d --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs @@ -0,0 +1,6 @@ +namespace Dlhis.Basic.MealUser.Response +{ + public class MealUserResponse + { + } +} diff --git a/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs b/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs new file mode 100644 index 00000000..c444ed33 --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs @@ -0,0 +1,14 @@ +using Dlhis.Basic.MealUser.Request; +using Dlhis.Basic.MealUser.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Basic.MealUser.Services; + +public interface IMealUserService : IScopeDependency +{ + Task> GetPageAsync(MealUserPageRequest request); + + Task AddAsync(MealUserAddRequest request); + + Task GetMealUserAsync(string uniqueId); +} diff --git a/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs new file mode 100644 index 00000000..c33e7ef0 --- /dev/null +++ b/Src/Dlhis.Basic/MealUser/Services/Implements/MealUserService.cs @@ -0,0 +1,53 @@ +using Dlhis.Basic.MealUser.Request; +using Dlhis.Basic.MealUser.Response; +using Dlhis.Entity.Canteen.Entities; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; + +namespace Dlhis.Basic.MealUser.Services.Implements; + +public class MealUserService : IMealUserService +{ + private readonly IDbContext _dbContext; + + public MealUserService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> GetPageAsync(MealUserPageRequest request) + { + var page = await _dbContext.Queryable() + .Select() + .ToPageListAsync(request); + + return page; + } + + public async Task AddAsync(MealUserAddRequest request) + { + //todo 获取档案信息 + + var entity = new CanteenUserEntity + { + UserId = request.UserId, + UserType = request.UserType, + UserCode = "", + CarNo = "", + Balance = 0, + BalanceOfRecharge = 0, + BalanceOfSubsidies = 0, + Version = 0, + }; + await _dbContext.InsertAsync(entity); + } + + public async Task GetMealUserAsync(string userId) + { + return await _dbContext.Queryable() + .Where(x => x.UserId == userId) + .Select() + .FirstAsync(); + } +} diff --git a/Src/Dlhis.Basic/Program.cs b/Src/Dlhis.Basic/Program.cs new file mode 100644 index 00000000..49e05881 --- /dev/null +++ b/Src/Dlhis.Basic/Program.cs @@ -0,0 +1,17 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.Startup; + +class Program +{ + static void Main(string[] args) + { + KurisuHost.Run(true, args); + } +} + +public class Startup : DefaultStartup +{ + public Startup(IConfiguration configuration) : base(configuration) + { + } +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/Properties/launchSettings.json b/Src/Dlhis.Basic/Properties/launchSettings.json new file mode 100644 index 00000000..eec7b064 --- /dev/null +++ b/Src/Dlhis.Basic/Properties/launchSettings.json @@ -0,0 +1,15 @@ +{ + "profiles": { + "Dlhis.Basic": { + "commandName": "Project", + "launchBrowser": false, + "launchUrl": "swagger/index.html", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5002" + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file diff --git a/Src/Dlhis.Basic/SqlSugarPack.cs b/Src/Dlhis.Basic/SqlSugarPack.cs new file mode 100644 index 00000000..b120d233 --- /dev/null +++ b/Src/Dlhis.Basic/SqlSugarPack.cs @@ -0,0 +1,25 @@ +using Kurisu.AspNetCore; +using Kurisu.AspNetCore.Startup; +using Kurisu.SqlSugar.Extensions; +using SqlSugar; + +namespace Dlhis.Canteen; + +public class SqlSugarPack : BaseAppPack +{ + public override bool IsBeforeUseRouting { get; } + + public override void ConfigureServices(IServiceCollection services) + { + services.AddSqlSugar(); + } + + public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + //using var scope = app.ApplicationServices.CreateScope(); + //var db = scope.ServiceProvider.GetService(); + //var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray(); + //db.DbMaintenance.CreateDatabase(); + //db.CodeFirst.InitTables(tables); + } +} diff --git a/Src/Dlhis.Basic/appsettings.Development.json b/Src/Dlhis.Basic/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/Src/Dlhis.Basic/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Src/Dlhis.Basic/appsettings.json b/Src/Dlhis.Basic/appsettings.json new file mode 100644 index 00000000..c2ec7767 --- /dev/null +++ b/Src/Dlhis.Basic/appsettings.json @@ -0,0 +1,74 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "InternalRequest": { + "CommonRequestUrl": "http://common" + }, + "SqlSugarOptions": { + "DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;", + "SlaveConnectionString": [], + "Timeout": 30, + "SlowSqlTime": 1, + "EnableSqlLog": true + }, + "SwaggerOptions": { + "Enable": true, + "Authority": "https://yikatong.isawesome.cn/oauth2", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid", + "profile": "profile", + "yikatong": "yikatong" + } + }, + "IdentityServerOptions": { + "Authority": "https://yikatong.isawesome.cn/oauth2", + "RequireHttpsMetadata": true, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "log/log.txt", + "rollingInterval": "Hour" + } + } + ] + } + } + ] + } +} diff --git a/Src/Dlhis.Canteen/Dlhis.Canteen.csproj b/Src/Dlhis.Canteen/Dlhis.Canteen.csproj new file mode 100644 index 00000000..ea0849b9 --- /dev/null +++ b/Src/Dlhis.Canteen/Dlhis.Canteen.csproj @@ -0,0 +1,45 @@ + + + + net6.0 + disable + enable + True + Linux + ..\.. + + + + + + + + + + + + + + + + + appsettings.json + + + + + + + + + + + + + + + + + + + diff --git a/Src/Dlhis.Canteen/Dockerfile b/Src/Dlhis.Canteen/Dockerfile new file mode 100644 index 00000000..b148099c --- /dev/null +++ b/Src/Dlhis.Canteen/Dockerfile @@ -0,0 +1,23 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Src/Dlhis.Canteen/Dlhis.Canteen.csproj", "Src/Dlhis.Canteen/"] +COPY ["Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj", "Src/Dlhis.Common.Api/"] +COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"] +RUN dotnet restore "Src/Dlhis.Canteen/Dlhis.Canteen.csproj" +COPY . . +WORKDIR "/src/Src/Dlhis.Canteen" +RUN dotnet build "Dlhis.Canteen.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Dlhis.Canteen.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Dlhis.Canteen.dll"] \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs b/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs new file mode 100644 index 00000000..5510ec53 --- /dev/null +++ b/Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs @@ -0,0 +1,36 @@ +using Dlhis.Canteen.Order.Request; +using Dlhis.Canteen.Order.Response; +using Dlhis.Canteen.Order.Services; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Canteen.Order.Controllers +{ + /// + /// 订单 + /// + [Authorize] + [Route("api/[controller]")] + [ApiController] + public class OrdersController : ControllerBase + { + private readonly IOrderService _orderService; + + public OrdersController(IOrderService orderService) + { + _orderService = orderService; + } + + /// + /// 订单分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] OrderPageRequest request) + { + return await _orderService.GetPageAsync(request); + } + } +} diff --git a/Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs b/Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs new file mode 100644 index 00000000..cd82d190 --- /dev/null +++ b/Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs @@ -0,0 +1,7 @@ +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Canteen.Order.Request; + +public class OrderPageRequest : PageDto +{ +} diff --git a/Src/Dlhis.Canteen/Order/Response/OrderResponse.cs b/Src/Dlhis.Canteen/Order/Response/OrderResponse.cs new file mode 100644 index 00000000..0486b439 --- /dev/null +++ b/Src/Dlhis.Canteen/Order/Response/OrderResponse.cs @@ -0,0 +1,5 @@ +namespace Dlhis.Canteen.Order.Response; + +public class OrderResponse +{ +} diff --git a/Src/Dlhis.Canteen/Order/Services/IOrderService.cs b/Src/Dlhis.Canteen/Order/Services/IOrderService.cs new file mode 100644 index 00000000..16f4fb21 --- /dev/null +++ b/Src/Dlhis.Canteen/Order/Services/IOrderService.cs @@ -0,0 +1,11 @@ +using Dlhis.Canteen.Order.Request; +using Dlhis.Canteen.Order.Response; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Canteen.Order.Services +{ + public interface IOrderService + { + Task> GetPageAsync(OrderPageRequest request); + } +} diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs new file mode 100644 index 00000000..a6135dac --- /dev/null +++ b/Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs @@ -0,0 +1,27 @@ +using Dlhis.Canteen.Order.Request; +using Dlhis.Canteen.Order.Response; +using Dlhis.Entity.Canteen.Entities; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; + +namespace Dlhis.Canteen.Order.Services.Implements; + +public class OrderService : IOrderService +{ + private readonly IDbContext _dbContext; + + public OrderService(IDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> GetPageAsync(OrderPageRequest request) + { + var page = await _dbContext.Queryable() + .Select() + .ToPageListAsync(request); + + return page; + } +} diff --git a/Src/Dlhis.Canteen/Program.cs b/Src/Dlhis.Canteen/Program.cs new file mode 100644 index 00000000..49e05881 --- /dev/null +++ b/Src/Dlhis.Canteen/Program.cs @@ -0,0 +1,17 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.Startup; + +class Program +{ + static void Main(string[] args) + { + KurisuHost.Run(true, args); + } +} + +public class Startup : DefaultStartup +{ + public Startup(IConfiguration configuration) : base(configuration) + { + } +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Properties/launchSettings.json b/Src/Dlhis.Canteen/Properties/launchSettings.json new file mode 100644 index 00000000..66e536a5 --- /dev/null +++ b/Src/Dlhis.Canteen/Properties/launchSettings.json @@ -0,0 +1,21 @@ +{ + "profiles": { + "Dlhis.Canteen": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5002" + }, + "Docker": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file diff --git a/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs b/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs new file mode 100644 index 00000000..c107d4ef --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs @@ -0,0 +1,69 @@ +using Dlhis.Canteen.Setting.Request; +using Dlhis.Canteen.Setting.Response; +using Dlhis.Canteen.Setting.Services; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Dto; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Canteen.Setting.Controllers; + +/// +/// 就餐配置 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class SettingController : ControllerBase +{ + private readonly ICanteenSettingService _settingService; + + public SettingController(ICanteenSettingService settingService) + { + _settingService = settingService; + } + + /// + /// 配置分页 + /// + /// + /// + [HttpGet("page")] + public async Task> GetPageAsync([FromQuery] CanteenSettingPageRequest request) + { + return await _settingService.GetPageAsync(request); + } + + /// + /// 配置保存 + /// + /// + /// + [HttpPost("save")] + public async Task SaveSettingAsync(CanteenSettingSaveRequest request) + { + await _settingService.SaveSettingAsync(request); + } + + /// + /// 配置启用状态 + /// + /// + /// + [HttpPut("enable")] + public async Task SetEnableAsync(CanteenSettingSetEnableRequest request) + { + await _settingService.SetEnableAsync(request); + } + + /// + /// 获取用户配置 + /// + /// + /// + [HttpGet("user")] + public async Task> GetUserSettingAsync(string userId) + { + return await _settingService.GetUserSettingAsync(userId); + } +} diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs new file mode 100644 index 00000000..8dee1142 --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingPageRequest.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Canteen.Setting.Request; + +public class CanteenSettingPageRequest : PageDto +{ + /// + /// 配置唯一类型 CanteenSettingUnqiueEnumType + /// + [EnumDataType(typeof(CanteenSettingUnqiueEnumType))] + public CanteenSettingUnqiueEnumType? UniqueType { get; set; } + + /// + /// 配置项 + /// + [EnumDataType(typeof(CanteenSettingItemEnumType))] + public CanteenSettingItemEnumType? Item { get; set; } +} diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs new file mode 100644 index 00000000..ef7c480a --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSaveRequest.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using Dlhis.Entity.Canteen.Enums; + +namespace Dlhis.Canteen.Setting.Request; + +public class CanteenSettingSaveRequest +{ + public long? Id { get; set; } + + /// + /// 配置生效范围 + /// + [EnumDataType(typeof(CanteenSettingUnqiueEnumType))] + public CanteenSettingUnqiueEnumType UniqueType { get; set; } + + /// + /// 唯一值 eg:UniqueType = 1时,传入非空字符串 + /// + [Required(ErrorMessage = "值不能为空")] + public string UniqueValue { get; set; } + + /// + /// 自定义分类分类 + /// + [Required(ErrorMessage = "分类不能为空")] + public string Catalog { get; set; } + + /// + /// 参数 CanteenSettingItemEnumType + /// + [EnumDataType(typeof(CanteenSettingItemEnumType))] + public CanteenSettingItemEnumType Item { get; set; } + + /// + /// 值 + /// + public string Value { get; set; } +} diff --git a/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs new file mode 100644 index 00000000..33179db1 --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Request/CanteenSettingSetEnableRequest.cs @@ -0,0 +1,9 @@ +namespace Dlhis.Canteen.Setting.Request +{ + public class CanteenSettingSetEnableRequest + { + public int Id { get; set; } + + public bool Enable { get; set; } + } +} diff --git a/Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs b/Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs new file mode 100644 index 00000000..b168d062 --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs @@ -0,0 +1,41 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Utils.Extensions; + +namespace Dlhis.Canteen.Setting.Response; + +public class CanteenSettingResponse +{ + public CanteenSettingUnqiueEnumType UniqueType { get; set; } + public string UniqueTypeDesc => UniqueType.GetDescription(); + + /// + /// 唯一值 + /// + public string UniqueValue { get; set; } + + /// + /// 唯一值说明 + /// + public string UniqueValueDesc { get; set; } + + /// + /// 分类 + /// + public string Catalog { get; set; } + + /// + /// 参数 + /// + public CanteenSettingItemEnumType Item { get; set; } + public string ItemDesc => Item.GetDescription(); + + /// + /// 值 + /// + public string Value { get; set; } + + /// + /// 是否启用 + /// + public bool Enable { get; set; } +} diff --git a/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs b/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs new file mode 100644 index 00000000..27fabb1e --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs @@ -0,0 +1,23 @@ +using Dlhis.Canteen.Setting.Request; +using Dlhis.Canteen.Setting.Response; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Dto; + +namespace Dlhis.Canteen.Setting.Services; + +public interface ICanteenSettingService : IScopeDependency +{ + Task> GetPageAsync(CanteenSettingPageRequest request); + + Task SaveSettingAsync(CanteenSettingSaveRequest request); + + Task SetEnableAsync(CanteenSettingSetEnableRequest request); + + /// + /// 获取人员的就餐配置信息 + /// + /// 就餐人员档案号 + /// + Task> GetUserSettingAsync(string userId); +} + diff --git a/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs new file mode 100644 index 00000000..3e11cccb --- /dev/null +++ b/Src/Dlhis.Canteen/Setting/Services/Implements/CanteenSettingService.cs @@ -0,0 +1,116 @@ +using Dlhis.Canteen.Setting.Request; +using Dlhis.Canteen.Setting.Response; +using Dlhis.Entity.Canteen.Entities; +using Dlhis.Entity.Canteen.Enums; +using Kurisu.AspNetCore.Utils.Extensions; +using Kurisu.Core.DataAccess.Dto; +using Kurisu.SqlSugar.Extensions; +using Kurisu.SqlSugar.Services; +using Mapster; + +namespace Dlhis.Canteen.Setting.Services.Implements; + +/// +/// 餐饮配置 +/// +public class CanteenSettingService : ICanteenSettingService +{ + private readonly IDbContext _context; + + public CanteenSettingService(IDbContext context) + { + _context = context; + } + + public async Task> GetPageAsync(CanteenSettingPageRequest request) + { + var page = await _context.Queryable() + .LeftJoin((setting, user) => setting.UniqueValue == user.UserId) + .WhereIF(request.UniqueType.HasValue, setting => setting.UniqueType == request.UniqueType) + .WhereIF(request.Item.HasValue, setting => setting.Item == request.Item) + .WhereIF(request.Search.IsPresent(), setting => setting.UniqueValue.Contains(request.Search)) + .Select((setting, user) => new CanteenSettingResponse + { + UniqueType = setting.UniqueType, + UniqueValue = setting.UniqueValue, + //UniqueValueDesc = user.UserName, + Catalog = setting.Catalog, + Enable = setting.Enable, + Item = setting.Item, + Value = setting.Value + }) + .ToPageListAsync(request); + + return page; + } + + public async Task SaveSettingAsync(CanteenSettingSaveRequest request) + { + await CheckDuplicateSettingAsync(request); + + if (!request.Id.HasValue) + { + var entity = request.Adapt(); + await _context.InsertAsync(entity); + } + else + { + var entity = await _context.Queryable().FirstAsync(x => x.Id == request.Id); + request.Adapt(entity); + + await _context.UpdateAsync(entity); + } + } + + public async Task SetEnableAsync(CanteenSettingSetEnableRequest request) + { + var entity = await _context.Queryable().FirstAsync(x => x.Id == request.Id); + entity.ThrowIfNull("配置不存在,无法修改状态"); + + entity.Enable = request.Enable; + await _context.UpdateAsync(entity); + } + + + public async Task> GetUserSettingAsync(string userId) + { + var setting = await _context.Queryable() + .Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Person && (x.UniqueValue == userId) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant) + .ToListAsync(); + + //从基地 -> 个人,确保下面循环做到覆盖,并且以个人配置为主 + setting = setting.OrderBy(x => x.UniqueType).ToList(); + + var result = new Dictionary(); + setting.ForEach(x => + { + if (result.ContainsKey(x.Item)) + { + result[x.Item] = x.Value; + } + else + { + result.Add(x.Item, x.Value); + } + }); + + return result; + } + + //*********************************************** help methods ***************************************************// + + private async Task CheckDuplicateSettingAsync(CanteenSettingSaveRequest request) + { + //Tenant只有一条数据, Person对应UniqueValue唯一 , Catalog不作为唯一判断 + + var exists = await _context.Queryable() + .Where(x => x.UniqueType == request.UniqueType) + .Where(x => x.Catalog == request.Catalog) + .Where(x => x.Item == request.Item) + .WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue) + .WhereIF(request.Id.HasValue, x => x.Id != request.Id) + .AnyAsync(); + + exists.ThrowIfTrue("配置项重复,请检查."); + } +} diff --git a/Src/Dlhis.Canteen/SqlSugarPack.cs b/Src/Dlhis.Canteen/SqlSugarPack.cs new file mode 100644 index 00000000..b120d233 --- /dev/null +++ b/Src/Dlhis.Canteen/SqlSugarPack.cs @@ -0,0 +1,25 @@ +using Kurisu.AspNetCore; +using Kurisu.AspNetCore.Startup; +using Kurisu.SqlSugar.Extensions; +using SqlSugar; + +namespace Dlhis.Canteen; + +public class SqlSugarPack : BaseAppPack +{ + public override bool IsBeforeUseRouting { get; } + + public override void ConfigureServices(IServiceCollection services) + { + services.AddSqlSugar(); + } + + public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + //using var scope = app.ApplicationServices.CreateScope(); + //var db = scope.ServiceProvider.GetService(); + //var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray(); + //db.DbMaintenance.CreateDatabase(); + //db.CodeFirst.InitTables(tables); + } +} diff --git a/Src/Dlhis.Canteen/appsettings.Development.json b/Src/Dlhis.Canteen/appsettings.Development.json new file mode 100644 index 00000000..beca36f8 --- /dev/null +++ b/Src/Dlhis.Canteen/appsettings.Development.json @@ -0,0 +1,11 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "InternalRequest": { + "CommonRequestUrl": "http://localhost:5001" + } +} diff --git a/Src/Dlhis.Canteen/appsettings.json b/Src/Dlhis.Canteen/appsettings.json new file mode 100644 index 00000000..745b748b --- /dev/null +++ b/Src/Dlhis.Canteen/appsettings.json @@ -0,0 +1,71 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "InternalRequest": { + "CommonRequestUrl": "http://common" + }, + "SqlSugarOptions": { + "DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;", + "SlaveConnectionString": [], + "Timeout": 30, + "SlowSqlTime": 1 + }, + "SwaggerOptions": { + "Enable": true, + "Authority": "https://yikatong.isawesome.cn/oauth2", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid" + } + }, + "IdentityServerOptions": { + "Authority": "https://yikatong.isawesome.cn/oauth2", + "RequireHttpsMetadata": true, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "log/log.txt", + "rollingInterval": "Hour" + } + } + ] + } + } + ] + } +} diff --git a/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj b/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj new file mode 100644 index 00000000..26abb5b7 --- /dev/null +++ b/Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + disable + True + + + + + + + diff --git a/Src/Dlhis.Common.Api/IEnumSettingApi.cs b/Src/Dlhis.Common.Api/IEnumSettingApi.cs new file mode 100644 index 00000000..bcd561b5 --- /dev/null +++ b/Src/Dlhis.Common.Api/IEnumSettingApi.cs @@ -0,0 +1,12 @@ +using Kurisu.Core.Result; +using Kurisu.RemoteCall.Attributes; + +namespace Dlhis.Common.Api; + +[EnableRemoteClient(Name = "common-service", BaseUrl = "${InternalRequest:CommonRequestUrl}")] +public interface IEnumSettingApi +{ + [Auth] + [Get("/api/enums")] + Task> GetEnums(string code = null); +} diff --git a/Src/Dlhis.Common/Dlhis.Common.csproj b/Src/Dlhis.Common/Dlhis.Common.csproj new file mode 100644 index 00000000..59f6cc51 --- /dev/null +++ b/Src/Dlhis.Common/Dlhis.Common.csproj @@ -0,0 +1,31 @@ + + + + net6.0 + disable + enable + True + Linux + ..\.. + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Dlhis.Common/Dockerfile b/Src/Dlhis.Common/Dockerfile new file mode 100644 index 00000000..938c3356 --- /dev/null +++ b/Src/Dlhis.Common/Dockerfile @@ -0,0 +1,22 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Src/Dlhis.Common/Dlhis.Common.csproj", "Src/Dlhis.Common/"] +COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"] +RUN dotnet restore "Src/Dlhis.Common/Dlhis.Common.csproj" +COPY . . +WORKDIR "/src/Src/Dlhis.Common" +RUN dotnet build "Dlhis.Common.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Dlhis.Common.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Dlhis.Common.dll"] \ No newline at end of file diff --git a/Src/Dlhis.Common/EnumSetting/EnumsController.cs b/Src/Dlhis.Common/EnumSetting/EnumsController.cs new file mode 100644 index 00000000..bd342d06 --- /dev/null +++ b/Src/Dlhis.Common/EnumSetting/EnumsController.cs @@ -0,0 +1,49 @@ +using System.Reflection; +using Kurisu.AspNetCore.Utils.Extensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Dlhis.Common.EnumSetting; + +/// +/// 枚举 +/// +[Authorize] +[Route("api/[controller]")] +[ApiController] +public class EnumsController : ControllerBase +{ + /// + /// 获取所有枚举 + /// + /// 枚举code + /// + [HttpGet] + public object GetEnums(string code) + { + var types = Assembly.Load("Dlhis.Entity") + .GetTypes() + .Where(x => x.IsEnum) + .WhereIf(code.IsPresent(), x => x.Name == code); + + return types.Select(x => + { + var d = x.GetDescription(); + return new + { + Code = x.Name, + Name = d, + Data = x.GetFields(BindingFlags.Public | BindingFlags.Static).Select(item => + { + var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString()); + var fd = e.GetDescription(); + return new + { + Key = fd, + Value = (int)item.GetValue(null) + }; + }) + }; + }); + } +} diff --git a/Src/Dlhis.Common/Program.cs b/Src/Dlhis.Common/Program.cs new file mode 100644 index 00000000..1bcd1be2 --- /dev/null +++ b/Src/Dlhis.Common/Program.cs @@ -0,0 +1,18 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.Startup; + +class Program +{ + static void Main(string[] args) + { + KurisuHost.Run(true, args); + } +} + +public class Startup : DefaultStartup +{ + public Startup(IConfiguration configuration) : base(configuration) + { + + } +} \ No newline at end of file diff --git a/Src/Dlhis.Common/Properties/launchSettings.json b/Src/Dlhis.Common/Properties/launchSettings.json new file mode 100644 index 00000000..f3b4ecc0 --- /dev/null +++ b/Src/Dlhis.Common/Properties/launchSettings.json @@ -0,0 +1,21 @@ +{ + "profiles": { + "Dlhis.Common": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5001" + }, + "Docker": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file diff --git a/Src/Dlhis.Common/appsettings.Development.json b/Src/Dlhis.Common/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/Src/Dlhis.Common/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Src/Dlhis.Common/appsettings.json b/Src/Dlhis.Common/appsettings.json new file mode 100644 index 00000000..369aba6b --- /dev/null +++ b/Src/Dlhis.Common/appsettings.json @@ -0,0 +1,62 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "SwaggerOptions": { + "Enable": true, + "Authority": "https://yikatong.isawesome.cn/oauth2", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid" + } + }, + "IdentityServerOptions": { + "Authority": "https://yikatong.isawesome.cn/oauth2", + "RequireHttpsMetadata": true, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "log/log.txt", + "rollingInterval": "Hour" + } + } + ] + } + } + ] + } +} diff --git a/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs new file mode 100644 index 00000000..7ba0aced --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs @@ -0,0 +1,136 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 充值/消费记录 +/// +[SugarTable(TableName = "BalanceRecord", TableDescription = "充值/消费记录")] +public class BalanceRecordEntity : SugarBaseEntity, ITenantId +{ + /// + /// 流水号 + /// + [SugarColumn(ColumnDescription = "流水号")] + public string No { get; set; } + + /// + /// 档案号/QRCode + /// + [SugarColumn(ColumnDescription = "档案号/QRCode")] + public string UserId { get; set; } + + /// + /// 姓名 + /// + [SugarColumn(ColumnDescription = "姓名")] + public string Name { get; set; } + + /// + /// 学工号 + /// + [SugarColumn(ColumnDescription = "学工号")] + public string UserCode { get; set; } + + /// + /// 部门号 + /// + [SugarColumn(ColumnDescription = "部门号")] + public string DepartmentNo { get; set; } + + /// + /// 来源 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")] + public BalanceRecordSourceEnumType Source { get; set; } + + /// + /// 来源备注 + /// + [SugarColumn(ColumnDescription = "来源备注")] + public string SourceRemark { get; set; } + + /// + /// 收入/支出 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")] + public BalanceRecordTypeEnumType Type { get; set; } + + /// + /// 金额 + - 表示 + /// + [SugarColumn(ColumnDescription = "金额+-表示")] + public decimal Amount { get; set; } + + + /// + /// 营业点 + /// + [SugarColumn(ColumnDescription = "营业点")] + public string BusinessPlaceCode { get; set; } + + /// + /// 餐次 + /// + [SugarColumn(ColumnDescription = "餐次")] + public string BusinessShiftCode { get; set; } + + /// + /// 所属成本日期 + /// + [SugarColumn(ColumnDescription = "所属成本日期")] + public DateTime CostDate { get; set; } + + /// + /// 操作人 + /// + [SugarColumn(ColumnDescription = "操作人")] + public string OperateUser { get; set; } + + /// + /// 消费机器唯一信息 + /// + [SugarColumn(ColumnDescription = "消费机器唯一信息")] + public string DeviceInfo { get; set; } + + /// + /// 餐补月份 + /// + [SugarColumn(ColumnDescription = "餐补月份")] + public string SubsidiesFromMonth { get; set; } + + /// + /// Ip + /// + [SugarColumn(ColumnDescription = "IP")] + public string IP { get; set; } + + /// + /// 成本中心 + /// + [SugarColumn(ColumnDescription = "成本中心")] + public string CostId { get; set; } + + /// + /// 消费者所在基地 + /// + [SugarColumn(ColumnDescription = "消费者所在基地")] + public string OriginTenantId { get; set; } + + /// + /// 成本计算是否允许跨基地范围 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")] + public bool IsCostCrossTenant { get; set; } + + /// + /// 数据状态 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")] + public BalanceRecordStatusEnumType Status { get; set; } + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessPlaceEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessPlaceEntity.cs new file mode 100644 index 00000000..ad8edfc8 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessPlaceEntity.cs @@ -0,0 +1,55 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 营业点 +/// +[SugarTable(TableName = "CanteenBusinessPlace", TableDescription = "营业点")] +public class CanteenBusinessPlaceEntity : SugarBaseEntity, ITenantId +{ + /// + /// 代号 + /// + [SugarColumn(ColumnDescription = "code")] + public Guid Code { get; set; } + + /// + /// 自定义代号 + /// + [SugarColumn(ColumnDescription = "自定义手工号")] + public string CustomCode { get; set; } + + + /// + /// 营业点名称 + /// + [SugarColumn(ColumnDescription = "营业点名称")] + public string Name { get; set; } + + /// + /// 状态,停用/启用 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "状态")] + public CanteenBusinessPlaceStatusEnumType Status { get; set; } + + + /// + /// 来源,自营/合作/外包 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源,自营/合作/外包")] + public CanteenBusinessPlaceSourceEnumType Source { get; set; } + + + /// + /// 分类,超市/餐厅/食堂 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "分类,超市/餐厅/食堂")] + public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessShiftEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessShiftEntity.cs new file mode 100644 index 00000000..4531ec87 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenBusinessShiftEntity.cs @@ -0,0 +1,49 @@ +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 营业点餐次 +/// +[SugarTable(TableName = "CanteenBusinessShift", TableDescription = "营业点餐次")] +public class CanteenBusinessShiftEntity : SugarBaseEntity, ITenantId +{ + /// + /// 营业点代号 + /// + [SugarColumn(ColumnDescription = "营业点code")] + public Guid BusinessPlaceCode { get; set; } + + /// + /// 代号 + /// + [SugarColumn(ColumnDescription = "code")] + public Guid Code { get; set; } + + /// + /// 自定义代号 + /// + [SugarColumn(ColumnDescription = "自定义手工号")] + public string CustomCode { get; set; } + + /// + /// 餐次名称 + /// + [SugarColumn(ColumnDescription = "餐次名称")] + public string Name { get; set; } + + /// + /// 经营开始时间 + /// + [SugarColumn(ColumnDescription = "经营开始时间")] + public TimeOnly Start { get; set; } + + /// + /// 经营结束时间 + /// + [SugarColumn(ColumnDescription = "经营结束时间")] + public TimeOnly End { get; set; } + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs new file mode 100644 index 00000000..8a192b6e --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs @@ -0,0 +1,43 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 就餐订单 +/// +[SugarTable(TableName = "CanteenOrder", TableDescription = "就餐订单")] +public class CanteenOrderEntity : BalanceRecordEntity, ITenantId +{ + /// + /// 请求json + /// + [SugarColumn(ColumnDescription = "请求json")] + public string RequestJson { get; set; } + + /// + /// 第三方订单号 + /// + [SugarColumn(ColumnDescription = "第三方订单号")] + public string ThirdNo { get; set; } + + /// + /// 订单状态 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")] + public CanteenOrderStatusEnumType OrderStatus { get; set; } + + /// + /// 是否离线数据 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "请求json")] + public bool IsOffline { get; set; } + + /// + /// 处理结果 + /// + [SugarColumn(ColumnDescription = "处理结果")] + public string Result { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs new file mode 100644 index 00000000..d719e7b5 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs @@ -0,0 +1,51 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 就餐配置 +/// +[SugarTable(TableName = "CanteenSetting", TableDescription = "就餐配置")] +public class CanteenSettingEntity : SugarBaseEntity, ITenantId +{ + /// + /// 唯一类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "唯一类型")] + public CanteenSettingUnqiueEnumType UniqueType { get; set; } + + /// + /// 唯一值 + /// + [SugarColumn(ColumnDescription = "唯一值")] + public string UniqueValue { get; set; } + + /// + /// 分类 + /// + [SugarColumn(ColumnDescription = "分类")] + public string Catalog { get; set; } + + /// + /// 参数 + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "参数", SqlParameterDbType = typeof(EnumToStringConvert))] + public CanteenSettingItemEnumType Item { get; set; } + + /// + /// 值 + /// + [SugarColumn(ColumnDescription = "值")] + public string Value { get; set; } + + /// + /// 是否启用 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] + public bool Enable { get; set; } + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs new file mode 100644 index 00000000..062cc6ec --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs @@ -0,0 +1,70 @@ +using Dlhis.Entity.Canteen.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// 就餐人员 +/// +[SugarTable(TableName = "CanteenUser", TableDescription = "就餐人员")] +public class CanteenUserEntity : SugarBaseEntity, IVersion, ITenantId +{ + /// + /// 档案号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "档案号")] + public string UserId { get; set; } + + + /// + /// 学工号 + /// + [SugarColumn(IsNullable = false, ColumnDescription = "学工号")] + public string UserCode { get; set; } + + + /// + /// 消费人员类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "消费人员类型")] + public CanteenUserEnumType UserType { get; set; } + + + /// + /// 卡号 + /// + [SugarColumn(ColumnDescription = "卡号")] + public string CarNo { get; set; } + + + /// + /// 余额 + /// + [SugarColumn(ColumnDescription = "余额")] + public decimal Balance { get; set; } + + + /// + /// 余额(充值) + /// + [SugarColumn(ColumnDescription = "余额(充值)")] + public decimal BalanceOfRecharge { get; set; } + + + /// + /// 余额(餐补) + /// + [SugarColumn(ColumnDescription = "余额(餐补)")] + public decimal BalanceOfSubsidies { get; set; } + + /// + /// 版本号 + /// + [SugarColumn(ColumnDescription = "版本号")] + public int Version { get; set; } + + + public string TenantId { get; set; } +} diff --git a/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherDetailEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherDetailEntity.cs new file mode 100644 index 00000000..3dd6c1c5 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherDetailEntity.cs @@ -0,0 +1,84 @@ +using SqlSugar; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// OA餐券明细 +/// +[SugarTable(TableName = "OaEMealVoucherDetail", TableDescription = "OA餐券明细")] +public class OaEMealVoucherDetailEntity +{ + public long Id { get; set; } + + + [SugarColumn(ColumnDescription = "餐券id")] + public long VoucherId { get; set; } + + + [SugarColumn(ColumnDescription = "序号")] + public int Sequence { get; set; } + + + [SugarColumn(ColumnDescription = "用餐人情况(新员工/外来人员)")] + public string DinnerType { get; set; } + + /// + /// 身份证 + /// + [SugarColumn(ColumnDescription = "序号")] + public string IdNo { get; set; } + + /// + /// 用餐人 + /// + [SugarColumn(ColumnDescription = "用餐人")] + public string Name { get; set; } + + /// + /// 手机号 + /// + [SugarColumn(ColumnDescription = "手机号")] + public string Phone { get; set; } + + /// + /// 就餐开始 + /// + [SugarColumn(ColumnDescription = "就餐开始")] + public DateTime Start { get; set; } + + /// + /// 就餐结束 + /// + [SugarColumn(ColumnDescription = "就餐结束")] + public DateTime End { get; set; } + + /// + /// 就餐天数 + /// + [SugarColumn(ColumnDescription = "就餐天数")] + public int Days { get; set; } + + /// + /// 金额 + /// + [SugarColumn(ColumnDescription = "金额")] + public decimal Amount { get; set; } + + /// + /// 二维码 + /// + [SugarColumn(ColumnDescription = "二维码")] + public string QrCode { get; set; } + + /// + /// 状态 + /// + [SugarColumn(ColumnDescription = "状态,默认为R")] + public string Status { get; set; } + + /// + /// 信息 + /// + [SugarColumn(ColumnDescription = "信息/错误信息")] + public string Message { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs new file mode 100644 index 00000000..4756edeb --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs @@ -0,0 +1,122 @@ +using SqlSugar; + +namespace Dlhis.Entity.Canteen.Entities; + +/// +/// OA餐券 +/// +[SugarTable(TableName = "OaEMealVoucher", TableDescription = "OA餐券")] +public class OaEMealVoucherEntity +{ + [SugarColumn(IsIdentity = true, IsPrimaryKey = true)] + public long Id { get; set; } + + /// + /// 标题 + /// + [SugarColumn(ColumnDescription = "标题")] + public string Title { get; set; } + + /// + /// 申请人工号 + /// + [SugarColumn(ColumnDescription = "申请人工号")] + public string UserCode { get; set; } + + /// + /// 申请人名称 + /// + [SugarColumn(ColumnDescription = "申请人名称")] + public string Name { get; set; } + + /// + /// 基地代码 + /// + [SugarColumn(ColumnDescription = "基地代码")] + public string TenantId { get; set; } + + /// + /// 基地名称 + /// + [SugarColumn(ColumnDescription = "基地名称")] + public string TenantName { get; set; } + + /// + /// 成本中心 + /// + [SugarColumn(ColumnDescription = "成本中心")] + public string CostId { get; set; } + + /// + /// 成本中心名称 + /// + [SugarColumn(ColumnDescription = "成本中心名称")] + public string CostName { get; set; } + + /// + /// 来宾公司 + /// + [SugarColumn(ColumnDescription = "来宾公司")] + public string Company { get; set; } + + /// + /// 联系人 + /// + [SugarColumn(ColumnDescription = "联系人")] + public string Phone { get; set; } + + /// + /// 来宾人数 + /// + [SugarColumn(ColumnDescription = "来宾人数")] + public int Num { get; set; } + + /// + /// 就餐食堂 + /// + [SugarColumn(ColumnDescription = "就餐食堂")] + public string Canteen { get; set; } + + /// + /// 就餐事由 + /// + [SugarColumn(ColumnDescription = "就餐事由")] + public string Reason { get; set; } + + /// + /// 就餐次 + /// + [SugarColumn(ColumnDescription = "就餐次")] + public string CanteenShift { get; set; } + + /// + /// oa流程id + /// + [SugarColumn(ColumnDescription = "oa流程id")] + public string OaId { get; set; } + + /// + /// 部门号 + /// + [SugarColumn(ColumnDescription = "部门号")] + public string DepartmentNo { get; set; } + + /// + /// 部门名称 + /// + [SugarColumn(ColumnDescription = "部门名称")] + public string DepartmentName { get; set; } + + + /// + /// 申请日期 + /// + [SugarColumn(ColumnDescription = "申请日期")] + public DateTime LogDate { get; set; } + + /// + /// 数据创建时间 + /// + [SugarColumn(ColumnDescription = "数据创建时间")] + public DateTime CreateTime { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordSourceEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordSourceEnumType.cs new file mode 100644 index 00000000..11481111 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordSourceEnumType.cs @@ -0,0 +1,60 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 充值/消费来源 +/// +[Description("充值/消费来源")] +public enum BalanceRecordSourceEnumType +{ + /// + /// 来自微信 + /// + [Description("来自微信")] + Wechat, + + /// + /// 来自支付宝 + /// + [Description("来自支付宝")] + Alipay, + + /// + /// 来自支付宝 + /// + [Description("银联")] + UnionPay, + + /// + /// 来自本基地补贴 + /// + [Description("来自本基地补贴")] + LocalTenantSubsidies, + + /// + /// 来自其他基地补贴 + /// + [Description("来自其他基地补贴")] + OtherTenantSubsidies, + + + /// + /// 餐厅 + /// + [Description("餐厅")] + Cateen, + + /// + /// 食堂 + /// + [Description("食堂")] + Cafeteria, + + /// + /// 超市 + /// + [Description("超市")] + Supermarket, + +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordStatusEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordStatusEnumType.cs new file mode 100644 index 00000000..d8144b9d --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordStatusEnumType.cs @@ -0,0 +1,23 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + + +/// +/// 充值/消费状态 +/// +[Description("充值/消费状态")] +public enum BalanceRecordStatusEnumType +{ + /// + /// 有效 + /// + [Description("有效")] + Valid = 1, + + /// + /// 作废 + /// + [Description("作废")] + Absolute +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs new file mode 100644 index 00000000..ccc77726 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 充值/消费 +/// +[Description("充值/消费")] +public enum BalanceRecordTypeEnumType +{ + /// + /// 支出 + /// + [Description("支出")] + Out = 0, + + /// + /// 充值 + /// + [Description("充值")] + In = 1, +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceCatalogEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceCatalogEnumType.cs new file mode 100644 index 00000000..9f0c4f97 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceCatalogEnumType.cs @@ -0,0 +1,29 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 营业点类型 +/// +[Description("营业点类型")] +public enum CanteenBusinessPlaceCatalogEnumType +{ + /// + /// 餐厅 + /// + [Description("餐厅")] + Cateen = 1, + + /// + /// 食堂 + /// + [Description("食堂")] + Cafeteria = 2, + + + /// + /// 超市 + /// + [Description("超市")] + Supermarket = 3, +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceSourceEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceSourceEnumType.cs new file mode 100644 index 00000000..f13ac02a --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceSourceEnumType.cs @@ -0,0 +1,29 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 营业点来源 +/// +[Description("营业点来源")] +public enum CanteenBusinessPlaceSourceEnumType +{ + /// + /// 自营 + /// + [Description("自营")] + Self = 1, + + /// + /// 合作 + /// + [Description("合作")] + Cooperation = 2, + + + /// + /// 外包 + /// + [Description("外包")] + Outsource, +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceStatusEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceStatusEnumType.cs new file mode 100644 index 00000000..15597434 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenBusinessPlaceStatusEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 营业点状态 +/// +[Description("营业点状态")] +public enum CanteenBusinessPlaceStatusEnumType +{ + /// + /// 启用 + /// + [Description("启用")] + Opened = 1, + + /// + /// 暂停 + /// + [Description("暂停")] + Stoped = 2 +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs new file mode 100644 index 00000000..923d8ac1 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 就餐订单状态 +/// +[Description("就餐订单状态")] +public enum CanteenOrderStatusEnumType +{ + /// + /// 失败 + /// + [Description("失败")] + Failure = 0, + + /// + /// 成功 + /// + [Description("成功")] + Successful, +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs new file mode 100644 index 00000000..0d417103 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs @@ -0,0 +1,82 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 就餐配置项 +/// +[Description("就餐配置项")] +public enum CanteenSettingItemEnumType +{ + //# BusinessSwitchTime varchar(255) not null comment '营业点切换时间 HH:00:00', + //# DayCostMax decimal(16, 2) not null comment '每日允许消费最高金额(存在普通模式)', + //# DayMarketCostMax decimal(16, 2) not null comment '每日超市允许消费最高金额', + //# AllowSendAtMeal bit not null comment '允许就餐下发', + //# DayEVoucherUseCountMax int not null comment '电子券每天使用最多次数', + //# Subsidies decimal(16, 2) not null comment '补贴', + //# AllowRepeatInOneShift bit not null comment '允许一餐次多次消费', + //# OnceCostMax decimal(16, 2) not null comment '一次最高消费金额', + //# AllowCrossTenant bit not null comment '允许跨基地消费', + //# InitBalance decimal(16, 2) not null comment '初始金额', + + /// + /// 营业点切换时间 + /// + [Description("营业点切换时间(HH:00:00)")] + BusinessSwitchTime = 1, + + /// + /// 每日允许消费最高金额 + /// + [Description("每日允许消费最高金额(decimal)")] + DayCostMax, + + /// + /// 每日超市允许消费最高金额 + /// + [Description("每日超市允许消费最高金额(decimal)")] + DayMarketCostMax, + + /// + /// 允许就餐下发 + /// + [Description("允许就餐下发(T/F)")] + AllowSendAtMeal, + + /// + /// 电子券每天使用最多次数 + /// + [Description("电子券每天使用最多次数(int)")] + DayEVoucherUseCountMax, + + /// + /// 补贴 + /// + [Description("补贴(decimal)")] + Subsidies, + + /// + /// 允许一餐次多次消费 + /// + [Description("允许一餐次多次消费(T/F)")] + AllowRepeatInOneShift, + + /// + /// 一次最高消费金额 + /// + [Description("一次最高消费金额(decimal)")] + OnceCostMax, + + + /// + /// 允许跨基地消费 + /// + [Description("允许跨基地消费(T/F)")] + AllowCrossTenant, + + /// + /// 初始金额 + /// + [Description("初始金额(decimal)")] + InitBalance, +} diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingUnqiueEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingUnqiueEnumType.cs new file mode 100644 index 00000000..6fa99d30 --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenSettingUnqiueEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 就餐配置类型 +/// +[Description("就餐配置类型")] +public enum CanteenSettingUnqiueEnumType +{ + /// + /// 基地/租户 + /// + [Description("基地/租户")] + Tenant = 1, + + /// + /// 就餐人员 + /// + [Description("就餐人员")] + Person = 10, +} diff --git a/Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs b/Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs new file mode 100644 index 00000000..9bc892fd --- /dev/null +++ b/Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs @@ -0,0 +1,30 @@ + + +using System.ComponentModel; + +namespace Dlhis.Entity.Canteen.Enums; + +/// +/// 就餐人员类型 +/// +[Description("就餐人员类型")] +public enum CanteenUserEnumType +{ + /// + /// 本基地 + /// + [Description("本基地人员")] + LocalTenant = 1, + + /// + /// 其他基地 + /// + [Description("其他基地人员")] + OtherTenant, + + /// + /// 外部人员 + /// + [Description("外部人员")] + External +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs new file mode 100644 index 00000000..afaf4ff1 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs @@ -0,0 +1,106 @@ +using Dlhis.Entity.Device.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +/// +/// 设备 +/// +[SugarTable(TableName = "Device", TableDescription = "设备表")] +public class DeviceEntity : SugarBaseEntity, ITenantId +{ + /// + /// 设备code + /// + [SugarColumn(ColumnDescription = "设备code")] + public Guid Code { get; set; } + + /// + /// 设备唯一码,IP/MAC/SNO + /// + [SugarColumn(ColumnDescription = "设备唯一码")] + public string UniqueNo { get; set; } + + /// + /// 心跳间隔 + /// + [SugarColumn(ColumnDescription = "心跳检查")] + public int HeartbeatInterval { get; set; } + + /// + /// 品牌 + /// + [SugarColumn(ColumnDescription = "品牌")] + public string Brand { get; set; } + + /// + /// 供应商 + /// + [SugarColumn(ColumnDescription = "供应商")] + public string Supplier { get; set; } + + /// + /// 设备功能 + /// + [SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能")] + public List Funcs { get; set; } + + /// + /// 部署点 + /// + [SugarColumn(ColumnDescription = "部署点")] + public string DeployPlace { get; set; } + + /// + /// 部署坐标 + /// + [SugarColumn(IsJson = true, ColumnDescription = "部署坐标")] + public string DeployPosition { get; set; } + + /// + /// 部署方向 + /// + [SugarColumn(ColumnDescription = "部署方向")] + public string DeployDirection { get; set; } + + /// + /// 模板code + /// + [SugarColumn(ColumnDescription = "模板code")] + public Guid TemplateCode { get; set; } + + /// + /// 连接信息 + /// + [SugarColumn(ColumnDescription = "连接信息")] + public string ConnectionInfo { get; set; } + + /// + /// 最后使用人 + /// + [SugarColumn(ColumnDescription = "最后使用人")] + public DateTime LastLogId { get; set; } + + /// + /// 最后使用日期 + /// + [SugarColumn(ColumnDescription = "最后使用日期")] + public DateTime LastLogDateTime { get; set; } + + + /// + /// 是否启用 + /// + [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")] + public bool Enable { get; set; } + + /// + /// 设别状态 + /// + [SugarColumn(ColumnDescription = "设别状态")] + public string Status { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs new file mode 100644 index 00000000..68978e83 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs @@ -0,0 +1,26 @@ +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +/// +/// 设备组 +/// +[SugarTable(TableName = "DeviceGroup", TableDescription = "设备组")] +public class DeviceGroupEntity : SugarBaseEntity, ITenantId +{ + /// + /// 设备组code + /// + [SugarColumn(ColumnDescription = "设备组code")] + public string Code { get; set; } + + /// + /// 设备组名称 + /// + [SugarColumn(ColumnDescription = "设备组名称")] + public string Name { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs new file mode 100644 index 00000000..08ab5530 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupRelationshipEntity.cs @@ -0,0 +1,26 @@ +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +/// +/// 设备组/设备关系 +/// +[SugarTable(TableName = "DeviceGroupRelationship", TableDescription = "设备组/设备关系")] +public class DeviceGroupRelationshipEntity : SugarBaseEntity, ITenantId +{ + /// + /// 设备组code + /// + [SugarColumn(ColumnDescription = "设备组code")] + public string GroupCode { get; set; } + + /// + /// 设备code + /// + [SugarColumn(ColumnDescription = "设备code")] + public string DeviceCode { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs new file mode 100644 index 00000000..91d63e01 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs @@ -0,0 +1,43 @@ +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +/// +/// 设备注册表 +/// +[SugarTable(TableName = "DeviceRegistry", TableDescription = "设备注册表")] +public class DeviceRegistryEntity : SugarBaseEntity, ITenantId +{ + /// + /// 设备唯一号 + /// + [SugarColumn(ColumnDescription = "设备唯一号")] + public string DeviceUniqueNo { get; set; } + + /// + /// 注册时间 + /// + [SugarColumn(ColumnDescription = "注册时间")] + public DateTime RegisterTime { get; set; } + + /// + /// 最后一次心跳时间 + /// + [SugarColumn(ColumnDescription = "最后一次心跳时间")] + public DateTime LastHeartbeatTime { get; set; } + + /// + /// 营业点code(可为空) + /// + [SugarColumn(IsNullable = true, ColumnDescription = "注册时间")] + public string BusinessPlaceCode { get; set; } + + /// + /// 营业点手工号(可为空) + /// + [SugarColumn(IsNullable = true, ColumnDescription = "注册时间")] + public string BusinessPlaceCustomCode { get; set; } + + public string TenantId { get; set; } +} diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs new file mode 100644 index 00000000..800d33a9 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs @@ -0,0 +1,38 @@ +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Device.Entities; + +/// +/// 设备配置模板 +/// +[SugarTable(TableName = "DeviceTemplate", TableDescription = "设备配置模板")] +public class DeviceTemplateEntity : SugarBaseEntity, ITenantId +{ + /// + /// 模板code + /// + [SugarColumn(ColumnDescription = "模板code")] + public Guid Code { get; set; } + + /// + /// 品牌 + /// + [SugarColumn(ColumnDescription = "品牌")] + public string Brand { get; set; } + + /// + /// 模板名称 + /// + [SugarColumn(ColumnDescription = "模板名称")] + public string Name { get; set; } + + /// + /// 模板json + /// + [SugarColumn(ColumnDescription = "模板json")] + public string Template { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs new file mode 100644 index 00000000..18bee720 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs @@ -0,0 +1,42 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Device.Enums; + +/// +/// 机器设备功能 +/// +[Description("机器设备功能")] +public enum DeviceFuncEnumType +{ + /// + /// 门禁 + /// + [Description("门禁")] + Door = 1, + + /// + /// 就餐 + /// + [Description("就餐")] + Meal, + + /// + /// 人脸 + /// + [Description("人脸")] + Face, + + + /// + /// 刷卡 + /// + [Description("刷卡")] + Card, + + + /// + /// 二维码 + /// + [Description("二维码")] + QrCode, +} diff --git a/Src/Dlhis.Entity/Dlhis.Entity.csproj b/Src/Dlhis.Entity/Dlhis.Entity.csproj new file mode 100644 index 00000000..8fd6be3f --- /dev/null +++ b/Src/Dlhis.Entity/Dlhis.Entity.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + disable + + + + + + + + + + + diff --git a/Src/Dlhis.Entity/Permission/Entities/DevicePermissionEntity.cs b/Src/Dlhis.Entity/Permission/Entities/DevicePermissionEntity.cs new file mode 100644 index 00000000..a475a9be --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Entities/DevicePermissionEntity.cs @@ -0,0 +1,32 @@ +using Dlhis.Entity.Permission.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Permission.Entities; + +/// +/// 设备权限 +/// +[SugarTable(TableName = "DevicePermission", TableDescription = "设备权限")] +public class DevicePermissionEntity : ITenantId +{ + /// + /// 设备权限类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备权限类型", SqlParameterDbType = typeof(DevicePermissionTypeEnumType))] + public DevicePermissionTypeEnumType UniqueType { get; set; } + + /// + /// 类型值 + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "类型值")] + public string UniqueValue { get; set; } + + /// + /// 设备code + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备code")] + public string Code { get; set; } + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs b/Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs new file mode 100644 index 00000000..8cd474df --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs @@ -0,0 +1,88 @@ +using Dlhis.Entity.Permission.Enums; +using SqlSugar; +using SqlSugar.DbConvert; + +namespace Dlhis.Entity.Permission.Entities; + +/// +/// 菜单 +/// +[SugarTable(TableName = "Menu", TableDescription = "菜单")] +public class MenuEntity : SugarBaseEntity +{ + /// + /// code + /// + [SugarColumn(ColumnDescription = "code")] + public string Code { get; set; } + + /// + /// 上级 + /// + [SugarColumn(ColumnDescription = "上级")] + public string PCode { get; set; } + + /// + /// 标题 + /// + [SugarColumn(ColumnDescription = "标题")] + public string Title { get; set; } + + /// + /// 名称 + /// + [SugarColumn(ColumnDescription = "名称")] + public string Name { get; set; } + + /// + /// 图标 + /// + [SugarColumn(ColumnDescription = "图标")] + public string Icon { get; set; } + + + /// + /// 路由地址 + /// + [SugarColumn(ColumnDescription = "路由地址")] + public string Route { get; set; } + + /// + /// 权限标识 + /// + [SugarColumn(ColumnDescription = "权限标识")] + public string Permission { get; set; } + + /// + /// 是否为外链 + /// + [SugarColumn(ColumnDescription = "是否为外链")] + public bool IsLink { get; set; } + + /// + /// 序号 + /// + [SugarColumn(ColumnDescription = "序号")] + public int Sequence { get; set; } + + + /// + /// 是否可见 + /// + [SugarColumn(ColumnDescription = "是否可见")] + public bool Visible { get; set; } + + + /// + /// 菜单类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")] + public MenuEnumType MenuType { get; set; } + + + /// + /// 平台类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")] + public PlatformEnumType Platform { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs b/Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs new file mode 100644 index 00000000..cac0df0e --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs @@ -0,0 +1,33 @@ +using Dlhis.Entity.Permission.Enums; +using Kurisu.Core.DataAccess.Entity; +using SqlSugar; + +namespace Dlhis.Entity.Permission.Entities; + +/// +/// 菜单权限 +/// +[SugarTable(TableName = "MenuPermission", TableDescription = "菜单权限")] +public class MenuPermissionEntity : SugarBaseEntity, ITenantId +{ + /// + /// 权限类型 + /// + [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "权限类型")] + public MenuPermissionTypeEnumType UniqueType { get; set; } + + /// + /// 类型值 + /// + [SugarColumn(ColumnDescription = "类型值")] + public string UniqueValue { get; set; } + + /// + /// 菜单code + /// + [SugarColumn(ColumnDescription = "菜单code")] + public string Code { get; set; } + + + public string TenantId { get; set; } +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Permission/Enums/DevicePermissionTypeEnumType.cs b/Src/Dlhis.Entity/Permission/Enums/DevicePermissionTypeEnumType.cs new file mode 100644 index 00000000..7a0a692f --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Enums/DevicePermissionTypeEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Permission.Enums; + +/// +/// 设备权限类型 +/// +[Description("设备权限类型")] +public enum DevicePermissionTypeEnumType +{ + /// + /// 设备组 + /// + [Description("设备组")] + Group = 1, + + /// + /// 人员 + /// + [Description("人员")] + Person = 2 +} diff --git a/Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs b/Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs new file mode 100644 index 00000000..bd0e32e7 --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Permission.Enums; + +/// +/// 菜单类型 +/// +[Description("菜单类型")] +public enum MenuEnumType +{ + /// + /// 目录 + /// + [Description("目录")] + Folder = 1, + + /// + /// 菜单 + /// + [Description("菜单")] + Menu = 2, + + /// + /// 按钮 + /// + [Description("按钮")] + Button = 3 +} \ No newline at end of file diff --git a/Src/Dlhis.Entity/Permission/Enums/MenuPermissionTypeEnumType.cs b/Src/Dlhis.Entity/Permission/Enums/MenuPermissionTypeEnumType.cs new file mode 100644 index 00000000..8ded493b --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Enums/MenuPermissionTypeEnumType.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Permission.Enums; + +/// +/// 权限类型 +/// +[Description("权限类型")] +public enum MenuPermissionTypeEnumType +{ + /// + /// 用户 + /// + [Description("用户")] + User = 1, + + /// + /// 角色 + /// + [Description("角色")] + Role = 2, + + /// + /// 组别 + /// + [Description("组别")] + Group = 3, + + /// + /// 部门 + /// + [Description("部门")] + Department = 4 +} diff --git a/Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs b/Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs new file mode 100644 index 00000000..8f393dae --- /dev/null +++ b/Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace Dlhis.Entity.Permission.Enums; + +/// +/// 平台类型 +/// +[Description("平台配型")] +public enum PlatformEnumType +{ + /// + /// Admin + /// + [Description("PC后台")] + PCAdmin = 1, + + /// + /// 用户手机端 + /// + [Description("用户手机端")] + UserMobile = 2, +} \ No newline at end of file diff --git a/Src/Dlhis.Permission/Dlhis.Permission.csproj b/Src/Dlhis.Permission/Dlhis.Permission.csproj new file mode 100644 index 00000000..b5512aec --- /dev/null +++ b/Src/Dlhis.Permission/Dlhis.Permission.csproj @@ -0,0 +1,32 @@ + + + + net6.0 + enable + enable + Linux + ..\.. + True + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Src/Dlhis.Permission/Dockerfile b/Src/Dlhis.Permission/Dockerfile new file mode 100644 index 00000000..c8f50dba --- /dev/null +++ b/Src/Dlhis.Permission/Dockerfile @@ -0,0 +1,21 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Src/Dlhis.Permission/Dlhis.Permission.csproj", "Src/Dlhis.Permission/"] +RUN dotnet restore "Src/Dlhis.Permission/Dlhis.Permission.csproj" +COPY . . +WORKDIR "/src/Src/Dlhis.Permission" +RUN dotnet build "Dlhis.Permission.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Dlhis.Permission.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Dlhis.Permission.dll"] \ No newline at end of file diff --git a/Src/Dlhis.Permission/Program.cs b/Src/Dlhis.Permission/Program.cs new file mode 100644 index 00000000..183eef6d --- /dev/null +++ b/Src/Dlhis.Permission/Program.cs @@ -0,0 +1,18 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.Startup; + +class Program +{ + static void Main(string[] args) + { + KurisuHost.Run(true, args); + } +} + +public class Startup : DefaultStartup +{ + public Startup(IConfiguration configuration) : base(configuration) + { + + } +} \ No newline at end of file diff --git a/Src/Dlhis.Permission/Properties/launchSettings.json b/Src/Dlhis.Permission/Properties/launchSettings.json new file mode 100644 index 00000000..b5d66c45 --- /dev/null +++ b/Src/Dlhis.Permission/Properties/launchSettings.json @@ -0,0 +1,20 @@ +{ + "profiles": { + "Dlhis.Permission": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5003" + }, + "Docker": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + } +} \ No newline at end of file diff --git a/Src/Dlhis.Permission/appsettings.Development.json b/Src/Dlhis.Permission/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/Src/Dlhis.Permission/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Src/Dlhis.Permission/appsettings.json b/Src/Dlhis.Permission/appsettings.json new file mode 100644 index 00000000..369aba6b --- /dev/null +++ b/Src/Dlhis.Permission/appsettings.json @@ -0,0 +1,62 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "SwaggerOptions": { + "Enable": true, + "Authority": "https://yikatong.isawesome.cn/oauth2", + "ClientId": "4fb184324eac4180", + "ClientSecret": "8ac8f235152f1524", + "Scopes": { + "openid": "openid" + } + }, + "IdentityServerOptions": { + "Authority": "https://yikatong.isawesome.cn/oauth2", + "RequireHttpsMetadata": true, + "Issuer": "identity.isawesome.cn", + "Audience": "", + "Pat": { + "Enable": false, + "Scheme": "token", + "ClientId": "reference", + "ClientSecret": "123456" + } + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "log/log.txt", + "rollingInterval": "Hour" + } + } + ] + } + } + ] + } +} diff --git a/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj new file mode 100644 index 00000000..2096c148 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj @@ -0,0 +1,23 @@ + + + + net7.0 + enable + enable + Linux + ..\.. + True + + + + + + + + + + + + + + diff --git a/Src/Dlhis.ScheduledTask/Dockerfile b/Src/Dlhis.ScheduledTask/Dockerfile new file mode 100644 index 00000000..603194ce --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Dockerfile @@ -0,0 +1,21 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +WORKDIR /src +COPY ["Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj", "Src/Dlhis.ScheduledTask/"] +RUN dotnet restore "Src/Dlhis.ScheduledTask/Dlhis.ScheduledTask.csproj" +COPY . . +WORKDIR "/src/Src/Dlhis.ScheduledTask" +RUN dotnet build "Dlhis.ScheduledTask.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Dlhis.ScheduledTask.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Dlhis.ScheduledTask.dll"] \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Program.cs b/Src/Dlhis.ScheduledTask/Program.cs new file mode 100644 index 00000000..183eef6d --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Program.cs @@ -0,0 +1,18 @@ +using Kurisu.AspNetCore.Startup; +using Kurisu.Startup; + +class Program +{ + static void Main(string[] args) + { + KurisuHost.Run(true, args); + } +} + +public class Startup : DefaultStartup +{ + public Startup(IConfiguration configuration) : base(configuration) + { + + } +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/Properties/launchSettings.json b/Src/Dlhis.ScheduledTask/Properties/launchSettings.json new file mode 100644 index 00000000..4f4a7b14 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/Properties/launchSettings.json @@ -0,0 +1,19 @@ +{ + "profiles": { + "Dlhis.ScheduledTask": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:5010" + }, + "Docker": { + "commandName": "Docker", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "http://+:80" + }, + "publishAllPorts": true + } + } +} \ No newline at end of file diff --git a/Src/Dlhis.ScheduledTask/appsettings.Development.json b/Src/Dlhis.ScheduledTask/appsettings.Development.json new file mode 100644 index 00000000..0c208ae9 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json new file mode 100644 index 00000000..6df643d4 --- /dev/null +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -0,0 +1,41 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}" + } + }, + { + "Name": "File", + "Args": { + "path": "log/log.txt", + "rollingInterval": "Hour" + } + } + ] + } + } + ] + } +}