Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-tool
Project
Project
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
tool
amos-tool
Commits
d028040d
Commit
d028040d
authored
Jan 11, 2024
by
chenzai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit 修改导出175时前缀产生的问题
parent
6a96aa1a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
DatabaseUtils.java
...n/java/com/yeejoin/amos/api/tool/utils/DatabaseUtils.java
+19
-2
application.properties
src/main/resources/application.properties
+1
-1
No files found.
src/main/java/com/yeejoin/amos/api/tool/utils/DatabaseUtils.java
View file @
d028040d
...
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.api.tool.face.model.DatabaseConnectionModel
;
import
com.yeejoin.amos.api.tool.face.model.DatabaseConnectionModel
;
import
com.yeejoin.amos.api.tool.face.orm.entity.TableColumn
;
import
com.yeejoin.amos.api.tool.face.orm.entity.TableColumn
;
import
com.yeejoin.amos.api.tool.face.service.DatabaseConnectionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -68,6 +70,12 @@ public class DatabaseUtils {
...
@@ -68,6 +70,12 @@ public class DatabaseUtils {
}
}
private
static
DatabaseConnectionService
databaseConnectionService
;
@Autowired
public
void
setDatabaseConnectionService
(
DatabaseConnectionService
databaseConnectionService
)
{
DatabaseUtils
.
databaseConnectionService
=
databaseConnectionService
;
}
/**
/**
* 连接数据库
* 连接数据库
...
@@ -84,10 +92,19 @@ public class DatabaseUtils {
...
@@ -84,10 +92,19 @@ public class DatabaseUtils {
if
(
model
.
getSuffix
()
==
null
||
model
.
getSuffix
().
isEmpty
()
||
model
.
getSuffix
().
equals
(
"null"
))
{
if
(
model
.
getSuffix
()
==
null
||
model
.
getSuffix
().
isEmpty
()
||
model
.
getSuffix
().
equals
(
"null"
))
{
model
.
setSuffix
(
""
);
model
.
setSuffix
(
""
);
}
}
/**
* 上一步有set操作,不确定是否修改过数据库名为需要导出的数据库名
* 修改后不会有重复拼接问题或者拼接前缀导致查询不到数据库
*/
// 连接新增的数据库
// 连接新增的数据库
String
dbUrl
=
"jdbc:mysql://"
+
model
.
getIp
()
+
":"
+
model
.
getPort
()
+
"/"
+
String
dbUrl
=
""
;
DatabaseConnectionModel
changeModel
=
databaseConnectionService
.
queryBySeq
(
model
.
getSequenceNbr
());
if
(!
model
.
getDbName
().
equals
(
changeModel
.
getDbName
())){
dbUrl
=
"jdbc:mysql://"
+
model
.
getIp
()
+
":"
+
model
.
getPort
()
+
"/"
+
model
.
getDbName
();
}
else
{
dbUrl
=
"jdbc:mysql://"
+
model
.
getIp
()
+
":"
+
model
.
getPort
()
+
"/"
+
model
.
getPrefix
()
+
model
.
getDbName
()
+
model
.
getSuffix
();
model
.
getPrefix
()
+
model
.
getDbName
()
+
model
.
getSuffix
();
// String dbUrl = "jdbc:mysql://" + model.getIp() + ":" + model.getPort() + "/" + model.getDbName();
}
// 解密pwd,并连接
// 解密pwd,并连接
return
DriverManager
.
getConnection
(
dbUrl
,
model
.
getUserName
(),
AESUtils
.
decrypt
(
model
.
getPassWord
()));
return
DriverManager
.
getConnection
(
dbUrl
,
model
.
getUserName
(),
AESUtils
.
decrypt
(
model
.
getPassWord
()));
...
...
src/main/resources/application.properties
View file @
d028040d
spring.application.name
=
AMOS-ATL
spring.application.name
=
AMOS-ATL
server.servlet.context-path
=
/atl
server.servlet.context-path
=
/atl
#server.servlet.context-path=/jcs
#server.servlet.context-path=/jcs
server.port
=
3000
1
server.port
=
3000
2
#server.port=20000
#server.port=20000
spring.profiles.active
=
dev
spring.profiles.active
=
dev
#spring.profiles.active=qa
#spring.profiles.active=qa
...
...
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