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
c1a47508
Commit
c1a47508
authored
Jul 06, 2022
by
charleslee
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.essenptl.com/sol/code
parents
dc91ba3c
f17a2088
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
219 additions
and
5 deletions
+219
-5
WebAPI/Controllers/EssenToCrmController.cs
WebAPI/Controllers/EssenToCrmController.cs
+81
-0
WebAPI/Controllers/FeeOfferConfigController.cs
WebAPI/Controllers/FeeOfferConfigController.cs
+9
-5
WebAPI/Controllers/RoleInfoController.cs
WebAPI/Controllers/RoleInfoController.cs
+91
-0
WebAPI/Models/RoleInfo.cs
WebAPI/Models/RoleInfo.cs
+27
-0
WebAPI/Template/報價導入樣板- CN.xls
WebAPI/Template/報價導入樣板- CN.xls
+0
-0
WebAPI/WebAPI.csproj
WebAPI/WebAPI.csproj
+9
-0
WebAPI/packages.config
WebAPI/packages.config
+2
-0
No files found.
WebAPI/Controllers/EssenToCrmController.cs
0 → 100644
View file @
c1a47508
using
Dapper
;
using
DapperQueryBuilder
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Configuration
;
using
System.Data
;
using
System.Data.SqlClient
;
using
System.Net
;
using
System.Net.Http
;
using
System.Web
;
using
System.Web.Http
;
using
WebAPI.Models
;
using
static
WebAPI
.
Tool
.
Common
;
namespace
WebAPI.Controllers
{
public
class
EssenToCrmController
:
ApiController
{
HttpResponseMessage
result
;
CommonResponseMsg
response
;
String
connString
;
public
EssenToCrmController
()
{
result
=
new
HttpResponseMessage
(
HttpStatusCode
.
OK
);
response
=
new
CommonResponseMsg
();
connString
=
ConfigurationManager
.
ConnectionStrings
[
"DefaultConnection"
].
ConnectionString
;
}
/// <summary>
/// 取得 essen_request_info 資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[
Route
(
"Get_essen_request_info"
)]
[
CorsHandle
]
[
HttpPost
]
public
HttpResponseMessage
Get_essen_request_info
(
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
))
{
var
dysql
=
Conn
.
QueryBuilder
(
$@" select eri.request_id,eri.customer_id,iri.invoice_title, cc.customer_name from essen_request_info eri
left join i_request_info iri on eri.request_id=iri.request_id
left join c_customer cc on cc.customer_id=eri.customer_id
/**where**/ "
);
if
(
obj_input
[
"request_id"
]
!=
null
)
{
dysql
.
Where
(
$"eri.request_id =
{
obj_input
[
"request_id"
].
ToString
()}
"
);
}
if
(
obj_input
[
"customer_id"
]
!=
null
)
{
dysql
.
Where
(
$" eri.customer_id =
{
obj_input
[
"customer_id"
].
ToString
()}
"
);
}
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/Controllers/FeeOfferConfigController.cs
View file @
c1a47508
...
@@ -267,11 +267,15 @@ namespace WebAPI.Controllers
...
@@ -267,11 +267,15 @@ namespace WebAPI.Controllers
String
errmsg
=
""
,
msg
=
""
;
String
errmsg
=
""
,
msg
=
""
;
List
<
Message
>
OutmsgLIst
=
new
List
<
Message
>();
List
<
Message
>
OutmsgLIst
=
new
List
<
Message
>();
String
connString
=
ConfigurationManager
.
ConnectionStrings
[
"DefaultConnection"
].
ConnectionString
;
String
connString
=
ConfigurationManager
.
ConnectionStrings
[
"DefaultConnection"
].
ConnectionString
;
Message
msgt
;
Message
msgt
;
var
table
=
ds
.
Tables
[
0
];
var
table
=
ds
.
Tables
[
0
];
DataRow
drh
=
table
.
Rows
[
0
];
DataRow
drh
=
table
.
Rows
[
0
];
for
(
int
i
=
0
;
i
<
drh
.
ItemArray
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
drh
.
ItemArray
.
Length
;
i
++)
table
.
Columns
[
i
].
ColumnName
=
ToTraditional
(
drh
[
i
].
ToString
());
{
string
a
=
drh
[
i
].
ToString
();
Console
.
WriteLine
(
ToTraditional
(
drh
[
i
].
ToString
()));
table
.
Columns
[
i
].
ColumnName
=
ToTraditional
(
drh
[
i
].
ToString
());
}
Dictionary
<
String
,
String
>
ids
=
new
Dictionary
<
String
,
String
>(),
Temps
=
new
Dictionary
<
String
,
String
>();
Dictionary
<
String
,
String
>
ids
=
new
Dictionary
<
String
,
String
>(),
Temps
=
new
Dictionary
<
String
,
String
>();
DataRow
drRow
;
DataRow
drRow
;
...
...
WebAPI/Controllers/RoleInfoController.cs
0 → 100644
View file @
c1a47508
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System.IO
;
using
System.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Configuration
;
using
System.Data
;
using
System.Data.SqlClient
;
using
System.Net
;
using
System.Net.Http
;
using
System.Web
;
using
Dapper
;
using
Dapper.Contrib.Extensions
;
using
System.Web.Http
;
using
WebAPI.Models
;
using
MySql.Data.MySqlClient
;
using
static
WebAPI
.
Tool
.
Common
;
using
System.Text
;
namespace
WebAPI.Controllers
{
[
RoutePrefix
(
"RoleInfo"
)]
public
class
RoleInfoController
:
ApiController
{
HttpResponseMessage
result
;
CommonResponseMsg
response
;
String
connString
;
public
RoleInfoController
()
{
result
=
new
HttpResponseMessage
(
HttpStatusCode
.
OK
);
response
=
new
CommonResponseMsg
();
connString
=
ConfigurationManager
.
ConnectionStrings
[
"DefaultConnection"
].
ConnectionString
;
}
/// <summary>
/// 取得角色資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[
Route
(
"Get_s_role_info"
)]
[
CorsHandle
]
[
HttpPost
]
public
HttpResponseMessage
Get_s_role_info
(
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
=
string
.
Empty
;
using
(
SqlConnection
Conn
=
new
SqlConnection
(
connString
))
{
string
sqlstr
=
@"select c.* from evw_Employee a
left join s_user_role b on a.user_id = b.user_id
left join s_role_info c on b.role_id = c.role_id
where a.user_id = @user_id "
;
if
(
obj_input
[
"role_code"
]
!=
null
)
{
sqlstr
+=
" and role_code=@role_code"
;
}
var
results
=
Conn
.
Query
<
Get_s_role_infoModel
>(
sqlstr
,
new
{
user_id
=
obj_input
[
"user_id"
]
==
null
?
""
:
obj_input
[
"user_id"
].
ToString
(),
role_code
=
obj_input
[
"role_code"
]
==
null
?
""
:
obj_input
[
"role_code"
].
ToString
()
}
,
commandType
:
CommandType
.
Text
);
JSONString
=
JsonConvert
.
SerializeObject
(
results
);
}
response
.
Msg
=
JSONString
;
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/Models/RoleInfo.cs
0 → 100644
View file @
c1a47508
using
System
;
using
Dapper.Contrib.Extensions
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Web
;
namespace
WebAPI.Models
{
[
Table
(
"s_role_info"
)]
public
class
s_role_infoModel
{
public
String
user_id
{
get
;
set
;
}
public
String
role_id
{
get
;
set
;
}
public
String
identity_id
{
get
;
set
;
}
}
public
class
Get_s_role_infoModel
{
public
String
role_id
{
get
;
set
;
}
public
String
role_name
{
get
;
set
;
}
public
String
role_code
{
get
;
set
;
}
public
String
is_default
{
get
;
set
;
}
public
String
remark
{
get
;
set
;
}
public
String
is_show
{
get
;
set
;
}
}
}
\ No newline at end of file
WebAPI/Template/報價導入樣板- CN.xls
View file @
c1a47508
No preview for this file type
WebAPI/WebAPI.csproj
View file @
c1a47508
...
@@ -61,6 +61,12 @@
...
@@ -61,6 +61,12 @@
<Reference
Include=
"Dapper.Contrib, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<Reference
Include=
"Dapper.Contrib, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Dapper.Contrib.2.0.78\lib\net461\Dapper.Contrib.dll
</HintPath>
<HintPath>
packages\Dapper.Contrib.2.0.78\lib\net461\Dapper.Contrib.dll
</HintPath>
</Reference>
</Reference>
<Reference
Include=
"Dapper.SqlBuilder, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Dapper.SqlBuilder.2.0.78\lib\net461\Dapper.SqlBuilder.dll
</HintPath>
</Reference>
<Reference
Include=
"DapperQueryBuilder, Version=1.2.5.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Dapper-QueryBuilder.1.2.5\lib\net472\DapperQueryBuilder.dll
</HintPath>
</Reference>
<Reference
Include=
"DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL"
>
<Reference
Include=
"DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL"
>
<HintPath>
packages\DocumentFormat.OpenXml.2.7.2\lib\net46\DocumentFormat.OpenXml.dll
</HintPath>
<HintPath>
packages\DocumentFormat.OpenXml.2.7.2\lib\net46\DocumentFormat.OpenXml.dll
</HintPath>
</Reference>
</Reference>
...
@@ -204,11 +210,13 @@
...
@@ -204,11 +210,13 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"Controllers\AnnualInfoController.cs"
/>
<Compile
Include=
"Controllers\AnnualInfoController.cs"
/>
<Compile
Include=
"Controllers\EssenToCrmController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todos_SettleController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todos_SettleController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todosController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todosController.cs"
/>
<Compile
Include=
"Controllers\DictionaryController.cs"
/>
<Compile
Include=
"Controllers\DictionaryController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_Todos_FlowController.cs"
/>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_Todos_FlowController.cs"
/>
<Compile
Include=
"Controllers\CustomerController.cs"
/>
<Compile
Include=
"Controllers\CustomerController.cs"
/>
<Compile
Include=
"Controllers\RoleInfoController.cs"
/>
<Compile
Include=
"Controllers\FileController.cs"
/>
<Compile
Include=
"Controllers\FileController.cs"
/>
<Compile
Include=
"Controllers\InventorController.cs"
/>
<Compile
Include=
"Controllers\InventorController.cs"
/>
<Compile
Include=
"Controllers\RequestController.cs"
/>
<Compile
Include=
"Controllers\RequestController.cs"
/>
...
@@ -220,6 +228,7 @@
...
@@ -220,6 +228,7 @@
<Compile
Include=
"Dal\DalFee.cs"
/>
<Compile
Include=
"Dal\DalFee.cs"
/>
<Compile
Include=
"Dal\DalCaseInfo.cs"
/>
<Compile
Include=
"Dal\DalCaseInfo.cs"
/>
<Compile
Include=
"Dal\DalProcInfo.cs"
/>
<Compile
Include=
"Dal\DalProcInfo.cs"
/>
<Compile
Include=
"Models\RoleInfo.cs"
/>
<Compile
Include=
"Models\DataObjects\PCaseInfo.cs"
/>
<Compile
Include=
"Models\DataObjects\PCaseInfo.cs"
/>
<Compile
Include=
"Models\DataObjects\SDeptInfo.cs"
/>
<Compile
Include=
"Models\DataObjects\SDeptInfo.cs"
/>
<Compile
Include=
"Models\DataObjects\SDeptUser.cs"
/>
<Compile
Include=
"Models\DataObjects\SDeptUser.cs"
/>
...
...
WebAPI/packages.config
View file @
c1a47508
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
<
package
id
=
"BouncyCastle"
version
=
"1.8.9"
targetFramework
=
"net48"
/>
<
package
id
=
"BouncyCastle"
version
=
"1.8.9"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper"
version
=
"2.0.123"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper"
version
=
"2.0.123"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper.Contrib"
version
=
"2.0.78"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper.Contrib"
version
=
"2.0.78"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper.SqlBuilder"
version
=
"2.0.78"
targetFramework
=
"net48"
/>
<
package
id
=
"Dapper-QueryBuilder"
version
=
"1.2.5"
targetFramework
=
"net48"
/>
<
package
id
=
"EastAsiaNumericFormatter"
version
=
"1.0.0"
targetFramework
=
"net48"
/>
<
package
id
=
"EastAsiaNumericFormatter"
version
=
"1.0.0"
targetFramework
=
"net48"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net48"
/>
<
package
id
=
"EntityFramework"
version
=
"6.2.0"
targetFramework
=
"net48"
/>
<
package
id
=
"EntityFramework.zh-Hant"
version
=
"6.2.0"
targetFramework
=
"net48"
/>
<
package
id
=
"EntityFramework.zh-Hant"
version
=
"6.2.0"
targetFramework
=
"net48"
/>
...
...
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