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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
25 deletions
+50
-25
performance/Performance.Api/Controllers/ConfigController.cs
+9
-4
performance/Performance.Api/wwwroot/Performance.Api.xml
+3
-3
performance/Performance.DtoModels/Enum.cs
+7
-1
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()
...
@@ -912,6 +912,7 @@ public ApiResponse CopyDropDown()
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
#
region
自定义表
/// <summary>
/// <summary>
/// 自定义表Heads表头
/// 自定义表Heads表头
/// </summary>
/// </summary>
...
@@ -946,7 +947,7 @@ public ApiResponse GetCustomList([FromBody] CustomPagingRequest request)
...
@@ -946,7 +947,7 @@ public ApiResponse GetCustomList([FromBody] CustomPagingRequest request)
}
}
/// <summary>
/// <summary>
///
保存自定义表数据
///
自定义表(保存数据)
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -965,7 +966,7 @@ public ApiResponse BatchSaveCustom([FromBody] SaveCustomData request)
...
@@ -965,7 +966,7 @@ public ApiResponse BatchSaveCustom([FromBody] SaveCustomData request)
}
}
/// <summary>
/// <summary>
/// 自定义表
数据
(加载上月)
/// 自定义表(加载上月)
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -980,11 +981,11 @@ public ApiResponse CustomNewcopy([FromBody] CustomNewcopyData request)
...
@@ -980,11 +981,11 @@ public ApiResponse CustomNewcopy([FromBody] CustomNewcopyData request)
else
if
(
string
.
IsNullOrEmpty
(
request
.
TableName
))
else
if
(
string
.
IsNullOrEmpty
(
request
.
TableName
))
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"表名为空"
);
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"表名为空"
);
return
_configService
.
CustomNewcopy
(
request
);
return
_configService
.
CustomNewcopy
(
request
);
}
}
/// <summary>
/// <summary>
/// 自定义表
导出
/// 自定义表
(下载)
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
...
@@ -1010,5 +1011,8 @@ public IActionResult CustomDownload([FromBody] CustomPagingRequest request)
...
@@ -1010,5 +1011,8 @@ public IActionResult CustomDownload([FromBody] CustomPagingRequest request)
var
memi
=
provider
.
Mappings
[
".xlsx"
];
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
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 @@
...
@@ -1519,21 +1519,21 @@
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchSaveCustom(Performance.DtoModels.SaveCustomData)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchSaveCustom(Performance.DtoModels.SaveCustomData)"
>
<summary>
<summary>
保存自定义表数据
自定义表(保存数据)
</summary>
</summary>
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomNewcopy(Performance.DtoModels.CustomNewcopyData)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomNewcopy(Performance.DtoModels.CustomNewcopyData)"
>
<summary>
<summary>
自定义表
数据
(加载上月)
自定义表(加载上月)
</summary>
</summary>
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomDownload(Performance.DtoModels.CustomPagingRequest)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.CustomDownload(Performance.DtoModels.CustomPagingRequest)"
>
<summary>
<summary>
自定义表
导出
自定义表
(下载)
</summary>
</summary>
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
...
...
performance/Performance.DtoModels/Enum.cs
View file @
4cecffe9
...
@@ -274,7 +274,7 @@ public enum TitleManage
...
@@ -274,7 +274,7 @@ public enum TitleManage
调节系数
=
4801
,
调节系数
=
4801
,
调节后其他绩效
=
4901
,
调节后其他绩效
=
4901
,
调节后其他管理绩效
=
4910
,
调节后其他管理绩效
=
4910
,
// 业务中层行政中高层调节后其他绩效 = 4920,
// 业务中层行政中高层调节后其他绩效 = 4920,
绩效合计
=
5001
,
绩效合计
=
5001
,
}
}
public
enum
DisplayRule
public
enum
DisplayRule
...
@@ -298,5 +298,11 @@ public enum Format
...
@@ -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 @@
...
@@ -18,7 +18,9 @@
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Linq.Expressions
;
using
System.Reflection.PortableExecutable
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
static
Performance
.
DtoModels
.
ManagementDept
;
namespace
Performance.Services
namespace
Performance.Services
{
{
...
@@ -1353,7 +1355,7 @@ public HandsonTableBase QueryHandsCustom(CustomPagingRequest request)
...
@@ -1353,7 +1355,7 @@ public HandsonTableBase QueryHandsCustom(CustomPagingRequest request)
ColHeaders
=
new
List
<
string
>(),
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
data
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
string
>>>(
jsonData
);
var
headDic
=
new
List
<
Dictionary
<
string
,
object
>>();
var
headDic
=
new
List
<
Dictionary
<
string
,
object
>>();
...
@@ -1479,6 +1481,12 @@ public ApiResponse CustomNewcopy(CustomNewcopyData request)
...
@@ -1479,6 +1481,12 @@ public ApiResponse CustomNewcopy(CustomNewcopyData request)
_perallotRepository
.
ProcCustomTableNewcopy
(
request
.
TableName
,
request
.
AllotId
,
prevAllotId
);
_perallotRepository
.
ProcCustomTableNewcopy
(
request
.
TableName
,
request
.
AllotId
,
prevAllotId
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
/// <summary>
/// 自定义表显示
/// </summary>
/// <param name="userId"></param>
/// <param name="request"></param>
/// <returns></returns>
public
ApiResponse
QueryCustom
(
int
userId
,
CustomPagingRequest
request
)
public
ApiResponse
QueryCustom
(
int
userId
,
CustomPagingRequest
request
)
{
{
var
heads
=
_perforReport
.
QueryCustomColumn
(
request
.
TableName
);
var
heads
=
_perforReport
.
QueryCustomColumn
(
request
.
TableName
);
...
@@ -1507,18 +1515,22 @@ public ApiResponse QueryCustom(int userId, CustomPagingRequest request)
...
@@ -1507,18 +1515,22 @@ public ApiResponse QueryCustom(int userId, CustomPagingRequest request)
{
{
Heads
=
headList
.
ToList
()
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
;
re
sult
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
columns
)
;
result
.
Datas
=
_perforReport
.
QueryCustom
(
request
,
true
,
isView
);
}
}
else
else
{
{
var
unitTypes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
var
unitTypes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
if
(
unitTypes
.
Any
())
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
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
...
@@ -1567,6 +1579,8 @@ public string CustomDownloadFile(int userId, CustomPagingRequest request, per_al
string
filepath
=
Path
.
Combine
(
dpath
,
filename
);
string
filepath
=
Path
.
Combine
(
dpath
,
filename
);
FileStream
stream
=
new
FileStream
(
filepath
,
FileMode
.
Create
);
FileStream
stream
=
new
FileStream
(
filepath
,
FileMode
.
Create
);
var
customResponses
=
(
CustomResponse
)
QueryCustom
(
userId
,
request
).
Data
;
var
user
=
_userService
.
GetUser
(
userId
);
var
user
=
_userService
.
GetUser
(
userId
);
var
roleType
=
_roleService
.
GetUserRole
(
userId
)?.
FirstOrDefault
()?.
Type
??
0
;
var
roleType
=
_roleService
.
GetUserRole
(
userId
)?.
FirstOrDefault
()?.
Type
??
0
;
...
@@ -1574,17 +1588,17 @@ public string CustomDownloadFile(int userId, CustomPagingRequest request, per_al
...
@@ -1574,17 +1588,17 @@ public string CustomDownloadFile(int userId, CustomPagingRequest request, per_al
if
(
heads
!=
null
&&
heads
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
)))
if
(
heads
!=
null
&&
heads
.
Any
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
)))
heads
.
RemoveAll
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
));
heads
.
RemoveAll
(
w
=>
string
.
IsNullOrEmpty
(
w
.
Comment
));
var
data
=
new
List
<
dynamic
>()
;
var
data
=
customResponses
.
Datas
.
DataList
;
if
(
request
.
Limit
==
1
)
//if (request.Limit == (int)CustomTableLimitation.无限制
)
{
//
{
request
.
QuerySearch
=
null
;
//
request.QuerySearch = null;
data
=
_perforReport
.
QueryCustom
(
request
.
TableName
,
request
.
AllotId
,
null
,
null
)
??
new
List
<
dynamic
>();
//
data = _perforReport.QueryCustom(request.TableName, request.AllotId, null, null) ?? new List<dynamic>();
}
//
}
else
//
else
{
//
{
var
unitTypes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
//
var unitTypes = UnitTypeUtil.GetMaps(roleType);
data
=
_perforReport
.
QueryCustom
(
request
.
TableName
,
request
.
AllotId
,
user
?.
Department
??
""
,
unitTypes
)
??
new
List
<
dynamic
>();
//
data = _perforReport.QueryCustom(request.TableName, request.AllotId, user?.Department ?? "", unitTypes) ?? new List<dynamic>();
}
//
}
try
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