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
039f18f0
Commit
039f18f0
authored
Aug 22, 2021
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自訂前往步驟bugfix
parent
53b58071
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
24 deletions
+85
-24
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
+85
-24
No files found.
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
View file @
039f18f0
...
...
@@ -476,22 +476,14 @@ namespace WebAPI.Controllers
return_msg_error
.
Add
(
dsr
[
"esn_todos_sn"
]
+
":該流程 "
+
Convert
.
ToDateTime
(
dsr
[
"Settle_Date"
]).
ToString
(
" yyyy年MM月 "
)
+
"已關帳, 不可變更"
);
#
endregion
CStepTypeCur
=
AllStepType
.
Where
(
p
=>
p
.
id
==
StepType_id
).
FirstOrDefault
();
if
(
JtSn
[
"targetclass"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
JtSn
[
"targetclass"
].
ToString
()))
{
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
AllStepType
.
Where
(
p2
=>
p2
.
Map_Class
==
JtSn
[
"targetclass"
].
ToString
()).
FirstOrDefault
().
id
).
FirstOrDefault
();
}
else
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
CStepTypeCur
.
Step_Id_Next
).
FirstOrDefault
();
//String Step_Value_previous = dsr["Step_Value_previous"].ToString(), Step_Value_Next = dsr["Step_Value_Next"].ToString();
Tsql
=
Tsql
+
"update esn_todos_Flow set "
;
//確認是否有審核資格
if
(
Confirm_Method
==
"CF"
||
Confirm_Method
==
"CFTLd"
)
{
CStepTypeCur
=
AllStepType
.
Where
(
p
=>
p
.
id
==
StepType_id
).
FirstOrDefault
();
StepType_idHis
=
CStepTypeCur
.
id
;
#
region
確認是否有審核資格
//2021-08-20限制全取消
if
(!
Confirm_Class
.
Contains
(
Map_Class
))
{
...
...
@@ -501,35 +493,49 @@ namespace WebAPI.Controllers
{
//return_msg_error.Add(dsr["esn_todos_sn"] + ":審核流程已結束,不可確認");
}
#
endregion
if
(
Confirm_Method
==
"CF"
||
Confirm_Method
==
"CFTLd"
)
{
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
CStepTypeCur
.
Step_Id_Next
).
FirstOrDefault
();
}
if
(
Confirm_Method
==
"RJ"
)
{
//Tsql = Tsql + "PG_IsConfirm =" + IsConfirm + "," + "PE_IsConfirm =" + IsConfirm + "," + "Leader_IsConfirm =" + IsConfirm + ","; //退回後,改為更新所有Flow狀態確認
//CStepTypeNext = AllStepType.Where(p => p.Step_Value == Step_Value_previous).FirstOrDefault();
StepType_idHis
=
CStepTypeCur
.
id
;
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
CStepTypeCur
.
Step_Id_previous
).
FirstOrDefault
()
;
}
else
if
(
Confirm_Method
==
"RV"
)
{
StepType_idHis
=
CStepTypeCur
.
id
;
//CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault();
//CStepTypeCur.id = CStepTypeNext.id; //回復與下一步 同ID
//Tsql = Tsql + CStepTypeNext.Map_Class + "_IsConfirm =" + IsConfirm + ",";
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
StepType_id_Previous
).
FirstOrDefault
();
}
else
if
(
Confirm_Method
==
"RJTOp"
)
{
//Tsql = Tsql + "PG_IsConfirm =" + IsConfirm + "," + "PE_IsConfirm =" + IsConfirm + "," + "Leader_IsConfirm =" + IsConfirm + ","; //退回後,改為更新所有Flow狀態確認
//CStepTypeNext = AllStepType.Where(p => p.Step_Value == Step_Value_previous).FirstOrDefault();
StepType_idHis
=
CStepTypeCur
.
id
;
RJTOp
=
String
.
Format
(
@"exec [dbo].esp_esn_Todos_V3_AssignStatus 'AS05' ,"
+
dsr
[
"sn"
]
+
@",'',@todos_Reject_Desc_{0},@Wade_User_ID"
,
i
);
cmd
.
Parameters
.
AddWithValue
(
string
.
Format
(
"@todos_Reject_Desc_{0}"
,
i
),
"承辦人:"
+
JtSn
[
"todos_Reject_Desc"
].
ToString
()
+
"<br>主管:"
+
Reject_Description
);
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
CStepTypeCur
.
Step_Id_previous
).
FirstOrDefault
();
}
else
{
//Tsql = Tsql + CStepTypeCur.Map_Class + "_IsConfirm =" + IsConfirm + ",";
StepType_idHis
=
CStepTypeCur
.
id
;
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
CStepTypeCur
.
Step_Id_Next
).
FirstOrDefault
()
;
}
//有指定蓋過預設
if
(
JtSn
[
"targetclass"
]
!=
null
&&
!
string
.
IsNullOrEmpty
(
JtSn
[
"targetclass"
].
ToString
()))
{
CStepTypeNext
=
AllStepType
.
Where
(
p
=>
p
.
id
==
AllStepType
.
Where
(
p2
=>
p2
.
Map_Class
==
JtSn
[
"targetclass"
].
ToString
()).
FirstOrDefault
().
id
).
FirstOrDefault
();
}
Tsql
=
Tsql
+
" StepType_id = '"
+
CStepTypeNext
.
id
+
"',StepType_id_Previous = '"
+
CStepTypeCur
.
id
+
"',Description = @Reject_Description,update_user_id=@Wade_User_ID,update_time='"
+
date0
+
"' "
+
" output Inserted.id into @TempTable where id ="
+
dsr
[
"Flowid"
]
+
";"
...
...
@@ -622,6 +628,61 @@ namespace WebAPI.Controllers
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
return
result
;
}
[
Route
(
"rpt_PerformanceMonth_Flow"
)]
[
CorsHandle
]
[
HttpPost
]
[
HttpGet
]
public
HttpResponseMessage
rpt_PerformanceMonth_Flow
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
try
{
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
SqlCommand
cmd
=
new
SqlCommand
(
""
,
Conn
)
{
CommandText
=
@"
Declare @p_ReportType varchar(20),@p_ReportType2 varchar(20), @p_Date_settlement_begin DateTime,@p_Date_settlement_end DateTime
DECLARE @Emp_ID VARCHAR(50),@Emp_ItemNo VARCHAR(20),@QryEmpItem VARCHAR(20)= '' ,@QryEmpDS VARCHAR(20)= '' ,@p_isComfirm varchar(1),@p_gtPoint int
,@IsPG bit=0,@PGJoin varchar(max)='',@p_flow_user_id_also VARCHAR(50);
select * into #tb_Split from ufn_split(@p_params,',')
select @p_ReportType=value from #tb_Split where id=1
select @p_isComfirm=value from #tb_Split where id=2
select @p_gtPoint=value from #tb_Split where id=3
select @p_Date_settlement_begin=value from #tb_Split where id=4
select @p_Date_settlement_end=value from #tb_Split where id=5
select @p_ReportType2=value from #tb_Split where id=6
"
};
//cmd.Parameters.AddWithValue("@SaveData", obj_input["SaveData"].ToString());
//cmd.Parameters.AddWithValue("@gUserID_wade", obj_input["gUserID_wade"].ToString());
//cmd.Parameters.AddWithValue("@Country", obj_input["Country"].ToString());
DataTable
dt
=
SqlToDt
(
cmd
);
response
.
Code
=
"1"
;
response
.
Msg
=
"匯出完畢"
;
}
}
catch
(
Exception
e
)
{
response
.
Code
=
"0"
;
response
.
Msg
=
"Exception:"
+
e
.
StackTrace
;
}
}
else
{
response
.
Code
=
"0"
;
response
.
Msg
=
"no input or format error"
;
}
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
return
result
;
}
}
}
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