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
93bd69b0
Commit
93bd69b0
authored
Jan 13, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交
parent
a0981050
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
279 additions
and
8 deletions
+279
-8
DmpProjectController.java
...a/com/jz/dmp/modules/controller/DmpProjectController.java
+19
-0
DmpMemberController.java
...om/jz/dmp/modules/controller/sys/DmpMemberController.java
+22
-7
DmpMemberMapper.java
...main/java/com/jz/dmp/modules/dao/sys/DmpMemberMapper.java
+22
-0
DmpProject.java
src/main/java/com/jz/dmp/modules/model/DmpProject.java
+4
-0
DmpProjectService.java
...in/java/com/jz/dmp/modules/service/DmpProjectService.java
+8
-0
DmpProjectServiceImpl.java
...om/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
+123
-0
DmpMemberService.java
...java/com/jz/dmp/modules/service/sys/DmpMemberService.java
+25
-0
DmpMemberServiceImpl.java
...jz/dmp/modules/service/sys/impl/DmpMemberServiceImpl.java
+34
-0
DmpMemberMapper.xml
src/main/resources/mapper/sys/DmpMemberMapper.xml
+22
-1
No files found.
src/main/java/com/jz/dmp/modules/controller/DmpProjectController.java
View file @
93bd69b0
...
...
@@ -56,6 +56,25 @@ public class DmpProjectController {
return
pageInfo
;
}
/**列表查询项目信息
* @param dmpProjectRequest
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findList"
)
@ApiOperation
(
value
=
"列表查询项目信息"
,
notes
=
"列表查询项目信息"
)
public
BaseBeanResponse
<
DmpProjectDto
>
findList
(
@RequestBody
DmpProjectRequest
dmpProjectRequest
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpProjectDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpProjectDto
>();
try
{
baseBeanResponse
=
dmpProjectService
.
findList
(
dmpProjectRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**软删除项目信息
* @param id
* @return
...
...
src/main/java/com/jz/dmp/modules/controller/sys/DmpMemberController.java
View file @
93bd69b0
package
com
.
jz
.
dmp
.
modules
.
controller
.
sys
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -98,16 +101,22 @@ public class DmpMemberController {
}
/**删除用户表
* @param
dmpMemberRequest
* @param
userId
* @return
*/
//@RequestMapping(method = RequestMethod.GET, value = "/delete")
//@ApiOperation(value = "删除用户表", notes = "删除用户表")
//@ApiImplicitParam(name = "
userId", value = "用户表主键
")
public
BaseResponse
delete
(
@RequestParam
(
name
=
"
userId"
,
required
=
true
)
Integer
userId
,
HttpServletRequest
httpRequest
){
//@ApiImplicitParam(name = "
ids", value = "用户表主键集(逗号隔开)
")
public
BaseResponse
delete
(
@RequestParam
(
name
=
"
ids"
,
required
=
true
)
String
ids
,
HttpServletRequest
httpRequest
){
BaseResponse
baseResponse
=
new
BaseResponse
();
try
{
baseResponse
=
dmpMemberService
.
deleteById
(
userId
,
httpRequest
);
//参数封装
String
[]
idStrs
=
ids
.
split
(
","
);
List
<
Integer
>
idList
=
Arrays
.
asList
(
idStrs
).
stream
().
map
(
x
->{
return
Integer
.
parseInt
(
x
);
}).
collect
(
Collectors
.
toList
());
baseResponse
=
dmpMemberService
.
deleteByIds
(
idList
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseResponse
.
setMessage
(
"删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
...
...
@@ -123,11 +132,17 @@ public class DmpMemberController {
*/
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/softDelete"
)
@ApiOperation
(
value
=
"软删除用户表"
,
notes
=
"软删除用户表"
)
@ApiImplicitParam
(
name
=
"
userId"
,
value
=
"用户表主键
"
)
public
BaseResponse
softDelete
(
@RequestParam
(
name
=
"
userId"
,
required
=
true
)
Integer
userId
,
HttpServletRequest
httpRequest
){
@ApiImplicitParam
(
name
=
"
ids"
,
value
=
"用户表主键集(逗号隔开)
"
)
public
BaseResponse
softDelete
(
@RequestParam
(
name
=
"
ids"
,
required
=
true
)
String
ids
,
HttpServletRequest
httpRequest
){
BaseResponse
baseResponse
=
new
BaseResponse
();
try
{
baseResponse
=
dmpMemberService
.
softDeleteById
(
userId
,
httpRequest
);
//参数封装
String
[]
idStrs
=
ids
.
split
(
","
);
List
<
Integer
>
idList
=
Arrays
.
asList
(
idStrs
).
stream
().
map
(
x
->{
return
Integer
.
parseInt
(
x
);
}).
collect
(
Collectors
.
toList
());
baseResponse
=
dmpMemberService
.
softDeleteByIds
(
idList
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseResponse
.
setMessage
(
"软删除失败"
);
baseResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
...
...
src/main/java/com/jz/dmp/modules/dao/sys/DmpMemberMapper.java
View file @
93bd69b0
...
...
@@ -3,6 +3,8 @@ package com.jz.dmp.modules.dao.sys;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.jz.dmp.modules.controller.sys.bean.DmpMemberDto
;
import
com.jz.dmp.modules.model.DmpMember
;
...
...
@@ -92,4 +94,24 @@ public interface DmpMemberMapper {
*/
public
DmpMember
findByUserName
(
String
userName
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(批量删除)
* @param @param idList
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public
void
deleteByIds
(
@Param
(
"idList"
)
List
<
Integer
>
idList
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(批量软删除)
* @param @param idList
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
public
void
softDeleteByIds
(
@Param
(
"idList"
)
List
<
Integer
>
idList
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/model/DmpProject.java
View file @
93bd69b0
...
...
@@ -3,6 +3,8 @@ package com.jz.dmp.modules.model;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
/**
* 项目信息(DmpProject)实体类
*
...
...
@@ -90,6 +92,7 @@ public class DmpProject implements Serializable {
/**
* 数据创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
* 创建用户ID
...
...
@@ -102,6 +105,7 @@ public class DmpProject implements Serializable {
/**
* 数据更新时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
...
...
src/main/java/com/jz/dmp/modules/service/DmpProjectService.java
View file @
93bd69b0
...
...
@@ -27,6 +27,14 @@ public interface DmpProjectService {
*/
public
PageInfoResponse
<
DmpProjectDto
>
findListWithPage
(
DmpProjectRequest
dmpProjectRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有项目信息
* @param dmpProjectRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectDto
>
findList
(
DmpProjectRequest
dmpProjectRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除项目信息
* @param id
* @param httpRequest
...
...
src/main/java/com/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
View file @
93bd69b0
...
...
@@ -174,6 +174,129 @@ public class DmpProjectServiceImpl extends BaseService implements DmpProjectServ
return
pageInfoResponse
;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DmpProjectService#findList(com.ycxc.vmts.controller.bean.DmpProjectRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectDto
>
findList
(
DmpProjectRequest
dmpProjectRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//ID
if
(
dmpProjectRequest
.
getId
()
!=
null
)
{
param
.
put
(
"id"
,
dmpProjectRequest
.
getId
());
}
//管理员帐号
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getOwnerId
()))
{
param
.
put
(
"ownerId"
,
dmpProjectRequest
.
getOwnerId
());
}
//生产帐号
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getProductionId
()))
{
param
.
put
(
"productionId"
,
dmpProjectRequest
.
getProductionId
());
}
//数据仓库帐号
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDataWarehouseId
()))
{
param
.
put
(
"dataWarehouseId"
,
dmpProjectRequest
.
getDataWarehouseId
());
}
//项目名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getName
()))
{
param
.
put
(
"name"
,
dmpProjectRequest
.
getName
());
}
//项目显示名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDisplayName
()))
{
param
.
put
(
"displayName"
,
dmpProjectRequest
.
getDisplayName
());
}
//项目描述
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getProjectDesc
()))
{
param
.
put
(
"projectDesc"
,
dmpProjectRequest
.
getProjectDesc
());
}
//发布目标
if
(
dmpProjectRequest
.
getPublishTargetId
()
!=
null
)
{
param
.
put
(
"publishTargetId"
,
dmpProjectRequest
.
getPublishTargetId
());
}
//启动调度周期
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getIsEnableScheduler
()))
{
param
.
put
(
"isEnableScheduler"
,
dmpProjectRequest
.
getIsEnableScheduler
());
}
//允许在本项目中直接编辑任务和代码
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getIsEditTaskCode
()))
{
param
.
put
(
"isEditTaskCode"
,
dmpProjectRequest
.
getIsEditTaskCode
());
}
//能否下载select结果
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getIsEnableSelect
()))
{
param
.
put
(
"isEnableSelect"
,
dmpProjectRequest
.
getIsEnableSelect
());
}
//数据仓库项目名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwName
()))
{
param
.
put
(
"dwName"
,
dmpProjectRequest
.
getDwName
());
}
//数据仓库访问身份类型
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwAccessType
()))
{
param
.
put
(
"dwAccessType"
,
dmpProjectRequest
.
getDwAccessType
());
}
//使用ACL授权
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwIsEnableAcl
()))
{
param
.
put
(
"dwIsEnableAcl"
,
dmpProjectRequest
.
getDwIsEnableAcl
());
}
//允许对象创建者访问对象
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwIsEnableAccessObj
()))
{
param
.
put
(
"dwIsEnableAccessObj"
,
dmpProjectRequest
.
getDwIsEnableAccessObj
());
}
//允许对象创建者授权对象
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwIsEnableAuthObj
()))
{
param
.
put
(
"dwIsEnableAuthObj"
,
dmpProjectRequest
.
getDwIsEnableAuthObj
());
}
//项目空间数据保护
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDwIsProtectData
()))
{
param
.
put
(
"dwIsProtectData"
,
dmpProjectRequest
.
getDwIsProtectData
());
}
//数据状态
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectRequest
.
getDataStatus
());
}
//创建用户ID
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getCreateUserId
()))
{
param
.
put
(
"createUserId"
,
dmpProjectRequest
.
getCreateUserId
());
}
//数据创建时间起
if
(
dmpProjectRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectRequest
.
getCreateTimeStart
());
}
//数据创建时间止
if
(
dmpProjectRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectRequest
.
getCreateTimeEnd
());
}
//创建用户ID
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getUpdateUserId
()))
{
param
.
put
(
"updateUserId"
,
dmpProjectRequest
.
getUpdateUserId
());
}
//
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getImpalaJdbcUrl
()))
{
param
.
put
(
"impalaJdbcUrl"
,
dmpProjectRequest
.
getImpalaJdbcUrl
());
}
//
if
(!
StringUtils
.
isEmpty
(
dmpProjectRequest
.
getImpalaMasterFqdn
()))
{
param
.
put
(
"impalaMasterFqdn"
,
dmpProjectRequest
.
getImpalaMasterFqdn
());
}
//数据更新时间起
if
(
dmpProjectRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectRequest
.
getUpdateTimeStart
());
}
//数据更新时间止
if
(
dmpProjectRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectRequest
.
getUpdateTimeEnd
());
}
List
<
DmpProject
>
dmpProjects
=
dmpProjectDao
.
findListByMap
(
param
);
List
<
DmpProjectDto
>
list
=
MyDmpProjectConverter
.
INSTANCE
().
domain2dto
(
dmpProjects
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DmpProjectService#deleteById(com.ycxc.vmts.controller.bean.DmpProjectRequest, javax.servlet.http.HttpServletRequest)
*/
...
...
src/main/java/com/jz/dmp/modules/service/sys/DmpMemberService.java
View file @
93bd69b0
package
com
.
jz
.
dmp
.
modules
.
service
.
sys
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -120,4 +121,28 @@ public interface DmpMemberService {
*/
public
BaseBeanResponse
<
DmpMember
>
switchProj
(
Integer
projectId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/sys/impl/DmpMemberServiceImpl.java
View file @
93bd69b0
...
...
@@ -484,4 +484,38 @@ public class DmpMemberServiceImpl extends BaseService implements DmpMemberServic
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpMemberMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpMemberMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
}
src/main/resources/mapper/sys/DmpMemberMapper.xml
View file @
93bd69b0
...
...
@@ -26,7 +26,7 @@
<resultMap
id=
"BaseDtoResultMap"
type=
"com.jz.dmp.modules.controller.sys.bean.DmpMemberDto"
extends=
"BaseResultMap"
>
<!-- /*$BaseDtoResultMapContent$*/ -->
<collection
property=
"roles"
ofType=
"java.lang.String"
javaType=
"java.util.List"
column=
"user
I
d"
select=
"getRoleNamesByUserid"
>
column=
"user
_i
d"
select=
"getRoleNamesByUserid"
>
</collection>
</resultMap>
...
...
@@ -371,4 +371,25 @@
AND data_status='1'
</select>
<!-- 根据主键批量删除用户表 -->
<delete
id=
"deleteByIds"
>
delete from dmp_member
where user_id in
<foreach
collection=
"idList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
item
</foreach>
</delete>
<!-- 根据主键批量软删除用户表 -->
<update
id=
"softDeleteByIds"
>
update dmp_member
<set>
data_status = '0'
</set>
where user_id in
<foreach
collection=
"idList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
</mapper>
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