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
4cecffe9
Commit
4cecffe9
authored
Oct 11, 2023
by
wyc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义表接口修改
parent
13115d59
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
23 deletions
+48
-23
performance/Performance.Api/Controllers/ConfigController.cs
+8
-3
performance/Performance.Api/wwwroot/Performance.Api.xml
+3
-3
performance/Performance.DtoModels/Enum.cs
+6
-0
performance/Performance.Repository/PerforReportRepository .cs
+0
-0
performance/Performance.Services/ConfigService.cs
+31
-17
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
4cecffe9
...
...
@@ -912,6 +912,7 @@ public ApiResponse CopyDropDown()
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
region
自定义表
/// <summary>
/// 自定义表Heads表头
/// </summary>
...
...
@@ -946,7 +947,7 @@ public ApiResponse GetCustomList([FromBody] CustomPagingRequest request)
}
/// <summary>
///
保存自定义表数据
///
自定义表(保存数据)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
...
...
@@ -965,7 +966,7 @@ public ApiResponse BatchSaveCustom([FromBody] SaveCustomData request)
}
/// <summary>
/// 自定义表
数据
(加载上月)
/// 自定义表(加载上月)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
...
...
@@ -984,7 +985,7 @@ public ApiResponse CustomNewcopy([FromBody] CustomNewcopyData request)
}
/// <summary>
/// 自定义表
导出
/// 自定义表
(下载)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
...
...
@@ -1010,5 +1011,8 @@ public IActionResult CustomDownload([FromBody] CustomPagingRequest request)
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
#
endregion
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
4cecffe9
...
...
@@ -1519,21 +1519,21 @@
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchSaveCustom(Performance.DtoModels.SaveCustomData)"
>
<summary>
保存自定义表数据
自定义表(保存数据)
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomNewcopy(Performance.DtoModels.CustomNewcopyData)"
>
<summary>
自定义表
数据
(加载上月)
自定义表(加载上月)
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomDownload(Performance.DtoModels.CustomPagingRequest)"
>
<summary>
自定义表
导出
自定义表
(下载)
</summary>
<param
name=
"request"
></param>
<returns></returns>
...
...
performance/Performance.DtoModels/Enum.cs
View file @
4cecffe9
...
...
@@ -298,5 +298,11 @@ public enum Format
三位小数百分比
,
四位小数百分比
,
}
public
enum
CustomTableLimitation
{
通过核算单元或者核算组别进行限制
=
0
,
无限制
=
1
,
}
}
}
performance/Performance.Repository/PerforReportRepository .cs
View file @
4cecffe9
This diff is collapsed.
Click to expand it.
performance/Performance.Services/ConfigService.cs
View file @
4cecffe9
...
...
@@ -18,7 +18,9 @@
using
System.IO
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Reflection.PortableExecutable
;
using
System.Text.RegularExpressions
;
using
static
Performance
.
DtoModels
.
ManagementDept
;
namespace
Performance.Services
{
...
...
@@ -1353,7 +1355,7 @@ public HandsonTableBase QueryHandsCustom(CustomPagingRequest request)
ColHeaders
=
new
List
<
string
>(),
};
var
jsonData
=
JsonHelper
.
Serialize
(
_perforReport
.
QueryCustom
(
request
,
true
,
false
).
DataList
);
var
jsonData
=
JsonHelper
.
Serialize
(
_perforReport
.
QueryCustom
(
request
,
dicCustom
.
Select
(
w
=>
w
.
Name
).
ToList
()
).
DataList
);
var
data
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
string
>>>(
jsonData
);
var
headDic
=
new
List
<
Dictionary
<
string
,
object
>>();
...
...
@@ -1479,6 +1481,12 @@ public ApiResponse CustomNewcopy(CustomNewcopyData request)
_perallotRepository
.
ProcCustomTableNewcopy
(
request
.
TableName
,
request
.
AllotId
,
prevAllotId
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 自定义表显示
/// </summary>
/// <param name="userId"></param>
/// <param name="request"></param>
/// <returns></returns>
public
ApiResponse
QueryCustom
(
int
userId
,
CustomPagingRequest
request
)
{
var
heads
=
_perforReport
.
QueryCustomColumn
(
request
.
TableName
);
...
...
@@ -1507,18 +1515,22 @@ public ApiResponse QueryCustom(int userId, CustomPagingRequest request)
{
Heads
=
headList
.
ToList
()
};
if
(
request
.
Limit
==
1
)
List
<
string
>
columns
=
result
.
Heads
.
Select
(
t
=>
t
.
Column
).
Distinct
().
ToList
();
if
(
request
.
Limit
==
(
int
)
CustomTableLimitation
.
无限制
)
{
re
quest
.
QuerySearch
=
null
;
result
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
true
,
isView
);
re
sult
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
columns
)
;
}
else
{
var
unitTypes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
if
(
unitTypes
.
Any
())
result
.
Datas
=
_perforReport
.
QueryCustom
(
request
.
TableName
,
request
.
AllotId
,
user
?.
Department
??
""
,
unitTypes
,
request
.
PageIndex
,
request
.
PageSize
,
isView
);
result
.
Datas
=
_perforReport
.
QueryCustom
(
user
?.
Department
??
""
,
unitTypes
,
request
,
columns
);
else
result
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
false
,
isView
);
{
result
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
columns
);
}
}
...
...
@@ -1567,6 +1579,8 @@ public string CustomDownloadFile(int userId, CustomPagingRequest request, per_al
string
filepath
=
Path
.
Combine
(
dpath
,
filename
);
FileStream
stream
=
new
FileStream
(
filepath
,
FileMode
.
Create
);
var
customResponses
=
(
CustomResponse
)
QueryCustom
(
userId
,
request
).
Data
;
var
user
=
_userService
.
GetUser
(
userId
);
var
roleType
=
_roleService
.
GetUserRole
(
userId
)?.
FirstOrDefault
()?.
Type
??
0
;
...
...
@@ -1574,17 +1588,17 @@ public string CustomDownloadFile(int userId, CustomPagingRequest request, per_al
if
(
heads
!=
null
&&
heads
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
)))
heads
.
RemoveAll
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
));
var
data
=
new
List
<
dynamic
>()
;
if
(
request
.
Limit
==
1
)
{
request
.
QuerySearch
=
null
;
data
=
_perforReport
.
QueryCustom
(
request
.
TableName
,
request
.
AllotId
,
null
,
null
)
??
new
List
<
dynamic
>();
}
else
{
var
unitTypes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
data
=
_perforReport
.
QueryCustom
(
request
.
TableName
,
request
.
AllotId
,
user
?.
Department
??
""
,
unitTypes
)
??
new
List
<
dynamic
>();
}
var
data
=
customResponses
.
Datas
.
DataList
;
//if (request.Limit == (int)CustomTableLimitation.无限制
)
//
{
//
request.QuerySearch = null;
//
data = _perforReport.QueryCustom(request.TableName, request.AllotId, null, null) ?? new List<dynamic>();
//
}
//
else
//
{
//
var unitTypes = UnitTypeUtil.GetMaps(roleType);
//
data = _perforReport.QueryCustom(request.TableName, request.AllotId, user?.Department ?? "", unitTypes) ?? new List<dynamic>();
//
}
try
...
...
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