Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
a8cecf99
Commit
a8cecf99
authored
Sep 26, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] delete Database Agent for create db
parent
30419404
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
66 deletions
+2
-66
DatabaseAgent.java
...i/src/main/java/pwc/taxtech/atms/agent/DatabaseAgent.java
+0
-42
ProjectServiceImpl.java
...ava/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
+2
-24
No files found.
atms-api/src/main/java/pwc/taxtech/atms/agent/DatabaseAgent.java
deleted
100644 → 0
View file @
30419404
package
pwc
.
taxtech
.
atms
.
agent
;
import
com.mysql.jdbc.MysqlErrorNumbers
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
java.sql.SQLException
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
CREATE_DB_EXISTS
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
CREATE_DB_FAILED
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
CREATE_DB_SUCCESS
;
@Service
public
class
DatabaseAgent
{
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
DatabaseAgent
.
class
);
@Autowired
private
JdbcTemplate
jdbcTemplate
;
public
int
createDatabase
(
String
dbName
)
{
try
{
jdbcTemplate
.
execute
(
"CREATE DATABASE "
+
dbName
+
" default charset utf8mb4 COLLATE utf8mb4_general_ci"
);
return
CREATE_DB_SUCCESS
;
}
catch
(
Exception
exception
)
{
if
(
exception
.
getCause
()
instanceof
SQLException
)
{
SQLException
ex
=
(
SQLException
)
exception
.
getCause
();
if
(
ex
.
getErrorCode
()
==
MysqlErrorNumbers
.
ER_DB_CREATE_EXISTS
)
{
LOGGER
.
warn
(
"db is exists {}"
,
dbName
);
return
CREATE_DB_EXISTS
;
}
}
LOGGER
.
warn
(
"Unknown Exception {}"
,
exception
.
getMessage
(),
exception
);
return
CREATE_DB_FAILED
;
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
View file @
a8cecf99
...
...
@@ -2,22 +2,14 @@ package pwc.taxtech.atms.service.impl;
import
com.google.common.base.Predicate
;
import
com.google.common.collect.Lists
;
import
org.apache.ibatis.io.Resources
;
import
org.apache.ibatis.jdbc.ScriptRunner
;
import
org.apache.ibatis.session.SqlSession
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.reflections.util.Utils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.agent.DatabaseAgent
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.OperateLogType
;
import
pwc.taxtech.atms.common.OperationModule
;
import
pwc.taxtech.atms.common.datasource.ShardingContextHolder
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.dao.OrganizationServiceTemplateGroupMapper
;
import
pwc.taxtech.atms.dao.ProjectClientMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
...
...
@@ -25,39 +17,28 @@ import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import
pwc.taxtech.atms.dao.ServiceTypeMapper
;
import
pwc.taxtech.atms.dao.StandardAccountMapper
;
import
pwc.taxtech.atms.dao.TemplateGroupMapper
;
import
pwc.taxtech.atms.dpo.ProjectDisplayDto
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.ProjectClientDto
;
import
pwc.taxtech.atms.dto.ServiceTypeDto
;
import
pwc.taxtech.atms.dto.TemplateGroupDto
;
import
pwc.taxtech.atms.dto.taxadmin.AddProjectResult
;
import
pwc.taxtech.atms.dpo.ProjectDisplayDto
;
import
pwc.taxtech.atms.dto.taxadmin.ProjectYearParam
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.entity.ProjectClientExample.Criteria
;
import
pwc.taxtech.atms.service.OperationLogService
;
import
pwc.taxtech.atms.service.ProjectService
;
import
pwc.taxtech.atms.vat.dao.VatStandardAccountMapper
;
import
pwc.taxtech.atms.vat.entity.VatStandardAccount
;
import
java.io.BufferedReader
;
import
java.io.BufferedWriter
;
import
java.io.IOException
;
import
java.io.Reader
;
import
java.io.StringReader
;
import
java.io.StringWriter
;
import
java.nio.charset.Charset
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.*;
@Service
public
class
ProjectServiceImpl
implements
ProjectService
{
/**
...
...
@@ -86,9 +67,6 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private
OperationLogService
operationLogService
;
@Autowired
private
DatabaseAgent
databaseAgent
;
@Autowired
private
SqlSessionTemplate
dynamicSqlSessionTemplate
;
...
...
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