Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
solho
code
Commits
cc80eaa9
Commit
cc80eaa9
authored
Nov 18, 2021
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:關帳可視權限邏輯 加入ALL選項支援
parent
227da49e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
WebAPI/Controllers/Esn_Subitem/Esn_todos_SettleController.cs
WebAPI/Controllers/Esn_Subitem/Esn_todos_SettleController.cs
+22
-3
No files found.
WebAPI/Controllers/Esn_Subitem/Esn_todos_SettleController.cs
View file @
cc80eaa9
...
...
@@ -74,6 +74,14 @@ namespace WebAPI.Controllers
//cmd.Parameters.Add("@DSid", objPermission_furtherSql["firmID"].ToString());
}
if
(
objPermission_furtherSql
[
"option"
]
!=
null
&&
!
String
.
IsNullOrEmpty
(
objPermission_furtherSql
[
"option"
].
ToString
()))
{
if
(
objPermission_furtherSql
[
"option"
].
ToString
().
Contains
(
"2485762"
))
//內管 OPTION為 ALL
{
@wherecase1
=
""
;
@wherecase2
=
""
;
}
}
}
if
(
obj_input
[
"Settle_Date"
]
!=
null
)
{
...
...
@@ -137,14 +145,16 @@ namespace WebAPI.Controllers
left join [evw_qResult_Dept] c on a.DeptNum=c.targetID
left join [evw_qResult_EmpItem] d on a.ItemNum=d.Emp_ItemNum
left join evw_Employee e on a.update_user_id=e.user_id
where 1=1 "
);
where 1=1 @wherecase1 "
);
String
@wherecase1
=
""
;
if
(
obj_input
[
"Permission_furtherSql"
]
!=
null
)
{
JObject
objPermission_furtherSql
=
JObject
.
Parse
(
obj_input
[
"Permission_furtherSql"
].
ToString
());
if
(
objPermission_furtherSql
[
"firmID"
]
!=
null
&&
!
String
.
IsNullOrEmpty
(
objPermission_furtherSql
[
"firmID"
].
ToString
()))
{
strsql
+=
" and b.ID in(@DSid)"
;
strsql
=
strsql
.
Replace
(
"@DSid"
,
objPermission_furtherSql
[
"firmID"
].
ToString
());
@wherecase1
+=
" and b.ID in(@DSid)"
;
@wherecase1
=
@wherecase1
.
Replace
(
"@DSid"
,
objPermission_furtherSql
[
"firmID"
].
ToString
());
//cmd.Parameters.Add("@DSid", objPermission_furtherSql["firmID"].ToString());
}
if
(
objPermission_furtherSql
[
"deptID"
]
!=
null
&&
!
String
.
IsNullOrEmpty
(
objPermission_furtherSql
[
"deptID"
].
ToString
()))
...
...
@@ -157,6 +167,11 @@ namespace WebAPI.Controllers
//strsql += " and ItemNum in(@ItemNum)";
//cmd.Parameters.Add("@ItemNum", objPermission_furtherSql["workGroupID"].ToString());
}
if
(
objPermission_furtherSql
[
"option"
]
!=
null
&&
!
String
.
IsNullOrEmpty
(
objPermission_furtherSql
[
"option"
].
ToString
()))
{
if
(
objPermission_furtherSql
[
"option"
].
ToString
().
Contains
(
"2485762"
))
//內管 OPTION為 ALL
@wherecase1
=
""
;
}
}
if
(
obj_input
[
"Settle_Date"
]!=
null
&&
!
String
.
IsNullOrEmpty
(
obj_input
[
"Settle_Date"
].
ToString
())
)
{
...
...
@@ -294,6 +309,10 @@ namespace WebAPI.Controllers
wherecasei
+=
" and targetid in("
+
objPermission_furtherSql
[
"firmID"
].
ToString
()
+
")"
;
wherecaseu
+=
" and a.id in("
+
objPermission_furtherSql
[
"firmID"
].
ToString
()
+
")"
;
}
if
(
objPermission_furtherSql
[
"option"
].
ToString
().
Contains
(
"2485762"
))
//內管 OPTION為 ALL
{
wherecasei
=
""
;
}
}
DateTime
Settle_Date
=
Convert
.
ToDateTime
(
obj_input
[
"Settle_Date"
].
ToString
());
...
...
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