Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
Nse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
Nse
Commits
b080293c
Commit
b080293c
authored
Aug 19, 2025
by
wuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版本
parent
f3e116f8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
2885 行增加
和
0 行删除
+2885
-0
src/main/java/com/chenyang/nse/bussiness/controller/console/DBFieldTypesController.java
+99
-0
src/main/java/com/chenyang/nse/bussiness/controller/core/DataSystemController.java
+0
-0
src/main/java/com/chenyang/nse/bussiness/dao/table/core/rule/conditions/DateConditionsDao.java
+9
-0
src/main/java/com/chenyang/nse/bussiness/encryptionrule/model/DataSystem.java
+47
-0
src/main/java/com/chenyang/nse/bussiness/engine/infa/powercenter961/pubbean/DataTypeBean.java
+40
-0
src/main/java/com/chenyang/nse/bussiness/entity/orm/table/core/rule/conditions/DateConditions.java
+39
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSourceAndTaskVO.java
+60
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSystemConfig.java
+412
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSystemVO.java
+285
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/auditlog/DbAccessPojo.java
+310
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/dataproject/DatasystemProjectdatasourceVO.java
+232
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/datascope/DataScopeVO.java
+0
-0
src/main/java/com/chenyang/nse/bussiness/entity/vo/datascope/DataSystemProjectVO.java
+98
-0
src/main/java/com/chenyang/nse/bussiness/init/DataSourceInit.java
+31
-0
src/main/java/com/chenyang/nse/bussiness/odbc/DbCache.java
+68
-0
src/main/java/com/chenyang/nse/bussiness/service/console/impl/DBFieldTypesServiceImpl.java
+87
-0
src/main/java/com/chenyang/nse/bussiness/service/core/DataScopeService.java
+131
-0
src/main/java/com/chenyang/nse/bussiness/service/core/DataSystemService.java
+158
-0
src/main/java/com/chenyang/nse/bussiness/service/core/DataSystemuserService.java
+4
-0
src/main/java/com/chenyang/nse/bussiness/service/core/impl/DataScopeServiceImpl.java
+0
-0
src/main/java/com/chenyang/nse/bussiness/service/core/impl/DataSecurityControlledAssetServiceImpl.java
+140
-0
src/main/java/com/chenyang/nse/bussiness/service/info/db/DB2.java
+0
-0
src/main/java/com/chenyang/nse/bussiness/tools/DataSourceTools.java
+18
-0
src/main/java/com/chenyang/nse/bussiness/tools/datatime/DateTime1Tool.java
+209
-0
src/main/java/com/chenyang/nse/bussiness/tools/datatime/DateTimeTool.java
+205
-0
src/main/java/com/chenyang/nse/bussiness/webtools/entity/vo/DataPreviewVO.java
+190
-0
src/main/java/com/chenyang/nse/bussiness/webtools/entity/vo/DatasystemVO.java
+0
-0
src/main/resources/sql/datasystemtreeuser.xml
+13
-0
没有找到文件。
src/main/java/com/chenyang/nse/bussiness/controller/console/DBFieldTypesController.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
controller
.
console
;
import
com.chenyang.nse.bussiness.dao.PageInfo
;
import
com.chenyang.nse.bussiness.entity.orm.table.console.TConsoleDbfieldtype
;
import
com.chenyang.nse.bussiness.entity.vo.ComboboxVO
;
import
com.chenyang.nse.bussiness.entity.vo.DataGridVO
;
import
com.chenyang.nse.bussiness.enumeration.EcolumnType
;
import
com.chenyang.nse.bussiness.enumeration.EdbType
;
import
com.chenyang.nse.bussiness.service.console.DBFieldTypesService
;
import
com.chenyang.nse.bussiness.service.console.DictionaryService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@RequestMapping
({
"/console/dbfieldtypes"
})
public
class
DBFieldTypesController
{
@Autowired
private
DBFieldTypesService
dbFieldTypesService
;
@Autowired
private
DictionaryService
dictionaryService
;
@RequestMapping
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
System
.
out
.
println
();
return
"console/dbfieldtypes"
;
}
@RequestMapping
({
"/query"
})
@ResponseBody
public
DataGridVO
<
TConsoleDbfieldtype
>
query
(
Integer
page
,
Integer
rows
,
PageInfo
pageInfo
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
pageInfo
.
setPageno
(
page
);
pageInfo
.
setPagesize
(
rows
);
List
<
TConsoleDbfieldtype
>
list
=
this
.
dbFieldTypesService
.
query
(
pageInfo
);
DataGridVO
<
TConsoleDbfieldtype
>
vo
=
new
DataGridVO
<
TConsoleDbfieldtype
>((
long
)
Integer
.
valueOf
(
String
.
valueOf
(
pageInfo
.
getCount
())),
list
);
return
vo
;
}
@RequestMapping
({
"/refreshDBFieldTypes"
})
public
void
refreshDBFieldTypes
()
{
this
.
dbFieldTypesService
.
refreshDBFieldTypes
();
}
@RequestMapping
({
"/add"
})
public
void
add
(
TConsoleDbfieldtype
dbFieldTypes
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
this
.
dbFieldTypesService
.
save
(
dbFieldTypes
);
}
@RequestMapping
({
"/remove"
})
public
void
remove
(
@RequestParam
(
"idlist[]"
)
List
<
String
>
idlist
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
this
.
dbFieldTypesService
.
remove
(
idlist
);
}
@RequestMapping
({
"/getcolumntypes"
})
@ResponseBody
public
List
<
ComboboxVO
>
getcolumntypes
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
List
<
ComboboxVO
>
list
=
new
ArrayList
();
EcolumnType
[]
db
=
EcolumnType
.
values
();
for
(
EcolumnType
ecolumnType
:
db
)
{
list
.
add
(
new
ComboboxVO
(
ecolumnType
.
getJavatype
(),
ecolumnType
.
getColumnname
()));
}
return
list
;
}
@RequestMapping
({
"/getdbtypes"
})
@ResponseBody
public
List
<
ComboboxVO
>
getdbtypes
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
List
<
ComboboxVO
>
list
=
new
ArrayList
();
EdbType
[]
db
=
EdbType
.
values
();
for
(
EdbType
item
:
db
)
{
list
.
add
(
new
ComboboxVO
(
item
.
getDbcode
()));
}
return
list
;
}
@RequestMapping
({
"/getenginecolumntypes"
})
@ResponseBody
public
List
<
ComboboxVO
>
getenginecolumntypes
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
List
<
String
>
typeList
=
this
.
dictionaryService
.
queryDictionaryValues
(
"12"
);
List
<
ComboboxVO
>
list
=
new
ArrayList
();
for
(
String
ecolumnType
:
typeList
)
{
list
.
add
(
new
ComboboxVO
(
ecolumnType
));
}
return
list
;
}
}
src/main/java/com/chenyang/nse/bussiness/controller/core/DataSystemController.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/java/com/chenyang/nse/bussiness/dao/table/core/rule/conditions/DateConditionsDao.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
dao
.
table
.
core
.
rule
.
conditions
;
import
com.chenyang.nse.bussiness.dao.BaseDao
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.rule.conditions.DateConditions
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
DateConditionsDao
extends
BaseDao
<
DateConditions
,
String
>
{
}
src/main/java/com/chenyang/nse/bussiness/encryptionrule/model/DataSystem.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
encryptionrule
.
model
;
public
class
DataSystem
{
private
String
datasystemid
;
private
String
dbip
;
private
String
dbport
;
private
String
dbservername
;
public
DataSystem
(
String
datasystemid
,
String
dbip
,
String
dbport
,
String
dbservername
)
{
this
.
datasystemid
=
datasystemid
;
this
.
dbip
=
dbip
;
this
.
dbport
=
dbport
;
this
.
dbservername
=
dbservername
;
}
public
String
getDatasystemid
()
{
return
this
.
datasystemid
;
}
public
void
setDatasystemid
(
String
datasystemid
)
{
this
.
datasystemid
=
datasystemid
;
}
public
String
getDbip
()
{
return
this
.
dbip
;
}
public
void
setDbip
(
String
dbip
)
{
this
.
dbip
=
dbip
;
}
public
String
getDbport
()
{
return
this
.
dbport
;
}
public
void
setDbport
(
String
dbport
)
{
this
.
dbport
=
dbport
;
}
public
String
getDbservername
()
{
return
this
.
dbservername
;
}
public
void
setDbservername
(
String
dbservername
)
{
this
.
dbservername
=
dbservername
;
}
}
src/main/java/com/chenyang/nse/bussiness/engine/infa/powercenter961/pubbean/DataTypeBean.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
engine
.
infa
.
powercenter961
.
pubbean
;
public
class
DataTypeBean
{
private
String
type
;
private
String
precision
;
private
String
scale
;
private
String
physical
;
public
String
getType
()
{
return
this
.
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getPrecision
()
{
return
this
.
precision
;
}
public
void
setPrecision
(
String
precision
)
{
this
.
precision
=
precision
;
}
public
String
getScale
()
{
return
this
.
scale
;
}
public
void
setScale
(
String
scale
)
{
this
.
scale
=
scale
;
}
public
String
getPhysical
()
{
return
this
.
physical
;
}
public
void
setPhysical
(
String
physical
)
{
this
.
physical
=
physical
;
}
}
src/main/java/com/chenyang/nse/bussiness/entity/orm/table/core/rule/conditions/DateConditions.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
orm
.
table
.
core
.
rule
.
conditions
;
import
com.chenyang.nse.bussiness.entity.orm.table.TBaseEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
@Entity
@Table
(
name
=
"t_console_dateconditions"
)
public
class
DateConditions
extends
TBaseEntity
{
private
String
starttime
;
private
String
endtime
;
private
String
ruleid
;
public
String
getStarttime
()
{
return
this
.
starttime
;
}
public
void
setStarttime
(
String
starttime
)
{
this
.
starttime
=
starttime
;
}
public
String
getEndtime
()
{
return
this
.
endtime
;
}
public
void
setEndtime
(
String
endtime
)
{
this
.
endtime
=
endtime
;
}
public
String
getRuleid
()
{
return
this
.
ruleid
;
}
public
void
setRuleid
(
String
ruleid
)
{
this
.
ruleid
=
ruleid
;
}
}
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSourceAndTaskVO.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
vo
;
public
class
DataSourceAndTaskVO
{
private
String
projectid
;
private
String
project
;
private
String
taskid
;
private
String
tname
;
private
String
updatetime
;
public
String
getProjectid
()
{
return
this
.
projectid
;
}
public
void
setProjectid
(
String
projectid
)
{
this
.
projectid
=
projectid
;
}
public
String
getProject
()
{
return
this
.
project
;
}
public
void
setProject
(
String
project
)
{
this
.
project
=
project
;
}
public
String
getTaskid
()
{
return
this
.
taskid
;
}
public
void
setTaskid
(
String
taskid
)
{
this
.
taskid
=
taskid
;
}
public
String
getTname
()
{
return
this
.
tname
;
}
public
void
setTname
(
String
tname
)
{
this
.
tname
=
tname
;
}
public
String
getUpdatetime
()
{
return
this
.
updatetime
;
}
public
void
setUpdatetime
(
String
updatetime
)
{
this
.
updatetime
=
updatetime
;
}
public
DataSourceAndTaskVO
(
String
projectid
,
String
project
,
String
taskid
,
String
tname
,
String
updatetime
)
{
this
.
projectid
=
projectid
;
this
.
project
=
project
;
this
.
taskid
=
taskid
;
this
.
tname
=
tname
;
this
.
updatetime
=
updatetime
;
}
public
DataSourceAndTaskVO
()
{
}
}
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSystemConfig.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/java/com/chenyang/nse/bussiness/entity/vo/DataSystemVO.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
vo
;
import
java.util.Date
;
public
class
DataSystemVO
{
private
String
id
;
private
String
flag
;
private
String
note
;
private
String
dbtype
;
private
String
dbip
;
private
String
dbport
;
private
String
dbservername
;
private
String
servername
;
private
String
username
;
private
String
password
;
private
Date
createtime
;
private
String
sysname
;
private
String
dbschema
;
private
String
parentid
;
private
String
inengine
;
private
String
pagecode
;
private
String
connectip
;
private
String
connectname
;
private
String
dblinkname
;
private
String
localdir
;
private
String
connectmode
;
private
String
istargetdb
;
private
String
iskerberos
;
private
String
principal
;
private
String
loginprincipal
;
private
String
keytab
;
private
String
ischarset
;
private
String
versionname
;
private
String
issysdba
;
private
String
crud
;
private
String
updateuserid
;
public
String
getId
()
{
return
this
.
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getFlag
()
{
return
this
.
flag
;
}
public
void
setFlag
(
String
flag
)
{
this
.
flag
=
flag
;
}
public
String
getNote
()
{
return
this
.
note
;
}
public
void
setNote
(
String
note
)
{
this
.
note
=
note
;
}
public
String
getDbtype
()
{
return
this
.
dbtype
;
}
public
void
setDbtype
(
String
dbtype
)
{
this
.
dbtype
=
dbtype
;
}
public
String
getDbip
()
{
return
this
.
dbip
;
}
public
void
setDbip
(
String
dbip
)
{
this
.
dbip
=
dbip
;
}
public
String
getDbport
()
{
return
this
.
dbport
;
}
public
void
setDbport
(
String
dbport
)
{
this
.
dbport
=
dbport
;
}
public
String
getDbservername
()
{
return
this
.
dbservername
;
}
public
void
setDbservername
(
String
dbservername
)
{
this
.
dbservername
=
dbservername
;
}
public
String
getServername
()
{
return
this
.
servername
;
}
public
void
setServername
(
String
servername
)
{
this
.
servername
=
servername
;
}
public
String
getUsername
()
{
return
this
.
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getPassword
()
{
return
this
.
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
Date
getCreatetime
()
{
return
this
.
createtime
;
}
public
void
setCreatetime
(
Date
createtime
)
{
this
.
createtime
=
createtime
;
}
public
String
getSysname
()
{
return
this
.
sysname
;
}
public
void
setSysname
(
String
sysname
)
{
this
.
sysname
=
sysname
;
}
public
String
getDbschema
()
{
return
this
.
dbschema
;
}
public
void
setDbschema
(
String
dbschema
)
{
this
.
dbschema
=
dbschema
;
}
public
String
getParentid
()
{
return
this
.
parentid
;
}
public
void
setParentid
(
String
parentid
)
{
this
.
parentid
=
parentid
;
}
public
String
getInengine
()
{
return
this
.
inengine
;
}
public
void
setInengine
(
String
inengine
)
{
this
.
inengine
=
inengine
;
}
public
String
getPagecode
()
{
return
this
.
pagecode
;
}
public
void
setPagecode
(
String
pagecode
)
{
this
.
pagecode
=
pagecode
;
}
public
String
getConnectip
()
{
return
this
.
connectip
;
}
public
void
setConnectip
(
String
connectip
)
{
this
.
connectip
=
connectip
;
}
public
String
getConnectname
()
{
return
this
.
connectname
;
}
public
void
setConnectname
(
String
connectname
)
{
this
.
connectname
=
connectname
;
}
public
String
getDblinkname
()
{
return
this
.
dblinkname
;
}
public
void
setDblinkname
(
String
dblinkname
)
{
this
.
dblinkname
=
dblinkname
;
}
public
String
getLocaldir
()
{
return
this
.
localdir
;
}
public
void
setLocaldir
(
String
localdir
)
{
this
.
localdir
=
localdir
;
}
public
String
getConnectmode
()
{
return
this
.
connectmode
;
}
public
void
setConnectmode
(
String
connectmode
)
{
this
.
connectmode
=
connectmode
;
}
public
String
getIstargetdb
()
{
return
this
.
istargetdb
;
}
public
void
setIstargetdb
(
String
istargetdb
)
{
this
.
istargetdb
=
istargetdb
;
}
public
String
getIskerberos
()
{
return
this
.
iskerberos
;
}
public
void
setIskerberos
(
String
iskerberos
)
{
this
.
iskerberos
=
iskerberos
;
}
public
String
getPrincipal
()
{
return
this
.
principal
;
}
public
void
setPrincipal
(
String
principal
)
{
this
.
principal
=
principal
;
}
public
String
getLoginprincipal
()
{
return
this
.
loginprincipal
;
}
public
void
setLoginprincipal
(
String
loginprincipal
)
{
this
.
loginprincipal
=
loginprincipal
;
}
public
String
getKeytab
()
{
return
this
.
keytab
;
}
public
void
setKeytab
(
String
keytab
)
{
this
.
keytab
=
keytab
;
}
public
String
getIscharset
()
{
return
this
.
ischarset
;
}
public
void
setIscharset
(
String
ischarset
)
{
this
.
ischarset
=
ischarset
;
}
public
String
getVersionname
()
{
return
this
.
versionname
;
}
public
void
setVersionname
(
String
versionname
)
{
this
.
versionname
=
versionname
;
}
public
String
getIssysdba
()
{
return
this
.
issysdba
;
}
public
void
setIssysdba
(
String
issysdba
)
{
this
.
issysdba
=
issysdba
;
}
public
String
getCrud
()
{
return
this
.
crud
;
}
public
void
setCrud
(
String
crud
)
{
this
.
crud
=
crud
;
}
public
String
getUpdateuserid
()
{
return
this
.
updateuserid
;
}
public
void
setUpdateuserid
(
String
updateuserid
)
{
this
.
updateuserid
=
updateuserid
;
}
}
src/main/java/com/chenyang/nse/bussiness/entity/vo/auditlog/DbAccessPojo.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
vo
.
auditlog
;
public
class
DbAccessPojo
{
private
String
logType
;
private
String
accessDate
;
private
String
accessSqlType
;
private
String
accessClient
;
private
String
accessIp
;
private
String
accessMac
;
private
String
accessOsUser
;
private
String
impactAction
;
private
String
dataSystemId
;
private
String
dataSystemName
;
private
String
connschema
;
private
String
proxyId
;
private
String
proxyName
;
private
String
ralsql
;
private
String
status
;
private
String
proxyIp
;
private
String
proxyPort
;
private
String
dbIp
;
private
String
dbPort
;
private
String
dbType
;
private
String
auditType
;
private
String
noticetype
;
private
String
noticeid
;
private
String
exeSql
;
private
String
accessSqlNum
;
private
String
systemSqlNum
;
private
String
accessSqlByteNum
;
private
String
accessSysSqlByteNum
;
private
String
ruleId
;
private
String
ruleName
;
private
String
strategyId
;
private
String
strategyName
;
private
String
impactMsg
;
private
String
notMatchCause
;
public
String
getLogType
()
{
return
this
.
logType
;
}
public
void
setLogType
(
String
logType
)
{
this
.
logType
=
logType
;
}
public
String
getAccessDate
()
{
return
this
.
accessDate
;
}
public
void
setAccessDate
(
String
accessDate
)
{
this
.
accessDate
=
accessDate
;
}
public
String
getAccessSqlType
()
{
return
this
.
accessSqlType
;
}
public
void
setAccessSqlType
(
String
accessSqlType
)
{
this
.
accessSqlType
=
accessSqlType
;
}
public
String
getAccessClient
()
{
return
this
.
accessClient
;
}
public
void
setAccessClient
(
String
accessClient
)
{
this
.
accessClient
=
accessClient
;
}
public
String
getAccessIp
()
{
return
this
.
accessIp
;
}
public
void
setAccessIp
(
String
accessIp
)
{
this
.
accessIp
=
accessIp
;
}
public
String
getAccessMac
()
{
return
this
.
accessMac
;
}
public
void
setAccessMac
(
String
accessMac
)
{
this
.
accessMac
=
accessMac
;
}
public
String
getAccessOsUser
()
{
return
this
.
accessOsUser
;
}
public
void
setAccessOsUser
(
String
accessOsUser
)
{
this
.
accessOsUser
=
accessOsUser
;
}
public
String
getImpactAction
()
{
return
this
.
impactAction
;
}
public
void
setImpactAction
(
String
impactAction
)
{
this
.
impactAction
=
impactAction
;
}
public
String
getDataSystemId
()
{
return
this
.
dataSystemId
;
}
public
void
setDataSystemId
(
String
dataSystemId
)
{
this
.
dataSystemId
=
dataSystemId
;
}
public
String
getDataSystemName
()
{
return
this
.
dataSystemName
;
}
public
void
setDataSystemName
(
String
dataSystemName
)
{
this
.
dataSystemName
=
dataSystemName
;
}
public
String
getConnschema
()
{
return
this
.
connschema
;
}
public
void
setConnschema
(
String
connschema
)
{
this
.
connschema
=
connschema
;
}
public
String
getProxyId
()
{
return
this
.
proxyId
;
}
public
void
setProxyId
(
String
proxyId
)
{
this
.
proxyId
=
proxyId
;
}
public
String
getProxyName
()
{
return
this
.
proxyName
;
}
public
void
setProxyName
(
String
proxyName
)
{
this
.
proxyName
=
proxyName
;
}
public
String
getRalsql
()
{
return
this
.
ralsql
;
}
public
void
setRalsql
(
String
ralsql
)
{
this
.
ralsql
=
ralsql
;
}
public
String
getStatus
()
{
return
this
.
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getProxyIp
()
{
return
this
.
proxyIp
;
}
public
void
setProxyIp
(
String
proxyIp
)
{
this
.
proxyIp
=
proxyIp
;
}
public
String
getProxyPort
()
{
return
this
.
proxyPort
;
}
public
void
setProxyPort
(
String
proxyPort
)
{
this
.
proxyPort
=
proxyPort
;
}
public
String
getDbIp
()
{
return
this
.
dbIp
;
}
public
void
setDbIp
(
String
dbIp
)
{
this
.
dbIp
=
dbIp
;
}
public
String
getDbPort
()
{
return
this
.
dbPort
;
}
public
void
setDbPort
(
String
dbPort
)
{
this
.
dbPort
=
dbPort
;
}
public
String
getDbType
()
{
return
this
.
dbType
;
}
public
void
setDbType
(
String
dbType
)
{
this
.
dbType
=
dbType
;
}
public
String
getAuditType
()
{
return
this
.
auditType
;
}
public
void
setAuditType
(
String
auditType
)
{
this
.
auditType
=
auditType
;
}
public
String
getNoticetype
()
{
return
this
.
noticetype
;
}
public
void
setNoticetype
(
String
noticetype
)
{
this
.
noticetype
=
noticetype
;
}
public
String
getNoticeid
()
{
return
this
.
noticeid
;
}
public
void
setNoticeid
(
String
noticeid
)
{
this
.
noticeid
=
noticeid
;
}
public
String
getExeSql
()
{
return
this
.
exeSql
;
}
public
void
setExeSql
(
String
exeSql
)
{
this
.
exeSql
=
exeSql
;
}
public
String
getAccessSqlNum
()
{
return
this
.
accessSqlNum
;
}
public
void
setAccessSqlNum
(
String
accessSqlNum
)
{
this
.
accessSqlNum
=
accessSqlNum
;
}
public
String
getSystemSqlNum
()
{
return
this
.
systemSqlNum
;
}
public
void
setSystemSqlNum
(
String
systemSqlNum
)
{
this
.
systemSqlNum
=
systemSqlNum
;
}
public
String
getAccessSqlByteNum
()
{
return
this
.
accessSqlByteNum
;
}
public
void
setAccessSqlByteNum
(
String
accessSqlByteNum
)
{
this
.
accessSqlByteNum
=
accessSqlByteNum
;
}
public
String
getAccessSysSqlByteNum
()
{
return
this
.
accessSysSqlByteNum
;
}
public
void
setAccessSysSqlByteNum
(
String
accessSysSqlByteNum
)
{
this
.
accessSysSqlByteNum
=
accessSysSqlByteNum
;
}
public
String
getRuleId
()
{
return
this
.
ruleId
;
}
public
void
setRuleId
(
String
ruleId
)
{
this
.
ruleId
=
ruleId
;
}
public
String
getRuleName
()
{
return
this
.
ruleName
;
}
public
void
setRuleName
(
String
ruleName
)
{
this
.
ruleName
=
ruleName
;
}
public
String
getStrategyId
()
{
return
this
.
strategyId
;
}
public
void
setStrategyId
(
String
strategyId
)
{
this
.
strategyId
=
strategyId
;
}
public
String
getStrategyName
()
{
return
this
.
strategyName
;
}
public
void
setStrategyName
(
String
strategyName
)
{
this
.
strategyName
=
strategyName
;
}
public
String
getImpactMsg
()
{
return
this
.
impactMsg
;
}
public
void
setImpactMsg
(
String
impactMsg
)
{
this
.
impactMsg
=
impactMsg
;
}
public
String
getNotMatchCause
()
{
return
this
.
notMatchCause
;
}
public
void
setNotMatchCause
(
String
notMatchCause
)
{
this
.
notMatchCause
=
notMatchCause
;
}
}
src/main/java/com/chenyang/nse/bussiness/entity/vo/dataproject/DatasystemProjectdatasourceVO.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
vo
.
dataproject
;
import
java.sql.Timestamp
;
import
java.util.Date
;
public
class
DatasystemProjectdatasourceVO
{
private
String
project_id
;
private
String
tid
;
private
String
flag
;
private
String
sysname
;
private
String
localdir
;
private
String
versionname
;
private
String
dbtype
;
private
String
pagecode
;
private
String
dbip
;
private
String
dbport
;
private
String
servername
;
private
String
xmlpath
;
private
String
dbservername
;
private
String
dblinkname
;
private
String
username
;
private
String
password
;
private
String
istargetdb
;
private
Date
createtime
;
private
String
crud
;
private
String
datasystemid
;
private
String
plaintext
;
private
String
desensitize
;
public
String
getXmlpath
()
{
return
this
.
xmlpath
;
}
public
void
setXmlpath
(
String
xmlpath
)
{
this
.
xmlpath
=
xmlpath
;
}
public
DatasystemProjectdatasourceVO
()
{
}
public
DatasystemProjectdatasourceVO
(
String
project_id
,
String
tid
,
String
flag
,
String
sysname
,
String
localdir
,
String
versionname
,
String
dbtype
,
String
pagecode
,
String
dbip
,
String
dbport
,
String
servername
,
String
dbservername
,
String
dblinkname
,
String
username
,
String
password
,
String
istargetdb
,
Timestamp
createtime
,
String
crud
,
String
datasystemid
,
String
plaintext
,
String
desensitize
)
{
this
.
project_id
=
project_id
;
this
.
tid
=
tid
;
this
.
flag
=
flag
;
this
.
sysname
=
sysname
;
this
.
localdir
=
localdir
;
this
.
versionname
=
versionname
;
this
.
dbtype
=
dbtype
;
this
.
pagecode
=
pagecode
;
this
.
dbip
=
dbip
;
this
.
dbport
=
dbport
;
this
.
servername
=
servername
;
this
.
dbservername
=
dbservername
;
this
.
dblinkname
=
dblinkname
;
this
.
username
=
username
;
this
.
password
=
password
;
this
.
istargetdb
=
istargetdb
;
this
.
createtime
=
createtime
;
this
.
crud
=
crud
;
this
.
datasystemid
=
datasystemid
;
this
.
plaintext
=
plaintext
;
this
.
desensitize
=
desensitize
;
}
public
String
getDatasystemid
()
{
return
this
.
datasystemid
;
}
public
void
setDatasystemid
(
String
datasystemid
)
{
this
.
datasystemid
=
datasystemid
;
}
public
String
getPlaintext
()
{
return
this
.
plaintext
;
}
public
void
setPlaintext
(
String
plaintext
)
{
this
.
plaintext
=
plaintext
;
}
public
String
getDesensitize
()
{
return
this
.
desensitize
;
}
public
void
setDesensitize
(
String
desensitize
)
{
this
.
desensitize
=
desensitize
;
}
public
String
getCrud
()
{
return
this
.
crud
;
}
public
Date
getCreatetime
()
{
return
this
.
createtime
;
}
public
void
setCreatetime
(
Date
createtime
)
{
this
.
createtime
=
createtime
;
}
public
void
setCrud
(
String
crud
)
{
this
.
crud
=
crud
;
}
public
String
getProject_id
()
{
return
this
.
project_id
;
}
public
void
setProject_id
(
String
project_id
)
{
this
.
project_id
=
project_id
;
}
public
String
getTid
()
{
return
this
.
tid
;
}
public
void
setTid
(
String
tid
)
{
this
.
tid
=
tid
;
}
public
String
getFlag
()
{
return
this
.
flag
;
}
public
void
setFlag
(
String
flag
)
{
this
.
flag
=
flag
;
}
public
String
getSysname
()
{
return
this
.
sysname
;
}
public
void
setSysname
(
String
sysname
)
{
this
.
sysname
=
sysname
;
}
public
String
getLocaldir
()
{
return
this
.
localdir
;
}
public
void
setLocaldir
(
String
localdir
)
{
this
.
localdir
=
localdir
;
}
public
String
getVersionname
()
{
return
this
.
versionname
;
}
public
void
setVersionname
(
String
versionname
)
{
this
.
versionname
=
versionname
;
}
public
String
getDbtype
()
{
return
this
.
dbtype
;
}
public
void
setDbtype
(
String
dbtype
)
{
this
.
dbtype
=
dbtype
;
}
public
String
getPagecode
()
{
return
this
.
pagecode
;
}
public
void
setPagecode
(
String
pagecode
)
{
this
.
pagecode
=
pagecode
;
}
public
String
getDbip
()
{
return
this
.
dbip
;
}
public
void
setDbip
(
String
dbip
)
{
this
.
dbip
=
dbip
;
}
public
String
getDbport
()
{
return
this
.
dbport
;
}
public
void
setDbport
(
String
dbport
)
{
this
.
dbport
=
dbport
;
}
public
String
getServername
()
{
return
this
.
servername
;
}
public
void
setServername
(
String
servername
)
{
this
.
servername
=
servername
;
}
public
String
getDbservername
()
{
return
this
.
dbservername
;
}
public
void
setDbservername
(
String
dbservername
)
{
this
.
dbservername
=
dbservername
;
}
public
String
getDblinkname
()
{
return
this
.
dblinkname
;
}
public
void
setDblinkname
(
String
dblinkname
)
{
this
.
dblinkname
=
dblinkname
;
}
public
String
getUsername
()
{
return
this
.
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getPassword
()
{
return
this
.
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getIstargetdb
()
{
return
this
.
istargetdb
;
}
public
void
setIstargetdb
(
String
istargetdb
)
{
this
.
istargetdb
=
istargetdb
;
}
}
src/main/java/com/chenyang/nse/bussiness/entity/vo/datascope/DataScopeVO.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/java/com/chenyang/nse/bussiness/entity/vo/datascope/DataSystemProjectVO.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
entity
.
vo
.
datascope
;
import
com.chenyang.nse.bussiness.entity.cache.LoginUser
;
public
class
DataSystemProjectVO
{
private
LoginUser
loginUser
;
private
String
discoverytype
;
private
String
projectid
;
public
LoginUser
getLoginUser
()
{
return
this
.
loginUser
;
}
public
void
setLoginUser
(
LoginUser
loginUser
)
{
this
.
loginUser
=
loginUser
;
}
public
String
getDiscoverytype
()
{
return
this
.
discoverytype
;
}
public
void
setDiscoverytype
(
String
discoverytype
)
{
this
.
discoverytype
=
discoverytype
;
}
public
String
getProjectid
()
{
return
this
.
projectid
;
}
public
void
setProjectid
(
String
projectid
)
{
this
.
projectid
=
projectid
;
}
public
boolean
equals
(
final
Object
o
)
{
if
(
o
==
this
)
{
return
true
;
}
else
if
(!(
o
instanceof
DataSystemProjectVO
))
{
return
false
;
}
else
{
DataSystemProjectVO
other
=
(
DataSystemProjectVO
)
o
;
if
(!
other
.
canEqual
(
this
))
{
return
false
;
}
else
{
Object
this
$loginUser
=
this
.
getLoginUser
();
Object
other$loginUser
=
other
.
getLoginUser
();
if
(
this
$loginUser
==
null
)
{
if
(
other$loginUser
!=
null
)
{
return
false
;
}
}
else
if
(!
this
$loginUser
.
equals
(
other$loginUser
))
{
return
false
;
}
Object
this
$discoverytype
=
this
.
getDiscoverytype
();
Object
other$discoverytype
=
other
.
getDiscoverytype
();
if
(
this
$discoverytype
==
null
)
{
if
(
other$discoverytype
!=
null
)
{
return
false
;
}
}
else
if
(!
this
$discoverytype
.
equals
(
other$discoverytype
))
{
return
false
;
}
Object
this
$projectid
=
this
.
getProjectid
();
Object
other$projectid
=
other
.
getProjectid
();
if
(
this
$projectid
==
null
)
{
if
(
other$projectid
!=
null
)
{
return
false
;
}
}
else
if
(!
this
$projectid
.
equals
(
other$projectid
))
{
return
false
;
}
return
true
;
}
}
}
protected
boolean
canEqual
(
final
Object
other
)
{
return
other
instanceof
DataSystemProjectVO
;
}
public
int
hashCode
()
{
int
PRIME
=
59
;
int
result
=
1
;
Object
$loginUser
=
this
.
getLoginUser
();
result
=
result
*
59
+
(
$loginUser
==
null
?
43
:
$loginUser
.
hashCode
());
Object
$discoverytype
=
this
.
getDiscoverytype
();
result
=
result
*
59
+
(
$discoverytype
==
null
?
43
:
$discoverytype
.
hashCode
());
Object
$projectid
=
this
.
getProjectid
();
result
=
result
*
59
+
(
$projectid
==
null
?
43
:
$projectid
.
hashCode
());
return
result
;
}
public
String
toString
()
{
return
"DataSystemProjectVO(loginUser="
+
this
.
getLoginUser
()
+
", discoverytype="
+
this
.
getDiscoverytype
()
+
", projectid="
+
this
.
getProjectid
()
+
")"
;
}
}
src/main/java/com/chenyang/nse/bussiness/init/DataSourceInit.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
init
;
import
com.chenyang.nse.bussiness.bean.DataCache
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
@Component
public
class
DataSourceInit
implements
ApplicationRunner
{
@Autowired
DataCache
dataCache
;
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
try
{
System
.
out
.
println
(
"开始缓存数据源"
);
(
new
Thread
(()
->
{
try
{
this
.
dataCache
.
cacheData
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
})).
start
();
System
.
out
.
println
(
"结束缓存数据源"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/com/chenyang/nse/bussiness/odbc/DbCache.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
odbc
;
import
com.chenyang.nse.bussiness.bean.Column
;
import
com.chenyang.nse.bussiness.bean.DataBase
;
import
com.chenyang.nse.bussiness.bean.DataCache
;
import
com.chenyang.nse.bussiness.bean.Schema
;
import
com.chenyang.nse.bussiness.bean.Table
;
import
java.util.ArrayList
;
import
java.util.List
;
import
util.JdbcUtil
;
import
util.getdata.DatabaseCache
;
public
class
DbCache
{
public
static
void
sync
()
{
try
{
List
<
DataBase
>
dataList
=
DataCache
.
dataList
;
List
<
bean
.
DataBase
>
dbList
=
new
ArrayList
();
for
(
DataBase
dataBase
:
dataList
)
{
bean
.
DataBase
db
=
new
bean
.
DataBase
();
db
.
setIp_port
(
dataBase
.
getIp_port
());
db
.
setDbType
(
dataBase
.
getDbType
().
toLowerCase
());
db
.
setUrl
(
dataBase
.
getUrl
());
if
(
dataBase
.
getSchemaList
()
!=
null
&&
dataBase
.
getSchemaList
().
size
()
>
0
)
{
for
(
Schema
schema
:
dataBase
.
getSchemaList
())
{
if
(
schema
!=
null
&&
schema
.
getName
()
!=
null
&&
schema
.
getName
().
length
()
!=
0
)
{
bean
.
Schema
sch
=
new
bean
.
Schema
(
schema
.
getName
());
sch
.
setRealName
(
schema
.
getName
());
if
(
schema
.
getTableList
()
!=
null
&&
schema
.
getTableList
().
size
()
!=
0
)
{
for
(
Table
table
:
schema
.
getTableList
())
{
if
(
table
!=
null
&&
table
.
getName
()
!=
null
&&
table
.
getName
().
length
()
!=
0
)
{
bean
.
Table
tb
=
new
bean
.
Table
(
table
.
getName
(),
schema
.
getName
());
tb
.
setRealName
(
table
.
getName
());
tb
.
setColumnList
(
new
ArrayList
());
sch
.
getTableList
().
add
(
tb
);
if
(
table
.
getColumnList
()
!=
null
&&
table
.
getColumnList
().
size
()
!=
0
)
{
for
(
Column
column
:
table
.
getColumnList
())
{
if
(
column
!=
null
&&
column
.
getColumnName
()
!=
null
&&
column
.
getColumnName
().
length
()
!=
0
)
{
bean
.
Column
col
=
new
bean
.
Column
();
col
.
setColumnName
(
column
.
getColumnName
());
col
.
setTable
(
table
.
getName
());
col
.
setSchema
(
schema
.
getName
());
tb
.
getColumnList
().
add
(
col
);
}
}
}
}
}
db
.
getSchemaList
().
add
(
sch
);
}
}
}
}
DatabaseCache
cache
=
new
DatabaseCache
(
db
);
db
.
simpleCache
=
cache
;
cache
.
init
();
dbList
.
add
(
db
);
}
JdbcUtil
.
dataBaseList
=
dbList
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/com/chenyang/nse/bussiness/service/console/impl/DBFieldTypesServiceImpl.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
console
.
impl
;
import
com.chenyang.nse.bussiness.dao.PageInfo
;
import
com.chenyang.nse.bussiness.dao.table.console.TConsoleDbfieldtypeDao
;
import
com.chenyang.nse.bussiness.entity.orm.table.console.TConsoleDbfieldtype
;
import
com.chenyang.nse.bussiness.service.console.DBFieldTypesService
;
import
java.util.List
;
import
org.hibernate.criterion.Criterion
;
import
org.hibernate.criterion.Restrictions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
public
class
DBFieldTypesServiceImpl
implements
DBFieldTypesService
{
@Autowired
private
TConsoleDbfieldtypeDao
tConsoleDbfieldtypeDao
;
private
static
List
<
TConsoleDbfieldtype
>
allDBFieldTypes
=
null
;
public
List
<
TConsoleDbfieldtype
>
query
(
PageInfo
pageInfo
)
{
return
this
.
tConsoleDbfieldtypeDao
.
queryByPageInfo
(
pageInfo
);
}
public
void
remove
(
List
<
String
>
idlist
)
{
for
(
String
id
:
idlist
)
{
this
.
tConsoleDbfieldtypeDao
.
removeById
(
id
);
}
}
public
void
save
(
TConsoleDbfieldtype
dbFieldTypes
)
{
this
.
tConsoleDbfieldtypeDao
.
saveOrUpdate
(
dbFieldTypes
);
}
public
String
getColumnTypeByJavaType
(
String
dbtype
,
String
javatype
)
{
Criterion
cdbtype
=
Restrictions
.
eq
(
"javatype"
,
javatype
);
Criterion
cjavatype
=
Restrictions
.
eq
(
"dbtype"
,
dbtype
);
List
<
TConsoleDbfieldtype
>
dbfieldtype
=
this
.
tConsoleDbfieldtypeDao
.
queryAll
(
new
Criterion
[]{
cdbtype
,
cjavatype
});
return
!
dbfieldtype
.
isEmpty
()
?
((
TConsoleDbfieldtype
)
dbfieldtype
.
get
(
0
)).
getColumntype
()
:
null
;
}
public
TConsoleDbfieldtype
getColumnTypeByJavaType
(
String
dbtype
,
String
javatype
,
String
enginecolumntype
)
{
TConsoleDbfieldtype
dbfieldtype
=
(
TConsoleDbfieldtype
)
this
.
tConsoleDbfieldtypeDao
.
queryUnique
(
new
Criterion
[]{
Restrictions
.
eq
(
"javatype"
,
javatype
),
Restrictions
.
eq
(
"dbtype"
,
dbtype
),
Restrictions
.
eq
(
"enginecolumntype"
,
enginecolumntype
)});
if
(
dbfieldtype
==
null
)
{
dbfieldtype
=
(
TConsoleDbfieldtype
)
this
.
tConsoleDbfieldtypeDao
.
queryUnique
(
new
Criterion
[]{
Restrictions
.
eq
(
"javatype"
,
javatype
),
Restrictions
.
eq
(
"dbtype"
,
dbtype
)});
}
if
(
dbfieldtype
==
null
)
{
dbfieldtype
=
(
TConsoleDbfieldtype
)
this
.
tConsoleDbfieldtypeDao
.
queryUnique
(
new
Criterion
[]{
Restrictions
.
eq
(
"enginecolumntype"
,
enginecolumntype
),
Restrictions
.
eq
(
"dbtype"
,
dbtype
)});
}
return
dbfieldtype
;
}
public
void
refreshDBFieldTypes
()
{
allDBFieldTypes
=
this
.
tConsoleDbfieldtypeDao
.
queryAll
();
}
public
String
getEngineType
(
String
dbtype
,
String
columntype
)
{
if
(
allDBFieldTypes
==
null
)
{
this
.
refreshDBFieldTypes
();
}
for
(
TConsoleDbfieldtype
t
:
allDBFieldTypes
)
{
if
(
t
.
getDbtype
().
equals
(
dbtype
)
&&
t
.
getColumntype
().
equals
(
columntype
))
{
return
t
.
getEnginecolumntype
();
}
}
return
"null"
;
}
public
String
getColumnJavaType
(
String
dbtype
,
String
columntype
)
{
List
<
TConsoleDbfieldtype
>
dbfieldtype
=
this
.
tConsoleDbfieldtypeDao
.
queryAll
(
new
Criterion
[]{
Restrictions
.
eq
(
"dbtype"
,
dbtype
),
Restrictions
.
eq
(
"columntype"
,
columntype
)});
return
dbfieldtype
!=
null
&&
dbfieldtype
.
size
()
>
0
?
((
TConsoleDbfieldtype
)
dbfieldtype
.
get
(
0
)).
getJavatype
()
:
null
;
}
public
TConsoleDbfieldtype
queryColumn
(
String
sourcedbtype
,
String
columnname
,
String
javatype
)
{
TConsoleDbfieldtype
column
=
null
;
if
(
column
==
null
)
{
column
=
(
TConsoleDbfieldtype
)
this
.
tConsoleDbfieldtypeDao
.
queryUnique
(
new
Criterion
[]{
Restrictions
.
eq
(
"dbtype"
,
sourcedbtype
),
Restrictions
.
eq
(
"javatype"
,
javatype
)});
}
return
column
;
}
}
src/main/java/com/chenyang/nse/bussiness/service/core/DataScopeService.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
;
import
com.chenyang.nse.bussiness.dao.PageInfo
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.HgToFlFj
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.HgToYuan
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.TCoreFullChart
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.fieldscope.TCoreFieldSensitive
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.fieldscope.TCoreScopeField
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.fieldscope.view.TViewComplianceDirectoryProject
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.fieldscope.view.TViewDataScopeProject
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.fieldscope.view.TViewSensitiveLevelProject
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.project.TCoreProjectInfo
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.scopeproject.TProEditionScope
;
import
com.chenyang.nse.bussiness.entity.vo.datascope.DataScopeVO
;
import
com.chenyang.nse.bussiness.entity.vo.datascope.EditionProjectVO
;
import
com.chenyang.nse.bussiness.entity.vo.datascope.FieldDetailReportVO
;
import
com.chenyang.nse.bussiness.entity.vo.datascope.FieldlistReportVO
;
import
com.chenyang.nse.bussiness.entity.vo.datascope.ReportCheckboxVO
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.web.multipart.MultipartFile
;
public
interface
DataScopeService
{
boolean
dataScopeIsExistsByName
(
String
text
,
String
editionid
);
void
save
(
DataScopeVO
scope
);
DataScopeVO
editbyid
(
String
id
);
void
remove
(
String
id
);
List
<
FieldlistReportVO
>
getFieldlistReport
(
PageInfo
pageInfo
,
String
projectid
,
String
type
,
String
directory_name
,
String
tablename
,
String
columnname
);
Object
getFieldlistRuleReport
(
PageInfo
pageInfo
,
String
type
,
String
directory_name
,
String
tablename
,
String
columnname
);
List
<
TCoreProjectInfo
>
getProjectList
();
List
<
ReportCheckboxVO
>
getComplianceDirectoryList
();
List
<
ReportCheckboxVO
>
getCoreDataScopeList
();
List
<
ReportCheckboxVO
>
getTCoreSensitiveLevelList
();
List
<
TViewComplianceDirectoryProject
>
getTViewComplianceDirectoryProject
(
PageInfo
pageInfo
,
String
projectid
,
String
type
,
String
directory_name
,
String
tablename
,
String
columnname
);
List
<
TViewDataScopeProject
>
getTViewDataScopeProject
(
PageInfo
pageInfo
,
String
projectid
,
String
type
,
String
directory_name
,
String
tablename
,
String
columnname
);
List
<
TViewSensitiveLevelProject
>
getTViewSensitiveLevelProject
(
PageInfo
pageInfo
,
String
projectid
,
String
type
,
String
directory_name
,
String
tablename
,
String
columnname
);
void
saveDataToRedis
();
void
removeDataToRedis
();
List
<
FieldDetailReportVO
>
getFieldDetail
(
String
columnid
);
void
getDataFromTable
();
List
<
TProEditionScope
>
getDataScopeProjectList
();
void
saveProject
(
EditionProjectVO
project
);
EditionProjectVO
editpeproject
(
String
id
);
void
removepeproject
(
String
id
);
List
<
TProEditionScope
>
geteditionlist
();
List
<
DataScopeVO
>
getScopeTable
(
String
vo
);
String
getmaxdatetid
(
String
editionid
);
String
getdefaultedition
(
String
setuptype
,
String
projectId
);
void
setdefaultedition
(
String
setuptype
,
String
editionid
);
String
hasEditName
(
EditionProjectVO
project
);
List
<
TCoreFullChart
>
findFirst
();
List
<
TCoreFullChart
>
queryALl
();
List
<
Map
>
findAllScopeField
();
List
<
HgToFlFj
>
queryALltwo
();
List
<
HgToYuan
>
queryAllThree
();
void
excelModelUp
(
MultipartFile
file
,
String
editionid
);
void
saveExcelData
(
List
<
List
<
String
>>
list
,
String
editionid
,
String
user
)
throws
Exception
;
void
removeByEdition
(
String
editionid
);
List
<
TProEditionScope
>
geteditionlistds
(
String
projectId
);
List
<
TProEditionScope
>
geteditionlistByEditionId
(
String
editionid
);
List
<
TCoreScopeField
>
getTCoreScopeFieldInfo
(
String
datasystemid
,
String
projectid
,
String
schemaname
,
String
tablename
);
List
<
TCoreFieldSensitive
>
getTCoreFieldSensitiveInfo
(
String
datasystemid
,
String
projectid
,
String
schemaname
,
String
tablename
);
String
checkName
(
String
scopename
,
String
editionid
);
List
<
Map
<
String
,
String
>>
selectRelationType
(
String
editionid
,
String
rule
,
String
type
);
List
<
Map
<
String
,
String
>>
selectRelationGrade
(
String
type
,
String
id
,
String
editionid
);
List
<
Map
<
String
,
String
>>
getScopelist
(
String
editionid
,
String
rule
);
Map
<
String
,
String
>
queryScopeById
(
String
id
);
Map
<
String
,
String
>
queryNewTProEditionScope
(
String
projectid
);
List
<
Map
<
String
,
String
>>
getScopelevellist
(
String
editionid
,
String
rule
);
Map
<
String
,
String
>
queryScopelevelById
(
String
id
);
List
<
TCoreScopeField
>
queryScopeById
(
String
projectid
,
String
datasystemid
,
String
editionid
);
List
<
TCoreFieldSensitive
>
queryScopeLevelById
(
String
projectid
,
String
datasystemid
,
String
editionid
);
Map
getVersionInfo
(
String
projectid
,
String
versions
,
String
editionid
);
boolean
isExistsByName
(
String
edition_name
,
String
scope_level
);
String
getEditionNameById
(
String
id
);
List
<
TProEditionScope
>
geteditionlistds
();
int
checkDatasystem
();
}
src/main/java/com/chenyang/nse/bussiness/service/core/DataSystemService.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
;
import
com.chenyang.nse.bussiness.dao.PageInfo
;
import
com.chenyang.nse.bussiness.entity.orm.table.base.TBaseUser
;
import
com.chenyang.nse.bussiness.entity.orm.table.base.TBaseUsersys
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.TCoreConfig
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.TCoreDatasourceSchema
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.TCoreDatasystem
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.TCoreDatasystemoracle
;
import
com.chenyang.nse.bussiness.entity.orm.table.core.dataproject.TCoreFileSysGroup
;
import
com.chenyang.nse.bussiness.entity.vo.ComboboxVO
;
import
com.chenyang.nse.bussiness.entity.vo.DBTableVO
;
import
com.chenyang.nse.bussiness.entity.vo.DataSourceAndTaskVO
;
import
com.chenyang.nse.bussiness.entity.vo.DataSystemConfig
;
import
com.chenyang.nse.bussiness.entity.vo.DataSystemVO
;
import
com.chenyang.nse.bussiness.entity.vo.TreeVO
;
import
com.chenyang.nse.bussiness.entity.vo.dataproject.DatasystemProjectdatasourceVO
;
import
java.io.IOException
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.util.List
;
import
java.util.Map
;
public
interface
DataSystemService
{
List
<
TCoreDatasystem
>
queryAll
(
String
sysname
,
String
ip
,
String
dbtype
,
String
userid
);
List
<
TreeVO
>
initTree
(
String
flag
,
String
code
,
String
text
,
String
parentid
,
String
alias
);
List
<
TreeVO
>
initTreeSchema
();
List
<
TCoreDatasystem
>
queryAll
();
List
<
TCoreDatasystem
>
query
(
String
flag
);
List
<
TCoreDatasystem
>
queryDataSystem
(
String
flag
,
String
istargetdb
);
List
<
TCoreDatasystem
>
query
(
List
<
String
>
flag
,
String
dbType
);
List
<
TCoreDatasystem
>
query
(
List
<
String
>
flag
,
PageInfo
pageInfo
);
List
<
TCoreDatasystem
>
queryExcludeId
(
String
excludeId
);
TCoreDatasystem
queryDataSystemById
(
String
id
);
TCoreDatasystem
queryDataSystemByCode
(
String
code
);
TCoreDatasystem
queryDataSystemBySysname
(
String
sysname
,
String
flag
);
void
remove
(
String
id
);
void
save
(
TCoreConfig
tCoreConfig
,
TCoreDatasystem
datasource
,
String
linkname
,
List
<
TBaseUser
>
users
,
List
<
TCoreDatasystemoracle
>
oracleIns
);
TCoreDatasystem
getSubDataSystem
(
String
parentid
,
String
schema
);
void
saveTableStructure
(
TCoreDatasystem
datasource
);
Connection
getConnectionByDataSystemId
(
String
datasystemid
);
Connection
getConnection
(
String
datasystemid
)
throws
SQLException
,
ClassNotFoundException
,
IOException
;
TCoreDatasystem
queryDataMapSystem
(
String
parentid
,
String
schemaname
);
TCoreDatasystem
queryDataSystem
(
String
parentid
,
String
schemaname
,
String
flag
);
List
<
ComboboxVO
>
queryShemas
(
String
dbType
,
String
dataSystemId
);
List
<
ComboboxVO
>
queryshemas
(
String
dbType
,
String
dataSystemId
)
throws
SQLException
,
ClassNotFoundException
,
IOException
;
List
<
TCoreDatasystem
>
querydatasource
();
List
<
Map
<
String
,
String
>>
querydatasource
(
String
projectid
,
String
discoverytype
,
String
userid
);
List
<
TCoreDatasystem
>
querydataAllsource
();
List
<
DataSystemVO
>
queryDatasystemCrudByUserid
(
List
<
String
>
userid
);
List
<
TreeVO
>
inittree
(
String
flag
);
void
generateDataSystemTree
();
List
<
TreeVO
>
queryDataSystemTree
();
List
<
TreeVO
>
queryDataSystemTreeUser
(
String
userid
);
void
addDataSystemTreeBySystemId
(
String
datasystemid
);
void
removeDataSystemTreeBySystemId
(
String
datasystemid
);
void
addTableNodeToDataSystemTree
(
String
datasystemid
,
String
schema
,
String
table
);
List
<
TBaseUsersys
>
queryTBaseUsersysByUserid
(
String
userid
);
void
synDataSystemTree
();
boolean
issystemexist
(
String
id
);
List
<
DBTableVO
>
queryTablename
(
String
datasystemid
,
String
schema
);
List
<
DBTableVO
>
queryTablename
(
String
datasystemid
,
String
schema
,
String
tableNamePattern
);
Map
<
String
,
String
>
queryTableName
(
String
datasystemid
,
String
schema
,
String
tableNamePattern
);
List
<
String
>
getAllTableNameList
(
String
mutifile
,
String
dmpFilePath
,
String
dmptype
,
String
tasknamereal
);
List
<
String
>
getAllTableNameLists
(
String
mutifile
,
String
dmpFilePath
,
String
dmptype
);
List
<
ComboboxVO
>
queryByFlag
(
String
flag
);
List
<
ComboboxVO
>
queryByFlagHadoop
(
String
flag
);
List
<
ComboboxVO
>
queryByFlagNosql
(
String
flag
);
List
<
DatasystemProjectdatasourceVO
>
queryByEditSort
(
String
flag
,
String
dbtype
,
PageInfo
pageInfo
);
List
<
DatasystemProjectdatasourceVO
>
queryByCrud
(
String
userid
,
String
groupid
,
String
flag
,
String
dbtype
,
PageInfo
pageInfo
);
DataSystemConfig
queryByFlagById
(
String
flag
,
String
id
);
List
<
DataSourceAndTaskVO
>
queryDiscoverydate
(
PageInfo
pageInfo
,
String
sourceid
);
List
<
DataSourceAndTaskVO
>
queryDesensitizationtask
(
PageInfo
pageInfo
,
String
sourceid
);
List
<
ComboboxVO
>
getFileSysGroup
(
String
id
);
void
saveFileSysGroup
(
TCoreFileSysGroup
obj
);
void
removeFileSysGroup
(
String
id
);
List
<
TCoreDatasystem
>
getname
(
String
name
);
List
<
TCoreDatasystem
>
queryDataSystemEM
(
String
flag
,
String
istargetdb
);
List
<
TCoreDatasystem
>
querydatasourceds
(
String
projectId
);
List
<
TCoreDatasystem
>
querydatasourceds
(
String
projectId
,
String
userId
);
List
<
ComboboxVO
>
queryByFlagKafka
(
String
flag
);
List
<
String
>
queryView
(
String
datasystemid
,
String
schema
);
List
<
String
>
querySynonym
(
String
datasystemid
,
String
schema
);
Map
<
String
,
Object
>
getDataView
(
Map
<
String
,
Object
>
map
);
Map
<
String
,
Object
>
getHomePage
(
Map
<
String
,
Object
>
map
);
List
<
ComboboxVO
>
getSchemaList
(
String
projectid
,
String
dataSystemId
);
List
<
TCoreDatasourceSchema
>
querySchemas
(
String
projectid
,
String
dataSystemId
);
boolean
checkUsedByProject
(
String
datasystemid
);
boolean
checkUsedByProject
(
String
datasystemid
,
String
projectId
);
int
checkRepeatName
(
String
sysname
,
String
datasystemid
);
List
<
TCoreFileSysGroup
>
queryByGroupid
(
String
groupid
);
}
src/main/java/com/chenyang/nse/bussiness/service/core/DataSystemuserService.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
;
public
interface
DataSystemuserService
{
}
src/main/java/com/chenyang/nse/bussiness/service/core/impl/DataScopeServiceImpl.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/java/com/chenyang/nse/bussiness/service/core/impl/DataSecurityControlledAssetServiceImpl.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
service
.
core
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.chenyang.nse.bussiness.entity.vo.DataScopeEntity
;
import
com.chenyang.nse.bussiness.entity.vo.Field
;
import
com.chenyang.nse.bussiness.entity.vo.ReturnInterfaceDate
;
import
com.chenyang.nse.bussiness.entity.vo.Scope
;
import
com.chenyang.nse.bussiness.entity.vo.TableInfo
;
import
com.chenyang.nse.bussiness.init.StaticDatasPool
;
import
com.chenyang.nse.bussiness.service.core.DataSecurityControlledAssetService
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
public
class
DataSecurityControlledAssetServiceImpl
implements
DataSecurityControlledAssetService
{
public
List
<
String
>
getClassifyInfos
(
List
<
Map
<
String
,
String
>>
list
)
{
new
HashMap
();
new
ArrayList
();
new
ArrayList
();
new
ArrayList
();
if
(
list
!=
null
&&
list
.
size
()
!=
0
&&
list
.
get
(
0
)
!=
null
)
{
String
dbip
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbip"
);
String
dbport
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbport"
);
String
dbtype
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbtype"
);
List
<
ReturnInterfaceDate
>
columnAndClassifyAndLevelAndAreaRelationList
=
StaticDatasPool
.
columnAndClassifyAndLevelAndAreaRelationList
;
String
ipAndPortAndTypeAndSchema
=
null
;
new
ReturnInterfaceDate
();
List
<
ReturnInterfaceDate
>
returnInterfaceDateArrayList
=
new
ArrayList
();
for
(
ReturnInterfaceDate
line
:
columnAndClassifyAndLevelAndAreaRelationList
)
{
ipAndPortAndTypeAndSchema
=
dbip
+
dbport
+
dbtype
;
if
(
ipAndPortAndTypeAndSchema
.
equals
(
line
.
getDatabaseIp
()
+
line
.
getDatabasePort
()
+
line
.
getDatabaseType
()))
{
returnInterfaceDateArrayList
.
add
(
line
);
}
}
List
<
String
>
sensitiveLevelList
=
new
ArrayList
();
for
(
ReturnInterfaceDate
line
:
returnInterfaceDateArrayList
)
{
for
(
Field
field
:
line
.
getField
())
{
for
(
TableInfo
tableInfo
:
field
.
getTableInfos
())
{
if
(
StringUtils
.
isNotBlank
(
tableInfo
.
getSensitiveLevel
()))
{
sensitiveLevelList
.
add
(
tableInfo
.
getSensitiveLevel
());
}
}
}
}
return
(
List
)
sensitiveLevelList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
else
{
return
null
;
}
}
public
Map
<
String
,
List
<
DataScopeEntity
>>
getClassifyInfos
(
List
<
Map
<
String
,
String
>>
list
,
String
schemaName
,
String
tableName
)
{
Map
<
String
,
List
<
DataScopeEntity
>>
result
=
new
HashMap
();
List
<
DataScopeEntity
>
fieldSensitiveBySchemaAndTableAndColumn
=
new
ArrayList
();
List
<
DataScopeEntity
>
scopeNames
=
new
ArrayList
();
List
<
DataScopeEntity
>
dataareaNameBySchemaAndTable
=
new
ArrayList
();
if
(
list
!=
null
&&
list
.
size
()
!=
0
&&
list
.
get
(
0
)
!=
null
)
{
String
dbip
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbip"
);
String
dbport
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbport"
);
String
dbtype
=
(
String
)((
Map
)
list
.
get
(
0
)).
get
(
"dbtype"
);
List
<
ReturnInterfaceDate
>
columnAndClassifyAndLevelAndAreaRelationList
=
StaticDatasPool
.
columnAndClassifyAndLevelAndAreaRelationList
;
String
ipAndPortAndTypeAndSchema
=
null
;
ReturnInterfaceDate
returnInterfaceDate
=
new
ReturnInterfaceDate
();
for
(
ReturnInterfaceDate
line
:
columnAndClassifyAndLevelAndAreaRelationList
)
{
ipAndPortAndTypeAndSchema
=
dbip
+
dbport
+
dbtype
+
schemaName
;
if
(
ipAndPortAndTypeAndSchema
.
equals
(
line
.
getDatabaseIp
()
+
line
.
getDatabasePort
()
+
line
.
getDatabaseType
()
+
line
.
getSchemaName
()))
{
returnInterfaceDate
=
line
;
break
;
}
}
if
(
returnInterfaceDate
!=
null
&&
returnInterfaceDate
.
getField
()
!=
null
)
{
for
(
Field
field
:
returnInterfaceDate
.
getField
())
{
if
(
field
.
getTableName
().
equals
(
tableName
))
{
for
(
TableInfo
tableInfo
:
field
.
getTableInfos
())
{
String
columnName
=
tableInfo
.
getColumnName
();
String
sensitiveLevel
=
tableInfo
.
getSensitiveLevel
();
if
(
StringUtils
.
isNotBlank
(
sensitiveLevel
))
{
DataScopeEntity
dataScopeEntity
=
new
DataScopeEntity
();
dataScopeEntity
.
setSchemaName
(
schemaName
);
dataScopeEntity
.
setTableName
(
tableName
);
dataScopeEntity
.
setColumnName
(
columnName
);
dataScopeEntity
.
setSensitiveLevel
(
sensitiveLevel
);
dataScopeEntity
.
setIsAuto
(
tableInfo
.
getIsAuto
());
fieldSensitiveBySchemaAndTableAndColumn
.
add
(
dataScopeEntity
);
}
String
dataAreaName
=
tableInfo
.
getDataAreaName
();
if
(
StringUtils
.
isNotBlank
(
dataAreaName
))
{
DataScopeEntity
dataScopeEntity
=
new
DataScopeEntity
();
dataScopeEntity
.
setSchemaName
(
schemaName
);
dataScopeEntity
.
setTableName
(
tableName
);
dataScopeEntity
.
setColumnName
(
columnName
);
dataScopeEntity
.
setDataareaName
(
dataAreaName
);
dataareaNameBySchemaAndTable
.
add
(
dataScopeEntity
);
}
if
(
tableInfo
.
getScopes
()
!=
null
&&
tableInfo
.
getScopes
().
size
()
>
0
&&
tableInfo
.
getScopes
().
get
(
0
)
!=
null
)
{
for
(
Scope
scope
:
tableInfo
.
getScopes
())
{
String
scopeName
=
scope
.
getScopeName
();
if
(
StringUtils
.
isNotBlank
(
scopeName
))
{
DataScopeEntity
dataScopeEntity
=
new
DataScopeEntity
();
dataScopeEntity
.
setSchemaName
(
schemaName
);
dataScopeEntity
.
setTableName
(
tableName
);
dataScopeEntity
.
setColumnName
(
columnName
);
dataScopeEntity
.
setScopeName
(
scopeName
);
dataScopeEntity
.
setIsAuto
(
scope
.
getIsAuto
());
scopeNames
.
add
(
dataScopeEntity
);
}
}
}
}
}
}
result
.
put
(
"dataareas"
,
dataareaNameBySchemaAndTable
);
result
.
put
(
"fieldSensitives"
,
fieldSensitiveBySchemaAndTableAndColumn
);
result
.
put
(
"scopeNames"
,
scopeNames
);
return
result
;
}
else
{
result
.
put
(
"dataareas"
,
null
);
result
.
put
(
"fieldSensitives"
,
null
);
result
.
put
(
"scopeNames"
,
new
ArrayList
());
return
result
;
}
}
else
{
return
null
;
}
}
}
src/main/java/com/chenyang/nse/bussiness/service/info/db/DB2.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/java/com/chenyang/nse/bussiness/tools/DataSourceTools.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
tools
;
import
com.chenyang.nse.bussiness.config.HibernateConfig
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
DataSourceTools
{
public
static
String
dealSqlFormat
(
String
sql
)
{
String
result
=
sql
;
if
(
HibernateConfig
.
PEIZHIKUDBTYPE
.
equals
(
"0"
))
{
result
=
sql
.
replaceAll
(
"\""
,
"`"
).
replaceAll
(
"to_date\\("
,
"str_to_date("
).
replaceAll
(
"yyyy-MM-dd HH24:MI:SS"
,
"%Y-%m-%d %H:%i:%s"
);
}
else
if
(
HibernateConfig
.
PEIZHIKUDBTYPE
.
equals
(
"1"
))
{
result
=
sql
.
replaceAll
(
"`"
,
"\""
).
replaceAll
(
"str_to_date\\("
,
"to_date("
).
replaceAll
(
"%Y-%m-%d %H:%i:%s"
,
"yyyy-MM-dd HH24:MI:SS"
);
}
return
result
;
}
}
src/main/java/com/chenyang/nse/bussiness/tools/datatime/DateTime1Tool.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
tools
.
datatime
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
public
class
DateTime1Tool
{
public
static
String
format
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
String
format01
=
"MM/dd/yyyy hh:mm:ss.SSSa"
;
public
static
String
format02
=
"dd-MM-yyyy HH:mm:ss"
;
public
static
String
format03
=
"EEEE dd MMMM, yyyy HH:mm:ssa"
;
public
static
String
format04
=
"MM/dd/yyyy HH:mm ZZZZ"
;
public
static
String
format05
=
"MM/dd/yyyy HH:mm Z"
;
public
static
String
getSysDateString
()
{
return
getDateString
(
new
Date
());
}
public
static
String
getDateString
(
Date
date
)
{
return
formatDateTime
(
date
,
(
String
)
null
);
}
public
static
String
formatDateTime
(
Date
date
,
String
fm
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
fm
!=
null
&&
!
""
.
equals
(
fm
)
?
dt
.
toString
(
fm
)
:
dt
.
toString
(
format
);
}
public
static
long
dateBetween
(
Date
start
,
Date
end
)
{
long
l
=
end
.
getTime
()
-
start
.
getTime
();
return
l
;
}
public
static
Date
getFirstDayOfYear
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfYear
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
date
=
getFirstDayOfYear
(
dt
.
plusYears
(
1
).
toDate
());
dt
=
new
DateTime
(
date
);
DateTime
d
=
dt
.
minusMillis
(
1
);
return
d
.
toDate
();
}
public
static
Date
getFirstDayOfMonth
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfMonth
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
date
=
getFirstDayOfMonth
(
dt
.
plusMonths
(
1
).
toDate
());
dt
=
new
DateTime
(
date
);
return
dt
.
minusMillis
(
1
).
toDate
();
}
public
static
Date
getFirstDayOfWeek
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
dt
=
dt
.
minusDays
(
dt
.
getDayOfWeek
()
-
1
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
cd
.
set
(
5
,
dt
.
getDayOfMonth
());
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfWeek
(
Date
date
)
{
date
=
getFirstDayOfWeek
(
date
);
DateTime
dt
=
new
DateTime
(
date
);
dt
=
dt
.
plusWeeks
(
1
).
minusMillis
(
1
);
return
dt
.
toDate
();
}
public
static
Date
parseDateTime
(
String
date
,
String
fm
)
{
DateTimeFormatter
dtf
=
null
;
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
dtf
=
DateTimeFormat
.
forPattern
(
format
);
}
dtf
=
DateTimeFormat
.
forPattern
(
fm
);
DateTime
dt
=
DateTime
.
parse
(
date
,
dtf
);
return
dt
.
toDate
();
}
public
static
Date
beforeYears
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusYears
(
n
).
toDate
();
}
public
static
Date
afterYears
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusYears
(
n
).
toDate
();
}
public
static
Date
beforeMonths
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusMonths
(
n
).
toDate
();
}
public
static
Date
afterMonths
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusMonths
(
n
).
toDate
();
}
public
static
Date
beforeWeeks
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusWeeks
(
n
).
toDate
();
}
public
static
Date
afterWeeks
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusWeeks
(
n
).
toDate
();
}
public
static
Date
beforeDays
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusDays
(
n
).
toDate
();
}
public
static
Date
afterDays
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusDays
(
n
).
toDate
();
}
public
static
Date
dayOfStart
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
cd
.
set
(
5
,
dt
.
getDayOfMonth
());
return
cd
.
getTime
();
}
public
static
Date
dayOfEnd
(
Date
date
)
{
date
=
dayOfStart
(
date
);
date
=
afterDays
(
date
,
1
);
DateTime
dt
=
new
DateTime
(
date
);
DateTime
d
=
dt
.
minusMillis
(
1
);
return
d
.
toDate
();
}
public
static
long
dataBetween
(
Date
startdate
,
Date
endtdate
)
{
long
start
=
startdate
.
getTime
();
long
end
=
endtdate
.
getTime
();
return
(
end
-
start
)
/
1000L
;
}
public
static
Date
getSysTimeDate
(
String
fm
)
{
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
fm
=
format
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
fm
);
Date
sysdate
=
new
Date
();
try
{
sysdate
=
sdf
.
parse
(
getSysTime
(
fm
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
sysdate
;
}
public
static
String
getSysTime
(
String
fm
)
{
Date
sysdate
=
new
Date
();
String
dateStr
=
formatDate
(
sysdate
,
format
);
return
dateStr
;
}
public
static
String
formatDate
(
Date
date
,
String
fm
)
{
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
fm
=
format
;
}
String
result
=
""
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
fm
);
if
(
date
!=
null
)
{
result
=
sdf
.
format
(
date
);
}
return
result
;
}
public
static
String
formatDuring
(
long
mss
)
{
long
days
=
mss
/
86400000L
;
long
hours
=
mss
%
86400000L
/
3600000L
;
long
minutes
=
mss
%
3600000L
/
60000L
;
long
seconds
=
mss
%
60000L
/
1000L
;
long
ns
=
mss
%
60000L
%
1000L
;
String
minutes_sh
=
minutes
!=
0L
?
minutes
+
"分"
:
""
;
String
seconds_sh
=
seconds
!=
0L
?
seconds
+
"秒"
:
""
;
return
minutes_sh
+
seconds_sh
+
ns
+
"毫秒"
;
}
}
src/main/java/com/chenyang/nse/bussiness/tools/datatime/DateTimeTool.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
tools
.
datatime
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
public
class
DateTimeTool
{
public
static
String
format
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
String
format01
=
"MM/dd/yyyy hh:mm:ss.SSSa"
;
public
static
String
format02
=
"dd-MM-yyyy HH:mm:ss"
;
public
static
String
format03
=
"EEEE dd MMMM, yyyy HH:mm:ssa"
;
public
static
String
format04
=
"MM/dd/yyyy HH:mm ZZZZ"
;
public
static
String
format05
=
"MM/dd/yyyy HH:mm Z"
;
public
static
String
getDateString
(
Date
date
)
{
return
formatDateTime
(
date
,
(
String
)
null
);
}
public
static
String
formatDateTime
(
Date
date
,
String
fm
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
fm
!=
null
&&
!
""
.
equals
(
fm
)
?
dt
.
toString
(
fm
)
:
dt
.
toString
(
format
);
}
public
static
long
dateBetween
(
Date
start
,
Date
end
)
{
long
l
=
end
.
getTime
()
-
start
.
getTime
();
return
l
;
}
public
static
Date
getFirstDayOfYear
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfYear
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
date
=
getFirstDayOfYear
(
dt
.
plusYears
(
1
).
toDate
());
dt
=
new
DateTime
(
date
);
DateTime
d
=
dt
.
minusMillis
(
1
);
return
d
.
toDate
();
}
public
static
Date
getFirstDayOfMonth
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfMonth
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
date
=
getFirstDayOfMonth
(
dt
.
plusMonths
(
1
).
toDate
());
dt
=
new
DateTime
(
date
);
return
dt
.
minusMillis
(
1
).
toDate
();
}
public
static
Date
getFirstDayOfWeek
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
dt
=
dt
.
minusDays
(
dt
.
getDayOfWeek
()
-
1
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
cd
.
set
(
5
,
dt
.
getDayOfMonth
());
return
cd
.
getTime
();
}
public
static
Date
getLastDayOfWeek
(
Date
date
)
{
date
=
getFirstDayOfWeek
(
date
);
DateTime
dt
=
new
DateTime
(
date
);
dt
=
dt
.
plusWeeks
(
1
).
minusMillis
(
1
);
return
dt
.
toDate
();
}
public
static
Date
parseDateTime
(
String
date
,
String
fm
)
{
DateTimeFormatter
dtf
=
null
;
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
dtf
=
DateTimeFormat
.
forPattern
(
format
);
}
dtf
=
DateTimeFormat
.
forPattern
(
fm
);
DateTime
dt
=
DateTime
.
parse
(
date
,
dtf
);
return
dt
.
toDate
();
}
public
static
Date
beforeYears
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusYears
(
n
).
toDate
();
}
public
static
Date
afterYears
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusYears
(
n
).
toDate
();
}
public
static
Date
beforeMonths
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusMonths
(
n
).
toDate
();
}
public
static
Date
afterMonths
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusMonths
(
n
).
toDate
();
}
public
static
Date
beforeWeeks
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusWeeks
(
n
).
toDate
();
}
public
static
Date
afterWeeks
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusWeeks
(
n
).
toDate
();
}
public
static
Date
beforeDays
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
minusDays
(
n
).
toDate
();
}
public
static
Date
afterDays
(
Date
date
,
int
n
)
{
DateTime
dt
=
new
DateTime
(
date
);
return
dt
.
plusDays
(
n
).
toDate
();
}
public
static
Date
dayOfStart
(
Date
date
)
{
DateTime
dt
=
new
DateTime
(
date
);
Calendar
cd
=
Calendar
.
getInstance
();
cd
.
clear
();
cd
.
set
(
1
,
dt
.
getYear
());
cd
.
set
(
2
,
dt
.
getMonthOfYear
()
-
1
);
cd
.
set
(
5
,
dt
.
getDayOfMonth
());
return
cd
.
getTime
();
}
public
static
Date
dayOfEnd
(
Date
date
)
{
date
=
dayOfStart
(
date
);
date
=
afterDays
(
date
,
1
);
DateTime
dt
=
new
DateTime
(
date
);
DateTime
d
=
dt
.
minusMillis
(
1
);
return
d
.
toDate
();
}
public
static
long
dataBetween
(
Date
startdate
,
Date
endtdate
)
{
long
start
=
startdate
.
getTime
();
long
end
=
endtdate
.
getTime
();
return
(
end
-
start
)
/
1000L
;
}
public
static
Date
getSysTimeDate
(
String
fm
)
{
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
fm
=
format
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
fm
);
Date
sysdate
=
new
Date
();
try
{
sysdate
=
sdf
.
parse
(
getSysTime
(
fm
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
sysdate
;
}
public
static
String
getSysTime
(
String
fm
)
{
Date
sysdate
=
new
Date
();
String
dateStr
=
formatDate
(
sysdate
,
format
);
return
dateStr
;
}
public
static
String
formatDate
(
Date
date
,
String
fm
)
{
if
(
fm
==
null
||
""
.
equals
(
fm
))
{
fm
=
format
;
}
String
result
=
""
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
fm
);
if
(
date
!=
null
)
{
result
=
sdf
.
format
(
date
);
}
return
result
;
}
public
static
String
formatDuring
(
long
mss
)
{
long
days
=
mss
/
86400000L
;
long
hours
=
mss
%
86400000L
/
3600000L
;
long
minutes
=
mss
%
3600000L
/
60000L
;
long
seconds
=
mss
%
60000L
/
1000L
;
long
ns
=
mss
%
60000L
%
1000L
;
String
minutes_sh
=
minutes
!=
0L
?
minutes
+
"分"
:
""
;
String
seconds_sh
=
seconds
!=
0L
?
seconds
+
"秒"
:
""
;
return
minutes_sh
+
seconds_sh
+
ns
+
"毫秒"
;
}
}
src/main/java/com/chenyang/nse/bussiness/webtools/entity/vo/DataPreviewVO.java
0 → 100644
View file @
b080293c
package
com
.
chenyang
.
nse
.
bussiness
.
webtools
.
entity
.
vo
;
import
com.chenyang.nse.bussiness.webtools.dao.PageInfo
;
import
com.chenyang.nse.bussiness.webtools.entity.db.ColumnInfo
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
public
class
DataPreviewVO
{
private
int
rows
;
private
int
page
;
private
String
sql
;
private
String
edition_id
;
private
String
datasystem_id
;
private
String
schema
;
private
String
table_name
;
private
Long
execute_time
;
private
String
errMsg
;
private
String
execute_result
;
private
int
sqlType
;
private
String
levelFlag
;
private
String
plaintext
;
private
String
desensitize
;
private
List
<
String
>
primary
;
private
PageInfo
pageInfo
;
private
List
<
ColumnInfo
>
filterColumnList
;
private
DatasystemVO
datasystem
;
private
Set
<
String
>
head
;
private
List
<
Map
<
String
,
Object
>>
data
;
public
int
getRows
()
{
return
this
.
rows
;
}
public
void
setRows
(
int
rows
)
{
this
.
rows
=
rows
;
}
public
int
getPage
()
{
return
this
.
page
;
}
public
void
setPage
(
int
page
)
{
this
.
page
=
page
;
}
public
String
getSql
()
{
return
this
.
sql
;
}
public
void
setSql
(
String
sql
)
{
this
.
sql
=
sql
;
}
public
String
getEdition_id
()
{
return
this
.
edition_id
;
}
public
void
setEdition_id
(
String
edition_id
)
{
this
.
edition_id
=
edition_id
;
}
public
String
getDatasystem_id
()
{
return
this
.
datasystem_id
;
}
public
void
setDatasystem_id
(
String
datasystem_id
)
{
this
.
datasystem_id
=
datasystem_id
;
}
public
String
getSchema
()
{
return
this
.
schema
;
}
public
void
setSchema
(
String
schema
)
{
this
.
schema
=
schema
;
}
public
String
getTable_name
()
{
return
this
.
table_name
;
}
public
void
setTable_name
(
String
table_name
)
{
this
.
table_name
=
table_name
;
}
public
String
getErrMsg
()
{
return
this
.
errMsg
;
}
public
void
setErrMsg
(
String
errMsg
)
{
this
.
errMsg
=
errMsg
;
}
public
List
<
String
>
getPrimary
()
{
return
this
.
primary
;
}
public
void
setPrimary
(
List
<
String
>
primary
)
{
this
.
primary
=
primary
;
}
public
Set
<
String
>
getHead
()
{
return
this
.
head
;
}
public
void
setHead
(
Set
<
String
>
head
)
{
this
.
head
=
head
;
}
public
List
<
Map
<
String
,
Object
>>
getData
()
{
return
this
.
data
;
}
public
void
setData
(
List
<
Map
<
String
,
Object
>>
data
)
{
this
.
data
=
data
;
}
public
PageInfo
getPageInfo
()
{
return
this
.
pageInfo
;
}
public
void
setPageInfo
(
PageInfo
pageInfo
)
{
this
.
pageInfo
=
pageInfo
;
}
public
List
<
ColumnInfo
>
getFilterColumnList
()
{
return
this
.
filterColumnList
;
}
public
void
setFilterColumnList
(
List
<
ColumnInfo
>
filterColumnList
)
{
this
.
filterColumnList
=
filterColumnList
;
}
public
String
getLevelFlag
()
{
return
this
.
levelFlag
;
}
public
void
setLevelFlag
(
String
levelFlag
)
{
this
.
levelFlag
=
levelFlag
;
}
public
Long
getExecute_time
()
{
return
this
.
execute_time
;
}
public
void
setExecute_time
(
Long
execute_time
)
{
this
.
execute_time
=
execute_time
;
}
public
DatasystemVO
getDatasystem
()
{
return
this
.
datasystem
;
}
public
void
setDatasystem
(
DatasystemVO
datasystem
)
{
this
.
datasystem
=
datasystem
;
}
public
String
getExecute_result
()
{
return
this
.
execute_result
;
}
public
void
setExecute_result
(
String
execute_result
)
{
this
.
execute_result
=
execute_result
;
}
public
int
getSqlType
()
{
return
this
.
sqlType
;
}
public
void
setSqlType
(
int
sqlType
)
{
this
.
sqlType
=
sqlType
;
}
public
String
getPlaintext
()
{
return
this
.
plaintext
;
}
public
void
setPlaintext
(
String
plaintext
)
{
this
.
plaintext
=
plaintext
;
}
public
String
getDesensitize
()
{
return
this
.
desensitize
;
}
public
void
setDesensitize
(
String
desensitize
)
{
this
.
desensitize
=
desensitize
;
}
}
src/main/java/com/chenyang/nse/bussiness/webtools/entity/vo/DatasystemVO.java
0 → 100644
View file @
b080293c
差异被折叠。
点击展开。
src/main/resources/sql/datasystemtreeuser.xml
0 → 100644
View file @
b080293c
<?xml version="1.0" encoding="UTF-8"?>
<sqls>
<select
id=
"updateExist"
>
UPDATE t_core_datasystemtreeuser t
SET t.exist = :exist
WHERE
t.datasystemtreeid = :datasystemtreeid
AND t.flag = :flag
</select>
</sqls>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论