Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
1fb74544
Commit
1fb74544
authored
Sep 09, 2024
by
wyc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
简单查询
parent
23a71138
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1301 additions
and
13 deletions
+1301
-13
performance/Performance.Api/Controllers/AccountController.cs
+15
-8
performance/Performance.Api/Controllers/LowProcController.cs
+182
-0
performance/Performance.Api/Program.cs
+5
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+57
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+223
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+82
-0
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+1
-0
performance/Performance.DtoModels/DynamicQuery.cs
+19
-0
performance/Performance.DtoModels/Enum.cs
+7
-0
performance/Performance.DtoModels/Request/LowProcRequest.cs
+9
-0
performance/Performance.DtoModels/Request/PagedQueryRequest.cs
+17
-0
performance/Performance.DtoModels/Response/ColumnResponse.cs
+97
-0
performance/Performance.DtoModels/Response/DashboardResponse.cs
+58
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+1
-0
performance/Performance.EntityModels/Entity/low_proc.cs
+92
-0
performance/Performance.Infrastructure/Extensions/Extensions.Linq.cs
+9
-0
performance/Performance.Infrastructure/Models/FileName.cs
+54
-0
performance/Performance.Infrastructure/Tools/ToolExport.cs
+0
-0
performance/Performance.Infrastructure/Tools/ToolPath.cs
+73
-0
performance/Performance.Infrastructure/Tools/Tools.cs
+48
-0
performance/Performance.Repository/BaseRepository.cs
+7
-3
performance/Performance.Repository/Repository/PerforLowProcRepository.cs
+14
-0
performance/Performance.Services/LowProcService.cs
+229
-0
performance/Performance.Services/Performance.Services.csproj
+2
-0
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
1fb74544
...
@@ -8,11 +8,13 @@
...
@@ -8,11 +8,13 @@
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services
;
namespace
Performance.Api.Controllers
namespace
Performance.Api.Controllers
...
@@ -20,19 +22,20 @@ namespace Performance.Api.Controllers
...
@@ -20,19 +22,20 @@ namespace Performance.Api.Controllers
[
Route
(
"api/[controller]"
)]
[
Route
(
"api/[controller]"
)]
public
class
AccountController
:
Controller
public
class
AccountController
:
Controller
{
{
private
UserService
_userService
;
private
readonly
UserService
_userService
;
private
RoleService
_roleService
;
private
readonly
RoleService
_roleService
;
private
IMemoryCache
_memoryCache
;
private
readonly
IMemoryCache
_memoryCache
;
private
Application
_options
;
private
readonly
Application
_options
;
private
ClaimService
_claim
;
private
readonly
ClaimService
_claim
;
private
HospitalService
_hospitalService
;
private
readonly
HospitalService
_hospitalService
;
private
readonly
ILogger
<
AppController
>
_logger
;
public
AccountController
(
UserService
userService
,
public
AccountController
(
UserService
userService
,
HospitalService
hospitalService
,
HospitalService
hospitalService
,
RoleService
roleService
,
RoleService
roleService
,
IMemoryCache
memoryCache
,
IMemoryCache
memoryCache
,
IOptions
<
Application
>
options
,
IOptions
<
Application
>
options
,
ClaimService
claim
)
ClaimService
claim
,
ILogger
<
AppController
>
logger
)
{
{
_userService
=
userService
;
_userService
=
userService
;
_roleService
=
roleService
;
_roleService
=
roleService
;
...
@@ -40,6 +43,7 @@ public class AccountController : Controller
...
@@ -40,6 +43,7 @@ public class AccountController : Controller
_hospitalService
=
hospitalService
;
_hospitalService
=
hospitalService
;
_options
=
options
.
Value
;
_options
=
options
.
Value
;
_claim
=
claim
;
_claim
=
claim
;
_logger
=
logger
;
}
}
/// <summary>
/// <summary>
...
@@ -189,6 +193,8 @@ public ApiResponse SelfInfo()
...
@@ -189,6 +193,8 @@ public ApiResponse SelfInfo()
int
[]
roleArray
=
UnitTypeUtil
.
Maps
.
Keys
.
ToArray
();
int
[]
roleArray
=
UnitTypeUtil
.
Maps
.
Keys
.
ToArray
();
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
().
Type
??
0
)
:
false
;
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
().
Type
??
0
)
:
false
;
_logger
.
LogInformation
(
$"查询个人信息二次分配角色映射表【
{
JsonHelper
.
Serialize
(
roleArray
)}
】"
);
_logger
.
LogInformation
(
$"查询个人信息分配角色【
{
JsonHelper
.
Serialize
(
user
.
Role
)}
】"
);
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
}
}
...
@@ -352,7 +358,8 @@ public ApiResponse SelfInfos([FromBody] UserRequest request)
...
@@ -352,7 +358,8 @@ public ApiResponse SelfInfos([FromBody] UserRequest request)
{
{
user
.
IsInitialPassword
=
(
int
)
InitialPassword
.
修改
;
user
.
IsInitialPassword
=
(
int
)
InitialPassword
.
修改
;
}
}
_logger
.
LogInformation
(
$"查询用户信息二次分配角色映射表【
{
JsonHelper
.
Serialize
(
roleArray
)}
】"
);
_logger
.
LogInformation
(
$"查询用户信息分配角色【
{
JsonHelper
.
Serialize
(
user
.
Role
)}
】"
);
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
}
}
...
...
performance/Performance.Api/Controllers/LowProcController.cs
0 → 100644
View file @
1fb74544
using
MassTransit.Internals.Extensions
;
using
Masuit.Tools
;
using
Masuit.Tools.Models
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.StaticFiles
;
using
Microsoft.Extensions.Logging
;
using
Newtonsoft.Json
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.IO
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
ExcelColumn
=
Performance
.
Infrastructure
.
ExcelColumn
;
namespace
Performance.Api.Controllers
{
/// <summary>
/// 可配置数据查询
/// </summary>
[
Route
(
"api/[controller]"
)]
[
ApiController
]
public
class
LowProcController
:
Controller
{
private
readonly
LowProcService
_services
;
private
readonly
ClaimService
_claim
;
private
readonly
UserService
_userService
;
private
readonly
RoleService
_roleService
;
private
readonly
ILogger
<
AppController
>
_logger
;
/// ctor
public
LowProcController
(
LowProcService
services
,
ClaimService
claim
,
UserService
userService
,
RoleService
roleService
,
ILogger
<
AppController
>
logger
)
{
_services
=
services
;
_claim
=
claim
;
_userService
=
userService
;
_roleService
=
roleService
;
_logger
=
logger
;
}
/// <summary>
/// 扩展查询
/// </summary>
/// <param name="title">扩展查询名</param>
/// <param name="paged"></param>
/// <returns></returns>
[
HttpGet
(
"list"
)]
[
ProducesResponseType
(
typeof
(
PagedList
<
low_proc
>),
StatusCodes
.
Status200OK
)]
public
ApiResponse
<
object
>
GetListAsync
([
FromQuery
]
string
?
title
,
[
FromQuery
]
PagedQueryRequest
?
paged
)
{
var
proc
=
_services
.
GetListAsync
(
title
,
paged
?.
Page
??
1
,
paged
?.
Size
??
20
);
return
new
ApiResponse
<
object
>(
ResponseType
.
OK
,
proc
);
}
/// <summary>
/// 新增扩展查询记录
/// </summary>
/// <param name="procDto"></param>
/// <returns></returns>
[
HttpPost
(
"add"
)]
public
async
Task
<
ApiResponse
>
AddAsync
([
FromBody
]
LowProcRequest
procDto
)
{
var
userid
=
_claim
.
GetUserId
();
await
_services
.
AddAsync
(
procDto
,
userid
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"添加成功"
);
}
/// <summary>
/// 修改扩展查询记录
/// </summary>
/// <param name="procId"></param>
/// <param name="procDto"></param>
/// <returns></returns>
[
HttpPost
(
"update"
)]
public
async
Task
<
ApiResponse
>
UpdateAsync
([
FromQuery
,
Required
]
long
procId
,
[
FromBody
]
LowProcRequest
procDto
)
{
var
userid
=
_claim
.
GetUserId
();
await
_services
.
UpdateAsync
(
procId
,
userid
,
procDto
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"修改成功"
);
}
/// <summary>
/// 删除扩展查询记录
/// </summary>
/// <param name="procIds"></param>
/// <returns></returns>
[
HttpPost
(
"delete"
)]
public
ApiResponse
DeleteAsync
([
FromBody
]
long
[]
procIds
)
{
_services
.
DeleteAsync
(
procIds
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"删除成功"
);
}
/// <summary>
/// 扩展数据查询
/// </summary>
/// <param name="procId"></param>
/// <param name="allotId"></param>
/// <param name="paged"></param>
/// <param name="filters"></param>
/// <returns></returns>
[
HttpPost
(
template
:
"query/datum"
)]
[
ResponseCache
(
VaryByHeader
=
"User-Agent"
,
Duration
=
10
)]
[
ProducesResponseType
(
typeof
(
List
<
DashboardResponse
>),
StatusCodes
.
Status200OK
)]
public
async
Task
<
ApiResponse
<
object
>>
GetDatumAsync
([
FromQuery
,
Required
]
long
procId
,
[
FromQuery
]
string
?
allotId
,
[
FromQuery
]
PagedQueryRequest
?
paged
,
[
FromBody
]
List
<
DynamicQuery
>
filters
)
{
var
filteredQueries
=
filters
.
Where
(
q
=>
!
string
.
IsNullOrEmpty
(
q
.
Value
)).
ToList
();
long
allotIdValue
=
long
.
TryParse
(
allotId
,
out
var
result
)
?
result
:
0
;
var
args
=
Args
(
allotIdValue
,
paged
?.
Page
??
1
,
paged
?.
Size
??
20
);
var
res
=
await
_services
.
GetDatumAsync
(
procId
,
filteredQueries
,
paged
?.
Page
??
1
,
paged
?.
Size
??
20
,
args
);
foreach
(
var
item
in
res
.
Columns
)
{
item
.
Field
=
item
.
Field
.
ToLower
();
}
return
new
ApiResponse
<
object
>(
ResponseType
.
OK
,
res
);
}
private
Dictionary
<
string
,
object
>
Args
(
long
allotId
,
int
page
,
int
size
)
{
var
userid
=
_claim
.
GetUserId
();
var
userClaim
=
_claim
.
GetUserClaim
();
var
user
=
_userService
.
GetUser
(
userid
);
user
.
Role
=
_roleService
.
GetUserRole
(
user
.
UserID
);
var
unitTypes
=
new
List
<
string
>();
if
(
user
.
Role
.
Any
()
&&
user
.
Role
.
First
().
Type
.
HasValue
&&
UnitTypeUtil
.
Maps
.
ContainsKey
(
user
.
Role
.
First
().
Type
.
Value
))
unitTypes
=
UnitTypeUtil
.
Maps
[
user
.
Role
.
First
().
Type
.
Value
].
ToList
();
var
unitType
=
string
.
Join
(
","
,
unitTypes
);
var
args
=
userClaim
.
ToDictionary
(
c
=>
c
.
Type
,
c
=>
(
object
)
c
.
Value
);
args
.
AddOrUpdate
(
"unittype"
,
unitType
,
unitType
);
args
.
AddOrUpdate
(
"allotid"
,
allotId
,
allotId
);
args
.
AddOrUpdate
(
"userid"
,
userid
,
userid
);
args
.
AddOrUpdate
(
"rolename"
,
user
.
Role
.
First
().
RoleName
,
user
.
Role
.
First
().
RoleName
);
var
userInfo
=
JsonConvert
.
SerializeObject
(
args
,
Tools
.
GetJsonSerializerSettings
())
??
"{}"
;
args
.
AddOrUpdate
(
"userinfo"
,
userInfo
,
userInfo
);
args
.
AddOrUpdate
(
"page"
,
page
,
page
);
args
.
AddOrUpdate
(
"size"
,
size
,
size
);
return
args
;
}
/// <summary>
/// 扩展数据查询导出
/// </summary>
/// <param name="procId"></param>
/// <param name="allotId"></param>
/// <param name="filters"></param>
/// <returns></returns>
[
HttpPost
(
template
:
"query/datum/export"
)]
public
async
Task
<
IActionResult
>
GetDatumExportAsync
([
FromQuery
,
Required
]
long
procId
,
[
FromQuery
]
string
?
allotId
,
[
FromBody
]
List
<
DynamicQuery
>
filters
)
{
var
filteredQueries
=
filters
.
Where
(
q
=>
!
string
.
IsNullOrEmpty
(
q
.
Value
)).
ToList
();
long
allotIdValue
=
long
.
TryParse
(
allotId
,
out
var
result
)
?
result
:
0
;
var
lowProc
=
await
_services
.
GetAsync
(
procId
)
??
throw
new
PerformanceException
(
"查询配置信息不存在"
);
var
args
=
Args
(
allotIdValue
,
1
,
int
.
MaxValue
);
var
res
=
await
_services
.
GetDatumAsync
(
procId
,
filteredQueries
,
1
,
int
.
MaxValue
,
args
);
var
filePath
=
Path
.
Combine
(
Tools
.
Path
.
Download
,
$"
{
lowProc
.
Title
}
.
{
Guid
.
NewGuid
():
N
}
.xlsx"
);
var
rows
=
Tools
.
MapDictionary
(
res
.
Data
);
var
columns
=
res
.
Columns
?.
Select
(
w
=>
new
ExcelColumn
(
w
.
Title
,
w
.
Field
)).
ToList
()
??
new
List
<
ExcelColumn
>();
Tools
.
Export
(
filePath
,
new
ExcelExportOption
()
{
Name
=
lowProc
.
Title
,
Rows
=
rows
,
Columns
=
columns
,
Aggregate
=
true
});
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filePath
,
FileMode
.
Open
))
{
await
stream
.
CopyToAsync
(
memoryStream
);
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
".xlsx"
];
var
fileInfo
=
new
FileInfo
(
filePath
);
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
}
}
performance/Performance.Api/Program.cs
View file @
1fb74544
using
System
;
using
Microsoft.AspNetCore
;
using
Microsoft.AspNetCore
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
NLog.Web
;
using
NLog.Web
;
using
System
;
using
Yitter.IdGenerator
;
namespace
Performance.Api
namespace
Performance.Api
{
{
...
@@ -11,6 +12,8 @@ public class Program
...
@@ -11,6 +12,8 @@ public class Program
{
{
public
static
void
Main
(
string
[]
args
)
public
static
void
Main
(
string
[]
args
)
{
{
var
options
=
new
IdGeneratorOptions
(
1
);
YitIdHelper
.
SetIdGenerator
(
options
);
var
logger
=
NLogBuilder
.
ConfigureNLog
(
"nlog.config"
).
GetCurrentClassLogger
();
var
logger
=
NLogBuilder
.
ConfigureNLog
(
"nlog.config"
).
GetCurrentClassLogger
();
FunctionLimit
.
Init
(
logger
);
FunctionLimit
.
Init
(
logger
);
try
try
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
1fb74544
...
@@ -2263,6 +2263,63 @@
...
@@ -2263,6 +2263,63 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"T:Performance.Api.Controllers.LowProcController"
>
<summary>
可配置数据查询
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.#ctor(Performance.Services.LowProcService,Performance.Api.ClaimService,Performance.Services.UserService,Performance.Services.RoleService,Microsoft.Extensions.Logging.ILogger{Performance.Api.Controllers.AppController})"
>
ctor
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.GetListAsync(System.String,Performance.DtoModels.PagedQueryRequest)"
>
<summary>
扩展查询
</summary>
<param
name=
"title"
>
扩展查询名
</param>
<param
name=
"paged"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.AddAsync(Performance.DtoModels.LowProcRequest)"
>
<summary>
新增扩展查询记录
</summary>
<param
name=
"procDto"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.UpdateAsync(System.Int64,Performance.DtoModels.LowProcRequest)"
>
<summary>
修改扩展查询记录
</summary>
<param
name=
"procId"
></param>
<param
name=
"procDto"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.DeleteAsync(System.Int64[])"
>
<summary>
删除扩展查询记录
</summary>
<param
name=
"procIds"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.GetDatumAsync(System.Int64,System.Nullable{System.Int64},Performance.DtoModels.PagedQueryRequest,System.Collections.Generic.List{Performance.DtoModels.DynamicQuery})"
>
<summary>
扩展数据查询
</summary>
<param
name=
"procId"
></param>
<param
name=
"allotId"
></param>
<param
name=
"paged"
></param>
<param
name=
"filters"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.GetDatumExportAsync(System.Int64,System.String,System.Collections.Generic.List{Performance.DtoModels.DynamicQuery})"
>
<summary>
扩展数据查询导出
</summary>
<param
name=
"procId"
></param>
<param
name=
"allotId"
></param>
<param
name=
"filters"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.MenuController.MenuList"
>
<member
name=
"M:Performance.Api.Controllers.MenuController.MenuList"
>
<summary>
<summary>
用户登录后菜单列表
用户登录后菜单列表
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
1fb74544
...
@@ -111,6 +111,21 @@
...
@@ -111,6 +111,21 @@
<param
name=
"input"
></param>
<param
name=
"input"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"T:Performance.DtoModels.DynamicQuery"
>
<summary>
动态查询
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DynamicQuery.Field"
>
<summary>
字段名
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DynamicQuery.Value"
>
<summary>
文本
</summary>
</member>
<member
name=
"T:Performance.DtoModels.SmsCodeType"
>
<member
name=
"T:Performance.DtoModels.SmsCodeType"
>
<summary>
验证码类型
</summary>
<summary>
验证码类型
</summary>
</member>
</member>
...
@@ -2752,6 +2767,35 @@
...
@@ -2752,6 +2767,35 @@
登录类型 1 手机号登录 2 账号登录
登录类型 1 手机号登录 2 账号登录
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.DtoModels.LowProcRequest"
>
<param
name=
"Title"
>
存储过程名称
</param>
<param
name=
"Script"
>
SQL
</param>
<param
name=
"Remark"
>
备注
</param>
<param
name=
"AllotLimit"
>
绩效ID限制
</param>
<param
name=
"DataPermissionLimit"
>
数据权限限制 0 不限制 1 限制
</param>
</member>
<member
name=
"M:Performance.DtoModels.LowProcRequest.#ctor(System.String,System.String,System.String,System.Boolean,System.Boolean)"
>
<param
name=
"Title"
>
存储过程名称
</param>
<param
name=
"Script"
>
SQL
</param>
<param
name=
"Remark"
>
备注
</param>
<param
name=
"AllotLimit"
>
绩效ID限制
</param>
<param
name=
"DataPermissionLimit"
>
数据权限限制 0 不限制 1 限制
</param>
</member>
<member
name=
"P:Performance.DtoModels.LowProcRequest.Title"
>
<summary>
存储过程名称
</summary>
</member>
<member
name=
"P:Performance.DtoModels.LowProcRequest.Script"
>
<summary>
SQL
</summary>
</member>
<member
name=
"P:Performance.DtoModels.LowProcRequest.Remark"
>
<summary>
备注
</summary>
</member>
<member
name=
"P:Performance.DtoModels.LowProcRequest.AllotLimit"
>
<summary>
绩效ID限制
</summary>
</member>
<member
name=
"P:Performance.DtoModels.LowProcRequest.DataPermissionLimit"
>
<summary>
数据权限限制 0 不限制 1 限制
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ModItemRequest.ModuleId"
>
<member
name=
"P:Performance.DtoModels.ModItemRequest.ModuleId"
>
<summary>
<summary>
...
@@ -2810,6 +2854,21 @@
...
@@ -2810,6 +2854,21 @@
<member
name=
"P:Performance.DtoModels.SpecialListRequest.Items"
>
<member
name=
"P:Performance.DtoModels.SpecialListRequest.Items"
>
<summary>
特殊考核项
</summary>
<summary>
特殊考核项
</summary>
</member>
</member>
<member
name=
"T:Performance.DtoModels.PagedQueryRequest"
>
<summary>
分页查询参数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PagedQueryRequest.Page"
>
<summary>
页码
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PagedQueryRequest.Size"
>
<summary>
行数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PasswordRequest.OldPwd"
>
<member
name=
"P:Performance.DtoModels.PasswordRequest.OldPwd"
>
<summary>
<summary>
原始密码
原始密码
...
@@ -4277,6 +4336,117 @@
...
@@ -4277,6 +4336,117 @@
医院总收支结余
医院总收支结余
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.DtoModels.ColumnResponse"
>
<inheritdoc/>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.ColId"
>
<inheritdoc/>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.ParentId"
>
<summary>
父菜单ID
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Key"
>
<summary>
识别关键字(菜单KEY)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.OrigName"
>
<summary>
系统名称
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Field"
>
<summary>
字段名
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Title"
>
<summary>
标题
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Width"
>
<summary>
宽度
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Resizable"
>
<summary>
拖动列宽(1 允许 0 禁止)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Visible"
>
<summary>
显示(1 显示 0 隐藏)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Filter"
>
<summary>
筛选(1 筛选 0 禁止)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Fixed"
>
<summary>
列固定(left:固定左侧 right:固定右侧)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Align"
>
<summary>
列对齐(left:左对齐 center:居中对齐 right:右对齐)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Formatter"
>
<summary>
格式化
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Sort"
>
<summary>
列排序
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Sortable"
>
<summary>
列排序(1 允许 0 禁止)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.BackColor"
>
<summary>
背景色
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.EnumName"
>
<summary>
数据枚举
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Attach"
>
<summary>
附加信息(无固定用途,慎重使用)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.AttachParams"
>
<summary>
附加信息(无固定用途,慎重使用)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.AttachStatus"
>
<summary>
附加信息(无固定用途,慎重使用)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.AttachOptions"
>
<summary>
附加信息(无固定用途,慎重使用)
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ColumnResponse.Children"
>
<summary>
子集
</summary>
</member>
<member
name=
"P:Performance.DtoModels.ComputeResponse.Source"
>
<member
name=
"P:Performance.DtoModels.ComputeResponse.Source"
>
<summary>
<summary>
来源
来源
...
@@ -4422,6 +4592,59 @@
...
@@ -4422,6 +4592,59 @@
0 未审核 1 部分审核 2 全部审核
0 未审核 1 部分审核 2 全部审核
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.DtoModels.DashboardResponse"
>
大屏对象
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Id"
>
<summary>
Id
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.MenuKey"
>
<summary>
菜单KEY
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Title"
>
<summary>
标题
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Name"
>
<summary>
数据来源
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Width"
>
<summary>
宽度
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Height"
>
<summary>
高度
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Options"
>
<summary>
自定义设置
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Remark"
>
<summary>
备注
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Sort"
>
<summary>
图表位置
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DashboardResponse.Data"
>
<summary>
数据
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DeptDataDetails`1.Pandect"
>
<member
name=
"P:Performance.DtoModels.DeptDataDetails`1.Pandect"
>
<summary>
概览
</summary>
<summary>
概览
</summary>
</member>
</member>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
1fb74544
...
@@ -5758,6 +5758,88 @@
...
@@ -5758,6 +5758,88 @@
1、绩效生成日志 2、绩效提取日志 3、绩效提取进度
1、绩效生成日志 2、绩效提取日志 3、绩效提取进度
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.EntityModels.low_proc"
>
<summary>
配置表 -- 表名
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.ProcId"
>
<summary>
Desc:
Default:
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.Title"
>
<summary>
Desc:标题
Default:
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.Script"
>
<summary>
Desc:执行脚本
Default:
Nullable:True
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.Describe"
>
<summary>
Desc:描述
Default:
Nullable:True
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.Remark"
>
<summary>
Desc:备注
Default:
Nullable:True
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.CreateBy"
>
<summary>
Desc:创建人
Default:0
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.CreateTime"
>
<summary>
Desc:创建时间
Default:CURRENT_TIMESTAMP
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.UpdateBy"
>
<summary>
Desc:最后修改人
Default:0
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.UpdateTime"
>
<summary>
Desc:修改时间
Default:CURRENT_TIMESTAMP
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.RowVersion"
>
<summary>
Desc:数据版本号
Default:0
Nullable:False
</summary>
</member>
<member
name=
"P:Performance.EntityModels.low_proc.Deleted"
>
<summary>
Desc:删除标记(1 删除 0 未删)
Default:true
Nullable:False
</summary>
</member>
<member
name=
"T:Performance.EntityModels.mod_dic"
>
<member
name=
"T:Performance.EntityModels.mod_dic"
>
<summary>
<summary>
部分公共数据抽取SQL
部分公共数据抽取SQL
...
...
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
1fb74544
...
@@ -296,6 +296,7 @@ public AutoMapperConfigs()
...
@@ -296,6 +296,7 @@ public AutoMapperConfigs()
CreateMap
<
AttendanceData
,
per_attendance
>().
ReverseMap
();
CreateMap
<
AttendanceData
,
per_attendance
>().
ReverseMap
();
CreateMap
<
AttendanceVacationData
,
per_attendance_vacation
>().
ReverseMap
();
CreateMap
<
AttendanceVacationData
,
per_attendance_vacation
>().
ReverseMap
();
CreateMap
<
LowProcRequest
,
low_proc
>().
ReverseMap
();
}
}
}
}
}
}
performance/Performance.DtoModels/DynamicQuery.cs
0 → 100644
View file @
1fb74544
namespace
Performance.DtoModels
{
/// <summary>
/// 动态查询
/// </summary>
public
class
DynamicQuery
{
/// <summary>
/// 字段名
/// </summary>
public
string
Field
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 文本
/// </summary>
public
string
Value
{
get
;
set
;
}
=
string
.
Empty
;
}
}
\ No newline at end of file
performance/Performance.DtoModels/Enum.cs
View file @
1fb74544
...
@@ -303,5 +303,12 @@ public enum CustomTableLimitation
...
@@ -303,5 +303,12 @@ public enum CustomTableLimitation
无限制
=
1
,
无限制
=
1
,
}
}
[
Description
(
description
:
"格式类型"
)]
public
enum
Formatter
{
text
,
numeric
,
tag
,
}
}
}
}
}
performance/Performance.DtoModels/Request/LowProcRequest.cs
0 → 100644
View file @
1fb74544
namespace
Performance.DtoModels
{
/// <param name="Title">存储过程名称</param>
/// <param name="Script">SQL</param>
/// <param name="Remark">备注</param>
/// <param name="AllotLimit">绩效ID限制</param>
/// <param name="DataPermissionLimit">数据权限限制 0 不限制 1 限制</param>
public
record
LowProcRequest
(
string
Title
,
string
Script
,
string
?
Remark
,
bool
AllotLimit
,
bool
DataPermissionLimit
);
}
performance/Performance.DtoModels/Request/PagedQueryRequest.cs
0 → 100644
View file @
1fb74544
namespace
Performance.DtoModels
{
/// <summary>
/// 分页查询参数
/// </summary>
public
class
PagedQueryRequest
{
/// <summary>
/// 页码
/// </summary>
public
int
?
Page
{
get
;
set
;
}
=
1
;
/// <summary>
/// 行数
/// </summary>
public
int
?
Size
{
get
;
set
;
}
=
20
;
}
}
performance/Performance.DtoModels/Response/ColumnResponse.cs
0 → 100644
View file @
1fb74544
using
System
;
using
System.Collections.Generic
;
namespace
Performance.DtoModels
{
/// <inheritdoc/>
public
class
ColumnResponse
:
IChildren
<
ColumnResponse
>
{
/// <inheritdoc/>
public
long
ColId
{
get
;
set
;
}
/// <summary>
/// 父菜单ID
/// </summary>
public
long
ParentId
{
get
;
set
;
}
/// <summary>
/// 识别关键字(菜单KEY)
/// </summary>
public
string
Key
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 系统名称
/// </summary>
public
string
OrigName
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 字段名
/// </summary>
public
string
Field
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 标题
/// </summary>
public
string
Title
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 宽度
/// </summary>
public
double
?
Width
{
get
;
set
;
}
/// <summary>
/// 拖动列宽(1 允许 0 禁止)
/// </summary>
public
bool
?
Resizable
{
get
;
set
;
}
/// <summary>
/// 显示(1 显示 0 隐藏)
/// </summary>
public
bool
?
Visible
{
get
;
set
;
}
/// <summary>
/// 筛选(1 筛选 0 禁止)
/// </summary>
public
bool
?
Filter
{
get
;
set
;
}
/// <summary>
/// 列固定(left:固定左侧 right:固定右侧)
/// </summary>
public
string
?
Fixed
{
get
;
set
;
}
/// <summary>
/// 列对齐(left:左对齐 center:居中对齐 right:右对齐)
/// </summary>
public
string
?
Align
{
get
;
set
;
}
/// <summary>
/// 格式化
/// </summary>
public
string
?
Formatter
{
get
;
set
;
}
/// <summary>
/// 列排序
/// </summary>
public
int
?
Sort
{
get
;
set
;
}
/// <summary>
/// 列排序(1 允许 0 禁止)
/// </summary>
public
bool
?
Sortable
{
get
;
set
;
}
/// <summary>
/// 背景色
/// </summary>
public
string
?
BackColor
{
get
;
set
;
}
/// <summary>
/// 数据枚举
/// </summary>
public
string
?
EnumName
{
get
;
set
;
}
/// <summary>
/// 附加信息(无固定用途,慎重使用)
/// </summary>
public
string
?
Attach
{
get
;
set
;
}
/// <summary>
/// 附加信息(无固定用途,慎重使用)
/// </summary>
public
string
?
AttachParams
{
get
;
set
;
}
/// <summary>
/// 附加信息(无固定用途,慎重使用)
/// </summary>
public
string
AttachStatus
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// 附加信息(无固定用途,慎重使用)
/// </summary>
public
object
?
AttachOptions
{
get
;
set
;
}
/// <summary>
/// 子集
/// </summary>
public
IEnumerable
<
ColumnResponse
>
Children
{
get
;
set
;
}
=
new
HashSet
<
ColumnResponse
>();
}
}
\ No newline at end of file
performance/Performance.DtoModels/Response/DashboardResponse.cs
0 → 100644
View file @
1fb74544
using
System
;
namespace
Performance.DtoModels
{
/// 大屏对象
public
class
DashboardResponse
{
/// <summary>
/// Id
/// </summary>
public
long
Id
{
get
;
set
;
}
/// <summary>
/// 菜单KEY
/// </summary>
public
string
MenuKey
{
get
;
set
;
}
/// <summary>
/// 标题
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 数据来源
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 宽度
/// </summary>
public
string
Width
{
get
;
set
;
}
/// <summary>
/// 高度
/// </summary>
public
string
Height
{
get
;
set
;
}
/// <summary>
/// 自定义设置
/// </summary>
public
string
Options
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 图表位置
/// </summary>
public
int
Sort
{
get
;
set
;
}
/// <summary>
/// 数据
/// </summary>
public
object
Data
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
1fb74544
...
@@ -284,6 +284,7 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
...
@@ -284,6 +284,7 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
per_assess_scheme_items
>
per_assess_scheme_items
{
get
;
set
;
}
public
virtual
DbSet
<
per_assess_scheme_items
>
per_assess_scheme_items
{
get
;
set
;
}
/// <summary>被考核对象</summary>
/// <summary>被考核对象</summary>
public
virtual
DbSet
<
per_assess_scheme_target
>
per_assess_scheme_target
{
get
;
set
;
}
public
virtual
DbSet
<
per_assess_scheme_target
>
per_assess_scheme_target
{
get
;
set
;
}
public
virtual
DbSet
<
low_proc
>
low_proc
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 在这个方法中,你可以配置实体类型之间的关系、数据库表的映射以及其他一些高级配置。
/// 在这个方法中,你可以配置实体类型之间的关系、数据库表的映射以及其他一些高级配置。
/// 这是 Entity Framework Core 中的一个重要方法,在派生自 DbContext 的类中重写它以定义数据模型
/// 这是 Entity Framework Core 中的一个重要方法,在派生自 DbContext 的类中重写它以定义数据模型
...
...
performance/Performance.EntityModels/Entity/low_proc.cs
0 → 100644
View file @
1fb74544
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
/// 配置表 -- 表名
/// </summary>
[
Table
(
"low_proc"
)]
public
class
low_proc
{
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
[
Key
]
public
long
ProcId
{
get
;
set
;
}
/// <summary>
/// Desc:标题
/// Default:
/// Nullable:False
/// </summary>
public
string
Title
{
get
;
set
;
}
=
null
!;
/// <summary>
/// Desc:执行脚本
/// Default:
/// Nullable:True
/// </summary>
public
string
?
Script
{
get
;
set
;
}
/// <summary>
/// Desc:描述
/// Default:
/// Nullable:True
/// </summary>
public
string
?
Describe
{
get
;
set
;
}
/// <summary>
/// Desc:备注
/// Default:
/// Nullable:True
/// </summary>
public
string
?
Remark
{
get
;
set
;
}
/// <summary>
/// Desc:创建人
/// Default:0
/// Nullable:False
/// </summary>
public
long
CreateBy
{
get
;
set
;
}
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:False
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// Desc:最后修改人
/// Default:0
/// Nullable:False
/// </summary>
public
long
UpdateBy
{
get
;
set
;
}
/// <summary>
/// Desc:修改时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:False
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// Desc:数据版本号
/// Default:0
/// Nullable:False
/// </summary>
public
long
RowVersion
{
get
;
set
;
}
/// <summary>
/// Desc:删除标记(1 删除 0 未删)
/// Default:true
/// Nullable:False
/// </summary>
public
bool
Deleted
{
get
;
set
;
}
}
}
performance/Performance.Infrastructure/Extensions/Extensions.Linq.cs
View file @
1fb74544
...
@@ -8,7 +8,16 @@ public static partial class UtilExtensions
...
@@ -8,7 +8,16 @@ public static partial class UtilExtensions
{
{
return
first
.
AndAlso
<
T
>(
second
,
Expression
.
AndAlso
);
return
first
.
AndAlso
<
T
>(
second
,
Expression
.
AndAlso
);
}
}
public
static
Expression
<
Func
<
T
,
bool
>>
AndIf
<
T
>(
this
Expression
<
Func
<
T
,
bool
>>
source
,
bool
condition
,
Expression
<
Func
<
T
,
bool
>>
predicate
)
{
if
(
condition
)
{
var
invokedExpr
=
Expression
.
Invoke
(
predicate
,
source
.
Parameters
);
return
Expression
.
Lambda
<
Func
<
T
,
bool
>>(
Expression
.
AndAlso
(
source
.
Body
,
invokedExpr
),
source
.
Parameters
);
}
return
source
;
}
public
static
Expression
<
Func
<
T
,
bool
>>
Or
<
T
>(
this
Expression
<
Func
<
T
,
bool
>>
first
,
Expression
<
Func
<
T
,
bool
>>
second
)
public
static
Expression
<
Func
<
T
,
bool
>>
Or
<
T
>(
this
Expression
<
Func
<
T
,
bool
>>
first
,
Expression
<
Func
<
T
,
bool
>>
second
)
{
{
return
first
.
AndAlso
<
T
>(
second
,
Expression
.
OrElse
);
return
first
.
AndAlso
<
T
>(
second
,
Expression
.
OrElse
);
...
...
performance/Performance.Infrastructure/Models/FileName.cs
0 → 100644
View file @
1fb74544
using
Masuit.Tools.Models
;
using
System.Collections.Generic
;
namespace
Performance.Infrastructure.Models
{
/// <summary>
/// 分页
/// </summary>
/// <typeparam name="TColumn"></typeparam>
/// <typeparam name="TData"></typeparam>
public
class
PagedList
<
TData
,
TColumn
>
:
PagedList
<
TData
>
where
TColumn
:
class
{
/// <summary>
/// 列头
/// </summary>
public
ICollection
<
TColumn
>?
Columns
{
get
;
set
;
}
/// <inheritdoc/>
public
PagedList
(
PagedList
<
TData
>
paged
,
List
<
TColumn
>?
columns
=
null
)
:
this
(
paged
.
Data
,
paged
.
CurrentPage
,
paged
.
PageSize
,
paged
.
TotalCount
,
columns
)
{
}
/// <inheritdoc/>
public
PagedList
(
List
<
TData
>
items
,
int
page
,
int
size
,
int
count
,
List
<
TColumn
>?
columns
=
null
)
:
base
(
items
,
page
,
size
,
count
)
{
Columns
=
columns
;
}
}
/// <summary>
/// 分页
/// </summary>
/// <typeparam name="TColumn"></typeparam>
/// <typeparam name="TData"></typeparam>
/// <typeparam name="TTotal"></typeparam>
public
class
PagedList
<
TData
,
TColumn
,
TTotal
>
:
PagedList
<
TData
,
TColumn
>
where
TColumn
:
class
{
/// <summary>
/// 汇总
/// </summary>
public
ICollection
<
TTotal
>?
Totals
{
get
;
set
;
}
/// <inheritdoc/>
public
PagedList
(
PagedList
<
TData
>
paged
,
List
<
TColumn
>?
columns
=
null
,
List
<
TTotal
>?
total
=
null
)
:
this
(
paged
.
Data
,
paged
.
CurrentPage
,
paged
.
PageSize
,
paged
.
TotalCount
,
columns
,
total
)
{
}
/// <inheritdoc/>
public
PagedList
(
List
<
TData
>
items
,
int
page
,
int
size
,
int
count
,
List
<
TColumn
>?
columns
=
null
,
List
<
TTotal
>?
total
=
null
)
:
base
(
items
,
page
,
size
,
count
,
columns
)
{
Totals
=
total
;
}
}
}
performance/Performance.Infrastructure/Tools/ToolExport.cs
0 → 100644
View file @
1fb74544
This diff is collapsed.
Click to expand it.
performance/Performance.Infrastructure/Tools/ToolPath.cs
0 → 100644
View file @
1fb74544
using
System
;
using
System.IO
;
namespace
Performance.Infrastructure
{
/// <summary>
/// 系统路径
/// </summary>
public
class
SystemPath
{
/// ctor
public
SystemPath
()
{
var
paths
=
new
string
[]
{
Temp
,
Download
,
Upload
,
Db
,
Backup
};
foreach
(
var
item
in
paths
)
{
if
(!
Directory
.
Exists
(
item
))
Directory
.
CreateDirectory
(
item
);
}
}
/// <summary>
/// 软件产出文件
/// </summary>
public
static
string
_files
{
get
;
}
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"files"
);
/// <summary>
/// 临时文件存放路径
/// </summary>
public
string
BaseFile
=>
_files
;
/// <summary>
/// 临时文件存放路径
/// </summary>
public
string
Temp
{
get
;
}
=
Path
.
Combine
(
_files
,
"temp-files"
);
/// <summary>
/// 下载文件存放
/// </summary>
public
string
Download
{
get
;
}
=
Path
.
Combine
(
_files
,
"download"
);
/// <summary>
/// 上传文件存放
/// </summary>
public
string
Upload
{
get
;
}
=
Path
.
Combine
(
_files
,
"upload"
);
/// <summary>
/// db
/// </summary>
public
string
Db
{
get
;
}
=
Path
.
Combine
(
_files
,
"db"
);
/// <summary>
/// 重要文件存档
/// </summary>
public
string
Backup
{
get
;
}
=
Path
.
Combine
(
_files
,
"backup"
);
/// <summary>
/// 获取相对路径(文件磁盘路径)
/// </summary>
/// <param name="rootPath"></param>
/// <param name="filePath"></param>
/// <returns></returns>
public
string
GetRelativePath
(
string
rootPath
,
string
filePath
)
=>
GetRelativeUri
(
rootPath
,
filePath
).
Replace
(
'/'
,
Path
.
DirectorySeparatorChar
);
/// <summary>
/// 获取相对路径(URI路径)
/// </summary>
/// <param name="rootPath"></param>
/// <param name="filePath"></param>
/// <returns></returns>
public
string
GetRelativeUri
(
string
rootPath
,
string
filePath
)
=>
Uri
.
UnescapeDataString
(
new
Uri
(
rootPath
).
MakeRelativeUri
(
new
Uri
(
filePath
)).
ToString
());
}
public
static
partial
class
Tools
{
private
static
readonly
Lazy
<
SystemPath
>
_lazySystemPath
=
new
Lazy
<
SystemPath
>(()
=>
new
SystemPath
());
/// 系统路径
public
static
SystemPath
Path
{
get
{
return
_lazySystemPath
.
Value
;
}
}
}
}
performance/Performance.Infrastructure/Tools/Tools.cs
0 → 100644
View file @
1fb74544
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Serialization
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
namespace
Performance.Infrastructure
{
public
static
partial
class
Tools
{
/// <summary>
/// 序列化全局配置(Newtonsoft.Json)
/// </summary>
/// <returns></returns>
public
static
JsonSerializerSettings
GetJsonSerializerSettings
(
Formatting
formatting
=
Formatting
.
Indented
)
{
var
options
=
new
JsonSerializerSettings
();
GetJsonSerializerSettings
(
options
);
options
.
Formatting
=
formatting
;
return
options
;
}
/// <summary>
/// 序列化全局配置(Newtonsoft.Json)
/// </summary>
/// <returns></returns>
public
static
void
GetJsonSerializerSettings
(
JsonSerializerSettings
options
)
{
options
.
Converters
.
Add
(
new
IsoDateTimeConverterContent
()
{
DateTimeFormat
=
"yyyy-MM-dd HH:mm:ss"
});
options
.
Formatting
=
Formatting
.
Indented
;
options
.
NullValueHandling
=
NullValueHandling
.
Include
;
options
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
options
.
DateTimeZoneHandling
=
DateTimeZoneHandling
.
Utc
;
options
.
Culture
=
new
CultureInfo
(
"zh-CN"
);
options
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
options
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
}
/// <summary>
/// 数据表转键值对集合
/// </summary>
/// <param name="dynamics">动态类型数据</param>
/// <returns>哈希表数组</returns>
public
static
List
<
Dictionary
<
string
,
object
>>
MapDictionary
(
this
List
<
dynamic
>
dynamics
)
{
return
dynamics
.
Select
(
expandoDict
=>
new
Dictionary
<
string
,
object
>(
expandoDict
)).
ToList
();
}
}
}
performance/Performance.Repository/BaseRepository.cs
View file @
1fb74544
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
using
System.Linq.Expressions
;
using
System.Linq.Expressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
using
Masuit.Tools.Models
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
using
Z.EntityFramework.Extensions
;
using
Z.EntityFramework.Extensions
;
...
@@ -89,7 +90,6 @@ public bool RemoveRange(params TEntity[] entities)
...
@@ -89,7 +90,6 @@ public bool RemoveRange(params TEntity[] entities)
context
.
Set
<
TEntity
>().
RemoveRange
(
entities
);
context
.
Set
<
TEntity
>().
RemoveRange
(
entities
);
return
context
.
SaveChanges
()
>
0
;
return
context
.
SaveChanges
()
>
0
;
}
}
public
bool
RemoveRange
(
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
public
bool
RemoveRange
(
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
{
{
var
query
=
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
);
var
query
=
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
);
...
@@ -145,9 +145,9 @@ public List<TEntity> GetEntities(Expression<Func<TEntity, bool>> exp)
...
@@ -145,9 +145,9 @@ public List<TEntity> GetEntities(Expression<Func<TEntity, bool>> exp)
return
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
).
ToList
();
return
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
).
ToList
();
}
}
public
List
<
TEntity
>
GetEntitiesForPaging
(
int
Page
,
int
pageSize
,
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
public
Paged
List
<
TEntity
>
GetEntitiesForPaging
(
int
Page
,
int
pageSize
,
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
{
{
return
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
).
Skip
((
Page
-
1
)
*
pageSize
).
Take
(
pageSize
).
To
List
(
);
return
context
.
Set
<
TEntity
>().
AsQueryable
().
Where
(
exp
).
Skip
((
Page
-
1
)
*
pageSize
).
Take
(
pageSize
).
To
PagedList
(
Page
,
pageSize
);
}
}
public
TEntity
GetEntity
(
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
public
TEntity
GetEntity
(
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
...
@@ -155,6 +155,10 @@ public TEntity GetEntity(Expression<Func<TEntity, bool>> exp)
...
@@ -155,6 +155,10 @@ public TEntity GetEntity(Expression<Func<TEntity, bool>> exp)
return
context
.
Set
<
TEntity
>().
AsQueryable
().
FirstOrDefault
(
exp
);
return
context
.
Set
<
TEntity
>().
AsQueryable
().
FirstOrDefault
(
exp
);
}
}
public
async
Task
<
TEntity
>
GetEntityAsync
(
Expression
<
Func
<
TEntity
,
bool
>>
exp
)
{
return
await
context
.
Set
<
TEntity
>().
FirstOrDefaultAsync
(
exp
);
}
#
region
Bulk
#
region
Bulk
public
void
BulkInsert
(
IEnumerable
<
TEntity
>
entities
)
public
void
BulkInsert
(
IEnumerable
<
TEntity
>
entities
)
...
...
performance/Performance.Repository/Repository/PerforLowProcRepository.cs
0 → 100644
View file @
1fb74544
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// low_proc Repository
/// </summary>
public
partial
class
PerforLowProcRepository
:
PerforRepository
<
low_proc
>
{
public
PerforLowProcRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/LowProcService.cs
0 → 100644
View file @
1fb74544
using
AutoMapper
;
using
Dapper
;
using
Masuit.Tools
;
using
Masuit.Tools.Models
;
using
Microsoft.Extensions.Options
;
using
MySql.Data.MySqlClient
;
using
Newtonsoft.Json
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure.Models
;
using
Performance.Repository
;
using
Swashbuckle.AspNetCore.SwaggerGen
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
using
System.Linq.Dynamic.Core
;
using
System.Linq.Expressions
;
using
System.Security.Claims
;
using
System.Threading.Tasks
;
using
Yitter.IdGenerator
;
using
static
Performance
.
DtoModels
.
ManagementDept
;
namespace
Performance.Services
{
/// <summary>
/// 可配置数据查询
/// </summary>
public
class
LowProcService
:
IAutoInjection
{
private
readonly
PerforLowProcRepository
_lowProcRepository
;
private
readonly
IMapper
_mapper
;
private
readonly
IOptions
<
AppConnection
>
_options
;
private
readonly
int
_commandTimeout
=
60
*
5
;
/// ctor
public
LowProcService
(
PerforLowProcRepository
lowProcRepository
,
IMapper
mapper
,
IOptions
<
AppConnection
>
options
)
{
_lowProcRepository
=
lowProcRepository
;
_mapper
=
mapper
;
_options
=
options
;
}
/// <summary>
/// 扩展查询
/// </summary>
/// <param name="title">扩展查询名</param>
/// <param name="page"></param>
/// <param name="size"></param>
/// <returns></returns>
public
PagedList
<
low_proc
>
GetListAsync
(
string
?
title
,
int
page
,
int
size
)
{
Expression
<
Func
<
low_proc
,
bool
>>
predicate
=
w
=>
true
;
predicate
=
predicate
.
AndIf
(!
string
.
IsNullOrWhiteSpace
(
title
),
w
=>
w
.
Title
.
Contains
(
title
!));
var
result
=
_lowProcRepository
.
GetEntitiesForPaging
(
page
,
size
,
predicate
);
return
result
;
}
/// <summary>
/// 查询配置信息
/// </summary>
/// <param name="procId"></param>
/// <returns></returns>
public
async
Task
<
low_proc
?>
GetAsync
(
long
procId
)
=>
await
_lowProcRepository
.
GetEntityAsync
(
x
=>
x
.
ProcId
==
procId
);
/// <summary>
/// 新增扩展查询记录
/// </summary>
/// <param name="procDto"></param>
/// <returns></returns>
/// <exception cref="DomainException"></exception>
public
async
Task
AddAsync
(
LowProcRequest
procDto
,
int
userid
)
{
if
(
string
.
IsNullOrEmpty
(
procDto
?.
Script
))
throw
new
PerformanceException
(
"您提交的扩展查询为空,请填写后重试"
);
var
low_Proc
=
await
_lowProcRepository
.
GetEntityAsync
(
w
=>
w
.
Title
==
procDto
.
Title
);
if
(
low_Proc
!=
null
)
throw
new
PerformanceException
(
"您提交的扩展查询名已存在,请修改后重试"
);
var
proc
=
_mapper
.
Map
<
low_proc
>(
procDto
);
proc
.
ProcId
=
YitIdHelper
.
NextId
();
proc
.
CreateBy
=
userid
;
proc
.
CreateTime
=
DateTime
.
Now
;
proc
.
UpdateBy
=
userid
;
proc
.
UpdateTime
=
DateTime
.
Now
;
await
_lowProcRepository
.
AddAsync
(
proc
);
}
/// <summary>
/// 修改扩展查询记录
/// </summary>
/// <param name="procId"></param>
/// <param name="procDto"></param>
/// <returns></returns>
/// <exception cref="DomainException"></exception>
public
async
Task
UpdateAsync
(
long
procId
,
int
userid
,
LowProcRequest
procDto
)
{
if
(
string
.
IsNullOrEmpty
(
procDto
?.
Script
))
throw
new
PerformanceException
(
"您提交的扩展查询为空,请填写后重试"
);
var
proc
=
await
_lowProcRepository
.
GetEntityAsync
(
w
=>
w
.
ProcId
==
procId
)
??
throw
new
PerformanceException
(
"未找到需要修改的扩展查询,请检查后重试"
);
_mapper
.
Map
(
procDto
,
proc
);
proc
.
UpdateBy
=
userid
;
proc
.
UpdateTime
=
DateTime
.
Now
;
_lowProcRepository
.
Update
(
proc
);
}
/// <summary>
/// 删除扩展查询记录
/// </summary>
/// <param name="procIds"></param>
/// <returns></returns>
/// <exception cref="DomainException"></exception>
public
void
DeleteAsync
(
params
long
[]
procIds
)
{
if
(
procIds
.
Length
==
0
)
throw
new
PerformanceException
(
"您提交的删除信息无效,请检查后重试!"
);
var
del
=
_lowProcRepository
.
GetEntities
(
w
=>
procIds
.
Contains
(
w
.
ProcId
));
_lowProcRepository
.
RemoveRange
(
del
.
ToArray
());
}
/// <summary>
/// 扩展数据
/// </summary>
/// <param name="procId"></param>
/// <param name="queries"></param>
/// <param name="page"></param>
/// <param name="size"></param>
public
async
Task
<
PagedList
<
dynamic
,
ColumnResponse
,
object
>>
GetDatumAsync
(
long
procId
,
List
<
DynamicQuery
>
queries
,
int
page
,
int
size
,
Dictionary
<
string
,
object
>
args
)
{
var
proc
=
await
_lowProcRepository
.
GetEntityAsync
(
x
=>
x
.
ProcId
==
procId
)
??
throw
new
PerformanceException
(
"当前查询数据信息错误,请检查配置信息"
);
foreach
(
var
query
in
queries
)
{
if
(
query
.
Field
.
Equals
(
"allotId"
,
StringComparison
.
OrdinalIgnoreCase
))
{
if
(
long
.
TryParse
(
query
.
Value
,
out
long
allotIdValue
))
args
.
AddOrUpdate
(
query
.
Field
,
allotIdValue
,
allotIdValue
);
else
args
.
AddOrUpdate
(
query
.
Field
,
0L
,
0L
);
}
else
{
args
.
AddOrUpdate
(
query
.
Field
,
query
.
Value
??
string
.
Empty
,
query
.
Value
??
string
.
Empty
);
}
}
if
(
string
.
IsNullOrWhiteSpace
(
proc
.
Script
))
throw
new
PerformanceException
(
"当前查询尚未配置脚本,请配置后重试"
);
(
IQueryable
<
dynamic
>
data
,
List
<
ColumnResponse
>
columns
)
=
await
GetExtensionDatumAsync
(
proc
.
Script
,
args
);
var
total
=
new
Dictionary
<
string
,
object
?>();
if
(
data
.
Any
())
{
var
dict
=
(
IDictionary
<
string
,
object
>)
data
.
First
();
var
keys
=
dict
.
Select
(
w
=>
w
.
Key
).
ToList
();
foreach
(
var
key
in
keys
)
{
var
col
=
columns
.
FirstOrDefault
(
w
=>
w
.
Field
.
Equals
(
key
,
StringComparison
.
OrdinalIgnoreCase
));
if
(
col
!=
null
)
col
.
Field
=
key
;
}
foreach
(
var
item
in
queries
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
Value
)))
{
var
field
=
keys
.
FirstOrDefault
(
col
=>
col
.
Equals
(
item
.
Field
,
StringComparison
.
OrdinalIgnoreCase
));
if
(!
string
.
IsNullOrEmpty
(
field
))
{
var
exp
=
$"
{
field
}
!= null &&
{
field
}
.ToString().Contains(@0, StringComparison.OrdinalIgnoreCase)"
;
data
=
data
.
Where
(
exp
,
item
.
Value
);
}
}
foreach
(
var
item
in
columns
)
{
object
?
sumValue
=
null
;
if
(
item
.
Formatter
==
Formatter
.
numeric
.
ToString
())
{
var
field
=
keys
.
FirstOrDefault
(
col
=>
col
.
Equals
(
item
.
Field
,
StringComparison
.
OrdinalIgnoreCase
));
if
(!
string
.
IsNullOrEmpty
(
field
))
sumValue
=
data
.
Select
(
field
).
ToDynamicList
().
Cast
<
decimal
?>().
Sum
();
}
total
.
AddOrUpdate
(
item
.
Field
,
sumValue
,
sumValue
);
}
}
page
=
data
.
Count
()
<=
size
?
1
:
page
;
var
paged
=
data
.
ToPagedList
(
page
,
size
);
return
new
PagedList
<
dynamic
,
ColumnResponse
,
object
>(
paged
,
columns
,
new
List
<
object
>
{
total
});
}
/// <summary>
/// 自识别存储过程查询
/// </summary>
/// <param name="script"></param>
/// <param name="args"></param>
/// <returns></returns>
public
async
Task
<(
IQueryable
<
dynamic
>
data
,
List
<
ColumnResponse
>
columns
)>
GetExtensionDatumAsync
(
string
script
,
Dictionary
<
string
,
object
>
args
)
{
using
(
var
conn
=
new
MySqlConnection
(
_options
.
Value
.
PerformanceConnectionString
))
{
if
(
conn
.
State
!=
ConnectionState
.
Open
)
conn
.
Open
();
var
multi
=
await
conn
.
QueryMultipleAsync
(
script
,
args
,
commandTimeout
:
_commandTimeout
);
var
data
=
(
await
multi
.
ReadAsync
()).
AsQueryable
();
var
columns
=
(
await
multi
.
ReadAsync
<
ColumnResponse
>()).
AsList
();
columns
.
ForEach
(
column
=>
{
column
.
Visible
??=
true
;
column
.
Sort
=
columns
.
Max
(
w
=>
w
.
Sort
??
1
)
+
1
;
});
columns
=
columns
.
OrderBy
(
w
=>
w
.
Sort
).
ToList
();
return
(
data
,
columns
);
}
}
}
}
performance/Performance.Services/Performance.Services.csproj
View file @
1fb74544
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
<PackageReference Include="GraphQL" Version="2.4.0" />
<PackageReference Include="GraphQL" Version="2.4.0" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.2.4" />
<PackageReference Include="MassTransit.AspNetCore" Version="7.2.4" />
<PackageReference Include="Polly" Version="7.2.2" />
<PackageReference Include="Polly" Version="7.2.2" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment