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
c31d321d
Commit
c31d321d
authored
May 16, 2022
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:API 位置名稱調整
parent
a719cf2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
132 deletions
+135
-132
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
+134
-131
WebAPI/Controllers/Esn_Subitem/Esn_todosController.cs
WebAPI/Controllers/Esn_Subitem/Esn_todosController.cs
+1
-1
No files found.
WebAPI/Controllers/Esn_Subitem/Esn_Todos_FlowController.cs
View file @
c31d321d
...
...
@@ -107,132 +107,6 @@ namespace WebAPI.Controllers
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
return
result
;
}
/// <summary>
/// 取得EHR匯出歷史
/// </summary>
/// <param ></param>
/// <returns></returns>
[
Route
(
"GetExportEHRhis"
)]
[
CorsHandle
]
[
HttpPost
]
//[HttpGet]
public
HttpResponseMessage
Get_ExportEHR_his
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
try
{
List
<
ExportEHR_hisModel
>
Hislist
=
new
List
<
ExportEHR_hisModel
>();
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
ExportEHR_hisModel
hisT
;
SqlCommand
cmd
=
new
SqlCommand
(
""
,
Conn
)
{
CommandText
=
@"select b.cn_name, a.id, a.Country, a.update_time, a.update_user_id, a.Create_user_id, a.Create_time from esn_todos_SettleLog a
left join s_user_info b on a.Create_user_id=b.user_id
where a.Create_user_id=@Create_user_id @wherecase"
};
String
wherecase
=
obj_input
[
"gUserID_wade"
]
==
null
||
string
.
IsNullOrEmpty
(
obj_input
[
"gUserID_wade"
].
ToString
())
?
" or 1=1"
:
""
;
cmd
.
Parameters
.
AddWithValue
(
"@Create_user_id"
,
obj_input
[
"gUserID_wade"
].
ToString
());
cmd
.
CommandText
=
cmd
.
CommandText
.
Replace
(
"@wherecase"
,
wherecase
);
DataSet
ds
=
SqlToDs
(
cmd
);
foreach
(
DataRow
dr
in
ds
.
Tables
[
0
].
Rows
)
{
hisT
=
new
ExportEHR_hisModel
()
{
id
=
(
int
)
dr
[
"id"
],
//SaveData = dr["SaveData"].ToString(),
update_time
=
(
DateTime
?)
dr
[
"update_time"
],
update_user_id
=
dr
[
"update_user_id"
].
ToString
(),
Create_time
=
(
DateTime
?)
dr
[
"Create_time"
],
Create_user_id
=
dr
[
"Create_user_id"
].
ToString
(),
cn_name
=
dr
[
"cn_name"
].
ToString
(),
};
Hislist
.
Add
(
hisT
);
}
}
response
.
Code
=
"1"
;
response
.
Msg
=
Hislist
;
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
}
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
;
}
/// <summary>
/// 取得EHR匯出歷史單筆細節
/// </summary>
/// <param ></param>
/// <returns></returns>
[
Route
(
"GetExportEHRhis_Detail"
)]
[
CorsHandle
]
[
HttpPost
]
//[HttpGet]
public
HttpResponseMessage
Get_ExportEHR_hisDetail
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
try
{
string
JsonString
=
""
;
List
<
ExportEHR_hisModel
>
Hislist
=
new
List
<
ExportEHR_hisModel
>();
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
SqlCommand
cmd
=
new
SqlCommand
(
""
,
Conn
)
{
CommandText
=
@"select b.cn_name, a.* from esn_todos_SettleLog a
left join s_user_info b on a.Create_user_id=b.user_id
where a.Create_user_id=@Create_user_id and a.id=@id "
};
cmd
.
Parameters
.
AddWithValue
(
"@Create_user_id"
,
obj_input
[
"gUserID_wade"
].
ToString
());
cmd
.
Parameters
.
AddWithValue
(
"@id"
,
obj_input
[
"id"
].
ToString
());
DataTable
dt
=
SqlToDt
(
cmd
);
foreach
(
DataRow
dr
in
dt
.
Rows
)
{
JsonString
=
dr
[
"SaveData"
].
ToString
();
}
}
response
.
Code
=
"1"
;
response
.
Msg
=
JsonString
;
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
}
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
;
}
/// <summary>
/// FLOW 保存
/// </summary>
...
...
@@ -525,11 +399,141 @@ namespace WebAPI.Controllers
}
/// <summary>
/// 取得EHR匯出歷史
/// </summary>
/// <param ></param>
/// <returns></returns>
[
Route
(
"GetExportEHRhis"
)]
[
CorsHandle
]
[
HttpPost
]
//[HttpGet]
public
HttpResponseMessage
Get_ExportEHR_his
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
try
{
List
<
ExportEHR_hisModel
>
Hislist
=
new
List
<
ExportEHR_hisModel
>();
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
ExportEHR_hisModel
hisT
;
SqlCommand
cmd
=
new
SqlCommand
(
""
,
Conn
)
{
CommandText
=
@"select b.cn_name, a.id, a.Country, a.update_time, a.update_user_id, a.Create_user_id, a.Create_time from esn_todos_SettleLog a
left join s_user_info b on a.Create_user_id=b.user_id
where a.Create_user_id=@Create_user_id @wherecase"
};
String
wherecase
=
obj_input
[
"gUserID_wade"
]
==
null
||
string
.
IsNullOrEmpty
(
obj_input
[
"gUserID_wade"
].
ToString
())
?
" or 1=1"
:
""
;
cmd
.
Parameters
.
AddWithValue
(
"@Create_user_id"
,
obj_input
[
"gUserID_wade"
].
ToString
());
cmd
.
CommandText
=
cmd
.
CommandText
.
Replace
(
"@wherecase"
,
wherecase
);
DataSet
ds
=
SqlToDs
(
cmd
);
foreach
(
DataRow
dr
in
ds
.
Tables
[
0
].
Rows
)
{
hisT
=
new
ExportEHR_hisModel
()
{
id
=
(
int
)
dr
[
"id"
],
//SaveData = dr["SaveData"].ToString(),
update_time
=
(
DateTime
?)
dr
[
"update_time"
],
update_user_id
=
dr
[
"update_user_id"
].
ToString
(),
Create_time
=
(
DateTime
?)
dr
[
"Create_time"
],
Create_user_id
=
dr
[
"Create_user_id"
].
ToString
(),
cn_name
=
dr
[
"cn_name"
].
ToString
(),
};
Hislist
.
Add
(
hisT
);
}
}
response
.
Code
=
"1"
;
response
.
Msg
=
Hislist
;
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
}
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
;
}
/// <summary>
/// 取得EHR匯出歷史單筆細節
/// </summary>
/// <param ></param>
/// <returns></returns>
[
Route
(
"GetExportEHRhis_Detail"
)]
[
CorsHandle
]
[
HttpPost
]
//[HttpGet]
public
HttpResponseMessage
Get_ExportEHR_hisDetail
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
try
{
string
JsonString
=
""
;
List
<
ExportEHR_hisModel
>
Hislist
=
new
List
<
ExportEHR_hisModel
>();
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
SqlCommand
cmd
=
new
SqlCommand
(
""
,
Conn
)
{
CommandText
=
@"select b.cn_name, a.* from esn_todos_SettleLog a
left join s_user_info b on a.Create_user_id=b.user_id
where a.id=@id "
};
cmd
.
Parameters
.
AddWithValue
(
"@Create_user_id"
,
obj_input
[
"gUserID_wade"
].
ToString
());
cmd
.
Parameters
.
AddWithValue
(
"@id"
,
obj_input
[
"id"
].
ToString
());
DataTable
dt
=
SqlToDt
(
cmd
);
foreach
(
DataRow
dr
in
dt
.
Rows
)
{
JsonString
=
dr
[
"SaveData"
].
ToString
();
}
}
response
.
Code
=
"1"
;
response
.
Msg
=
JsonString
;
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
}
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
;
}
/// <summary>
/// 紀錄EHR匯出資料
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[
Route
(
"SavePointSettlementLog"
)]
[
CorsHandle
]
[
HttpPost
]
[
HttpGet
]
public
HttpResponseMessage
Save_
PointSettlement_Log
(
ParamModel
param
)
public
HttpResponseMessage
Save_
ExportEHR_his
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
...
...
@@ -537,7 +541,7 @@ namespace WebAPI.Controllers
try
{
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
DataTable
dt
=
Save_
PointSettlement_Log
_Base
(
obj_input
);
DataTable
dt
=
Save_
ExportEHR_his
_Base
(
obj_input
);
response
.
Code
=
"1"
;
response
.
Msg
=
"匯出完畢"
;
}
...
...
@@ -545,8 +549,7 @@ namespace WebAPI.Controllers
{
response
.
Code
=
"0"
;
response
.
Msg
=
"Exception:"
+
e
.
StackTrace
;
}
}
}
else
{
...
...
@@ -556,7 +559,7 @@ namespace WebAPI.Controllers
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
return
result
;
}
public
static
DataTable
Save_
PointSettlement_Log
_Base
(
JObject
obj_input
)
public
static
DataTable
Save_
ExportEHR_his
_Base
(
JObject
obj_input
)
{
DataTable
dt
=
null
;
JArray
obj_input_data
=
JArray
.
Parse
(
obj_input
[
"SaveData"
].
ToString
());
...
...
WebAPI/Controllers/Esn_Subitem/Esn_todosController.cs
View file @
c31d321d
...
...
@@ -633,7 +633,7 @@ namespace WebAPI.Controllers
obj_input
[
"gUserID_wade"
]
=
obj_input
[
"@p_Emp_ID"
];
String
jstring
=
JsonConvert
.
SerializeObject
(
ExportEhr
);
obj_input
[
"SaveData"
]
=
jstring
;
DataTable
dtsave
=
Esn_Todos_FlowController
.
Save_
PointSettlement_Log
_Base
(
obj_input
);
DataTable
dtsave
=
Esn_Todos_FlowController
.
Save_
ExportEHR_his
_Base
(
obj_input
);
response
.
Msg
=
ExportEhr
;
response
.
Code
=
"1"
;
}
...
...
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