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
ce2f36e8
Commit
ce2f36e8
authored
Feb 16, 2022
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:處理事項新增取得期限變更歷史 功能
parent
77c119b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
WebAPI/Controllers/ProcInfoController.cs
WebAPI/Controllers/ProcInfoController.cs
+46
-0
WebAPI/Tool/SqlServerHelper.cs
WebAPI/Tool/SqlServerHelper.cs
+29
-0
No files found.
WebAPI/Controllers/ProcInfoController.cs
View file @
ce2f36e8
...
...
@@ -1128,5 +1128,51 @@ namespace WebAPI.Controllers
}
return
dt
;
}
/// <summary>
/// 取得期限變更歷史資料
/// </summary>
/// <param name="param">取得JSON</param>
/// <returns></returns>
[
Route
(
"ProcInfo/Get_p_case_status_history_topcus_due_date"
)]
[
CorsHandle
]
[
HttpPost
]
public
HttpResponseMessage
Get_p_case_status_history_topcus_due_date
(
ParamModel
param
)
{
HttpResponseMessage
result
=
new
HttpResponseMessage
(
HttpStatusCode
.
OK
);
CommonResponseMsg
response
=
new
CommonResponseMsg
();
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
try
{
SqlServerHelper
sql_server_helper
=
new
SqlServerHelper
();
DataTable
dt
;
using
(
SqlCommand
sqlcmd
=
new
SqlCommand
())
{
sqlcmd
.
CommandText
=
@"select top 1 cus_due_date_old from p_case_status_history a where a.case_id=@proc_id and isnull(a.cus_due_date_old,'')!=''
order by cus_due_date_old"
;
sqlcmd
.
Parameters
.
AddWithValue
(
"@proc_id"
,
obj_input
[
"proc_id"
].
ToString
());
dt
=
sql_server_helper
.
GetTable
(
sqlcmd
);
}
response
.
Code
=
"1"
;
response
.
Msg
=
dt
;
}
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
;
}
}
}
\ No newline at end of file
WebAPI/Tool/SqlServerHelper.cs
View file @
ce2f36e8
...
...
@@ -155,6 +155,35 @@ namespace WebAPI.Tool
return
dataTable
;
}
/// <summary>
/// 通过sql语句获取数据表
/// </summary>
/// <param name="selectSqlCommand">获取表的select语句</param>
/// <returns>获取到的数据表</returns>
public
DataTable
GetTable
(
SqlCommand
selectSqlCommand
)
{
if
(
selectSqlCommand
==
null
)
throw
new
Exception
(
"要执行的selectSqlCommand不能为空"
);
OpenConnection
();
selectSqlCommand
.
Connection
=
SqlCnt
;
SqlDataAdapter
sqlDataAdapter
=
new
SqlDataAdapter
(
selectSqlCommand
);
DataTable
dataTable
=
new
DataTable
();
try
{
sqlDataAdapter
.
Fill
(
dataTable
);
//通过SqlDataAdapter填充DataTable对象
}
catch
(
Exception
e
)
{
LogHelper
.
WriteErrorLog
(
string
.
Format
(
@"{0}"
,
selectSqlCommand
),
e
,
this
.
GetType
().
Name
+
":"
+
MethodBase
.
GetCurrentMethod
().
Name
);
throw
new
Exception
(
"select语句有错或者数据表不存在:"
+
e
);
}
finally
{
CloseConnection
();
}
return
dataTable
;
}
public
DataSet
GetDataSet
(
string
selectSqlCommand
,
Hashtable
ht
=
null
)
{
if
(
string
.
IsNullOrEmpty
(
selectSqlCommand
))
...
...
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