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
82bbb942
Commit
82bbb942
authored
Aug 17, 2022
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:命名規範改從處理事項 取得資訊
parent
93ca4fb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
WebAPI/Controllers/WadeMailController.cs
WebAPI/Controllers/WadeMailController.cs
+30
-19
No files found.
WebAPI/Controllers/WadeMailController.cs
View file @
82bbb942
...
...
@@ -29,13 +29,14 @@ namespace WebAPI.Controllers
response
=
new
CommonResponseMsg
();
connString
=
ConfigurationManager
.
ConnectionStrings
[
"DefaultConnection"
].
ConnectionString
;
}
/// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[
Route
(
"Get_essen_back_file_rule"
)]
[
CorsHandle
]
[
CorsHandle
]
[
HttpPost
]
public
HttpResponseMessage
Get_essen_back_file_rule
(
ParamModel
param
)
{
...
...
@@ -48,26 +49,36 @@ namespace WebAPI.Controllers
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
var
dysql
=
Conn
.
QueryBuilder
(
$@"
SELECT cc.customer_name,icp.ctrl_proc_zh_tw,icp.ctrl_proc_zh_cn,ebfr.* FROM essen_back_file_rule ebfr
left join
c_customer cc on cc.customer_id =ebfr.customer
_id
left join i_ctrl_proc icp on icp.ctrl_proc_id =ebfr.ctrl_proc
_id
select epci.customer_name,eppi.ctrl_proc_zh_tw,eppi.ctrl_proc_zh_cn,ebfr.* from evw_p_proc_info eppi
left join
evw_p_case_info epci on epci.case_id=eppi.case
_id
inner join essen_back_file_rule ebfr on eppi.ctrl_proc_id=ebfr.ctrl_proc_id and eppi.country_id=ebfr.country
_id
/**where**/ "
);
if
(
obj_input
[
"
ctrl_
proc_id"
]
!=
null
)
if
(
obj_input
[
"proc_id"
]
!=
null
)
{
dysql
.
Where
(
$"icp.ctrl_proc_id in (
{
obj_input
[
"ctrl_proc_id"
].
ToString
()}
)"
);
string
[]
procids
=
obj_input
[
"proc_id"
].
ToString
().
Split
(
','
);
dysql
.
Where
(
$"eppi.proc_id in (
{
procids
}
)"
);
}
if
(
obj_input
[
"c
ustomer
_id"
]
!=
null
)
if
(
obj_input
[
"c
ase
_id"
]
!=
null
)
{
dysql
.
Where
(
$"
cc.customer_id in (
{
obj_input
[
"customer_id"
].
ToString
()}
)"
);
dysql
.
Where
(
$"
epci.case_id in ('
{
obj_input
[
"case_id"
].
ToString
()}
'
)"
);
}
if
(
obj_input
[
"country_id"
]
!=
null
)
if
(
obj_input
[
"
Case_
country_id"
]
!=
null
)
{
dysql
.
Where
(
$" ebfr.country_id in (
{
obj_input
[
"country_id"
].
ToString
()}
)"
);
}
var
results
=
dysql
.
Query
();
dysql
.
Where
(
$"epci.country_id = '
{
obj_input
[
"Case_country_id"
].
ToString
()}
'"
);
}
if
(
obj_input
[
"case_type_Code"
]
!=
null
)
{
dysql
.
Where
(
$"epci.case_type_Code = '
{
obj_input
[
"case_type_Code"
].
ToString
()}
'"
);
}
if
(
obj_input
[
"customer_name"
]
!=
null
)
{
dysql
.
Where
(
$"epci.customer_name like '
{
obj_input
[
"customer_name"
].
ToString
()}
%'"
);
}
var
results
=
dysql
.
Query
();
response
.
Msg
=
JsonConvert
.
SerializeObject
(
results
);
response
.
Code
=
"1"
;
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -84,9 +95,10 @@ namespace WebAPI.Controllers
result
.
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
response
),
System
.
Text
.
Encoding
.
UTF8
,
"application/json"
);
return
result
;
}
/// <summary>
/// 取得
Mail_js內返稿文件命名規範
資訊
/// 取得
處理事項,案件
資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
...
...
@@ -104,15 +116,14 @@ namespace WebAPI.Controllers
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
string
sql_fields
=
obj_input
[
"sql_fields"
]
==
null
?
"*"
:
obj_input
[
"sql_fields"
].
ToString
();
FormattableString
sql
=
$@" select
TOP 10
{
sql_fields
}
from evw_p_proc_info eppi
FormattableString
sql
=
$@" select
*
from evw_p_proc_info eppi
left join evw_p_case_info epci on epci.case_id=eppi.case_id
/**where**/ "
;
var
dysql
=
Conn
.
QueryBuilder
();
dysql
.
AppendLine
(
$" select TOP 10
{
sql_fields
}
from evw_p_proc_info eppi"
);
dysql
.
AppendLine
(
$"left join evw_p_case_info epci on epci.case_id=eppi.case_id"
);
var
dysql
=
Conn
.
QueryBuilder
(
sql
);
if
(
obj_input
[
"proc_id"
]
!=
null
)
{
dysql
.
Where
(
$"eppi.proc_id in (
{
obj_input
[
"proc_id"
].
ToString
()}
)"
);
string
[]
procids
=
obj_input
[
"proc_id"
].
ToString
().
Split
(
','
);
dysql
.
Where
(
$"eppi.proc_id in (
{
procids
}
)"
);
}
if
(
obj_input
[
"case_id"
]
!=
null
)
{
...
...
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