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
acc94b35
Commit
acc94b35
authored
Aug 16, 2022
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:merge
parent
327adaae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
1 deletion
+75
-1
WebAPI/Controllers/WadeMailController.cs
WebAPI/Controllers/WadeMailController.cs
+73
-1
WebAPI/WebAPI.csproj
WebAPI/WebAPI.csproj
+2
-0
No files found.
WebAPI/Controllers/WadeMailController.cs
View file @
acc94b35
...
@@ -4,6 +4,7 @@ using Newtonsoft.Json;
...
@@ -4,6 +4,7 @@ using Newtonsoft.Json;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
using
System.Configuration
;
using
System.Configuration
;
using
System.Linq
;
using
System.Data
;
using
System.Data
;
using
System.Data.SqlClient
;
using
System.Data.SqlClient
;
using
System.Net
;
using
System.Net
;
...
@@ -12,6 +13,8 @@ using System.Web;
...
@@ -12,6 +13,8 @@ using System.Web;
using
System.Web.Http
;
using
System.Web.Http
;
using
WebAPI.Models
;
using
WebAPI.Models
;
using
static
WebAPI
.
Tool
.
Common
;
using
static
WebAPI
.
Tool
.
Common
;
using
System.Collections.Generic
;
namespace
WebAPI.Controllers
namespace
WebAPI.Controllers
{
{
public
class
WadeMailController
:
ApiController
public
class
WadeMailController
:
ApiController
...
@@ -82,5 +85,74 @@ namespace WebAPI.Controllers
...
@@ -82,5 +85,74 @@ namespace WebAPI.Controllers
return
result
;
return
result
;
}
}
/// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[
Route
(
"ProcInfo/Get_evwProcInfo"
)]
[
CorsHandle
]
[
HttpPost
]
public
HttpResponseMessage
Get_evwProcInfo
(
ParamModel
param
)
{
if
(
param
!=
null
&&
param
.
Input
!=
null
&&
!
string
.
IsNullOrWhiteSpace
((
param
.
Input
.
ToString
())))
{
string
input
=
param
.
Input
.
ToString
();
try
{
JObject
obj_input
=
JObject
.
Parse
(
input
.
ToString
());
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
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"
);
if
(
obj_input
[
"proc_id"
]
!=
null
)
{
dysql
.
Where
(
$"eppi.proc_id in (
{
obj_input
[
"proc_id"
].
ToString
()}
)"
);
}
if
(
obj_input
[
"case_id"
]
!=
null
)
{
dysql
.
Where
(
$"epci.case_id in ('
{
obj_input
[
"case_id"
].
ToString
()}
')"
);
}
if
(
obj_input
[
"Case_country_id"
]
!=
null
)
{
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
()}
%'"
);
}
dysql
+=
$" ORDER BY epci.case_id"
;
var
results
=
dysql
.
Query
();
response
.
Msg
=
JsonConvert
.
SerializeObject
(
results
);
response
.
Code
=
"1"
;
}
}
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
;
}
}
}
}
}
WebAPI/WebAPI.csproj
View file @
acc94b35
...
@@ -210,6 +210,8 @@
...
@@ -210,6 +210,8 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"Controllers\AnnualInfoController.cs"
/>
<Compile
Include=
"Controllers\AnnualInfoController.cs"
/>
<Compile
Include=
"Controllers\Esn_Todos_FlowController.cs"
/>
<Compile
Include=
"Controllers\ValuesController.cs"
/>
<Compile
Include=
"Controllers\WadeMailController.cs"
/>
<Compile
Include=
"Controllers\WadeMailController.cs"
/>
<Compile
Include=
"Controllers\EssenToCrmController.cs"
/>
<Compile
Include=
"Controllers\EssenToCrmController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todos_SettleController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todos_SettleController.cs"
/>
...
...
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