Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
171214e6
Commit
171214e6
authored
Jan 15, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:组件功能
parent
fd9786b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
3 deletions
+45
-3
GlobalConfig.cs
Bailun.DC.Common/GlobalConfig.cs
+5
-0
ComponentEnum.cs
Bailun.DC.Models/Component/Enum/ComponentEnum.cs
+8
-2
BaseService.cs
Bailun.DC.Services/Component/BaseService.cs
+18
-0
DictionaryService.cs
Bailun.DC.Services/Component/DictionaryService.cs
+14
-1
No files found.
Bailun.DC.Common/GlobalConfig.cs
View file @
171214e6
...
@@ -48,6 +48,11 @@ namespace Bailun.DC.Common
...
@@ -48,6 +48,11 @@ namespace Bailun.DC.Common
/// 数据仓库
/// 数据仓库
/// </summary>
/// </summary>
public
static
string
ConnectionString_DW
=
"server=gz-cdb-ncg4yhjb.sql.tencentcdb.com;port=58537;database=datawarehouse;uid=root;password=#7kfnymAM$Y9-Ntf;SslMode=none;"
;
public
static
string
ConnectionString_DW
=
"server=gz-cdb-ncg4yhjb.sql.tencentcdb.com;port=58537;database=datawarehouse;uid=root;password=#7kfnymAM$Y9-Ntf;SslMode=none;"
;
/// <summary>
/// 产品库
/// </summary>
public
static
string
ConnectionString_Pro
=
"Server=gz-cdb-oxt89knc.sql.tencentcdb.com;port=62967;database=bailun_bltpro;uid=root;password=#7kfnymAM$Y9-Ntf;Convert Zero Datetime=True;Allow User Variables=True;pooling=true"
;
}
}
}
}
Bailun.DC.Models/Component/Enum/ComponentEnum.cs
View file @
171214e6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Bailun.DC.Models.Component.Enum
namespace
Bailun.DC.Models.Component.Enum
{
{
/// <summary>
/// <summary>
/// 数据库:1: 数据中心, 2: 交易流水
/// 数据库:1: 数据中心, 2: 交易流水
, 3: 产品库
/// </summary>
/// </summary>
public
enum
DBEnum
public
enum
DBEnum
{
{
...
@@ -17,6 +17,12 @@ namespace Bailun.DC.Models.Component.Enum
...
@@ -17,6 +17,12 @@ namespace Bailun.DC.Models.Component.Enum
/// 交易流水
/// 交易流水
/// </summary>
/// </summary>
[
Description
(
"交易流水"
)]
[
Description
(
"交易流水"
)]
DataWareHouse
=
2
DataWareHouse
=
2
,
/// <summary>
/// 产品库
/// </summary>
[
Description
(
"产品库"
)]
Pro
=
3
}
}
}
}
Bailun.DC.Services/Component/BaseService.cs
View file @
171214e6
...
@@ -53,6 +53,24 @@ namespace Bailun.DC.Services.Component
...
@@ -53,6 +53,24 @@ namespace Bailun.DC.Services.Component
}
}
}
}
private
MySqlConnection
_PRO_DB
;
public
MySqlConnection
PRO_DB
{
get
{
if
(
_PRO_DB
==
null
)
{
_PRO_DB
=
new
MySqlConnection
(
GlobalConfig
.
ConnectionString_Pro
);
}
if
(
_PRO_DB
.
State
==
ConnectionState
.
Closed
)
{
_PRO_DB
.
Open
();
}
return
_PRO_DB
;
}
}
public
IEnumerable
<
T
>
DeserializeCollection
<
T
>(
string
jsonStr
)
public
IEnumerable
<
T
>
DeserializeCollection
<
T
>(
string
jsonStr
)
{
{
IEnumerable
<
T
>
list
=
default
(
IEnumerable
<
T
>);
IEnumerable
<
T
>
list
=
default
(
IEnumerable
<
T
>);
...
...
Bailun.DC.Services/Component/DictionaryService.cs
View file @
171214e6
...
@@ -35,8 +35,21 @@ namespace Bailun.DC.Services.Component
...
@@ -35,8 +35,21 @@ namespace Bailun.DC.Services.Component
switch
(
entity
.
type
)
switch
(
entity
.
type
)
{
{
case
DictionaryTypeEnum
.
SQL
:
case
DictionaryTypeEnum
.
SQL
:
MySqlConnection
db
=
default
(
MySqlConnection
);
switch
(
entity
.
data_db
)
{
case
DBEnum
.
DataWareHouse
:
db
=
DW_DB
;
break
;
case
DBEnum
.
Pro
:
db
=
PRO_DB
;
break
;
default
:
db
=
DB
;
break
;
}
//查询
//查询
using
(
var
db
=
(
entity
.
data_db
==
DBEnum
.
DataWareHouse
?
DW_DB
:
DB
)
)
using
(
db
)
{
{
list
=
db
.
Query
(
entity
.
value
,
sqlparam
);
list
=
db
.
Query
(
entity
.
value
,
sqlparam
);
}
}
...
...
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