Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
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
姚本章
jz-dmp-service
Commits
7cd9c5eb
Commit
7cd9c5eb
authored
Dec 24, 2020
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
fef4fdb3
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
95 additions
and
55 deletions
+95
-55
JsonResult.java
src/main/java/com/jz/common/constant/JsonResult.java
+7
-1
ResultCode.java
src/main/java/com/jz/common/constant/ResultCode.java
+2
-2
DataSourceController.java
...ules/controller/DataIntegration/DataSourceController.java
+24
-0
DmpTableColumnController.java
...m/jz/dmp/modules/controller/DmpTableColumnController.java
+0
-10
DmpTableController.java
...ava/com/jz/dmp/modules/controller/DmpTableController.java
+0
-10
DmpTableFieldMappingController.java
...mp/modules/controller/DmpTableFieldMappingController.java
+0
-10
DmpTableFieldSchemaController.java
...dmp/modules/controller/DmpTableFieldSchemaController.java
+0
-10
DvRuleTController.java
...java/com/jz/dmp/modules/controller/DvRuleTController.java
+0
-10
DmpSyncingDatasourceDao.java
.../java/com/jz/dmp/modules/dao/DmpSyncingDatasourceDao.java
+5
-0
DmpSyncingDatasourceService.java
...m/jz/dmp/modules/service/DmpSyncingDatasourceService.java
+4
-0
DmpSyncingDatasourceServiceImpl.java
...modules/service/impl/DmpSyncingDatasourceServiceImpl.java
+29
-2
DmpSyncingDatasourceDao.xml
src/main/resources/mapper/dmp/DmpSyncingDatasourceDao.xml
+24
-0
No files found.
src/main/java/com/jz/common/constant/JsonResult.java
View file @
7cd9c5eb
...
...
@@ -28,7 +28,7 @@ public class JsonResult<T> {
public
JsonResult
()
{
this
.
setCode
(
ResultCode
.
SUCCESS
);
this
.
setMessage
(
"成功
�?
"
);
this
.
setMessage
(
"成功
!
"
);
}
public
JsonResult
(
ResultCode
code
)
{
...
...
@@ -53,6 +53,12 @@ public class JsonResult<T> {
this
.
setData
(
data
);
}
public
JsonResult
(
T
data
)
{
this
.
setCode
(
ResultCode
.
SUCCESS
);
this
.
setMessage
(
"成功!"
);
this
.
setData
(
data
);
}
public
JsonResult
(
com
.
jz
.
dmp
.
agent
.
ResultCode
code
,
String
message
)
{
}
...
...
src/main/java/com/jz/common/constant/ResultCode.java
View file @
7cd9c5eb
...
...
@@ -22,7 +22,7 @@ public enum ResultCode {
PARAMS_ERROR_TOKEN
(
"446"
,
"token无效"
),
/** 不支持当前请求方�? */
METHOD_NOT_ALLOWED
(
"405"
,
"不支持当前请求方
�?
"
),
METHOD_NOT_ALLOWED
(
"405"
,
"不支持当前请求方
式!
"
),
/** 不支持或已经废弃 */
NOT_SUPPORTED
(
"410"
,
"不支持或已经废弃"
),
...
...
@@ -31,7 +31,7 @@ public enum ResultCode {
UNSUPPORTED_MEDIA_TYPE
(
"415"
,
"不支持当前媒体类�?"
),
/** AuthCode错误 */
INVALID_AUTHCODE
(
"444"
,
"无权限访
�?
"
),
INVALID_AUTHCODE
(
"444"
,
"无权限访
问!
"
),
/** 太频繁的调用 */
TOO_FREQUENT
(
"445"
,
"太频繁的调用"
),
...
...
src/main/java/com/jz/dmp/modules/controller/DataIntegration/DataSourceController.java
View file @
7cd9c5eb
...
...
@@ -71,4 +71,28 @@ public class DataSourceController {
JsonResult
result
=
dmpSyncingDatasourceService
.
delDataSourceById
(
datasourceId
);
return
result
;
}
/**
* 获取数据源类型-下拉框
*
* @return
*/
@ApiOperation
(
value
=
"获取数据源类型"
,
notes
=
"获取数据源类型-下拉框"
)
@GetMapping
(
value
=
"/queryDatasourceType"
)
public
JsonResult
getDatasourceType
(
HttpServletRequest
httpRequest
)
throws
Exception
{
JsonResult
result
=
dmpSyncingDatasourceService
.
queryDatasourceType
();
return
result
;
}
/**
* 新增获取数据源类型
*
* @return
*/
@ApiOperation
(
value
=
"新增--获取数据源类型"
,
notes
=
"获取数据源类型"
)
@GetMapping
(
value
=
"/queryGroupDatasourceType"
)
public
JsonResult
getGroupDatasourceType
(
HttpServletRequest
httpRequest
)
throws
Exception
{
JsonResult
result
=
dmpSyncingDatasourceService
.
queryGroupDatasourceType
();
return
result
;
}
}
src/main/java/com/jz/dmp/modules/controller/DmpTableColumnController.java
View file @
7cd9c5eb
...
...
@@ -24,15 +24,5 @@ public class DmpTableColumnController {
@Autowired
private
DmpTableColumnService
dmpTableColumnService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableColumn
selectOne
(
Integer
id
)
{
return
this
.
dmpTableColumnService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableController.java
View file @
7cd9c5eb
...
...
@@ -23,15 +23,5 @@ public class DmpTableController {
@Resource
private
DmpTableService
dmpTableService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTable
selectOne
(
Integer
id
)
{
return
this
.
dmpTableService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableFieldMappingController.java
View file @
7cd9c5eb
...
...
@@ -24,15 +24,5 @@ public class DmpTableFieldMappingController{
@Autowired
private
DmpTableFieldMappingService
dmpTableFieldMappingService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableFieldMapping
selectOne
(
Integer
id
)
{
return
this
.
dmpTableFieldMappingService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableFieldSchemaController.java
View file @
7cd9c5eb
...
...
@@ -24,15 +24,5 @@ public class DmpTableFieldSchemaController{
@Autowired
private
DmpTableFieldSchemaService
dmpTableFieldSchemaService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableFieldSchema
selectOne
(
Integer
id
)
{
return
this
.
dmpTableFieldSchemaService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DvRuleTController.java
View file @
7cd9c5eb
...
...
@@ -24,15 +24,5 @@ public class DvRuleTController {
@Autowired
private
DvRuleTService
dvRuleTService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DvRuleT
selectOne
(
Long
id
)
{
return
this
.
dvRuleTService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/DmpSyncingDatasourceDao.java
View file @
7cd9c5eb
...
...
@@ -6,6 +6,7 @@ import com.jz.dmp.modules.model.DmpSyncingDatasource;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 数据源配置(DmpSyncingDatasource)表数据库访问层
...
...
@@ -89,4 +90,8 @@ public interface DmpSyncingDatasourceDao {
List
<
DataSourceListDto
>
queryDataSourceListPage
(
DataSourceListReq
req
)
throws
Exception
;
void
delDataSourceById
(
@Param
(
"ids"
)
String
[]
ids
)
throws
Exception
;
List
<
Map
>
queryDatasourceType
()
throws
Exception
;
List
<
Map
>
queryGroupDatasourceType
()
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpSyncingDatasourceService.java
View file @
7cd9c5eb
...
...
@@ -62,4 +62,8 @@ public interface DmpSyncingDatasourceService {
PageInfoResponse
<
DataSourceListDto
>
queryDataSourceListPage
(
DataSourceListReq
req
,
HttpServletRequest
httpRequest
)
throws
Exception
;
JsonResult
delDataSourceById
(
String
datasourceId
)
throws
Exception
;
JsonResult
queryDatasourceType
()
throws
Exception
;
JsonResult
queryGroupDatasourceType
()
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpSyncingDatasourceServiceImpl.java
View file @
7cd9c5eb
...
...
@@ -7,7 +7,6 @@ import com.jz.common.constant.ResultCode;
import
com.jz.common.page.PageInfoResponse
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto
;
import
com.jz.dmp.modules.dao.DmpSyncingDatasourceDao
;
import
com.jz.dmp.modules.model.DmpSyncingDatasource
;
import
com.jz.dmp.modules.service.DmpSyncingDatasourceService
;
...
...
@@ -18,8 +17,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -129,4 +128,32 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
dmpSyncingDatasourceDao
.
delDataSourceById
(
ids
);
return
new
JsonResult
();
}
@Override
public
JsonResult
queryDatasourceType
()
throws
Exception
{
List
<
Map
>
list
=
dmpSyncingDatasourceDao
.
queryDatasourceType
();
return
new
JsonResult
(
list
);
}
/**
* 新增-获取数据源类型
*
* @return
*/
@Override
public
JsonResult
queryGroupDatasourceType
()
throws
Exception
{
Map
<
String
,
ArrayList
<
Map
>>
returnMap
=
new
HashMap
();
List
<
Map
>
list
=
dmpSyncingDatasourceDao
.
queryGroupDatasourceType
();
if
(
list
.
size
()
>
0
&&
list
!=
null
)
{
for
(
Map
<
String
,
Object
>
dto
:
list
)
{
String
datasourceCatename
=
(
String
)
dto
.
get
(
"datasourceCatename"
);
if
(
returnMap
.
get
(
datasourceCatename
)
==
null
)
{
returnMap
.
put
(
datasourceCatename
,
new
ArrayList
<
Map
>());
}
ArrayList
<
Map
>
param
=
returnMap
.
get
(
datasourceCatename
);
param
.
add
(
dto
);
}
}
return
new
JsonResult
(
returnMap
);
}
}
\ No newline at end of file
src/main/resources/mapper/dmp/DmpSyncingDatasourceDao.xml
View file @
7cd9c5eb
...
...
@@ -278,4 +278,28 @@
</foreach>
</delete>
<!--查询数据源类型名称-->
<select
id=
"queryDatasourceType"
resultType=
"map"
>
select
datasource as datasourceName,
id as datasourceTypeId
from dmp_syncing_datasource_type
where data_status = '1' and is_enabled = '1'
order by datasource_catetype
</select>
<select
id=
"queryGroupDatasourceType"
resultType=
"map"
>
SELECT
id as datasourceTypeId,
datasource as datasourceTypeName,
datasource_catename as datasourceCatename,
datasource_catecode as datasourceCatecode,
IFNULL(img_url, '') as imgUrl,
IFNULL(is_enabled, '0') as isEnabled,
IFNULL(is_enable_test, '0') as isEnableTest
from dmp_syncing_datasource_type
where data_status = '1'
order by datasource_catetype
</select>
</mapper>
\ No newline at end of file
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