first commit
commit
29dd439db8
|
|
@ -0,0 +1,40 @@
|
||||||
|
# Build and Release Folders
|
||||||
|
bin-debug/
|
||||||
|
bin-release/
|
||||||
|
[Oo]bj/
|
||||||
|
[Bb]in/
|
||||||
|
|
||||||
|
# Other files and folders
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.swf
|
||||||
|
*.air
|
||||||
|
*.ipa
|
||||||
|
*.apk
|
||||||
|
|
||||||
|
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
|
||||||
|
# should NOT be excluded as they contain compiler settings and other important
|
||||||
|
# information for Eclipse / Flash Builder.
|
||||||
|
/Admin.NET/.vs
|
||||||
|
/Admin.NET/packages
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Upload
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Avatar
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/wwwroot/Signature
|
||||||
|
/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj.user
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj.user
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/Properties/PublishProfiles
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/publish
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/logs
|
||||||
|
/Admin.NET/Admin.NET.Web.Entry/*.db
|
||||||
|
|
||||||
|
# folders
|
||||||
|
dist/
|
||||||
|
node_modules/
|
||||||
|
/Web/package-lock.json
|
||||||
|
/Web/public/config.js
|
||||||
|
/Web/stats.html
|
||||||
|
.vs
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
/Admin.NET/Admin.NET.Core/Entity/CePing/BusScale.cs
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,175 @@
|
||||||
|
|
||||||
|
[*.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_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_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
|
||||||
|
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 = file_scoped:silent
|
||||||
|
csharp_style_prefer_top_level_statements = true:silent
|
||||||
|
csharp_style_prefer_method_group_conversion = true:silent
|
||||||
|
csharp_prefer_static_local_function = true:suggestion
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
|
||||||
|
csharp_style_prefer_switch_expression = true:suggestion
|
||||||
|
csharp_style_prefer_pattern_matching = true:silent
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||||
|
csharp_style_prefer_not_pattern = true:suggestion
|
||||||
|
csharp_style_prefer_extended_property_pattern = true:suggestion
|
||||||
|
csharp_style_throw_expression = true:suggestion
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true:suggestion
|
||||||
|
csharp_prefer_simple_default_expression = true:suggestion
|
||||||
|
csharp_style_prefer_local_over_anonymous_function = true:suggestion
|
||||||
|
csharp_style_prefer_index_operator = true:suggestion
|
||||||
|
csharp_style_prefer_range_operator = true:suggestion
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
|
||||||
|
csharp_style_prefer_tuple_swap = true:suggestion
|
||||||
|
csharp_style_prefer_utf8_string_literals = true:suggestion
|
||||||
|
csharp_style_inlined_variable_declaration = true:suggestion
|
||||||
|
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
|
||||||
|
[*.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}]
|
||||||
|
end_of_line = crlf
|
||||||
|
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
|
||||||
|
dotnet_code_quality_unused_parameters = all:suggestion
|
||||||
|
dotnet_style_readonly_field = true:suggestion
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
|
||||||
|
dotnet_style_coalesce_expression = true:suggestion
|
||||||
|
dotnet_style_null_propagation = true:suggestion
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||||
|
dotnet_style_prefer_auto_properties = true:silent
|
||||||
|
dotnet_style_object_initializer = true:suggestion
|
||||||
|
dotnet_style_collection_initializer = true:suggestion
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||||
|
dotnet_style_explicit_tuple_names = true:suggestion
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||||
|
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true:suggestion
|
||||||
|
dotnet_style_namespace_match_folder = true:suggestion
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:silent
|
||||||
|
indent_size = 4
|
||||||
|
tab_width = 4
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<NoWarn>1701;1702;1591;8632</NoWarn>
|
||||||
|
<DocumentationFile></DocumentationFile>
|
||||||
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
|
<Nullable>disable</Nullable>
|
||||||
|
<Copyright>© Admin.NET</Copyright>
|
||||||
|
<Description>Admin.NET 通用权限开发平台</Description>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Configuration\**\*">
|
||||||
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="wwwroot\**\*">
|
||||||
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Configuration\sysregion.sql" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="MailKit" Version="4.8.0" />
|
||||||
|
<PackageReference Include="MimeKit" Version="4.10.0" />
|
||||||
|
<PackageReference Include="MiniExcel" Version="1.35.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
|
||||||
|
<ProjectReference Include="..\Plugins\Admin.NET.Plugin.DingTalk\Admin.NET.Plugin.DingTalk.csproj" />
|
||||||
|
<ProjectReference Include="..\Plugins\Admin.NET.Plugin.ReZero\Admin.NET.Plugin.ReZero.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="Configuration\App.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"APIJSON": {
|
||||||
|
"Roles": [
|
||||||
|
{
|
||||||
|
"RoleName": "Role1", // 权限名称 唯一
|
||||||
|
"Select": { // 查询
|
||||||
|
"Table": [ "*" ], // 可操作的表
|
||||||
|
"Column": [ "*" ], // 可操作的字段
|
||||||
|
"Filter": []
|
||||||
|
},
|
||||||
|
"Insert": { // 添加
|
||||||
|
"Table": [ "table1", "table2", "table3" ],
|
||||||
|
"Column": [ "*", "*", "tb.*" ]
|
||||||
|
},
|
||||||
|
"Update": { // 修改
|
||||||
|
"Table": [ "table1", "table2", "table3" ],
|
||||||
|
"Column": [ "*", "tb.*", "tb.*" ]
|
||||||
|
},
|
||||||
|
"Delete": { // 删除
|
||||||
|
"Table": [ "table1", "table2", "table3" ]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"RoleName": "Role2",
|
||||||
|
"Select": {
|
||||||
|
"Table": [ "table1" ],
|
||||||
|
"Column": [ "tb.*" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Urls": "http://*:5006", // 配置默认端口
|
||||||
|
// "https_port": 44325,
|
||||||
|
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
|
||||||
|
"AppSettings": {
|
||||||
|
"InjectSpecificationDocument": true, // 生产环境是否开启Swagger
|
||||||
|
"ExternalAssemblies": [ "plugins" ] // 插件目录
|
||||||
|
},
|
||||||
|
"DynamicApiControllerSettings": {
|
||||||
|
//"DefaultRoutePrefix": "api", // 默认路由前缀
|
||||||
|
"CamelCaseSeparator": "", // 驼峰命名分隔符
|
||||||
|
"SplitCamelCase": false, // 切割骆驼(驼峰)/帕斯卡命名
|
||||||
|
"LowercaseRoute": false, // 小写路由格式
|
||||||
|
"AsLowerCamelCase": true, // 小驼峰命名(首字母小写)
|
||||||
|
"KeepVerb": false, // 保留动作方法请求谓词
|
||||||
|
"KeepName": false // 保持原有名称不处理
|
||||||
|
},
|
||||||
|
"FriendlyExceptionSettings": {
|
||||||
|
"DefaultErrorMessage": "系统异常,请联系管理员",
|
||||||
|
"ThrowBah": true, // 是否将 Oops.Oh 默认抛出为业务异常
|
||||||
|
"LogError": false // 是否输出异常日志
|
||||||
|
},
|
||||||
|
"LocalizationSettings": {
|
||||||
|
"SupportedCultures": [ "zh-CN", "en" ], // 语言列表
|
||||||
|
"DefaultCulture": "zh-CN", // 默认语言
|
||||||
|
"DateTimeFormatCulture": "zh-CN" // 固定时间区域为特定时区(多语言)
|
||||||
|
},
|
||||||
|
"CorsAccessorSettings": {
|
||||||
|
// "WithOrigins": ["https://gitee.com"],
|
||||||
|
"WithExposedHeaders": [ "Content-Disposition", "X-Pagination", "access-token", "x-access-token" ], // 如果前端不代理且是axios请求
|
||||||
|
"SignalRSupport": true // 启用 SignalR 跨域支持
|
||||||
|
},
|
||||||
|
"SnowId": {
|
||||||
|
"WorkerId": 1, // 机器码 全局唯一
|
||||||
|
"WorkerIdBitLength": 6, // 机器码位长 默认值6,取值范围 [1, 19]
|
||||||
|
"SeqBitLength": 6, // 序列数位长 默认值6,取值范围 [3, 21](建议不小于4,值越大性能越高、Id位数也更长)
|
||||||
|
"WorkerPrefix": "adminnet_" // 缓存前缀
|
||||||
|
},
|
||||||
|
"Cryptogram": {
|
||||||
|
"StrongPassword": false, // 是否开启密码强度验证
|
||||||
|
"PasswordStrengthValidation": "(?=^.{6,16}$)(?=.*\\d)(?=.*\\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\\n).*$", // 密码强度验证正则表达式,必须须包含大小写字母、数字和特殊字符的组合,长度在6-16之间
|
||||||
|
"PasswordStrengthValidationMsg": "密码必须包含大小写字母、数字和特殊字符的组合,长度在6-16之间", // 密码强度验证消息提示
|
||||||
|
"CryptoType": "SM2", // 密码加密算法:MD5、SM2、SM4
|
||||||
|
"PublicKey": "0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312", // 公钥
|
||||||
|
"PrivateKey": "8EDB615B1D48B8BE188FC0F18EC08A41DF50EA731FA28BF409E6552809E3A111" // 私钥
|
||||||
|
},
|
||||||
|
"OutExApi": {
|
||||||
|
"BaseUrl": "http://192.168.104.102:8081/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Cache": {
|
||||||
|
"Prefix": "adminnet_", // 全局缓存前缀
|
||||||
|
"CacheType": "Memory", // Memory、Redis
|
||||||
|
"Redis": {
|
||||||
|
"Configuration": "server=192.168.104.104:6379;password=jhkdjhkjdhsIUTYURTU_X6M3YN;db=5;", // Redis连接字符串
|
||||||
|
"Prefix": "adminnet_", // Redis前缀(目前没用)
|
||||||
|
"MaxMessageSize": "1048576" // 最大消息大小 默认1024 * 1024
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Cluster": { // 集群配置
|
||||||
|
"Enabled": false, // 启用集群:前提开启Redis缓存模式
|
||||||
|
"ServerId": "adminnet", // 服务器标识
|
||||||
|
"ServerIp": "", // 服务器IP
|
||||||
|
"SignalR": {
|
||||||
|
"RedisConfiguration": "192.168.104.104:6379,ssl=false,password=jhkdjhkjdhsIUTYURTU_X6M3YN,defaultDatabase=6",
|
||||||
|
"ChannelPrefix": "signalrPrefix_"
|
||||||
|
},
|
||||||
|
"DataProtecteKey": "AdminNet:DataProtection-Keys",
|
||||||
|
"IsSentinel": false, // 是否哨兵模式
|
||||||
|
"SentinelConfig": {
|
||||||
|
"DefaultDb": "4",
|
||||||
|
"EndPoints": [ // 哨兵端口
|
||||||
|
// "10.10.0.124:26380"
|
||||||
|
],
|
||||||
|
"MainPrefix": "adminNet:",
|
||||||
|
"Password": "123456",
|
||||||
|
"SentinelPassword": "adminNet",
|
||||||
|
"ServiceName": "adminNet",
|
||||||
|
"SignalRChannelPrefix": "signalR:"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Mongoopt": {
|
||||||
|
"Url": "mongodb://mongo_B26NQQ:mongo_35EGkB@192.168.104.104:27017"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"CaptchaOptions": {
|
||||||
|
"CaptchaType": 10, // 验证码类型0、1、2、3、4、5、6、7、8、9、10、11
|
||||||
|
"CodeLength": 1, // 验证码长度, 要放在CaptchaType设置后 当类型为算术表达式时,长度代表操作的个数, 例如2
|
||||||
|
"ExpirySeconds": 60, // 验证码过期秒数
|
||||||
|
"IgnoreCase": true, // 比较时是否忽略大小写
|
||||||
|
"StoreageKeyPrefix": "", // 存储键前缀
|
||||||
|
"ImageOption": {
|
||||||
|
"Animation": true, // 是否启用动画
|
||||||
|
"FontSize": 36, // 字体大小
|
||||||
|
"Width": 150, // 验证码宽度
|
||||||
|
"Height": 50, // 验证码高度
|
||||||
|
"BubbleMinRadius": 5, // 气泡最小半径
|
||||||
|
"BubbleMaxRadius": 10, // 气泡最大半径
|
||||||
|
"BubbleCount": 3, // 气泡数量
|
||||||
|
"BubbleThickness": 1.0, // 气泡边沿厚度
|
||||||
|
"InterferenceLineCount": 3, // 干扰线数量
|
||||||
|
"FontFamily": "kaiti", // 包含actionj,epilog,fresnel,headache,lexo,prefix,progbot,ransom,robot,scandal,kaiti
|
||||||
|
"FrameDelay": 300, // 每帧延迟,Animation=true时有效, 默认300
|
||||||
|
"BackgroundColor": "#ffffff", // 格式: rgb, rgba, rrggbb, or rrggbbaa format to match web syntax, 默认#fff
|
||||||
|
"ForegroundColors": "", // 颜色格式同BackgroundColor,多个颜色逗号分割,随机选取。不填,空值,则使用默认颜色集
|
||||||
|
"Quality": 100, // 图片质量(质量越高图片越大,gif调整无效可能会更大)
|
||||||
|
"TextBold": true // 粗体
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
// 代码生成配置项-程序集名称集合
|
||||||
|
"CodeGen": {
|
||||||
|
"EntityAssemblyNames": [ "Admin.NET.Core", "Admin.NET.Application" ],
|
||||||
|
"BaseEntityNames": [ "EntityTenantId", "EntityTenant", "EntityTenantBaseData", "EntityBaseData", "EntityBase", "EntityBaseId" ],
|
||||||
|
"EntityBaseColumn": {
|
||||||
|
"EntityTenantId": [ "Id", "TenantId" ],
|
||||||
|
"EntityTenant": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "TenantId" ],
|
||||||
|
"EntityTenantBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName", "TenantId" ],
|
||||||
|
"EntityBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName" ],
|
||||||
|
"EntityBase": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete" ],
|
||||||
|
"EntityBaseId": [ "Id" ]
|
||||||
|
//"BaseId": [ "Id" ]
|
||||||
|
},
|
||||||
|
"FrontRootPath": "Web", // 前端项目根目录
|
||||||
|
"BackendApplicationNamespaces": [ "Admin.NET.Application", "Admin.NET.Application2" ] // 后端生成到的项目
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
// 详细数据库配置见SqlSugar官网(第一个为默认库)
|
||||||
|
"DbConnection": {
|
||||||
|
"EnableConsoleSql": true, // 启用控制台打印SQL
|
||||||
|
"ConnectionConfigs": [
|
||||||
|
{
|
||||||
|
//"ConfigId": "1300000000001", // 默认库标识-禁止修改
|
||||||
|
"DbType": "MySql", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
|
||||||
|
"ConnectionString": "DataSource=192.168.104.103; Port=3306;SslMode=None;Database=ZhiyuanForNet; Uid=ZhiyuanForNet; Pwd=xeYtEixkWixTpdhG;CharSet=utf8mb4", // 库连接字符串
|
||||||
|
//"SlaveConnectionConfigs": [ // 读写分离/主从
|
||||||
|
// {
|
||||||
|
// "HitRate": 10,
|
||||||
|
// "ConnectionString": "DataSource=./Admin.NET1.db"
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "HitRate": 10,
|
||||||
|
// "ConnectionString": "DataSource=./Admin.NET2.db"
|
||||||
|
// }
|
||||||
|
//],
|
||||||
|
"DbSettings": {
|
||||||
|
"EnableInitDb": false, // 启用库初始化
|
||||||
|
"EnableDiffLog": false, // 启用库表差异日志
|
||||||
|
"EnableUnderLine": false // 启用驼峰转下划线
|
||||||
|
},
|
||||||
|
"TableSettings": {
|
||||||
|
"EnableInitTable": true, // 启用表初始化
|
||||||
|
"EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||||
|
},
|
||||||
|
"SeedSettings": {
|
||||||
|
"EnableInitSeed": false, // 启用种子初始化
|
||||||
|
"EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//// 日志独立数据库配置
|
||||||
|
//{
|
||||||
|
// "ConfigId": "1300000000002", // 日志库标识-禁止修改
|
||||||
|
// "DbType": "Sqlite",
|
||||||
|
// "ConnectionString": "DataSource=./Admin.NET.Log.db", // 库连接字符串
|
||||||
|
// "DbSettings": {
|
||||||
|
// "EnableInitDb": true, // 启用库初始化
|
||||||
|
// "EnableDiffLog": false, // 启用库表差异日志
|
||||||
|
// "EnableUnderLine": false // 启用驼峰转下划线
|
||||||
|
// },
|
||||||
|
// "TableSettings": {
|
||||||
|
// "EnableInitTable": true, // 启用表初始化
|
||||||
|
// "EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||||
|
// },
|
||||||
|
// "SeedSettings": {
|
||||||
|
// "EnableInitSeed": false, // 启用种子初始化
|
||||||
|
// "EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||||
|
// }
|
||||||
|
//},
|
||||||
|
//// 其他数据库配置(可以配置多个)
|
||||||
|
//{
|
||||||
|
// "ConfigId": "test", // 库标识
|
||||||
|
// "DbType": "Sqlite", // 库类型
|
||||||
|
// "ConnectionString": "DataSource=./Admin.NET.Test.db", // 库连接字符串
|
||||||
|
// "DbSettings": {
|
||||||
|
// "EnableInitDb": true, // 启用库初始化
|
||||||
|
// "EnableDiffLog": false, // 启用库表差异日志
|
||||||
|
// "EnableUnderLine": false // 启用驼峰转下划线
|
||||||
|
// },
|
||||||
|
// "TableSettings": {
|
||||||
|
// "EnableInitTable": true, // 启用表初始化
|
||||||
|
// "EnableIncreTable": false // 启用表增量更新-特性[IncreTable]
|
||||||
|
// },
|
||||||
|
// "SeedSettings": {
|
||||||
|
// "EnableInitSeed": true, // 启用种子初始化
|
||||||
|
// "EnableIncreSeed": false // 启用种子增量更新-特性[IncreSeed]
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Email": {
|
||||||
|
"Host": "smtp.163.com", // 主机
|
||||||
|
"Port": 465, // 端口 465、994、25
|
||||||
|
"EnableSsl": true, // 启用SSL
|
||||||
|
"DefaultFromEmail": "xxx@163.com", // 默认发件者邮箱
|
||||||
|
"DefaultToEmail": "xxx@qq.com", // 默认接收人邮箱
|
||||||
|
"UserName": "xxx@163.com", // 邮箱账号
|
||||||
|
"Password": "", // 邮箱授权码
|
||||||
|
"DefaultFromName": "Admin.NET 通用权限开发平台" // 默认邮件标题
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
// 枚举实体所在程序集名称集合
|
||||||
|
"Enum": {
|
||||||
|
"EntityAssemblyNames": [ "Admin.NET.Core", "Admin.NET.Application", "Admin.NET.AppCMS" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"EventBus": {
|
||||||
|
"RabbitMQ": {
|
||||||
|
"UserName": "adminnet",
|
||||||
|
"Password": "adminnet++123456",
|
||||||
|
"HostName": "127.0.0.1",
|
||||||
|
"Port": 5672
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"JWTSettings": {
|
||||||
|
"ValidateIssuerSigningKey": true, // 是否验证密钥,bool 类型,默认true
|
||||||
|
"IssuerSigningKey": "9k1cbc3f546eda35168c3aa3cb91780fbe703f0996c6d123ea96dc85c70bbc0a", // 密钥,string 类型,必须是复杂密钥,长度大于16
|
||||||
|
"ValidateIssuer": true, // 是否验证签发方,bool 类型,默认true
|
||||||
|
"ValidIssuer": "YCYMEDUCENTER", // 签发方,string 类型
|
||||||
|
"ValidateAudience": true, // 是否验证签收方,bool 类型,默认true
|
||||||
|
"ValidAudience": "YCYMEDUCLIENT", // 签收方,string 类型
|
||||||
|
"ValidateLifetime": true, // 是否验证过期时间,bool 类型,默认true,建议true
|
||||||
|
//"ExpiredTime": 20, // 过期时间,long 类型,单位分钟,默认20分钟,最大支持 13 年
|
||||||
|
"ClockSkew": 5, // 过期时间容错值,long 类型,单位秒,默认5秒
|
||||||
|
"Algorithm": "HS256", // 加密算法,string 类型,默认 HS256
|
||||||
|
"RequireExpirationTime": true // 验证过期时间,设置 false 将永不过期
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
// IP限流配置
|
||||||
|
"IpRateLimiting": {
|
||||||
|
// 例如:设置每分钟5次访问限流
|
||||||
|
// 当False时:每个接口都加入计数,不管你访问哪个接口,只要在一分钟内累计够5次,将禁止访问。
|
||||||
|
// 当True 时:当一分钟请求了5次GetData接口,则该接口将在时间段内禁止访问,但是还可以访问PostData()5次,总得来说是每个接口都有5次在这一分钟,互不干扰。
|
||||||
|
"EnableEndpointRateLimiting": true,
|
||||||
|
// 如果StackBlockedRequests设置为false,拒绝的API调用不会添加到调用次数计数器上。比如:如果客户端每秒发出3个请求并且您设置了每秒一个调用的限制,
|
||||||
|
// 则每分钟或每天计数器等其他限制将仅记录第一个调用,即成功的API调用。如果您希望被拒绝的API调用计入其他时间的显示(分钟,小时等),则必须设置
|
||||||
|
"StackBlockedRequests": false,
|
||||||
|
// 在RealIpHeader使用时,你的Kestrel服务器背后是一个反向代理,如果你的代理服务器使用不同的页眉然后提取客户端IP X-Real-IP使用此选项来设置它。
|
||||||
|
"RealIpHeader": "X-Real-IP",
|
||||||
|
// 将ClientIdHeader被用于提取白名单的客户端ID。如果此标头中存在客户端ID并且与ClientWhitelist中指定的值匹配,则不应用速率限制。
|
||||||
|
"ClientIdHeader": "X-ClientId",
|
||||||
|
// IP白名单:支持Ipv4和Ipv6
|
||||||
|
"IpWhitelist": [],
|
||||||
|
// 端点白名单
|
||||||
|
"EndpointWhitelist": [],
|
||||||
|
// 客户端白名单
|
||||||
|
"ClientWhitelist": [],
|
||||||
|
"QuotaExceededResponse": {
|
||||||
|
"Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问过于频繁,请稍后重试!\",\"result\":null,\"extras\":null}}",
|
||||||
|
"ContentType": "application/json",
|
||||||
|
"StatusCode": 429
|
||||||
|
},
|
||||||
|
// 返回状态码
|
||||||
|
"HttpStatusCode": 429,
|
||||||
|
// API规则,结尾一定要带*
|
||||||
|
"GeneralRules": [
|
||||||
|
// 1秒钟只能调用10次
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1s",
|
||||||
|
"Limit": 10
|
||||||
|
},
|
||||||
|
// 1分钟只能调用600次
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1m",
|
||||||
|
"Limit": 600
|
||||||
|
},
|
||||||
|
// 1小时只能调用3600
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1h",
|
||||||
|
"Limit": 3600
|
||||||
|
},
|
||||||
|
// 1天只能调用86400次
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1d",
|
||||||
|
"Limit": 86400
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"IpRateLimitPolicies": {
|
||||||
|
"IpRules": [
|
||||||
|
{
|
||||||
|
"Ip": "XXX.XXX.XXX.XXX",
|
||||||
|
"Rules": [
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1s",
|
||||||
|
"Limit": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1m",
|
||||||
|
"Limit": 600
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 客户端限流配置
|
||||||
|
"ClientRateLimiting": {
|
||||||
|
"EnableEndpointRateLimiting": true,
|
||||||
|
"ClientIdHeader": "X-ClientId",
|
||||||
|
"EndpointWhitelist": [],
|
||||||
|
"ClientWhitelist": [],
|
||||||
|
"QuotaExceededResponse": {
|
||||||
|
"Content": "{{\"code\":429,\"type\":\"error\",\"message\":\"访问人数过多,请稍后重试!\",\"result\":null,\"extras\":null}}",
|
||||||
|
"ContentType": "application/json",
|
||||||
|
"StatusCode": 429
|
||||||
|
},
|
||||||
|
"HttpStatusCode": 429,
|
||||||
|
"GeneralRules": [
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1s",
|
||||||
|
"Limit": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1m",
|
||||||
|
"Limit": 600
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ClientRateLimitPolicies": {
|
||||||
|
"ClientRules": [
|
||||||
|
{
|
||||||
|
"ClientId": "xxx-xxx",
|
||||||
|
"Rules": [
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1s",
|
||||||
|
"Limit": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Endpoint": "*",
|
||||||
|
"Period": "1m",
|
||||||
|
"Limit": 600
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Information"
|
||||||
|
},
|
||||||
|
"File": {
|
||||||
|
"Enabled": false, // 启用文件日志
|
||||||
|
"FileName": "logs/{0:yyyyMMdd}_{1}.log", // 日志文件
|
||||||
|
"Append": true, // 追加覆盖
|
||||||
|
// "MinimumLevel": "Information", // 日志级别
|
||||||
|
"FileSizeLimitBytes": 10485760, // 10M=10*1024*1024
|
||||||
|
"MaxRollingFiles": 30 // 只保留30个文件
|
||||||
|
},
|
||||||
|
"Database": {
|
||||||
|
"Enabled": true, // 启用数据库日志
|
||||||
|
"MinimumLevel": "Information"
|
||||||
|
},
|
||||||
|
"ElasticSearch": {
|
||||||
|
"Enabled": false, // 启用ES日志
|
||||||
|
"AuthType": "Basic", // ES认证类型,可选 Basic、ApiKey、Base64ApiKey
|
||||||
|
"User": "admin", // Basic认证的用户名,使用Basic认证类型时必填
|
||||||
|
"Password": "123456", // Basic认证的密码,使用Basic认证类型时必填
|
||||||
|
"ApiId": "", // 使用ApiKey认证类型时必填
|
||||||
|
"ApiKey": "", // 使用ApiKey认证类型时必填
|
||||||
|
"Base64ApiKey": "TmtrOEszNEJuQ0NyaWlydGtROFk6SG1RZ0w3YzBTc2lCanJTYlV3aXNzZw==", // 使用Base64ApiKey认证类型时必填
|
||||||
|
"Fingerprint": "37:08:6A:C6:06:CC:9A:43:CF:ED:25:A2:1C:A4:69:57:90:31:2C:06:CA:61:56:39:6A:9C:46:11:BD:22:51:DA", // ES使用Https时的证书指纹
|
||||||
|
"ServerUris": [ "http://192.168.1.100:9200" ], // 地址
|
||||||
|
"DefaultIndex": "adminnet" // 索引
|
||||||
|
},
|
||||||
|
"Monitor": {
|
||||||
|
"GlobalEnabled": true, // 启用全局拦截日志
|
||||||
|
"IncludeOfMethods": [], // 拦截特定方法,当GlobalEnabled=false有效
|
||||||
|
"ExcludeOfMethods": [], // 排除特定方法,当GlobalEnabled=true有效
|
||||||
|
"BahLogLevel": "Information", // Oops.Oh 和 Oops.Bah 业务日志输出级别
|
||||||
|
"WithReturnValue": true, // 是否包含返回值,默认true
|
||||||
|
"ReturnValueThreshold": 500, // 返回值字符串阈值,默认0全量输出
|
||||||
|
"JsonBehavior": "None", // 是否输出Json,默认None(OnlyJson、All)
|
||||||
|
"JsonIndented": false, // 是否格式化Json
|
||||||
|
"UseUtcTimestamp": false, // 时间格式UTC、LOCAL
|
||||||
|
"ConsoleLog": true // 是否显示控制台日志
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"OAuth": {
|
||||||
|
"SSO": {
|
||||||
|
"ClientId": "ssoid",
|
||||||
|
"ClientSecret": "9k1cbc3f546eda35168c3aa3cb91780fbe703f0996c6d123ea96dc85c70bbc0a"
|
||||||
|
},
|
||||||
|
"Weixin": {
|
||||||
|
"ClientId": "xxx",
|
||||||
|
"ClientSecret": "xxx"
|
||||||
|
},
|
||||||
|
"Gitee": {
|
||||||
|
"ClientId": "xxx",
|
||||||
|
"ClientSecret": "xxx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"SMS": {
|
||||||
|
"Aliyun": {
|
||||||
|
"AccessKeyId": "",
|
||||||
|
"AccessKeySecret": "",
|
||||||
|
"SignName": "AdminNET平台", // 短信签名
|
||||||
|
"TemplateCode": "" // 短信模板
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"SpecificationDocumentSettings": {
|
||||||
|
"DocumentTitle": "Admin.NET 通用权限开发平台",
|
||||||
|
"GroupOpenApiInfos": [
|
||||||
|
{
|
||||||
|
"Group": "Default",
|
||||||
|
"Title": "Admin.NET 通用权限开发平台",
|
||||||
|
"Description": "让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。",
|
||||||
|
"Version": "1.0.0",
|
||||||
|
"Order": 1000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Group": "All Groups",
|
||||||
|
"Title": "所有接口",
|
||||||
|
"Description": "让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。",
|
||||||
|
"Version": "1.0.0",
|
||||||
|
"Order": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DefaultGroupName": "Default", // 默认分组名
|
||||||
|
"DocExpansionState": "List", // List、Full、None
|
||||||
|
"EnableAllGroups": true,
|
||||||
|
"LoginInfo": {
|
||||||
|
"Enabled": true, // 是否开启Swagger登录
|
||||||
|
"CheckUrl": "/api/swagger/checkUrl",
|
||||||
|
"SubmitUrl": "/api/swagger/submitUrl"
|
||||||
|
},
|
||||||
|
"EnumToNumber": true // 枚举类型生成值类型
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Upload": {
|
||||||
|
"Path": "Upload/{yyyy}/{MM}/{dd}", // 文件上传目录
|
||||||
|
"MaxSize": 20480, // 文件最大限制KB:1024*20
|
||||||
|
"ContentType": [ "application/json", "image/jpg", "image/png", "image/jpeg", "image/gif", "image/bmp", "text/plain", "application/pdf", "application/msword", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "video/mp4" ],
|
||||||
|
"EnableMd5": false // 启用文件MDF5验证-防止重复上传
|
||||||
|
},
|
||||||
|
"OSSProvider": {
|
||||||
|
"IsEnable": true,
|
||||||
|
"Provider": "Aliyun", // OSS提供者 Invalid/Minio/Aliyun/QCloud/Qiniu/HuaweiCloud
|
||||||
|
"Endpoint": "oss-cn-shanghai.aliyuncs.com", // 节点/API地址(在腾讯云OSS中表示AppId)
|
||||||
|
"Region": "https://static-ycymedu-minpro.oss-cn-shanghai.aliyuncs.com", // 地域
|
||||||
|
"AccessKey": "LTAI5tKs3TXSbt7E4WMDcxwR",
|
||||||
|
"SecretKey": "EvC8MjRaQC1kHubgU4MtecZnofOb0v",
|
||||||
|
"IsEnableHttps": true, // 是否启用HTTPS
|
||||||
|
"IsEnableCache": true, // 是否启用缓存
|
||||||
|
"Bucket": "static-ycymedu-minpro"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||||
|
|
||||||
|
"Wechat": {
|
||||||
|
// 公众号
|
||||||
|
"WechatAppId": "wxf8db44d5ec082dfc",
|
||||||
|
"WechatAppSecret": "9898bb082be3a517dabebb244b20182b",
|
||||||
|
"WechatToken": "", // 微信公众号服务器配置中的令牌(Token)
|
||||||
|
"WechatEncodingAESKey": "", // 微信公众号服务器配置中的消息加解密密钥(EncodingAESKey)
|
||||||
|
// 小程序
|
||||||
|
"WxOpenAppId": "wx05e75004e657527c",
|
||||||
|
"WxOpenAppSecret": "9383aa5517e1d6bf23404dce9c86b0f1",
|
||||||
|
"WxToken": "", // 小程序消息推送中的令牌(Token)
|
||||||
|
"WxEncodingAESKey": "" // 小程序消息推送中的消息加解密密钥(EncodingAESKey)
|
||||||
|
},
|
||||||
|
// 微信支付
|
||||||
|
"WechatPay": {
|
||||||
|
"AppId": "wx05e75004e657527c", // 微信公众平台AppId、开放平台AppId、小程序AppId、企业微信CorpId
|
||||||
|
"MerchantId": "1614987630", // 商户平台的商户号
|
||||||
|
"MerchantV3Secret": "brapuk6fon0wachiMlth2t3lb4a0h7ji", // 商户平台的APIv3密钥
|
||||||
|
"MerchantCertificateSerialNumber": "1B304596B953D156B37863FF52FCAE40B458C9F2", // 商户平台的证书序列号
|
||||||
|
"MerchantCertificatePrivateKey": "/wxpaycert/apiclient_key.pem" // 商户平台的API证书私钥(apiclient_key.pem文件内容)
|
||||||
|
},
|
||||||
|
// 支付回调
|
||||||
|
"PayCallBack": {
|
||||||
|
"WechatPayUrl": "https://api.v3.ycymedu.com/api/sysWechatPay/payCallBack", // 微信支付回调
|
||||||
|
"WechatRefundUrl": "", // 微信退款回调
|
||||||
|
"AlipayUrl": "", // 支付宝支付回调
|
||||||
|
"AlipayRefundUrl": "" // 支付宝退款回调
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,23 @@
|
||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 业务应用相关常量
|
||||||
|
/// </summary>
|
||||||
|
public class ApplicationConst
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// API分组名称
|
||||||
|
/// </summary>
|
||||||
|
//public const string GroupName = "xxx业务应用";
|
||||||
|
|
||||||
|
public const string ZYGroupName = "志愿业务应用";
|
||||||
|
|
||||||
|
public const string CPGroupName = "志愿业务应用";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
global using Admin.NET.Core;
|
||||||
|
global using Furion;
|
||||||
|
global using Furion.DependencyInjection;
|
||||||
|
global using Furion.DynamicApiController;
|
||||||
|
global using Furion.FriendlyException;
|
||||||
|
global using Mapster;
|
||||||
|
global using Microsoft.AspNetCore.Authorization;
|
||||||
|
global using Microsoft.AspNetCore.Mvc;
|
||||||
|
global using Microsoft.Extensions.DependencyInjection;
|
||||||
|
global using SqlSugar;
|
||||||
|
global using System;
|
||||||
|
global using System.Collections.Generic;
|
||||||
|
global using System.ComponentModel;
|
||||||
|
global using System.ComponentModel.DataAnnotations;
|
||||||
|
global using System.Threading.Tasks;
|
||||||
|
global using System.Linq;
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 示例开放接口
|
||||||
|
///// </summary>
|
||||||
|
//[ApiDescriptionSettings("开放接口", Name = "Demo", Order = 100)]
|
||||||
|
//[Authorize(AuthenticationSchemes = SignatureAuthenticationDefaults.AuthenticationScheme)]
|
||||||
|
//public class DemoOpenApi : IDynamicApiController
|
||||||
|
//{
|
||||||
|
// private readonly UserManager _userManager;
|
||||||
|
|
||||||
|
// public DemoOpenApi(UserManager userManager)
|
||||||
|
// {
|
||||||
|
// _userManager = userManager;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// [HttpGet("helloWord")]
|
||||||
|
// public Task<string> HelloWord()
|
||||||
|
// {
|
||||||
|
// return Task.FromResult($"Hello word. {_userManager.Account}");
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
@ -0,0 +1,238 @@
|
||||||
|
using Admin.NET.Core.Service;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.ZYGroupName, Order = 100)]
|
||||||
|
public class BusBatchBaseService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusBatchBase> _rep;
|
||||||
|
public BusBatchBaseService(SqlSugarRepository<BusBatchBase> rep)
|
||||||
|
{
|
||||||
|
_rep = rep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询基础批次表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusBatchBaseOutput>> Page(BusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
var query = _rep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||||
|
u.ProvinceCode.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.ProvinceName.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Batch.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Course.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.BatchType.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.PressureRange.Contains(input.SearchKey.Trim())
|
||||||
|
)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ProvinceCode), u => u.ProvinceCode.Contains(input.ProvinceCode.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ProvinceName), u => u.ProvinceName.Contains(input.ProvinceName.Trim()))
|
||||||
|
.WhereIF(input.Year > 0, u => u.Year == input.Year)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Batch), u => u.Batch.Contains(input.Batch.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Course), u => u.Course.Contains(input.Course.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BatchType), u => u.BatchType.Contains(input.BatchType.Trim()))
|
||||||
|
.WhereIF(input.Score > 0, u => u.Score == input.Score)
|
||||||
|
.WhereIF(input.PressureScore > 0, u => u.PressureScore == input.PressureScore)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PressureRange), u => u.PressureRange.Contains(input.PressureRange.Trim()))
|
||||||
|
|
||||||
|
// 只进行一次 LEFT JOIN,避免重复
|
||||||
|
.LeftJoin<BusBatchBase>((u, p) => u.ProvinceCode == p.ProvinceCode)
|
||||||
|
|
||||||
|
// 去重,避免重复数据
|
||||||
|
.Distinct()
|
||||||
|
|
||||||
|
// 按创建时间排序
|
||||||
|
.OrderBy(u => u.CreateTime)
|
||||||
|
|
||||||
|
// 选择需要的字段
|
||||||
|
.Select((u, p) => new BusBatchBaseOutput
|
||||||
|
{
|
||||||
|
Id = u.Id,
|
||||||
|
ProvinceCode = u.ProvinceCode,
|
||||||
|
ProvinceCodeProvinceCode = p.ProvinceCode,
|
||||||
|
ProvinceName = u.ProvinceName,
|
||||||
|
ProvinceNameProvinceName = p.ProvinceName,
|
||||||
|
Year = u.Year,
|
||||||
|
Batch = u.Batch,
|
||||||
|
Course = u.Course,
|
||||||
|
BatchType = u.BatchType,
|
||||||
|
Score = u.Score,
|
||||||
|
PressureScore = u.PressureScore,
|
||||||
|
PressureRange = u.PressureRange,
|
||||||
|
CreateTime = u.CreateTime,
|
||||||
|
UpdateTime = u.UpdateTime,
|
||||||
|
CreateUserId = u.CreateUserId,
|
||||||
|
CreateUserName = u.CreateUserName,
|
||||||
|
UpdateUserId = u.UpdateUserId,
|
||||||
|
UpdateUserName = u.UpdateUserName,
|
||||||
|
IsDelete = u.IsDelete,
|
||||||
|
});
|
||||||
|
|
||||||
|
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加基础批次表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Add")]
|
||||||
|
public async Task<long> Add(AddBusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusBatchBase>();
|
||||||
|
await _rep.InsertAsync(entity);
|
||||||
|
return entity.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除基础批次表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Delete")]
|
||||||
|
public async Task Delete(DeleteBusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
await _rep.FakeDeleteAsync(entity); //假删除
|
||||||
|
//await _rep.DeleteAsync(entity); //真删除
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新基础批次表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Update")]
|
||||||
|
public async Task Update(UpdateBusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusBatchBase>();
|
||||||
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取基础批次表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "Detail")]
|
||||||
|
public async Task<BusBatchBase> Detail([FromQuery] QueryByIdBusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取基础批次表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "List")]
|
||||||
|
public async Task<List<BusBatchBaseOutput>> List([FromQuery] BusBatchBaseInput input)
|
||||||
|
{
|
||||||
|
return await _rep.AsQueryable().Select<BusBatchBaseOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取省份Code列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "BusBatchBaseProvinceCodeDropdown"), HttpGet]
|
||||||
|
public async Task<dynamic> BusBatchBaseProvinceCodeDropdown()
|
||||||
|
{
|
||||||
|
return await _rep.Context.Queryable<BusProvince>()
|
||||||
|
.Select(u => new
|
||||||
|
{
|
||||||
|
Label = u.Code,
|
||||||
|
Value = u.Code
|
||||||
|
}
|
||||||
|
).ToListAsync();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取省份列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "BusBatchBaseProvinceNameDropdown"), HttpGet]
|
||||||
|
public async Task<dynamic> BusBatchBaseProvinceNameDropdown()
|
||||||
|
{
|
||||||
|
return await _rep.Context.Queryable<BusProvince>()
|
||||||
|
.Select(u => new
|
||||||
|
{
|
||||||
|
Label = u.Name,
|
||||||
|
Value = u.Name
|
||||||
|
}
|
||||||
|
).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据省份code和批次类型获取批次信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="requestDTO"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ApiDescriptionSettings(Name = "batch")]
|
||||||
|
public async Task<ProvinceBatchResultDto> Batch([FromQuery] BusBatchRequestDTO requestDTO)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(requestDTO.LocationCode))
|
||||||
|
throw Oops.Oh("locationCode 不能为空");
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(requestDTO.Course))
|
||||||
|
{
|
||||||
|
requestDTO.Course = "综合";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (requestDTO.LocationCode == "510000" || requestDTO.LocationCode == "410000")
|
||||||
|
{
|
||||||
|
requestDTO.Course = requestDTO.Course.Contains("物") ? "理科" : "文科";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
requestDTO.Course = requestDTO.Course.Contains("物") ? "物理类" : "历史类";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var result = new ProvinceBatchResultDto();
|
||||||
|
var query = await _rep.AsQueryable().Where(e => e.ProvinceCode == requestDTO.LocationCode)
|
||||||
|
.Where(e => e.Course == requestDTO.Course)
|
||||||
|
.Select<BusBatchBaseOutput>().ToListAsync();
|
||||||
|
|
||||||
|
result.Year = query.FirstOrDefault() != null ? query.FirstOrDefault().Year : 0;
|
||||||
|
result.ProvinceCode = query.FirstOrDefault() != null ? query.FirstOrDefault().ProvinceCode : "";
|
||||||
|
result.ProvinceName = query.FirstOrDefault() != null ? query.FirstOrDefault().ProvinceName : "";
|
||||||
|
result.MinScore = query.FirstOrDefault() != null ? query.FirstOrDefault().MinScore : 0;
|
||||||
|
result.MaxScore = query.FirstOrDefault() != null ? query.FirstOrDefault().MaxScore : 0;
|
||||||
|
result.batches = query.Select(s => new ProvinceBatchItem()
|
||||||
|
{
|
||||||
|
Batch = s.Batch,
|
||||||
|
Year = s.Year,
|
||||||
|
BatchType = s.BatchType,
|
||||||
|
Course = s.Course,
|
||||||
|
Score = s.Score,
|
||||||
|
PressureScore = s.PressureScore,
|
||||||
|
PressureRange = s.PressureRange,
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusBatchBaseDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceCodeProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceNameProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年份
|
||||||
|
/// </summary>
|
||||||
|
public int Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次名称
|
||||||
|
/// </summary>
|
||||||
|
public string Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public string Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次类型
|
||||||
|
/// </summary>
|
||||||
|
public string BatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次分
|
||||||
|
/// </summary>
|
||||||
|
public int Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分
|
||||||
|
/// </summary>
|
||||||
|
public int PressureScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分区间
|
||||||
|
/// </summary>
|
||||||
|
public string PressureRange { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,263 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表基础输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusBatchBaseBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public virtual string ProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
public virtual string ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年份
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次类型
|
||||||
|
/// </summary>
|
||||||
|
public virtual string BatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次分
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分
|
||||||
|
/// </summary>
|
||||||
|
public virtual int PressureScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分区间
|
||||||
|
/// </summary>
|
||||||
|
public virtual string PressureRange { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表分页查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusBatchBaseInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字查询
|
||||||
|
/// </summary>
|
||||||
|
public string? SearchKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string? ProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
public string? ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年份
|
||||||
|
/// </summary>
|
||||||
|
public int? Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public string? Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次类型
|
||||||
|
/// </summary>
|
||||||
|
public string? BatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次分
|
||||||
|
/// </summary>
|
||||||
|
public int? Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分
|
||||||
|
/// </summary>
|
||||||
|
public int? PressureScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分区间
|
||||||
|
/// </summary>
|
||||||
|
public string? PressureRange { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusBatchRequestDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string LocationCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Course { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表增加输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class AddBusBatchBaseInput : BusBatchBaseBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "省份Code不能为空")]
|
||||||
|
public override string ProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "省份不能为空")]
|
||||||
|
public override string ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年份
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "年份不能为空")]
|
||||||
|
public override int Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次名称
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "批次名称不能为空")]
|
||||||
|
public override string Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "类型不能为空")]
|
||||||
|
public override string Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次类型
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "批次类型不能为空")]
|
||||||
|
public override string BatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次分
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "批次分不能为空")]
|
||||||
|
public override int Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "压力分不能为空")]
|
||||||
|
public override int PressureScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分区间
|
||||||
|
/// </summary>
|
||||||
|
public override string PressureRange { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "软删除不能为空")]
|
||||||
|
public override bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表删除输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteBusBatchBaseInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateBusBatchBaseInput : BusBatchBaseBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "主键Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表主键查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class QueryByIdBusBatchBaseInput : DeleteBusBatchBaseInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础批次表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusBatchBaseOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code 描述
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceCodeProvinceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份 描述
|
||||||
|
/// </summary>
|
||||||
|
public string ProvinceNameProvinceName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年份
|
||||||
|
/// </summary>
|
||||||
|
public int Year { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次名称
|
||||||
|
/// </summary>
|
||||||
|
public string Batch { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public string Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次类型
|
||||||
|
/// </summary>
|
||||||
|
public string BatchType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次分
|
||||||
|
/// </summary>
|
||||||
|
public int Score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分
|
||||||
|
/// </summary>
|
||||||
|
public int PressureScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 压力分区间
|
||||||
|
/// </summary>
|
||||||
|
public string PressureRange { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次最低分
|
||||||
|
/// </summary>
|
||||||
|
public int MinScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次最高分
|
||||||
|
/// </summary>
|
||||||
|
public int MaxScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class ProvinceBatchResultDto
|
||||||
|
{
|
||||||
|
public string ProvinceCode { get; set; }
|
||||||
|
public string ProvinceName { get; set; }
|
||||||
|
public int Year { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 批次最低分
|
||||||
|
/// </summary>
|
||||||
|
public int MinScore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次最高分
|
||||||
|
/// </summary>
|
||||||
|
public int MaxScore { get; set; }
|
||||||
|
public List<ProvinceBatchItem> batches { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProvinceBatchItem
|
||||||
|
{
|
||||||
|
public int Year { get; set; }
|
||||||
|
public string Batch { get; set; }
|
||||||
|
public string Course { get; set; }
|
||||||
|
public string BatchType { get; set; }
|
||||||
|
public int Score { get; set; }
|
||||||
|
public int PressureScore { get; set; }
|
||||||
|
public string PressureRange { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
using Admin.NET.Core.Service;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.ZYGroupName, Order = 100)]
|
||||||
|
public class BusProductService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusProduct> _rep;
|
||||||
|
public BusProductService(SqlSugarRepository<BusProduct> rep)
|
||||||
|
{
|
||||||
|
_rep = rep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询基础产品信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusProductOutput>> Page(BusProductInput input)
|
||||||
|
{
|
||||||
|
var query = _rep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||||
|
u.Name.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Image.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Summary.Contains(input.SearchKey.Trim())
|
||||||
|
)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Image), u => u.Image.Contains(input.Image.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Summary), u => u.Summary.Contains(input.Summary.Trim()))
|
||||||
|
//处理外键和TreeSelector相关字段的连接
|
||||||
|
.OrderBy(u => u.CreateTime)
|
||||||
|
.Select((u) => new BusProductOutput
|
||||||
|
{
|
||||||
|
Id = u.Id,
|
||||||
|
Name = u.Name,
|
||||||
|
Price = u.Price,
|
||||||
|
Image = u.Image,
|
||||||
|
Summary = u.Summary,
|
||||||
|
CreateTime = u.CreateTime,
|
||||||
|
UpdateTime = u.UpdateTime,
|
||||||
|
CreateUserId = u.CreateUserId,
|
||||||
|
CreateUserName = u.CreateUserName,
|
||||||
|
UpdateUserId = u.UpdateUserId,
|
||||||
|
UpdateUserName = u.UpdateUserName,
|
||||||
|
IsDelete = u.IsDelete,
|
||||||
|
});
|
||||||
|
//.Mapper(c => c.ImageAttachment, c => c.Image)
|
||||||
|
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加基础产品信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Add")]
|
||||||
|
public async Task<long> Add(AddBusProductInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusProduct>();
|
||||||
|
await _rep.InsertAsync(entity);
|
||||||
|
return entity.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除基础产品信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Delete")]
|
||||||
|
public async Task Delete(DeleteBusProductInput input)
|
||||||
|
{
|
||||||
|
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
await _rep.FakeDeleteAsync(entity); //假删除
|
||||||
|
//await _rep.DeleteAsync(entity); //真删除
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新基础产品信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Update")]
|
||||||
|
public async Task Update(UpdateBusProductInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusProduct>();
|
||||||
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取基础产品信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "Detail")]
|
||||||
|
public async Task<BusProduct> Detail([FromQuery] QueryByIdBusProductInput input)
|
||||||
|
{
|
||||||
|
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取基础产品信息列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "List")]
|
||||||
|
public async Task<List<BusProductOutput>> List([FromQuery] BusProductInput input)
|
||||||
|
{
|
||||||
|
return await _rep.AsQueryable().Select<BusProductOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传产品图片
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "UploadImage"), HttpPost]
|
||||||
|
public async Task<SysFile> UploadImage([Required] IFormFile file)
|
||||||
|
{
|
||||||
|
var service = App.GetRequiredService<SysFileService>();
|
||||||
|
return await service.UploadFile(file, "upload/Image");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProductDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品图片
|
||||||
|
/// </summary>
|
||||||
|
public string? Image { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品简介
|
||||||
|
/// </summary>
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息基础输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProductBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品单价
|
||||||
|
/// </summary>
|
||||||
|
public virtual decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品图片
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Image { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品简介
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息分页查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProductInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字查询
|
||||||
|
/// </summary>
|
||||||
|
public string? SearchKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal? Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品图片
|
||||||
|
/// </summary>
|
||||||
|
public string? Image { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品简介
|
||||||
|
/// </summary>
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息增加输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class AddBusProductInput : BusProductBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "产品名称不能为空")]
|
||||||
|
public override string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品单价
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "产品单价不能为空")]
|
||||||
|
public override decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "软删除不能为空")]
|
||||||
|
public override bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息删除输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteBusProductInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateBusProductInput : BusProductBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "主键Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息主键查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class QueryByIdBusProductInput : DeleteBusProductInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础产品信息输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProductOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品图片
|
||||||
|
/// </summary>
|
||||||
|
public string? Image { get; set; }
|
||||||
|
public SysFile ImageAttachment { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品简介
|
||||||
|
/// </summary>
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
using Admin.NET.Core.Service;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.ZYGroupName, Order = 800)]
|
||||||
|
public class BusProvinceInitializationService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusProvinceInitialization> _rep;
|
||||||
|
public BusProvinceInitializationService(SqlSugarRepository<BusProvinceInitialization> rep)
|
||||||
|
{
|
||||||
|
_rep = rep;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取各省份政策初始化表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ApiDescriptionSettings(Name = "List")]
|
||||||
|
public async Task<List<ProvinceInitializationOutputDto>> List()
|
||||||
|
{
|
||||||
|
int currentYear = DateTime.Now.Year;
|
||||||
|
var response = new List<ProvinceInitializationOutputDto>();
|
||||||
|
var query = await _rep.AsQueryable().Where(e => e.IsDelete == false).Select<BusProvinceInitializationOutput>().ToListAsync();
|
||||||
|
query.ForEach(a =>
|
||||||
|
{
|
||||||
|
|
||||||
|
response.Add(new ProvinceInitializationOutputDto()
|
||||||
|
{
|
||||||
|
Allscore = a.Allscore,
|
||||||
|
Code = a.Code,
|
||||||
|
Policy = a.Policy,
|
||||||
|
Provincename = a.Provincename,
|
||||||
|
lizations = GenerateLizations(currentYear)
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Lization> GenerateLizations(int currentYear)
|
||||||
|
{
|
||||||
|
string[] chineseNumbers = { "一", "二", "三"};
|
||||||
|
return Enumerable.Range(0, 3)
|
||||||
|
.Select(i => new Lization
|
||||||
|
{
|
||||||
|
Name = $"{currentYear + i}(现高{chineseNumbers[2 - i]})",
|
||||||
|
|
||||||
|
Code = currentYear + i
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceInitializationDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string? provincename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 政策类型
|
||||||
|
/// </summary>
|
||||||
|
public int? policy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份总分
|
||||||
|
/// </summary>
|
||||||
|
public int? allscore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表基础输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceInitializationBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? provincename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 政策类型
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? policy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份总分
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? allscore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表分页查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceInitializationInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字查询
|
||||||
|
/// </summary>
|
||||||
|
public string? SearchKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string? provincename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 政策类型
|
||||||
|
/// </summary>
|
||||||
|
public int? policy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份总分
|
||||||
|
/// </summary>
|
||||||
|
public int? allscore { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表增加输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class AddBusProvinceInitializationInput : BusProvinceInitializationBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "软删除不能为空")]
|
||||||
|
public override bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表删除输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteBusProvinceInitializationInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateBusProvinceInitializationInput : BusProvinceInitializationBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "主键Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表主键查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class QueryByIdBusProvinceInitializationInput : DeleteBusProvinceInitializationInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 各省份政策初始化表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceInitializationOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Provincename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 政策类型
|
||||||
|
/// </summary>
|
||||||
|
public int? Policy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份总分
|
||||||
|
/// </summary>
|
||||||
|
public int? Allscore { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProvinceInitializationOutputDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份Code
|
||||||
|
/// </summary>
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string? Provincename { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 政策类型
|
||||||
|
/// </summary>
|
||||||
|
public int? Policy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份总分
|
||||||
|
/// </summary>
|
||||||
|
public int? Allscore { get; set; }
|
||||||
|
|
||||||
|
public List<Lization> lizations { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Lization
|
||||||
|
{
|
||||||
|
public string Name { get; set; }// "2025(现高三)",
|
||||||
|
public int Code { get; set; }// 2025
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,231 @@
|
||||||
|
using Admin.NET.Core.Service;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
using Minio.DataModel;
|
||||||
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.ZYGroupName, Order = 100)]
|
||||||
|
public class BusVipCardInfoService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusVipCardInfo> _rep;
|
||||||
|
private readonly SqlSugarRepository<SysDictData> _dictdata;
|
||||||
|
public BusVipCardInfoService(SqlSugarRepository<BusVipCardInfo> rep, SqlSugarRepository<SysDictData> _dictrep)
|
||||||
|
{
|
||||||
|
_rep = rep;
|
||||||
|
_dictdata = _dictrep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询Vip卡生成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusVipCardInfoOutput>> Page(BusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
var query = _rep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
|
||||||
|
u.Code.Contains(input.SearchKey.Trim())
|
||||||
|
|| u.Pwd.Contains(input.SearchKey.Trim())
|
||||||
|
)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code.Trim()))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Pwd), u => u.Pwd.Contains(input.Pwd.Trim()))
|
||||||
|
.WhereIF(input.IsBind > 0, u => u.IsBind == input.IsBind)
|
||||||
|
.WhereIF(input.Day > 0, u => u.Day == input.Day)
|
||||||
|
.WhereIF(input.CardTypeId > 0, u => u.CardTypeId == input.CardTypeId)
|
||||||
|
//处理外键和TreeSelector相关字段的连接
|
||||||
|
.LeftJoin<SysDictData>((u, cardtypeid) => u.CardTypeId == cardtypeid.Id)
|
||||||
|
.OrderBy(u => u.CreateTime)
|
||||||
|
.Select((u, cardtypeid) => new BusVipCardInfoOutput
|
||||||
|
{
|
||||||
|
Id = u.Id,
|
||||||
|
Code = u.Code,
|
||||||
|
Pwd = u.Pwd,
|
||||||
|
IsBind = u.IsBind,
|
||||||
|
Day = u.Day,
|
||||||
|
EndTime = u.EndTime,
|
||||||
|
Money = u.Money,
|
||||||
|
CardTypeId = u.CardTypeId,
|
||||||
|
CardTypeIdName = cardtypeid.Name,
|
||||||
|
TenantId = u.TenantId,
|
||||||
|
CreateTime = u.CreateTime,
|
||||||
|
UpdateTime = u.UpdateTime,
|
||||||
|
CreateUserId = u.CreateUserId,
|
||||||
|
CreateUserName = u.CreateUserName,
|
||||||
|
UpdateUserId = u.UpdateUserId,
|
||||||
|
UpdateUserName = u.UpdateUserName,
|
||||||
|
IsDelete = u.IsDelete,
|
||||||
|
});
|
||||||
|
if (input.EndTimeRange != null && input.EndTimeRange.Count > 0)
|
||||||
|
{
|
||||||
|
DateTime? start = input.EndTimeRange[0];
|
||||||
|
query = query.WhereIF(start.HasValue, u => u.EndTime > start);
|
||||||
|
if (input.EndTimeRange.Count > 1 && input.EndTimeRange[1].HasValue)
|
||||||
|
{
|
||||||
|
var end = input.EndTimeRange[1].Value.AddDays(1);
|
||||||
|
query = query.Where(u => u.EndTime < end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加Vip卡生成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Add")]
|
||||||
|
public async Task<long> Add(AddBusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusVipCardInfo>();
|
||||||
|
await _rep.InsertAsync(entity);
|
||||||
|
return entity.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除Vip卡生成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Delete")]
|
||||||
|
public async Task Delete(DeleteBusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
await _rep.FakeDeleteAsync(entity); //假删除
|
||||||
|
//await _rep.DeleteAsync(entity); //真删除
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新Vip卡生成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "Update")]
|
||||||
|
public async Task Update(UpdateBusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<BusVipCardInfo>();
|
||||||
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取Vip卡生成
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "Detail")]
|
||||||
|
public async Task<BusVipCardInfo> Detail([FromQuery] QueryByIdBusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
return await _rep.GetFirstAsync(u => u.Id == input.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取Vip卡生成列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[ApiDescriptionSettings(Name = "List")]
|
||||||
|
public async Task<List<BusVipCardInfoOutput>> List([FromQuery] BusVipCardInfoInput input)
|
||||||
|
{
|
||||||
|
return await _rep.AsQueryable().Select<BusVipCardInfoOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取卡类型Id列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "SysDictDataCardTypeIdDropdown"), HttpGet]
|
||||||
|
public async Task<dynamic> SysDictDataCardTypeIdDropdown()
|
||||||
|
{
|
||||||
|
return await _rep.Context.Queryable<SysDictData>().Where(e => e.DictTypeId == 656829828702277)
|
||||||
|
.Select(u => new
|
||||||
|
{
|
||||||
|
Label = u.Name,
|
||||||
|
Value = u.Id
|
||||||
|
}
|
||||||
|
).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量生成卡号(只可以生成高三的一年卡)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ApiDescriptionSettings(Name = "GenerateVipCards")]
|
||||||
|
public async Task<dynamic> GenerateVipCards([FromBody] GenrateVipCardRequestDto genrate)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (genrate.Count <= 0 || string.IsNullOrWhiteSpace(genrate.Prefix))
|
||||||
|
{
|
||||||
|
throw Oops.Oh("参数无效");
|
||||||
|
}
|
||||||
|
|
||||||
|
var cardtypeInfo = await _dictdata.AsQueryable().Where(e => e.Id == genrate.CardTypeId).FirstAsync();
|
||||||
|
if (cardtypeInfo == null)
|
||||||
|
throw Oops.Oh("卡类型无效");
|
||||||
|
|
||||||
|
var random = new Random();
|
||||||
|
var generatedCards = new List<BusVipCardInfo>();
|
||||||
|
|
||||||
|
// 1. 查询数据库中已有的卡号,放入 HashSet
|
||||||
|
var existingCodes = new HashSet<string>(await _rep.AsQueryable().Select(c => c.Code)
|
||||||
|
.ToListAsync());
|
||||||
|
// 计算卡号有效期,统一截止至当年8月31日
|
||||||
|
DateTime now = DateTime.UtcNow;
|
||||||
|
DateTime expiryDate = new DateTime(now.Year, 8, 31, 23, 59, 59);
|
||||||
|
if (now > expiryDate) // 如果当前时间已过8月31日,则设置为下一年的8月31日
|
||||||
|
{
|
||||||
|
expiryDate = expiryDate.AddYears(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
while (generatedCards.Count < genrate.Count)
|
||||||
|
{
|
||||||
|
var newCodes = new HashSet<string>();
|
||||||
|
|
||||||
|
// 2. 一次性生成 count * 2 个随机卡号,避免频繁检查
|
||||||
|
while (newCodes.Count < genrate.Count * 2)
|
||||||
|
{
|
||||||
|
string cardNumber = genrate.Prefix + random.Next(100000, 999999); // 6 位随机数
|
||||||
|
if (!existingCodes.Contains(cardNumber)) // 只添加不重复的
|
||||||
|
{
|
||||||
|
newCodes.Add(cardNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 过滤掉已经在数据库中的卡号
|
||||||
|
var uniqueNewCodes = newCodes.Except(existingCodes).Take(genrate.Count - generatedCards.Count).ToList();
|
||||||
|
|
||||||
|
// 4. 生成卡信息
|
||||||
|
generatedCards.AddRange(uniqueNewCodes.Select(cardNumber => new BusVipCardInfo
|
||||||
|
{
|
||||||
|
Code = cardNumber,
|
||||||
|
Pwd = random.Next(100000, 999999).ToString(),
|
||||||
|
IsBind = 0,
|
||||||
|
Day = (expiryDate - now).Days, // 剩余天数
|
||||||
|
EndTime = expiryDate,
|
||||||
|
Money = decimal.Parse(cardtypeInfo.Code),
|
||||||
|
CardTypeId = genrate.CardTypeId,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
// 6. 批量插入数据库
|
||||||
|
await _rep.InsertRangeAsync(generatedCards);
|
||||||
|
|
||||||
|
return generatedCards;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusVipCardInfoDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
public string? CardTypeIdName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡密码
|
||||||
|
/// </summary>
|
||||||
|
public string? Pwd { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否绑定
|
||||||
|
/// </summary>
|
||||||
|
public int IsBind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号有效时间
|
||||||
|
/// </summary>
|
||||||
|
public int Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime EndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额
|
||||||
|
/// </summary>
|
||||||
|
public decimal Money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
public long CardTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户Id
|
||||||
|
/// </summary>
|
||||||
|
public long? TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,223 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成基础输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusVipCardInfoBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡密码
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? Pwd { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否绑定
|
||||||
|
/// </summary>
|
||||||
|
public virtual int IsBind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号有效时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime EndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额
|
||||||
|
/// </summary>
|
||||||
|
public virtual decimal Money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long CardTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public virtual DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GenrateVipCardRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///卡号数量
|
||||||
|
/// </summary>
|
||||||
|
public int Count { get; set; }
|
||||||
|
|
||||||
|
public long CardTypeId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号前缀
|
||||||
|
/// </summary>
|
||||||
|
public string Prefix { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成分页查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusVipCardInfoInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字查询
|
||||||
|
/// </summary>
|
||||||
|
public string? SearchKey { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡密码
|
||||||
|
/// </summary>
|
||||||
|
public string? Pwd { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否绑定
|
||||||
|
/// </summary>
|
||||||
|
public int? IsBind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号有效时间
|
||||||
|
/// </summary>
|
||||||
|
public int? Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? EndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间范围
|
||||||
|
/// </summary>
|
||||||
|
public List<DateTime?> EndTimeRange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 金额
|
||||||
|
/// </summary>
|
||||||
|
public decimal? Money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CardTypeId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成增加输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class AddBusVipCardInfoInput : BusVipCardInfoBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 是否绑定
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "是否绑定不能为空")]
|
||||||
|
public override int IsBind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号有效时间
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "卡号有效时间不能为空")]
|
||||||
|
public override int Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "到期时间不能为空")]
|
||||||
|
public override DateTime EndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "金额不能为空")]
|
||||||
|
public override decimal Money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "卡类型Id不能为空")]
|
||||||
|
public override long CardTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "软删除不能为空")]
|
||||||
|
public override bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成删除输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteBusVipCardInfoInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateBusVipCardInfoInput : BusVipCardInfoBaseInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "主键Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成主键查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class QueryByIdBusVipCardInfoInput : DeleteBusVipCardInfoInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
namespace Admin.NET.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vip卡生成输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusVipCardInfoOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号
|
||||||
|
/// </summary>
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡密码
|
||||||
|
/// </summary>
|
||||||
|
public string? Pwd { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否绑定
|
||||||
|
/// </summary>
|
||||||
|
public int IsBind { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡号有效时间
|
||||||
|
/// </summary>
|
||||||
|
public int Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 到期时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime EndTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额
|
||||||
|
/// </summary>
|
||||||
|
public decimal Money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id
|
||||||
|
/// </summary>
|
||||||
|
public long CardTypeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 卡类型Id 描述
|
||||||
|
/// </summary>
|
||||||
|
public string? CardTypeIdName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户Id
|
||||||
|
/// </summary>
|
||||||
|
public long? TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? CreateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者Id
|
||||||
|
/// </summary>
|
||||||
|
public long? UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改者姓名
|
||||||
|
/// </summary>
|
||||||
|
public string? UpdateUserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 软删除
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDelete { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 班级表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.CPGroupName, Name = "BusClassInfo", Order = 100)]
|
||||||
|
public class BusClassInfoService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusClassInfo> _busClassInfoRep;
|
||||||
|
private readonly SqlSugarRepository<BusGrade> _busGradeRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
public BusClassInfoService(
|
||||||
|
SqlSugarRepository<BusGrade> busGradeRep,
|
||||||
|
SqlSugarRepository<BusClassInfo> busClassInfoRep, UserManager userManager)
|
||||||
|
{
|
||||||
|
_busGradeRep = busGradeRep;
|
||||||
|
_busClassInfoRep = busClassInfoRep;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询班级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusClassInfoOutput>> Page([FromQuery] BusClassInfoInput input)
|
||||||
|
{
|
||||||
|
var busClassInfos = await _busClassInfoRep.AsQueryable()
|
||||||
|
.WhereIF(input.GradeId > 0, u => u.GradeId == input.GradeId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Name), u => u.Name == input.Name)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.NumberCode), u => u.NumberCode == input.NumberCode)
|
||||||
|
//.Where(u => u.Sort == input.Sort)
|
||||||
|
.Where(u => u.TenantId == _userManager.TenantId)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.Select(s => new BusClassInfoOutput()
|
||||||
|
{
|
||||||
|
GradeId = s.GradeId,
|
||||||
|
Name = s.Name,
|
||||||
|
NumberCode = s.NumberCode,
|
||||||
|
Sort = s.Sort,
|
||||||
|
TenantId = s.TenantId.Value,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busClassInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加班级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusClassInfoInput input)
|
||||||
|
{
|
||||||
|
|
||||||
|
var busClassInfo = input.Adapt<BusClassInfo>();
|
||||||
|
busClassInfo.TenantId = _userManager.TenantId;
|
||||||
|
await _busClassInfoRep.InsertAsync(busClassInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除班级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusClassInfoInput input)
|
||||||
|
{
|
||||||
|
var busClassInfo = await _busClassInfoRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busClassInfoRep.FakeDeleteAsync(busClassInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新班级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusClassInfoInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busClassInfoRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busClassInfo = input.Adapt<BusClassInfo>();
|
||||||
|
await _busClassInfoRep.UpdateAsync(busClassInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取班级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusClassInfoOutput> Get([FromQuery] QueryeBusClassInfoInput input)
|
||||||
|
{
|
||||||
|
return (await _busClassInfoRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusClassInfoOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取班级表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusClassInfo>> List([FromQuery] BusClassInfoInput input)
|
||||||
|
{
|
||||||
|
return await _busClassInfoRep.AsQueryable().Select<BusClassInfo>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取BusGrade列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("fkBusGrade")]
|
||||||
|
public async Task<dynamic> FkBusGradeList()
|
||||||
|
{
|
||||||
|
var list = await _busGradeRep.AsQueryable().ToListAsync();
|
||||||
|
return list.Select(e => new { Code = e.Id, Name = e.Name });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 班级表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusClassInfoDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级
|
||||||
|
/// </summary>
|
||||||
|
public string BusGradeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年级
|
||||||
|
/// </summary>
|
||||||
|
public long GradeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级编号
|
||||||
|
/// </summary>
|
||||||
|
public string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 班级表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusClassInfoInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级
|
||||||
|
/// </summary>
|
||||||
|
public virtual long GradeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级编号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long TenantId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusClassInfoInput : BusClassInfoInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusClassInfoInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusClassInfoInput : BusClassInfoInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusClassInfoInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 班级表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusClassInfoOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级
|
||||||
|
/// </summary>
|
||||||
|
public long GradeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级编号
|
||||||
|
/// </summary>
|
||||||
|
public string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用户做题进度服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusCustomMapReport", Order = 100)]
|
||||||
|
|
||||||
|
public class BusCustomMapReportService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusCustomMapReport> _busCustomMapReportRep;
|
||||||
|
|
||||||
|
public BusCustomMapReportService(
|
||||||
|
SqlSugarRepository<BusCustomMapReport> busCustomMapReportRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busCustomMapReportRep = busCustomMapReportRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询用户做题进度
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusCustomMapReportOutput>> Page([FromQuery] BusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
var busCustomMapReports = await _busCustomMapReportRep.AsQueryable()
|
||||||
|
.Where(u => u.CustomId == input.CustomId)
|
||||||
|
.Where(u => u.Status == input.Status)
|
||||||
|
.Where(u => u.Proccess == input.Proccess)
|
||||||
|
.Where(u => u.Sort == input.Sort)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.Select(s => new BusCustomMapReportOutput
|
||||||
|
{
|
||||||
|
CustomId = s.CustomId,
|
||||||
|
Id = s.Id,
|
||||||
|
Proccess = s.Proccess,
|
||||||
|
Sort = s.Sort,
|
||||||
|
Status = s.Status
|
||||||
|
})
|
||||||
|
.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busCustomMapReports;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加用户做题进度
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
var busCustomMapReport = input.Adapt<BusCustomMapReport>();
|
||||||
|
await _busCustomMapReportRep.InsertAsync(busCustomMapReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除用户做题进度
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
var busCustomMapReport = await _busCustomMapReportRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busCustomMapReportRep.FakeDeleteAsync(busCustomMapReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新用户做题进度
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busCustomMapReportRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busCustomMapReport = input.Adapt<BusCustomMapReport>();
|
||||||
|
await _busCustomMapReportRep.UpdateAsync(busCustomMapReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取用户做题进度
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusCustomMapReportOutput> Get([FromQuery] QueryeBusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
return (await _busCustomMapReportRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusCustomMapReportOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取用户做题进度列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusCustomMapReportOutput>> List([FromQuery] BusCustomMapReportInput input)
|
||||||
|
{
|
||||||
|
return await _busCustomMapReportRep.AsQueryable().Select<BusCustomMapReportOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用户做题进度输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMapReportDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CustomId
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 进度Id
|
||||||
|
/// </summary>
|
||||||
|
public int Proccess { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用户做题进度输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMapReportInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CustomId
|
||||||
|
/// </summary>
|
||||||
|
public virtual long CustomId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 进度Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Proccess { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusCustomMapReportInput : BusCustomMapReportInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusCustomMapReportInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusCustomMapReportInput : BusCustomMapReportInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusCustomMapReportInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用户做题进度输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMapReportOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CustomId
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 进度Id
|
||||||
|
/// </summary>
|
||||||
|
public int Proccess { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,148 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 学生菜单服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusCustomMenus", Order = 100)]
|
||||||
|
public class BusCustomMenusService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusCustomMenus> _busCustomMenusRep;
|
||||||
|
private readonly SqlSugarRepository<SysDictData> _sysDictDataRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sysDictDataRep"></param>
|
||||||
|
/// <param name="busCustomMenusRep"></param>
|
||||||
|
/// <param name="userManager"></param>
|
||||||
|
public BusCustomMenusService(
|
||||||
|
SqlSugarRepository<SysDictData> sysDictDataRep,
|
||||||
|
SqlSugarRepository<BusCustomMenus> busCustomMenusRep,
|
||||||
|
UserManager userManager
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_sysDictDataRep = sysDictDataRep;
|
||||||
|
_busCustomMenusRep = busCustomMenusRep;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询学生菜单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusCustomMenusOutput>> Page([FromQuery] BusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
var busCustomMenuss = await _busCustomMenusRep.AsQueryable()
|
||||||
|
.WhereIF(input.RootId > 0, u => u.RootId == input.RootId)
|
||||||
|
.WhereIF(input.UrlType.HasValue, u => u.UrlType == input.UrlType)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.MenuName), u => u.MenuName == input.MenuName)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Icon), u => u.Icon == input.Icon)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Url), u => u.Url == input.Url)
|
||||||
|
// .Where(u => u.Sort == input.Sort)
|
||||||
|
.Where(u => u.TenantId == _userManager.TenantId)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusCustomMenusOutput()
|
||||||
|
{
|
||||||
|
Icon = s.Icon,
|
||||||
|
Id = s.Id,
|
||||||
|
MenuName = s.MenuName,
|
||||||
|
RootId = s.RootId,
|
||||||
|
Sort = s.Sort,
|
||||||
|
Url = s.Url,
|
||||||
|
UrlType = s.UrlType
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busCustomMenuss;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加学生菜单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
var busCustomMenus = input.Adapt<BusCustomMenus>();
|
||||||
|
await _busCustomMenusRep.InsertAsync(busCustomMenus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除学生菜单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
var busCustomMenus = await _busCustomMenusRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busCustomMenusRep.FakeDeleteAsync(busCustomMenus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新学生菜单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busCustomMenusRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busCustomMenus = input.Adapt<BusCustomMenus>();
|
||||||
|
await _busCustomMenusRep.UpdateAsync(busCustomMenus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取学生菜单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusCustomMenusOutput> Get([FromQuery] QueryeBusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
return (await _busCustomMenusRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusCustomMenusOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取学生菜单列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusCustomMenusOutput>> List([FromQuery] BusCustomMenusInput input)
|
||||||
|
{
|
||||||
|
return await _busCustomMenusRep.AsQueryable().Select<BusCustomMenusOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取SysDictData列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("fkSysDictData")]
|
||||||
|
public async Task<dynamic> FkSysDictDataList()
|
||||||
|
{
|
||||||
|
var list = await _sysDictDataRep.AsQueryable().ToListAsync();
|
||||||
|
return list.Select(e => new { Code = e.Id, Name = e.Value });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 学生菜单输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMenusDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 根菜单
|
||||||
|
/// </summary>
|
||||||
|
public string SysDictDataValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根菜单
|
||||||
|
/// </summary>
|
||||||
|
public long RootId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 链接类型
|
||||||
|
/// </summary>
|
||||||
|
public int UrlType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单名称
|
||||||
|
/// </summary>
|
||||||
|
public string MenuName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单icon
|
||||||
|
/// </summary>
|
||||||
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 路由地址
|
||||||
|
/// </summary>
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 学生菜单输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMenusInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 根菜单
|
||||||
|
/// </summary>
|
||||||
|
public virtual long RootId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 链接类型
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? UrlType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string MenuName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单icon
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 路由地址
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long TenantId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusCustomMenusInput : BusCustomMenusInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusCustomMenusInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusCustomMenusInput : BusCustomMenusInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusCustomMenusInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 学生菜单输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomMenusOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 根菜单
|
||||||
|
/// </summary>
|
||||||
|
public long RootId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 链接类型
|
||||||
|
/// </summary>
|
||||||
|
public int UrlType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单名称
|
||||||
|
/// </summary>
|
||||||
|
public string MenuName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单icon
|
||||||
|
/// </summary>
|
||||||
|
public string Icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 路由地址
|
||||||
|
/// </summary>
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见反馈表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusFeedback", Order = 100)]
|
||||||
|
public class BusFeedbackService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusFeedback> _busFeedbackRep;
|
||||||
|
private readonly SqlSugarRepository<BusStudentsFramily> _busStudentsRep;
|
||||||
|
public BusFeedbackService(
|
||||||
|
SqlSugarRepository<BusFeedback> busFeedbackRep, SqlSugarRepository<BusStudentsFramily> busStudentsRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busFeedbackRep = busFeedbackRep;
|
||||||
|
_busStudentsRep = busStudentsRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询意见反馈表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusFeedbackOutput>> Page([FromQuery] BusFeedbackInput input)
|
||||||
|
{
|
||||||
|
var busFeedbacks = await _busFeedbackRep.AsQueryable()
|
||||||
|
.Where(u => u.Type == input.Type)
|
||||||
|
//.Where(u => u.FamilyId == input.FamilyId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Context), u => u.Context == input.Context)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusFeedbackOutput()
|
||||||
|
{
|
||||||
|
Type = s.Type,
|
||||||
|
FamilyId = s.FamilyId,
|
||||||
|
Context = s.Context,
|
||||||
|
Id = s.Id
|
||||||
|
}).ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busFeedbacks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加意见反馈表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusFeedbackInput input)
|
||||||
|
{
|
||||||
|
var framilyInfo = await _busStudentsRep.AsQueryable().FirstAsync(c => c.Uuid == input.UuId);
|
||||||
|
var busFeedback = input.Adapt<BusFeedback>();
|
||||||
|
busFeedback.FamilyId = framilyInfo.Id;
|
||||||
|
await _busFeedbackRep.InsertAsync(busFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除意见反馈表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusFeedbackInput input)
|
||||||
|
{
|
||||||
|
var busFeedback = await _busFeedbackRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busFeedbackRep.FakeDeleteAsync(busFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新意见反馈表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusFeedbackInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busFeedbackRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busFeedback = input.Adapt<BusFeedback>();
|
||||||
|
await _busFeedbackRep.UpdateAsync(busFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取意见反馈表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusFeedbackOutput> Get([FromQuery] QueryeBusFeedbackInput input)
|
||||||
|
{
|
||||||
|
return (await _busFeedbackRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusFeedbackOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取意见反馈表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusFeedbackOutput>> List([FromQuery] BusFeedbackInput input)
|
||||||
|
{
|
||||||
|
return await _busFeedbackRep.AsQueryable().Select<BusFeedbackOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见反馈表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFeedbackDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见类型
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 家长Id
|
||||||
|
/// </summary>
|
||||||
|
public long FamilyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 意见内容
|
||||||
|
/// </summary>
|
||||||
|
public string Context { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见反馈表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFeedbackInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见类型(0 升学路径问题,1 测试结果理解问题,2 系统bug,3 其他问题)
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 家长Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual string UuId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 意见内容
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Context { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusFeedbackInput : BusFeedbackInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusFeedbackInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusFeedbackInput : BusFeedbackInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusFeedbackInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见反馈表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFeedbackOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 意见类型
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 家长Id
|
||||||
|
/// </summary>
|
||||||
|
public long FamilyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 意见内容
|
||||||
|
/// </summary>
|
||||||
|
public string Context { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,238 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Flurl.Http;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭关联学生表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusFramilyMapStudents", Order = 100)]
|
||||||
|
[Route("api/[Controller]")]
|
||||||
|
public class BusFramilyMapStudentsService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusFramilyMapStudents> _busFramilyMapStudentsRep;
|
||||||
|
private readonly SqlSugarRepository<BusStudentsFramily> _studentsfamily;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="busFramilyMapStudentsRep"></param>
|
||||||
|
/// <param name="configuration"></param>
|
||||||
|
/// <param name="studentsfamily"></param>
|
||||||
|
public BusFramilyMapStudentsService(
|
||||||
|
SqlSugarRepository<BusFramilyMapStudents> busFramilyMapStudentsRep, IConfiguration configuration, SqlSugarRepository<BusStudentsFramily> studentsfamily
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busFramilyMapStudentsRep = busFramilyMapStudentsRep;
|
||||||
|
_configuration = configuration;
|
||||||
|
_studentsfamily = studentsfamily;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询家庭关联学生表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusFramilyMapStudentsOutput>> Page([FromQuery] BusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
var busFramilyMapStudentss = await _busFramilyMapStudentsRep.AsQueryable()
|
||||||
|
.Where(u => u.FramilyId == input.FramilyId)
|
||||||
|
.Where(u => u.StudentId == input.StudentId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.BarCode), u => u.BarCode == input.BarCode)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.StudentName), u => u.StudentName == input.StudentName)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.SchoolName), u => u.SchoolName == input.SchoolName)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.GradeName), u => u.GradeName == input.GradeName)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.ClassName), u => u.ClassName == input.ClassName)
|
||||||
|
.Where(u => u.Sort == input.Sort)
|
||||||
|
.Where(u => u.TenantId == input.TenantId)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusFramilyMapStudentsOutput()
|
||||||
|
{
|
||||||
|
BarCode = s.BarCode,
|
||||||
|
StudentName = s.StudentName,
|
||||||
|
SchoolName = s.SchoolName,
|
||||||
|
GradeName = s.GradeName,
|
||||||
|
ClassName = s.ClassName,
|
||||||
|
Gender = s.Gender,
|
||||||
|
Sort = s.Sort,
|
||||||
|
TenantId = s.TenantId.Value,
|
||||||
|
Id = s.Id,
|
||||||
|
IsDefault = s.IsDefault
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busFramilyMapStudentss;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取远端用户信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inputDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<BusSeachStudentResult> SeachStudentInfo([FromQuery] BusSeachStudentInfoInputDto inputDto)
|
||||||
|
{
|
||||||
|
string key = "3c1cbc3f546eda35168c3aa3cb91780fbe703f0996c6d123ea96dc85c70bbc0a8e70006ae6b35eb3962ad057f41a1690";
|
||||||
|
var ulrs = _configuration["WebApi:url"].ToString() + "/UserCenters/GetFramilyMapCenter";
|
||||||
|
var flurlResponse = await ulrs.PostJsonAsync(new BusSeachStudentInfoInputDto { Key = key, CardID = inputDto.CardID, UserName = inputDto.UserName });
|
||||||
|
var result = await flurlResponse.GetJsonAsync<BusSeachStudentInfoOutDto>();
|
||||||
|
if (result.Result == null)
|
||||||
|
{
|
||||||
|
throw Oops.Oh("未查询到该学生信息");
|
||||||
|
}
|
||||||
|
return result.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加家庭关联学生表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
var framilyInfo = await _studentsfamily.AsQueryable().FirstAsync(c => c.Uuid == input.UuId);
|
||||||
|
var busFramilyMapStudents = input.Adapt<BusFramilyMapStudents>();
|
||||||
|
busFramilyMapStudents.IsDefault = true;
|
||||||
|
busFramilyMapStudents.FramilyId = framilyInfo.Id;
|
||||||
|
var anyinfo = await _busFramilyMapStudentsRep.AsQueryable().AnyAsync(c => c.FramilyId == framilyInfo.Id && c.StudentId == input.StudentId);
|
||||||
|
if (!anyinfo)
|
||||||
|
{
|
||||||
|
var oldlist = await _busFramilyMapStudentsRep.AsQueryable().Where(c => c.FramilyId == framilyInfo.Id).ToListAsync();
|
||||||
|
oldlist.ForEach(c =>
|
||||||
|
{
|
||||||
|
c.IsDefault = false;
|
||||||
|
});
|
||||||
|
_busFramilyMapStudentsRep.UpdateRange(oldlist);
|
||||||
|
await _busFramilyMapStudentsRep.InsertAsync(busFramilyMapStudents);
|
||||||
|
framilyInfo.framilyRole = input.FramilyRole;
|
||||||
|
await _studentsfamily.UpdateAsync(framilyInfo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw Oops.Oh("绑定关系已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 切换默认孩子数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("changedefault")]
|
||||||
|
public async Task ChangeDefault(ChangeDefaultChildrenInput input)
|
||||||
|
{
|
||||||
|
var framilyInfo = await _studentsfamily.AsQueryable().FirstAsync(c => c.Uuid == input.UuId);
|
||||||
|
var oldlist = await _busFramilyMapStudentsRep.AsQueryable().Where(c => c.FramilyId == framilyInfo.Id).ToListAsync();
|
||||||
|
oldlist.ForEach(c =>
|
||||||
|
{
|
||||||
|
c.IsDefault = false;
|
||||||
|
});
|
||||||
|
_busFramilyMapStudentsRep.UpdateRange(oldlist);
|
||||||
|
var defaultmodel = await _busFramilyMapStudentsRep.AsQueryable().FirstAsync(c => c.FramilyId == framilyInfo.Id && c.StudentId == input.StudentId);
|
||||||
|
defaultmodel.IsDefault = true;
|
||||||
|
await _busFramilyMapStudentsRep.UpdateAsync(defaultmodel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除家庭关联学生表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
var busFramilyMapStudents = await _busFramilyMapStudentsRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busFramilyMapStudentsRep.FakeDeleteAsync(busFramilyMapStudents);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新家庭关联学生表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busFramilyMapStudentsRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busFramilyMapStudents = input.Adapt<BusFramilyMapStudents>();
|
||||||
|
await _busFramilyMapStudentsRep.UpdateAsync(busFramilyMapStudents);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取家庭关联学生表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusFramilyMapStudentsOutput> Get([FromQuery] QueryeBusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
return (await _busFramilyMapStudentsRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusFramilyMapStudentsOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取家庭关联学生表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusFramilyMapStudentsOutput>> List([FromQuery] BusFramilyMapStudentsInput input)
|
||||||
|
{
|
||||||
|
var framilyInfo = await _studentsfamily.AsQueryable().FirstAsync(c => c.Uuid == input.UuId);
|
||||||
|
var list = await _busFramilyMapStudentsRep.AsQueryable().Where(c => c.FramilyId == framilyInfo.Id).
|
||||||
|
Select(s => new BusFramilyMapStudentsOutput()
|
||||||
|
{
|
||||||
|
FmailyRole = framilyInfo.framilyRole.GetDescription(),
|
||||||
|
StudentId = s.StudentId,
|
||||||
|
BarCode = s.BarCode,
|
||||||
|
StudentName = s.StudentName,
|
||||||
|
SchoolName = s.SchoolName,
|
||||||
|
GradeName = s.GradeName,
|
||||||
|
ClassName = s.ClassName,
|
||||||
|
Gender = s.Gender,
|
||||||
|
Sort = s.Sort,
|
||||||
|
TenantId = s.TenantId.Value,
|
||||||
|
Id = s.Id,
|
||||||
|
IsDefault = s.IsDefault
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
//list.ForEach(c =>
|
||||||
|
//{
|
||||||
|
// c.FmailyRole = EnumUtil.GetDescription(framilyInfo.framilyRole);
|
||||||
|
//});
|
||||||
|
if (list.Count() <= 0)
|
||||||
|
{
|
||||||
|
throw Oops.Oh(ErrorCodeEnum.D1002);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭关联学生表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFramilyMapStudentsDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭Id
|
||||||
|
/// </summary>
|
||||||
|
public long FramilyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid StudentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生学号
|
||||||
|
/// </summary>
|
||||||
|
public string BarCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生姓名
|
||||||
|
/// </summary>
|
||||||
|
public string StudentName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学校名称
|
||||||
|
/// </summary>
|
||||||
|
public string SchoolName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生年级
|
||||||
|
/// </summary>
|
||||||
|
public string GradeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生班级
|
||||||
|
/// </summary>
|
||||||
|
public string ClassName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭关联学生表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFramilyMapStudentsInput : BasePageInput
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// OpenId
|
||||||
|
/// </summary>
|
||||||
|
public string UuId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long FramilyId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 家长身份
|
||||||
|
/// </summary>
|
||||||
|
public virtual FramilyRoleEnum FramilyRole { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual Guid StudentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生学号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string BarCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生姓名
|
||||||
|
/// </summary>
|
||||||
|
public virtual string StudentName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学校名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string SchoolName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生年级
|
||||||
|
/// </summary>
|
||||||
|
public virtual string GradeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生班级
|
||||||
|
/// </summary>
|
||||||
|
public virtual string ClassName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性别
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Gender { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long TenantId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusFramilyMapStudentsInput : BusFramilyMapStudentsInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusFramilyMapStudentsInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusFramilyMapStudentsInput : BusFramilyMapStudentsInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusFramilyMapStudentsInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ChangeDefaultChildrenInput
|
||||||
|
{
|
||||||
|
public string UuId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生Id
|
||||||
|
/// </summary>
|
||||||
|
public virtual Guid StudentId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭关联学生表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusFramilyMapStudentsOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 家庭Id
|
||||||
|
/// </summary>
|
||||||
|
public long FramilyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string FmailyRole { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 学生Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid StudentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生学号
|
||||||
|
/// </summary>
|
||||||
|
public string BarCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生姓名
|
||||||
|
/// </summary>
|
||||||
|
public string StudentName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学校名称
|
||||||
|
/// </summary>
|
||||||
|
public string SchoolName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生年级
|
||||||
|
/// </summary>
|
||||||
|
public string GradeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生班级
|
||||||
|
/// </summary>
|
||||||
|
public string ClassName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性别
|
||||||
|
/// </summary>
|
||||||
|
public string Gender { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否默认
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDefault { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusSeachStudentInfoInputDto
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 约定Key(前端无需传值)
|
||||||
|
/// </summary>
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学生姓名
|
||||||
|
/// </summary>
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身份证号(学号)
|
||||||
|
/// </summary>
|
||||||
|
public string CardID { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public class BusSeachStudentInfoOutDto
|
||||||
|
{
|
||||||
|
public string Code { get; set; }
|
||||||
|
public string Msg { get; set; }
|
||||||
|
public BusSeachStudentResult Result { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BusSeachStudentResult
|
||||||
|
{
|
||||||
|
public string StudentId { get; set; }
|
||||||
|
public string StudentName { get; set; }
|
||||||
|
public string StudentCode { get; set; }
|
||||||
|
public string GradeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Gender { get; set; }
|
||||||
|
public string ClassName { get; set; }
|
||||||
|
public string SchoolName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusGrade", Order = 100)]
|
||||||
|
public class BusGradeService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusGrade> _busGradeRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
public BusGradeService(
|
||||||
|
SqlSugarRepository<BusGrade> busGradeRep,
|
||||||
|
UserManager userManager
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busGradeRep = busGradeRep;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询年级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusGradeOutput>> Page([FromQuery] BusGradeInput input)
|
||||||
|
{
|
||||||
|
var busGrades = await _busGradeRep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Name), u => u.Name == input.Name)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.NumberCode), u => u.NumberCode == input.NumberCode)
|
||||||
|
.Where(u => u.TenantId == _userManager.TenantId)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusGradeOutput()
|
||||||
|
{
|
||||||
|
Name = s.Name,
|
||||||
|
NumberCode = s.NumberCode,
|
||||||
|
Sort = s.Sort,
|
||||||
|
TenantId = s.TenantId.Value,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busGrades;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加年级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusGradeInput input)
|
||||||
|
{
|
||||||
|
var busGrade = input.Adapt<BusGrade>();
|
||||||
|
await _busGradeRep.InsertAsync(busGrade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除年级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusGradeInput input)
|
||||||
|
{
|
||||||
|
var busGrade = await _busGradeRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busGradeRep.FakeDeleteAsync(busGrade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新年级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusGradeInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busGradeRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busGrade = input.Adapt<BusGrade>();
|
||||||
|
await _busGradeRep.UpdateAsync(busGrade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取年级表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusGradeOutput> Get([FromQuery] QueryeBusGradeInput input)
|
||||||
|
{
|
||||||
|
return (await _busGradeRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusGradeOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取年级表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusGradeOutput>> List([FromQuery] BusGradeInput input)
|
||||||
|
{
|
||||||
|
return await _busGradeRep.AsQueryable().Select<BusGradeOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusGradeDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年级编号
|
||||||
|
/// </summary>
|
||||||
|
public string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusGradeInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年级编号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public virtual long TenantId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusGradeInput : BusGradeInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusGradeInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusGradeInput : BusGradeInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusGradeInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusGradeOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年级名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 年级编号
|
||||||
|
/// </summary>
|
||||||
|
public string NumberCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户id
|
||||||
|
/// </summary>
|
||||||
|
public long TenantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业大类服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusMajorType", Order = 100)]
|
||||||
|
public class BusMajorTypeService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusMajorType> _busMajorTypeRep;
|
||||||
|
|
||||||
|
public BusMajorTypeService(
|
||||||
|
SqlSugarRepository<BusMajorType> busMajorTypeRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busMajorTypeRep = busMajorTypeRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询专业大类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusMajorTypeOutput>> Page([FromQuery] BusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
var busMajorTypes = await _busMajorTypeRep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Code), u => u.Code == input.Code)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Name), u => u.Name == input.Name)
|
||||||
|
.Where(u => u.Type == input.Type)
|
||||||
|
//.Where(u => u.Sort == input.Sort)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusMajorTypeOutput()
|
||||||
|
{
|
||||||
|
Code = s.Code,
|
||||||
|
Name = s.Name,
|
||||||
|
Type = s.Type,
|
||||||
|
Sort = s.Sort,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busMajorTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加专业大类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
var busMajorType = input.Adapt<BusMajorType>();
|
||||||
|
await _busMajorTypeRep.InsertAsync(busMajorType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除专业大类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
var busMajorType = await _busMajorTypeRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busMajorTypeRep.FakeDeleteAsync(busMajorType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新专业大类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busMajorTypeRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busMajorType = input.Adapt<BusMajorType>();
|
||||||
|
await _busMajorTypeRep.UpdateAsync(busMajorType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取专业大类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusMajorTypeOutput> Get([FromQuery] QueryeBusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
return (await _busMajorTypeRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusMajorTypeOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取专业大类列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusMajorTypeOutput>> List([FromQuery] BusMajorTypeInput input)
|
||||||
|
{
|
||||||
|
return await _busMajorTypeRep.AsQueryable().Select<BusMajorTypeOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业大类输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMajorTypeDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业编号
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业大类输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMajorTypeInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业编号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusMajorTypeInput : BusMajorTypeInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusMajorTypeInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusMajorTypeInput : BusMajorTypeInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusMajorTypeInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业大类输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMajorTypeOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 专业编号
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单关联量表服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusMenuMapScale", Order = 100)]
|
||||||
|
public class BusMenuMapScaleService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusMenuMapScale> _busMenuMapScaleRep;
|
||||||
|
|
||||||
|
public BusMenuMapScaleService(
|
||||||
|
SqlSugarRepository<BusMenuMapScale> busMenuMapScaleRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busMenuMapScaleRep = busMenuMapScaleRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询菜单关联量表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusMenuMapScaleOutput>> Page([FromQuery] BusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
var busMenuMapScales = await _busMenuMapScaleRep.AsQueryable()
|
||||||
|
.Where(u => u.MenuId == input.MenuId)
|
||||||
|
.Where(u => u.ScaleId == input.ScaleId)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusMenuMapScaleOutput()
|
||||||
|
{
|
||||||
|
MenuId = s.MenuId,
|
||||||
|
ScaleId = s.ScaleId,
|
||||||
|
Id = s.Id
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busMenuMapScales;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加菜单关联量表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
var busMenuMapScale = input.Adapt<BusMenuMapScale>();
|
||||||
|
await _busMenuMapScaleRep.InsertAsync(busMenuMapScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除菜单关联量表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
var busMenuMapScale = await _busMenuMapScaleRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busMenuMapScaleRep.FakeDeleteAsync(busMenuMapScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新菜单关联量表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busMenuMapScaleRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busMenuMapScale = input.Adapt<BusMenuMapScale>();
|
||||||
|
await _busMenuMapScaleRep.UpdateAsync(busMenuMapScale);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取菜单关联量表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusMenuMapScaleOutput> Get([FromQuery] QueryeBusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
return (await _busMenuMapScaleRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusMenuMapScaleOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取菜单关联量表列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusMenuMapScaleOutput>> List([FromQuery] BusMenuMapScaleInput input)
|
||||||
|
{
|
||||||
|
return await _busMenuMapScaleRep.AsQueryable().Select<BusMenuMapScaleOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单关联量表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMenuMapScaleDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long MenuId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单关联量表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMenuMapScaleInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public virtual long MenuId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public virtual long ScaleId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusMenuMapScaleInput : BusMenuMapScaleInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusMenuMapScaleInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusMenuMapScaleInput : BusMenuMapScaleInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusMenuMapScaleInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单关联量表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusMenuMapScaleOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long MenuId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份管理服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusProvince", Order = 100)]
|
||||||
|
public class BusProvinceService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusProvince> _busProvinceRep;
|
||||||
|
|
||||||
|
public BusProvinceService(
|
||||||
|
SqlSugarRepository<BusProvince> busProvinceRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busProvinceRep = busProvinceRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询省份管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusProvinceOutput>> Page([FromQuery] BusProvinceInput input)
|
||||||
|
{
|
||||||
|
var busProvinces = await _busProvinceRep.AsQueryable()
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Code), u => u.Code == input.Code)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Name), u => u.Name == input.Name)
|
||||||
|
//.Where(u => u.Sort == input.Sort)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusProvinceOutput()
|
||||||
|
{
|
||||||
|
Code = s.Code,
|
||||||
|
Name = s.Name,
|
||||||
|
Sort = s.Sort,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busProvinces;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加省份管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusProvinceInput input)
|
||||||
|
{
|
||||||
|
var busProvince = input.Adapt<BusProvince>();
|
||||||
|
await _busProvinceRep.InsertAsync(busProvince);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除省份管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusProvinceInput input)
|
||||||
|
{
|
||||||
|
var busProvince = await _busProvinceRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busProvinceRep.FakeDeleteAsync(busProvince);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新省份管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusProvinceInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busProvinceRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busProvince = input.Adapt<BusProvince>();
|
||||||
|
await _busProvinceRep.UpdateAsync(busProvince);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取省份管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusProvinceOutput> Get([FromQuery] QueryeBusProvinceInput input)
|
||||||
|
{
|
||||||
|
return (await _busProvinceRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusProvinceOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取省份管理列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusProvinceOutput>> List([FromQuery] BusProvinceInput input)
|
||||||
|
{
|
||||||
|
return await _busProvinceRep.AsQueryable().Select<BusProvinceOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份管理输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份编号
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份管理输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份编号
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusProvinceInput : BusProvinceInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusProvinceInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusProvinceInput : BusProvinceInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusProvinceInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份管理输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusProvinceOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 省份编号
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 省份名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusByMenuInput
|
||||||
|
{
|
||||||
|
public long MenuId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,245 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusComprehensiveReportRequestDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 报告关联Id
|
||||||
|
/// </summary>
|
||||||
|
public long ReportId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 综合报告
|
||||||
|
/// </summary>
|
||||||
|
public class BusComprehensiveReportDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public HollandDimension hollandDimension { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public MBTIDimension bTIDimension { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public AbilityDimension abilityDimension { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public OpinionAboutValue opinionAbout { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class HollandDimension
|
||||||
|
{
|
||||||
|
public string HTag { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public PicChart picCharts { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<ReportItem> reportItems { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class MBTIDimension
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public LinChart linChart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public ReportItem reportItem { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class AbilityDimension
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<LinChart> linChart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<ReportItem> reportItems { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class OpinionAboutValue
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
//public string TestTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public PicChart picCharts { get; set; }
|
||||||
|
|
||||||
|
public string Tag { get; set; }
|
||||||
|
public List<ReportItem> reportItems { get; set; }
|
||||||
|
|
||||||
|
public List<OpinionItem> opinionItems { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class LinChart
|
||||||
|
{
|
||||||
|
public List<string> Name { get; set; }
|
||||||
|
|
||||||
|
public List<double> Value { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Indicat
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public int Max { get; set; }
|
||||||
|
}
|
||||||
|
public class PicChart
|
||||||
|
{
|
||||||
|
public List<Indicat> indicator { get; set; }
|
||||||
|
public List<int> radars { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ReportItem
|
||||||
|
{
|
||||||
|
public int Score { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 标签
|
||||||
|
/// </summary>
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签名称
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签解析
|
||||||
|
/// </summary>
|
||||||
|
public string Resolving { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性格特质
|
||||||
|
/// </summary>
|
||||||
|
public string Traits { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主要特征
|
||||||
|
/// </summary>
|
||||||
|
public string Features { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string MainDomain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 职业
|
||||||
|
/// </summary>
|
||||||
|
public string Occupation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业
|
||||||
|
/// </summary>
|
||||||
|
public string Major { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 院校
|
||||||
|
/// </summary>
|
||||||
|
public string University { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class OpinionItem
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public int Value { get; set; }
|
||||||
|
|
||||||
|
public int Max { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomReportsList
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<CustomReports> customReports { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomReportRequestDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
public class CustomReports
|
||||||
|
{
|
||||||
|
public long ReportsId { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public int Type { get; set; }
|
||||||
|
public string RoleName { get; set; }
|
||||||
|
|
||||||
|
public DateTimeOffset CreateTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomScaleExplainRequestDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long CustomScaleId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusCustomScaleExplainDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string CustomName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset TestTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Result { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public string Total { get; set; }
|
||||||
|
|
||||||
|
public string TagName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Suggestions { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusReportMapIdsRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ReportId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusReportsRequestDto
|
||||||
|
{
|
||||||
|
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusReportMapIdsDto
|
||||||
|
{
|
||||||
|
|
||||||
|
public int Proccess { get; set; }
|
||||||
|
public long HId { get; set; }
|
||||||
|
public long MId { get; set; }
|
||||||
|
public long NId { get; set; }
|
||||||
|
|
||||||
|
public long JId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ReportAIPrompt
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 报告ID
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
public class BusScaleDescriptionRequestDTO
|
||||||
|
{
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleDescriptionResponseDto
|
||||||
|
{
|
||||||
|
public List<BusScaleDescriptionDto> busScaleDescriptions { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单选多选
|
||||||
|
/// </summary>
|
||||||
|
public int QuestionsType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表简介
|
||||||
|
/// </summary>
|
||||||
|
public string Summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表海报
|
||||||
|
/// </summary>
|
||||||
|
public string Pic { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型表输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型名称
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单选多选
|
||||||
|
/// </summary>
|
||||||
|
public virtual int? QuestionsType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表简介
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Summary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表海报
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Pic { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusScaleInput : BusScaleInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusScaleInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusScaleInput : BusScaleInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusScaleInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型表输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单选多选
|
||||||
|
/// </summary>
|
||||||
|
public int QuestionsType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表简介
|
||||||
|
/// </summary>
|
||||||
|
public string Summary { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表海报
|
||||||
|
/// </summary>
|
||||||
|
public string Pic { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表小图
|
||||||
|
/// </summary>
|
||||||
|
public string MinImg { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否免费
|
||||||
|
/// </summary>
|
||||||
|
public bool IsFree { get; set; } = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleRequestDTO
|
||||||
|
{
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class Remark
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Answers
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
|
public string value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleStudyBroadResponseDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string TitleName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<BusScaleStudyBroadDTO> busScaleStudies { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleStudyBroadDTO
|
||||||
|
{
|
||||||
|
public int type { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public List<Answers> answer { get; set; }
|
||||||
|
public Remark remark { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 试题
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleResponseDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表类型名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单选多选
|
||||||
|
/// </summary>
|
||||||
|
public int QuestionsType { get; set; }
|
||||||
|
|
||||||
|
public int Go { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 试题列表
|
||||||
|
/// </summary>
|
||||||
|
public List<ScaleQuestions> scaleQuestions { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ScaleQuestions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string type { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int score { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<Answer> answer { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class Answer
|
||||||
|
{
|
||||||
|
public string key { get; set; } = "";
|
||||||
|
public string tag { get; set; } = "";
|
||||||
|
public string name { get; set; }
|
||||||
|
|
||||||
|
public string value { get; set; }
|
||||||
|
|
||||||
|
public int score { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 量表数据保存要求
|
||||||
|
/// </summary>
|
||||||
|
public class CustomBusScaleRequestDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<ScalListItem> Inputs { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ScalTotals
|
||||||
|
{
|
||||||
|
public int Total { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ScalListItem
|
||||||
|
{
|
||||||
|
public string type { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public int value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BusScaleResult
|
||||||
|
{
|
||||||
|
public string Result { get; set; }
|
||||||
|
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
public List<ScalListItem> scalLists { get; set; }
|
||||||
|
}
|
||||||
|
public class CustomBusScaleDto
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ReportId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset TestTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
public class CustomBusScaleV2Dto
|
||||||
|
{
|
||||||
|
public long ReportId { get; set; }
|
||||||
|
public int Type{get;set;}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class xxfgItem
|
||||||
|
{
|
||||||
|
public string type { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string desc { get; set; }
|
||||||
|
public int value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class xxfgTagbject
|
||||||
|
{
|
||||||
|
public List<Tag> tags { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Tag
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public List<string> features { get; set; }
|
||||||
|
public List<string> learning_performance { get; set; }
|
||||||
|
public string notes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CustomMapProccessRequestDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long CustomId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CustomMapProccessDTO
|
||||||
|
{
|
||||||
|
public List<MapProccessDTO> mapProccesses { get; set; }
|
||||||
|
|
||||||
|
public string ScaleId { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class MapProccessDTO
|
||||||
|
{
|
||||||
|
public int Sort { get; set; }
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public string UsesTime { get; set; }
|
||||||
|
public string Introduce { get; set; }
|
||||||
|
|
||||||
|
public string Application { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string Notice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Status { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 学习风格
|
||||||
|
/// </summary>
|
||||||
|
public class StudyStyleResponseDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset TestTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public PicChart picCharts { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<ReportItem> reportItems { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<StudyStyleTables> studyStyles { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public StudyStyleResult studyStyleResult { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StudyStyleTables
|
||||||
|
{
|
||||||
|
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int Score { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class StudyStyleResult
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 优点
|
||||||
|
/// </summary>
|
||||||
|
public string Advantage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 追求
|
||||||
|
/// </summary>
|
||||||
|
public string Seek { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最爱问
|
||||||
|
/// </summary>
|
||||||
|
public string FavoriteQuestions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 适合的职业
|
||||||
|
/// </summary>
|
||||||
|
public string SuitableOccupation { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class StudyStyleRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,157 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表描述服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusScaleDescription", Order = 100)]
|
||||||
|
[Route("api/[Controller]")]
|
||||||
|
public class BusScaleDescriptionService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusScaleDescription> _busScaleDescriptionRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
public BusScaleDescriptionService(
|
||||||
|
SqlSugarRepository<BusScaleDescription> busScaleDescriptionRep,
|
||||||
|
UserManager userManager
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busScaleDescriptionRep = busScaleDescriptionRep;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询量表描述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusScaleDescriptionOutput>> Page([FromQuery] BusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
var busScaleDescriptions = await _busScaleDescriptionRep.AsQueryable()
|
||||||
|
.Where(u => u.ScaleId == input.ScaleId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Introduce), u => u.Introduce == input.Introduce)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Application), u => u.Application == input.Application)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Notice), u => u.Notice == input.Notice)
|
||||||
|
.Where(u => u.Sort == input.Sort)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusScaleDescriptionOutput()
|
||||||
|
{
|
||||||
|
Introduce = s.Introduce,
|
||||||
|
Application = s.Application,
|
||||||
|
Notice = s.Notice,
|
||||||
|
Sort = s.Sort,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busScaleDescriptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加量表描述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
var busScaleDescription = input.Adapt<BusScaleDescription>();
|
||||||
|
await _busScaleDescriptionRep.InsertAsync(busScaleDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除量表描述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
var busScaleDescription = await _busScaleDescriptionRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busScaleDescriptionRep.FakeDeleteAsync(busScaleDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新量表描述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busScaleDescriptionRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busScaleDescription = input.Adapt<BusScaleDescription>();
|
||||||
|
await _busScaleDescriptionRep.UpdateAsync(busScaleDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取量表描述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusScaleDescriptionOutput> Get([FromQuery] QueryeBusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
return (await _busScaleDescriptionRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusScaleDescriptionOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取量表描述列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusScaleDescriptionOutput>> List([FromQuery] BusScaleDescriptionInput input)
|
||||||
|
{
|
||||||
|
return await _busScaleDescriptionRep.AsQueryable().Select<BusScaleDescriptionOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据导入
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("import")]
|
||||||
|
public async Task Imports(IFormFile file)
|
||||||
|
{
|
||||||
|
var scaledescription = new List<BusScaleDescription>();
|
||||||
|
var list = InputExcelUtil<ImportScaleDescriptionDTO>.InputExcel(file);
|
||||||
|
for (int i = 0; i < list.Count(); i++)
|
||||||
|
{
|
||||||
|
var input = list[i];
|
||||||
|
scaledescription.Add(new BusScaleDescription()
|
||||||
|
{
|
||||||
|
Application = input.Application,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
CreateUserId = _userManager.UserId,
|
||||||
|
CreateUserName = _userManager.Account,
|
||||||
|
Introduce = input.Introduce,
|
||||||
|
Notice = input.Notice,
|
||||||
|
UsesTime = input.UserTime,
|
||||||
|
ScaleId = input.ScaleId,
|
||||||
|
Sort = input.Sort,
|
||||||
|
IsDelete = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await _busScaleDescriptionRep.InsertRangeAsync(scaledescription);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表描述输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleDescriptionDto
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public string UsesTime { get; set; }
|
||||||
|
|
||||||
|
public string Title { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// ScaleId
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 介绍
|
||||||
|
/// </summary>
|
||||||
|
public string Introduce { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用
|
||||||
|
/// </summary>
|
||||||
|
public string Application { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 须知
|
||||||
|
/// </summary>
|
||||||
|
public string Notice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表描述输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleDescriptionInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ScaleId
|
||||||
|
/// </summary>
|
||||||
|
public virtual long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 介绍
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Introduce { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Application { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 须知
|
||||||
|
/// </summary>
|
||||||
|
public virtual string Notice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public virtual int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AddBusScaleDescriptionInput : BusScaleDescriptionInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteBusScaleDescriptionInput : BaseIdInput
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateBusScaleDescriptionInput : BusScaleDescriptionInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "Id主键不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QueryeBusScaleDescriptionInput : BaseIdInput
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表描述输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleDescriptionOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ScaleId
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 介绍
|
||||||
|
/// </summary>
|
||||||
|
public string Introduce { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用
|
||||||
|
/// </summary>
|
||||||
|
public string Application { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 须知
|
||||||
|
/// </summary>
|
||||||
|
public string Notice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ImportScaleDescriptionDTO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ScaleId
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 介绍
|
||||||
|
/// </summary>
|
||||||
|
public string Introduce { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用
|
||||||
|
/// </summary>
|
||||||
|
public string Application { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 须知
|
||||||
|
/// </summary>
|
||||||
|
public string Notice { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string UserTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using Furion.DatabaseAccessor;
|
||||||
|
using Furion.DependencyInjection;
|
||||||
|
using Furion.DynamicApiController;
|
||||||
|
using Furion.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表结果解释服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings("测评服务", Name = "BusScaleExplain", Order = 100)]
|
||||||
|
public class BusScaleExplainService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<BusScaleExplain> _busScaleExplainRep;
|
||||||
|
private readonly UserManager _userManager;
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="busScaleExplainRep"></param>
|
||||||
|
public BusScaleExplainService(
|
||||||
|
SqlSugarRepository<BusScaleExplain> busScaleExplainRep,
|
||||||
|
UserManager userManager
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_busScaleExplainRep = busScaleExplainRep;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询量表结果解释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<SqlSugarPagedList<BusScaleExplainOutput>> Page([FromQuery] BusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
var busScaleExplains = await _busScaleExplainRep.AsQueryable()
|
||||||
|
.Where(u => u.ScaleId == input.ScaleId)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Tag), u => u.Tag == input.Tag)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title == input.Title)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Description), u => u.Description == input.Description)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Resolving), u => u.Resolving == input.Resolving)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Traits), u => u.Traits == input.Traits)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Features), u => u.Features == input.Features)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Occupation), u => u.Occupation == input.Occupation)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.Major), u => u.Major == input.Major)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(input.University), u => u.University == input.University)
|
||||||
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderBuilder(input)
|
||||||
|
.Select(s => new BusScaleExplainOutput
|
||||||
|
{
|
||||||
|
Tag = s.Tag,
|
||||||
|
Title = s.Title,
|
||||||
|
Description = s.Description,
|
||||||
|
Resolving = s.Resolving,
|
||||||
|
Traits = s.Traits,
|
||||||
|
Features = s.Features,
|
||||||
|
Occupation = s.Occupation,
|
||||||
|
Major = s.Major,
|
||||||
|
University = s.University,
|
||||||
|
Id = s.Id
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
|
||||||
|
return busScaleExplains;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加量表结果解释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("add")]
|
||||||
|
public async Task Add(AddBusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
var busScaleExplain = input.Adapt<BusScaleExplain>();
|
||||||
|
await _busScaleExplainRep.InsertAsync(busScaleExplain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除量表结果解释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("delete")]
|
||||||
|
public async Task Delete(DeleteBusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
var busScaleExplain = await _busScaleExplainRep.AsQueryable().FirstAsync(u => u.Id == input.Id);
|
||||||
|
await _busScaleExplainRep.FakeDeleteAsync(busScaleExplain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新量表结果解释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("edit")]
|
||||||
|
public async Task Update(UpdateBusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
var isExist = await _busScaleExplainRep.AsQueryable().AnyAsync(u => u.Id == input.Id);
|
||||||
|
if (!isExist) throw Oops.Oh(ErrorCodeEnum.D3000);
|
||||||
|
|
||||||
|
var busScaleExplain = input.Adapt<BusScaleExplain>();
|
||||||
|
await _busScaleExplainRep.UpdateAsync(busScaleExplain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取量表结果解释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<BusScaleExplainOutput> Get([FromQuery] QueryeBusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
return (await _busScaleExplainRep.AsQueryable().FirstAsync(u => u.Id == input.Id)).Adapt<BusScaleExplainOutput>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取量表结果解释列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<List<BusScaleExplainOutput>> List([FromQuery] BusScaleExplainInput input)
|
||||||
|
{
|
||||||
|
return await _busScaleExplainRep.AsQueryable()
|
||||||
|
.Select<BusScaleExplainOutput>().ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("import")]
|
||||||
|
public async Task Imports(IFormFile file)
|
||||||
|
{
|
||||||
|
var list = InputExcelUtil<ScaleExplainImportDTO>.InputExcel(file);
|
||||||
|
var scalelist = new List<BusScaleExplain>();
|
||||||
|
for (int i = 0; i < list.Count(); i++)
|
||||||
|
{
|
||||||
|
var item = list[i];
|
||||||
|
scalelist.Add(new BusScaleExplain()
|
||||||
|
{
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
CreateUserName = _userManager.Account,
|
||||||
|
CreateUserId = _userManager.UserId,
|
||||||
|
Description = item.Description,
|
||||||
|
Features = item.Features,
|
||||||
|
MainDomain = item.MainDomain,
|
||||||
|
Major = item.Major,
|
||||||
|
Occupation = item.Occupation,
|
||||||
|
Resolving = item.Resolving,
|
||||||
|
ScaleId = item.ScaleId,
|
||||||
|
Tag = item.Tag,
|
||||||
|
Title = item.Title,
|
||||||
|
Traits = item.Traits,
|
||||||
|
University = item.University,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await _busScaleExplainRep.InsertRangeAsync(scalelist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Admin.NET.Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 量表结果解释输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class BusScaleExplainDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 标签ScaleId
|
||||||
|
/// </summary>
|
||||||
|
public long ScaleId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签
|
||||||
|
/// </summary>
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签名称
|
||||||
|
/// </summary>
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标签解析
|
||||||
|
/// </summary>
|
||||||
|
public string Resolving { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 性格特质
|
||||||
|
/// </summary>
|
||||||
|
public string Traits { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主要特征
|
||||||
|
/// </summary>
|
||||||
|
public string Features { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string MainDomain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 职业
|
||||||
|
/// </summary>
|
||||||
|
public string Occupation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业
|
||||||
|
/// </summary>
|
||||||
|
public string Major { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 院校
|
||||||
|
/// </summary>
|
||||||
|
public string University { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id主键
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue