Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-auth
Commits
c7944e30
Commit
c7944e30
authored
Sep 19, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
107aaea0
9b3ae087
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1029 additions
and
45 deletions
+1029
-45
AuditedGroupDTO.java
...h-api/src/main/java/com/gic/auth/dto/AuditedGroupDTO.java
+106
-0
AuditedGroupQO.java
...uth-api/src/main/java/com/gic/auth/qo/AuditedGroupQO.java
+109
-0
AuditedGroupApiService.java
...ain/java/com/gic/auth/service/AuditedGroupApiService.java
+60
-0
TabAuditedGroupMapper.java
...n/java/com/gic/auth/dao/mapper/TabAuditedGroupMapper.java
+11
-0
TabAuditedGroupUserRelMapper.java
...com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
+15
-0
TabAuditorAuditedGroupRelMapper.java
.../gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
+4
-0
TabSysUserMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
+6
-4
TabAuditedGroup.java
...ce/src/main/java/com/gic/auth/entity/TabAuditedGroup.java
+26
-0
TabAuditedGroupUserRel.java
...main/java/com/gic/auth/entity/TabAuditedGroupUserRel.java
+13
-0
TabAuditorAuditedGroupRel.java
...n/java/com/gic/auth/entity/TabAuditorAuditedGroupRel.java
+13
-0
TabAuditorProjectRel.java
...c/main/java/com/gic/auth/entity/TabAuditorProjectRel.java
+13
-0
AuditedGroupService.java
...c/main/java/com/gic/auth/service/AuditedGroupService.java
+27
-0
AuditedGroupUserRelService.java
...java/com/gic/auth/service/AuditedGroupUserRelService.java
+23
-0
AuditorAuditedGroupRelService.java
...a/com/gic/auth/service/AuditorAuditedGroupRelService.java
+12
-0
UserService.java
...rvice/src/main/java/com/gic/auth/service/UserService.java
+4
-2
AuditedGroupServiceImpl.java
...va/com/gic/auth/service/impl/AuditedGroupServiceImpl.java
+73
-0
AuditedGroupUserRelServiceImpl.java
...gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
+67
-0
AuditorAuditedGroupRelServiceImpl.java
.../auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
+24
-0
UserServiceImpl.java
.../main/java/com/gic/auth/service/impl/UserServiceImpl.java
+12
-6
AuditedGroupApiServiceImpl.java
...c/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
+127
-0
dubbo-gic-platform-auth-service.xml
...ce/src/main/resources/dubbo-gic-platform-auth-service.xml
+2
-0
TabAuditedGroupMapper.xml
...rvice/src/main/resources/mapper/TabAuditedGroupMapper.xml
+68
-8
TabAuditedGroupUserRelMapper.xml
...rc/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
+82
-8
TabAuditorAuditedGroupRelMapper.xml
...main/resources/mapper/TabAuditorAuditedGroupRelMapper.xml
+27
-9
TabAuditorProjectRelMapper.xml
.../src/main/resources/mapper/TabAuditorProjectRelMapper.xml
+20
-8
TabSysUserMapper.xml
...th-service/src/main/resources/mapper/TabSysUserMapper.xml
+18
-0
AuditedGroupController.java
...a/com/gic/auth/web/controller/AuditedGroupController.java
+63
-0
dubbo-gic-platform-auth-web.xml
...th-web/src/main/resources/dubbo-gic-platform-auth-web.xml
+4
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/AuditedGroupDTO.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
dto
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:13
*/
public
class
AuditedGroupDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2850377191052218727L
;
public
interface
SaveValid
{}
/**
*
*/
private
Integer
auditedGroupId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 受审组name
*/
@NotBlank
(
message
=
"受审组名称不能为空"
,
groups
=
SaveValid
.
class
)
private
String
auditedGroupName
;
/**
*
*/
private
Date
createTime
;
@NotEmpty
(
message
=
"请选择审核员"
,
groups
=
SaveValid
.
class
)
private
List
<
Integer
>
userIdList
;
private
Integer
allCheck
;
private
Integer
userCount
;
public
void
setUserCount
(
Integer
userCount
)
{
this
.
userCount
=
userCount
;
}
public
Integer
getUserCount
()
{
return
userCount
;
}
public
void
setAllCheck
(
Integer
allCheck
)
{
this
.
allCheck
=
allCheck
;
}
public
Integer
getAllCheck
()
{
return
allCheck
;
}
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
public
void
setAuditedGroupId
(
Integer
auditedGroupId
)
{
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getAuditedGroupName
()
{
return
auditedGroupName
;
}
public
void
setAuditedGroupName
(
String
auditedGroupName
)
{
this
.
auditedGroupName
=
auditedGroupName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
List
<
Integer
>
getUserIdList
()
{
return
userIdList
;
}
public
void
setUserIdList
(
List
<
Integer
>
userIdList
)
{
this
.
userIdList
=
userIdList
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/AuditedGroupQO.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
qo
;
import
com.gic.enterprise.qo.PageQO
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 16:59
*/
public
class
AuditedGroupQO
extends
PageQO
{
private
static
final
long
serialVersionUID
=
4181799724240655836L
;
public
interface
SaveValid
{}
public
interface
DelValid
{
}
public
interface
GetValid
{}
/**
*
*/
@NotNull
(
message
=
"受审组id不能为空"
,
groups
=
{
DelValid
.
class
,
GetValid
.
class
})
private
Integer
auditedGroupId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 受审组name
*/
@NotBlank
(
message
=
"受审组名称不能为空"
,
groups
=
SaveValid
.
class
)
private
String
auditedGroupName
;
/**
*
*/
private
Date
createTime
;
@NotBlank
(
message
=
"请选择审核员"
,
groups
=
SaveValid
.
class
)
private
String
userIds
;
private
Integer
allCheck
;
private
Integer
userCount
;
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
public
void
setAuditedGroupId
(
Integer
auditedGroupId
)
{
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getAuditedGroupName
()
{
return
auditedGroupName
;
}
public
void
setAuditedGroupName
(
String
auditedGroupName
)
{
this
.
auditedGroupName
=
auditedGroupName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUserIds
()
{
return
userIds
;
}
public
void
setUserIds
(
String
userIds
)
{
this
.
userIds
=
userIds
;
}
public
Integer
getAllCheck
()
{
return
allCheck
;
}
public
void
setAllCheck
(
Integer
allCheck
)
{
this
.
allCheck
=
allCheck
;
}
public
Integer
getUserCount
()
{
return
userCount
;
}
public
void
setUserCount
(
Integer
userCount
)
{
this
.
userCount
=
userCount
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/AuditedGroupApiService.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.qo.AuditedGroupQO
;
/**
* 受审组
* @ClassName: AuditedGroupApiService
* @Description:
* @author zhiwj
* @date 2019-09-18 11:11
*/
public
interface
AuditedGroupApiService
{
/**
* 新增或修改受审组
* @Title: saveOrUpdateAuditedGroup
* @Description:
* @author zhiwj
* @param auditedGroupDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
Integer
>
saveOrUpdateAuditedGroup
(
AuditedGroupDTO
auditedGroupDTO
);
/**
* 删除
* @Title: delAuditedGroup
* @Description:
* @author zhiwj
* @param auditedGroupId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
Integer
>
delAuditedGroup
(
Integer
auditedGroupId
);
/**
* 受审组列表
* @Title: listAuditedGroup
* @Description:
* @author zhiwj
* @param auditedGroupQO
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.auth.dto.AuditedGroupDTO>>
* @throws
*/
ServiceResponse
<
Page
<
AuditedGroupDTO
>>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
);
/**
*
* @Title: getAuditedGroup
* @Description:
* @author zhiwj
* @param auditedGroupId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.AuditedGroupDTO>
* @throws
*/
ServiceResponse
<
AuditedGroupDTO
>
getAuditedGroup
(
Integer
auditedGroupId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditedGroupMapper.java
View file @
c7944e30
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroup
;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabAuditedGroupMapper
{
/**
...
...
@@ -50,4 +54,10 @@ public interface TabAuditedGroupMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabAuditedGroup
record
);
Integer
getFirstAuditedGroup
(
AuditedGroupDTO
auditedGroupDTO
);
Integer
delAuditedGroup
(
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
);
Page
<
TabAuditedGroup
>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
View file @
c7944e30
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
TabAuditedGroupUserRelMapper
{
/**
...
...
@@ -50,4 +54,14 @@ public interface TabAuditedGroupUserRelMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabAuditedGroupUserRel
record
);
int
delByAuditedGroupId
(
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
);
void
insertSelectiveByNotExist
(
TabAuditedGroupUserRel
auditedGroupUserRel
);
Integer
updateStatusByUserIds
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
,
@Param
(
"ids"
)
List
<
Integer
>
userIdList
);
List
<
Map
<
Integer
,
Object
>>
getUserCountByAuditedGroup
(
@Param
(
"ids"
)
List
<
Integer
>
auditedGroupIds
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
TabAuditedGroupUserRel
groupUserRel
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
View file @
c7944e30
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabAuditorAuditedGroupRelMapper
{
/**
...
...
@@ -50,4 +51,6 @@ public interface TabAuditorAuditedGroupRelMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabAuditorAuditedGroupRel
record
);
int
delRel
(
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
View file @
c7944e30
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.auth.dto.UserListDTO
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.UserListQO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabSysUserMapper
{
/**
...
...
@@ -93,4 +92,6 @@ public interface TabSysUserMapper {
* @return int
*/
int
deleteById
(
@Param
(
"userId"
)
Integer
userId
);
Integer
getFirstNotInUserId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"ids"
)
List
<
Integer
>
userIdList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditedGroup.java
View file @
c7944e30
...
...
@@ -12,11 +12,21 @@ public class TabAuditedGroup {
private
Integer
auditedGroupId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 受审组name
*/
private
String
auditedGroupName
;
/**
* 是否是全选的受审组 1:是 0:否
*/
private
Integer
allCheck
;
/**
*
*/
private
Integer
status
;
...
...
@@ -39,6 +49,14 @@ public class TabAuditedGroup {
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getAuditedGroupName
()
{
return
auditedGroupName
;
}
...
...
@@ -47,6 +65,14 @@ public class TabAuditedGroup {
this
.
auditedGroupName
=
auditedGroupName
;
}
public
Integer
getAllCheck
()
{
return
allCheck
;
}
public
void
setAllCheck
(
Integer
allCheck
)
{
this
.
allCheck
=
allCheck
;
}
public
Integer
getStatus
()
{
return
status
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditedGroupUserRel.java
View file @
c7944e30
...
...
@@ -12,6 +12,11 @@ public class TabAuditedGroupUserRel {
private
Integer
auditedGroupUserRelId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 受审组id
*/
private
Integer
auditedGroupId
;
...
...
@@ -44,6 +49,14 @@ public class TabAuditedGroupUserRel {
this
.
auditedGroupUserRelId
=
auditedGroupUserRelId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditorAuditedGroupRel.java
View file @
c7944e30
...
...
@@ -12,6 +12,11 @@ public class TabAuditorAuditedGroupRel {
private
Integer
auditorAuditedGroupRelId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 审核员id
*/
private
Integer
auditorId
;
...
...
@@ -44,6 +49,14 @@ public class TabAuditorAuditedGroupRel {
this
.
auditorAuditedGroupRelId
=
auditorAuditedGroupRelId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getAuditorId
()
{
return
auditorId
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditorProjectRel.java
View file @
c7944e30
...
...
@@ -12,6 +12,11 @@ public class TabAuditorProjectRel {
private
Integer
auditorProjectRelId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 审核员
*/
private
Integer
auditorId
;
...
...
@@ -44,6 +49,14 @@ public class TabAuditorProjectRel {
this
.
auditorProjectRelId
=
auditorProjectRelId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getAuditorId
()
{
return
auditorId
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupService.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroup
;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.github.pagehelper.Page
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:29
*/
public
interface
AuditedGroupService
{
boolean
validAuditedGroupIsRepeat
(
Integer
enterpriseId
,
String
auditedGroupName
,
Integer
auditedGroupId
);
Integer
save
(
AuditedGroupDTO
auditedGroupDTO
);
Integer
update
(
AuditedGroupDTO
auditedGroupDTO
);
Integer
delAuditedGroup
(
Integer
auditedGroupId
);
Page
<
TabAuditedGroup
>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
);
TabAuditedGroup
getAuditedGroup
(
Integer
auditedGroupId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupUserRelService.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
java.util.List
;
import
java.util.Map
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:31
*/
public
interface
AuditedGroupUserRelService
{
Integer
addOrUpdateRel
(
AuditedGroupDTO
auditedGroupDTO
);
int
delRel
(
Integer
auditedGroupId
);
Map
<
Integer
,
Integer
>
getUserCountByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
Integer
auditedGroupId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorAuditedGroupRelService.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 16:30
*/
public
interface
AuditorAuditedGroupRelService
{
int
delRel
(
Integer
auditedGroupId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/UserService.java
View file @
c7944e30
package
com
.
gic
.
auth
.
service
;
import
java.util.List
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.dto.UserListDTO
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.UserListQO
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
/**
* @author guojx
* @date 2019/7/16 6:50 PM
...
...
@@ -64,4 +64,6 @@ public interface UserService {
* @return void
*/
void
delete
(
Integer
userId
);
Integer
getAllCheckValue
(
Integer
enterpriseId
,
List
<
Integer
>
userIdList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupServiceImpl.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditedGroupMapper
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroup
;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.gic.auth.service.AuditedGroupService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:29
*/
@Service
public
class
AuditedGroupServiceImpl
implements
AuditedGroupService
{
@Autowired
private
TabAuditedGroupMapper
tabAuditedGroupMapper
;
@Override
public
boolean
validAuditedGroupIsRepeat
(
Integer
enterpriseId
,
String
auditedGroupName
,
Integer
auditedGroupId
)
{
AuditedGroupDTO
auditedGroupDTO
=
new
AuditedGroupDTO
();
auditedGroupDTO
.
setEnterpriseId
(
enterpriseId
);
auditedGroupDTO
.
setAuditedGroupName
(
auditedGroupName
);
auditedGroupDTO
.
setAuditedGroupId
(
auditedGroupId
);
Integer
line
=
tabAuditedGroupMapper
.
getFirstAuditedGroup
(
auditedGroupDTO
);
return
line
!=
null
;
}
@Override
public
Integer
save
(
AuditedGroupDTO
auditedGroupDTO
)
{
TabAuditedGroup
auditedGroup
=
EntityUtil
.
changeEntityByJSON
(
TabAuditedGroup
.
class
,
auditedGroupDTO
);
auditedGroup
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
auditedGroup
.
setCreateTime
(
new
Date
());
tabAuditedGroupMapper
.
insertSelective
(
auditedGroup
);
return
auditedGroup
.
getAuditedGroupId
();
}
@Override
public
Integer
update
(
AuditedGroupDTO
auditedGroupDTO
)
{
TabAuditedGroup
auditedGroup
=
new
TabAuditedGroup
();
auditedGroup
.
setAuditedGroupId
(
auditedGroupDTO
.
getAuditedGroupId
());
auditedGroup
.
setAllCheck
(
auditedGroupDTO
.
getAllCheck
());
auditedGroup
.
setAuditedGroupName
(
auditedGroupDTO
.
getAuditedGroupName
());
return
tabAuditedGroupMapper
.
updateByPrimaryKeySelective
(
auditedGroup
);
}
@Override
public
Integer
delAuditedGroup
(
Integer
auditedGroupId
)
{
return
tabAuditedGroupMapper
.
delAuditedGroup
(
auditedGroupId
);
}
@Override
public
Page
<
TabAuditedGroup
>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
)
{
PageHelper
.
startPage
(
auditedGroupQO
.
getCurrentPage
(),
auditedGroupQO
.
getPageSize
());
return
tabAuditedGroupMapper
.
listAuditedGroup
(
auditedGroupQO
);
}
@Override
public
TabAuditedGroup
getAuditedGroup
(
Integer
auditedGroupId
)
{
TabAuditedGroup
tabAuditedGroup
=
tabAuditedGroupMapper
.
selectByPrimaryKey
(
auditedGroupId
);
return
tabAuditedGroup
!=
null
&&
(
GlobalInfo
.
DATA_STATUS_NORMAL
==
tabAuditedGroup
.
getStatus
())
?
tabAuditedGroup
:
null
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditedGroupUserRelMapper
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.service.AuditedGroupUserRelService
;
import
com.gic.commons.util.GlobalInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:31
*/
@Service
public
class
AuditedGroupUserRelServiceImpl
implements
AuditedGroupUserRelService
{
@Autowired
private
TabAuditedGroupUserRelMapper
tabAuditedGroupUserRelMapper
;
@Override
public
Integer
addOrUpdateRel
(
AuditedGroupDTO
auditedGroupDTO
)
{
// 把所有auditedGroup的关联status设置为0
tabAuditedGroupUserRelMapper
.
delByAuditedGroupId
(
auditedGroupDTO
.
getAuditedGroupId
());
// 插入不存在的关联
for
(
Integer
userId
:
auditedGroupDTO
.
getUserIdList
())
{
TabAuditedGroupUserRel
auditedGroupUserRel
=
new
TabAuditedGroupUserRel
();
auditedGroupUserRel
.
setEnterpriseId
(
auditedGroupDTO
.
getEnterpriseId
());
auditedGroupUserRel
.
setAuditedGroupId
(
auditedGroupDTO
.
getAuditedGroupId
());
auditedGroupUserRel
.
setUserId
(
userId
);
auditedGroupUserRel
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
auditedGroupUserRel
.
setCreateTime
(
new
Date
());
tabAuditedGroupUserRelMapper
.
insertSelectiveByNotExist
(
auditedGroupUserRel
);
}
// 把所有userId关联status都设置为1
return
tabAuditedGroupUserRelMapper
.
updateStatusByUserIds
(
auditedGroupDTO
.
getEnterpriseId
(),
auditedGroupDTO
.
getAuditedGroupId
(),
auditedGroupDTO
.
getUserIdList
());
}
@Override
public
int
delRel
(
Integer
auditedGroupId
)
{
return
tabAuditedGroupUserRelMapper
.
delByAuditedGroupId
(
auditedGroupId
);
}
@Override
public
Map
<
Integer
,
Integer
>
getUserCountByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
)
{
List
<
Map
<
Integer
,
Object
>>
mapList
=
tabAuditedGroupUserRelMapper
.
getUserCountByAuditedGroup
(
auditedGroupIds
);
Map
<
Integer
,
Integer
>
resultMap
=
new
HashMap
<>(
auditedGroupIds
.
size
());
for
(
Map
<
Integer
,
Object
>
map
:
mapList
)
{
resultMap
.
put
(
Integer
.
valueOf
(
map
.
get
(
"auditedGroupId"
).
toString
()),
Integer
.
valueOf
(
map
.
get
(
"userCount"
).
toString
()));
}
return
resultMap
;
}
@Override
public
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
Integer
auditedGroupId
)
{
TabAuditedGroupUserRel
groupUserRel
=
new
TabAuditedGroupUserRel
();
groupUserRel
.
setAuditedGroupId
(
auditedGroupId
);
return
this
.
tabAuditedGroupUserRelMapper
.
listAuditedGroup
(
groupUserRel
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper
;
import
com.gic.auth.service.AuditorAuditedGroupRelService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 16:30
*/
@Service
public
class
AuditorAuditedGroupRelServiceImpl
implements
AuditorAuditedGroupRelService
{
@Autowired
private
TabAuditorAuditedGroupRelMapper
tabAuditorAuditedGroupRelMapper
;
@Override
public
int
delRel
(
Integer
auditedGroupId
)
{
return
tabAuditorAuditedGroupRelMapper
.
delRel
(
auditedGroupId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UserServiceImpl.java
View file @
c7944e30
package
com
.
gic
.
auth
.
service
.
impl
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.gic.auth.dao.mapper.TabSysUserMapper
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.dto.UserListDTO
;
...
...
@@ -13,8 +7,14 @@ import com.gic.auth.entity.TabSysUser;
import
com.gic.auth.qo.UserListQO
;
import
com.gic.auth.service.UserService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* @author guojx
...
...
@@ -80,4 +80,10 @@ public class UserServiceImpl implements UserService {
public
void
delete
(
Integer
userId
)
{
tabSysUserMapper
.
deleteById
(
userId
);
}
@Override
public
Integer
getAllCheckValue
(
Integer
enterpriseId
,
List
<
Integer
>
userIdList
)
{
Integer
line
=
tabSysUserMapper
.
getFirstNotInUserId
(
enterpriseId
,
userIdList
);
return
line
==
null
?
GlobalInfo
.
DATA_STATUS_NORMAL
:
GlobalInfo
.
DATA_STATUS_DELETE
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.entity.TabAuditedGroup
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.gic.auth.service.*
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 11:26
*/
@Service
(
"auditedGroupApiService"
)
public
class
AuditedGroupApiServiceImpl
implements
AuditedGroupApiService
{
private
Logger
logger
=
LogManager
.
getLogger
(
AuditedGroupApiServiceImpl
.
class
);
@Autowired
private
AuditedGroupService
auditedGroupService
;
@Autowired
private
AuditedGroupUserRelService
auditedGroupUserRelService
;
@Autowired
private
UserService
userService
;
@Autowired
private
AuditorAuditedGroupRelService
auditorAuditedGroupRelService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@SuppressWarnings
(
"unchecked"
)
public
ServiceResponse
<
Integer
>
saveOrUpdateAuditedGroup
(
AuditedGroupDTO
auditedGroupDTO
)
{
// 判断名是否重复
boolean
repeat
=
auditedGroupService
.
validAuditedGroupIsRepeat
(
auditedGroupDTO
.
getEnterpriseId
(),
auditedGroupDTO
.
getAuditedGroupName
(),
auditedGroupDTO
.
getAuditedGroupId
());
if
(
repeat
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"受审组名称重复"
);
}
// 判断该受审组是否是全选的
Integer
allCheck
=
userService
.
getAllCheckValue
(
auditedGroupDTO
.
getEnterpriseId
(),
auditedGroupDTO
.
getUserIdList
());
auditedGroupDTO
.
setAllCheck
(
allCheck
);
Integer
id
;
if
(
auditedGroupDTO
.
getAuditedGroupId
()
==
null
)
{
// save
id
=
auditedGroupService
.
save
(
auditedGroupDTO
);
auditedGroupDTO
.
setAuditedGroupId
(
id
);
if
(
id
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
OPERATION_FAILED
);
}
}
else
{
// update
Integer
line
=
auditedGroupService
.
update
(
auditedGroupDTO
);
if
(
line
==
0
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
id
=
auditedGroupDTO
.
getAuditedGroupId
();
}
this
.
auditedGroupUserRelService
.
addOrUpdateRel
(
auditedGroupDTO
);
// if (line != auditedGroupDTO.getUserIdList().size()) {
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED);
// }
return
ServiceResponse
.
success
(
id
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
Integer
>
delAuditedGroup
(
Integer
auditedGroupId
)
{
Integer
line
=
auditedGroupService
.
delAuditedGroup
(
auditedGroupId
);
if
(
line
==
0
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
// 删除受审组和管理员的关联关系
auditedGroupUserRelService
.
delRel
(
auditedGroupId
);
// 删除受审组和审核员的关联关系
auditorAuditedGroupRelService
.
delRel
(
auditedGroupId
);
return
ServiceResponse
.
success
(
line
);
}
@Override
public
ServiceResponse
<
Page
<
AuditedGroupDTO
>>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
)
{
com
.
github
.
pagehelper
.
Page
<
TabAuditedGroup
>
page
=
auditedGroupService
.
listAuditedGroup
(
auditedGroupQO
);
Page
<
AuditedGroupDTO
>
resultPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
,
AuditedGroupDTO
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
resultPage
.
getResult
()))
{
List
<
Integer
>
auditedGroupIds
=
resultPage
.
getResult
().
stream
().
map
(
AuditedGroupDTO:
:
getAuditedGroupId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
Integer
>
map
=
auditedGroupUserRelService
.
getUserCountByAuditedGroup
(
auditedGroupIds
);
for
(
AuditedGroupDTO
dto
:
resultPage
.
getResult
())
{
dto
.
setUserCount
(
map
.
get
(
dto
.
getAuditedGroupId
()));
}
}
return
ServiceResponse
.
success
(
resultPage
);
}
@Override
public
ServiceResponse
<
AuditedGroupDTO
>
getAuditedGroup
(
Integer
auditedGroupId
)
{
TabAuditedGroup
auditedGroup
=
auditedGroupService
.
getAuditedGroup
(
auditedGroupId
);
if
(
auditedGroup
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
AuditedGroupDTO
auditedGroupDTO
=
EntityUtil
.
changeEntityByJSON
(
AuditedGroupDTO
.
class
,
auditedGroup
);
List
<
TabAuditedGroupUserRel
>
rels
=
auditedGroupUserRelService
.
listAuditedGroup
(
auditedGroupId
);
if
(
CollectionUtils
.
isNotEmpty
(
rels
))
{
List
<
Integer
>
userIds
=
rels
.
stream
().
map
(
TabAuditedGroupUserRel:
:
getUserId
).
collect
(
Collectors
.
toList
());
auditedGroupDTO
.
setUserIdList
(
userIds
);
}
return
ServiceResponse
.
success
(
auditedGroupDTO
);
}
}
gic-platform-auth-service/src/main/resources/dubbo-gic-platform-auth-service.xml
View file @
c7944e30
...
...
@@ -24,4 +24,6 @@
<dubbo:service
interface=
"com.gic.auth.service.UnionEnterpriseApiService"
ref=
"unionEnterpriseApiService"
timeout=
"6000"
/>
<!--角色-->
<dubbo:service
interface=
"com.gic.auth.service.RoleApiService"
ref=
"roleApiService"
timeout=
"6000"
/>
<!--受审组-->
<dubbo:service
interface=
"com.gic.auth.service.AuditedGroupApiService"
ref=
"auditedGroupApiService"
timeout=
"6000"
/>
</beans>
gic-platform-auth-service/src/main/resources/mapper/TabAuditedGroupMapper.xml
View file @
c7944e30
...
...
@@ -3,13 +3,16 @@
<mapper
namespace=
"com.gic.auth.dao.mapper.TabAuditedGroupMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabAuditedGroup"
>
<id
column=
"audited_group_id"
jdbcType=
"INTEGER"
property=
"auditedGroupId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"audited_group_name"
jdbcType=
"VARCHAR"
property=
"auditedGroupName"
/>
<result
column=
"all_check"
jdbcType=
"INTEGER"
property=
"allCheck"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
audited_group_id, audited_group_name, status, create_time, update_time
audited_group_id, enterprise_id, audited_group_name, all_check, status, create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -22,22 +25,31 @@
where audited_group_id = #{auditedGroupId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditedGroup"
>
insert into tab_audited_group (audited_group_id, audited_group_name,
status, create_time, update_time
)
values (#{auditedGroupId,jdbcType=INTEGER}, #{auditedGroupName,jdbcType=VARCHAR},
#{
status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
insert into tab_audited_group (audited_group_id,
enterprise_id,
audited_group_name,
all_check, status, create_time,
update_time
)
values (#{auditedGroupId,jdbcType=INTEGER}, #{
enterpriseId,jdbcType=INTEGER}, #{
auditedGroupName,jdbcType=VARCHAR},
#{
allCheck,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditedGroup"
>
<selectKey
keyProperty=
"auditedGroupId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_audited_group
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditedGroupId != null"
>
audited_group_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"auditedGroupName != null"
>
audited_group_name,
</if>
<if
test=
"allCheck != null"
>
all_check,
</if>
<if
test=
"status != null"
>
status,
</if>
...
...
@@ -52,9 +64,15 @@
<if
test=
"auditedGroupId != null"
>
#{auditedGroupId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditedGroupName != null"
>
#{auditedGroupName,jdbcType=VARCHAR},
</if>
<if
test=
"allCheck != null"
>
#{allCheck,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
...
...
@@ -69,9 +87,15 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditedGroup"
>
update tab_audited_group
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditedGroupName != null"
>
audited_group_name = #{auditedGroupName,jdbcType=VARCHAR},
</if>
<if
test=
"allCheck != null"
>
all_check = #{allCheck,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
...
...
@@ -86,10 +110,45 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditedGroup"
>
update tab_audited_group
set audited_group_name = #{auditedGroupName,jdbcType=VARCHAR},
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
audited_group_name = #{auditedGroupName,jdbcType=VARCHAR},
all_check = #{allCheck,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where audited_group_id = #{auditedGroupId,jdbcType=INTEGER}
</update>
<select
id=
"getFirstAuditedGroup"
resultType=
"java.lang.Integer"
>
select
1
from tab_audited_group
where status = 1
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"auditedGroupName != null and auditedGroupName != '' "
>
and audited_group_name = #{auditedGroupName}
</if>
<if
test=
"auditedGroupId != null "
>
and audited_group_id
<>
#{auditedGroupId}
</if>
</select>
<update
id=
"delAuditedGroup"
>
update tab_audited_group
set status = 0
where audited_group_id = #{auditedGroupId}
</update>
<select
id=
"listAuditedGroup"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_audited_group
<where>
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"auditedGroupName != null and auditedGroupName != '' "
>
and audited_group_name like concat('%', #{auditedGroupName}, '%')
</if>
</where>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
View file @
c7944e30
...
...
@@ -3,6 +3,7 @@
<mapper
namespace=
"com.gic.auth.dao.mapper.TabAuditedGroupUserRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabAuditedGroupUserRel"
>
<id
column=
"audited_group_user_rel_id"
jdbcType=
"INTEGER"
property=
"auditedGroupUserRelId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"audited_group_id"
jdbcType=
"INTEGER"
property=
"auditedGroupId"
/>
<result
column=
"user_id"
jdbcType=
"INTEGER"
property=
"userId"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
...
...
@@ -10,7 +11,8 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
audited_group_user_rel_id, audited_group_id, user_id, status, create_time, update_time
audited_group_user_rel_id, enterprise_id, audited_group_id, user_id, status, create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -23,12 +25,12 @@
where audited_group_user_rel_id = #{auditedGroupUserRelId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditedGroupUserRel"
>
insert into tab_audited_group_user_rel (audited_group_user_rel_id,
audited_group
_id,
user_id, status, create_time
,
update_time)
values (#{auditedGroupUserRelId,jdbcType=INTEGER}, #{
auditedGroup
Id,jdbcType=INTEGER},
#{
userId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP
},
#{updateTime,jdbcType=TIMESTAMP})
insert into tab_audited_group_user_rel (audited_group_user_rel_id,
enterprise
_id,
audited_group_id, user_id, status
,
create_time,
update_time)
values (#{auditedGroupUserRelId,jdbcType=INTEGER}, #{
enterprise
Id,jdbcType=INTEGER},
#{
auditedGroupId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER
},
#{
createTime,jdbcType=TIMESTAMP}, #{
updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditedGroupUserRel"
>
insert into tab_audited_group_user_rel
...
...
@@ -36,6 +38,9 @@
<if
test=
"auditedGroupUserRelId != null"
>
audited_group_user_rel_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"auditedGroupId != null"
>
audited_group_id,
</if>
...
...
@@ -56,6 +61,9 @@
<if
test=
"auditedGroupUserRelId != null"
>
#{auditedGroupUserRelId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditedGroupId != null"
>
#{auditedGroupId,jdbcType=INTEGER},
</if>
...
...
@@ -76,6 +84,9 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditedGroupUserRel"
>
update tab_audited_group_user_rel
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditedGroupId != null"
>
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
</if>
...
...
@@ -96,11 +107,73 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditedGroupUserRel"
>
update tab_audited_group_user_rel
set audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where audited_group_user_rel_id = #{auditedGroupUserRelId,jdbcType=INTEGER}
</update>
<update
id=
"delByAuditedGroupId"
>
update tab_audited_group_user_rel set status = 0
where audited_group_id = #{auditedGroupId}
</update>
<insert
id=
"insertSelectiveByNotExist"
>
INSERT INTO tab_audited_group_user_rel (
audited_group_id,
user_id,
status,
create_time,
enterprise_id
) SELECT
#{auditedGroupId},
#{userId},
#{status},
#{createTime},
#{enterpriseId}
FROM
DUAL
WHERE
NOT EXISTS (
SELECT
1
FROM
tab_audited_group_user_rel tb
WHERE
tb.enterprise_id = #{enterpriseId}
AND tb.audited_group_id = #{auditedGroupId}
AND tb.user_id = #{userId}
)
</insert>
<update
id=
"updateStatusByUserIds"
>
update tab_audited_group_user_rel set status = 1
where enterprise_id = #{enterpriseId}
and audited_group_id = #{auditedGroupId}
and user_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
<select
id=
"getUserCountByAuditedGroup"
resultType=
"java.util.HashMap"
>
select
audited_group_id auditedGroupId, count(1) userCount
from
tab_audited_group_user_rel
where status = 1
<if
test=
"null != ids"
>
and audited_group_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
group by audited_group_id
</select>
<select
id=
"listAuditedGroup"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_audited_group_user_rel
where status = 1
and audited_group_id = #{auditedGroupId}
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditorAuditedGroupRelMapper.xml
View file @
c7944e30
...
...
@@ -3,6 +3,7 @@
<mapper
namespace=
"com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabAuditorAuditedGroupRel"
>
<id
column=
"auditor_audited_group_rel_id"
jdbcType=
"INTEGER"
property=
"auditorAuditedGroupRelId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"auditor_id"
jdbcType=
"INTEGER"
property=
"auditorId"
/>
<result
column=
"audited_group_id"
jdbcType=
"INTEGER"
property=
"auditedGroupId"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
...
...
@@ -10,8 +11,8 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
auditor_audited_group_rel_id,
auditor_id, audited_group_id, status, create_time
,
update_time
auditor_audited_group_rel_id,
enterprise_id, auditor_id, audited_group_id, status
,
create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -24,12 +25,12 @@
where auditor_audited_group_rel_id = #{auditorAuditedGroupRelId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditorAuditedGroupRel"
>
insert into tab_auditor_audited_group_rel (auditor_audited_group_rel_id,
auditor
_id,
audit
ed_group_id, status, create_time
,
update_time)
values (#{auditorAuditedGroupRelId,jdbcType=INTEGER}, #{
auditor
Id,jdbcType=INTEGER},
#{audit
edGroupId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP
},
#{updateTime,jdbcType=TIMESTAMP})
insert into tab_auditor_audited_group_rel (auditor_audited_group_rel_id,
enterprise
_id,
audit
or_id, audited_group_id, status
,
create_time,
update_time)
values (#{auditorAuditedGroupRelId,jdbcType=INTEGER}, #{
enterprise
Id,jdbcType=INTEGER},
#{audit
orId,jdbcType=INTEGER}, #{auditedGroupId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER
},
#{
createTime,jdbcType=TIMESTAMP}, #{
updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditorAuditedGroupRel"
>
insert into tab_auditor_audited_group_rel
...
...
@@ -37,6 +38,9 @@
<if
test=
"auditorAuditedGroupRelId != null"
>
auditor_audited_group_rel_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"auditorId != null"
>
auditor_id,
</if>
...
...
@@ -57,6 +61,9 @@
<if
test=
"auditorAuditedGroupRelId != null"
>
#{auditorAuditedGroupRelId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditorId != null"
>
#{auditorId,jdbcType=INTEGER},
</if>
...
...
@@ -77,6 +84,9 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditorAuditedGroupRel"
>
update tab_auditor_audited_group_rel
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditorId != null"
>
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
...
...
@@ -97,11 +107,18 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditorAuditedGroupRel"
>
update tab_auditor_audited_group_rel
set auditor_id = #{auditorId,jdbcType=INTEGER},
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER},
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_audited_group_rel_id = #{auditorAuditedGroupRelId,jdbcType=INTEGER}
</update>
<update
id=
"delRel"
>
update tab_auditor_audited_group_rel
set status = 0
where audited_group_id = #{auditedGroupId}
and status = 1
</update>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditorProjectRelMapper.xml
View file @
c7944e30
...
...
@@ -3,6 +3,7 @@
<mapper
namespace=
"com.gic.auth.dao.mapper.TabAuditorProjectRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabAuditorProjectRel"
>
<id
column=
"auditor_project_rel_id"
jdbcType=
"INTEGER"
property=
"auditorProjectRelId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"auditor_id"
jdbcType=
"INTEGER"
property=
"auditorId"
/>
<result
column=
"project_id"
jdbcType=
"INTEGER"
property=
"projectId"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
...
...
@@ -10,7 +11,8 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
auditor_project_rel_id, auditor_id, project_id, status, create_time, update_time
auditor_project_rel_id, enterprise_id, auditor_id, project_id, status, create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -23,12 +25,12 @@
where auditor_project_rel_id = #{auditorProjectRelId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
insert into tab_auditor_project_rel (auditor_project_rel_id,
auditor_id, project
_id,
status, create_time, update_time
)
values (#{auditorProjectRelId,jdbcType=INTEGER}, #{
auditorId,jdbcType=INTEGER}, #{project
Id,jdbcType=INTEGER},
#{
status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
insert into tab_auditor_project_rel (auditor_project_rel_id,
enterprise
_id,
auditor_id, project_id, status,
create_time, update_time
)
values (#{auditorProjectRelId,jdbcType=INTEGER}, #{
enterprise
Id,jdbcType=INTEGER},
#{
auditorId,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
insert into tab_auditor_project_rel
...
...
@@ -36,6 +38,9 @@
<if
test=
"auditorProjectRelId != null"
>
auditor_project_rel_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"auditorId != null"
>
auditor_id,
</if>
...
...
@@ -56,6 +61,9 @@
<if
test=
"auditorProjectRelId != null"
>
#{auditorProjectRelId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditorId != null"
>
#{auditorId,jdbcType=INTEGER},
</if>
...
...
@@ -76,6 +84,9 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
update tab_auditor_project_rel
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"auditorId != null"
>
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
...
...
@@ -96,7 +107,8 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
update tab_auditor_project_rel
set auditor_id = #{auditorId,jdbcType=INTEGER},
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER},
project_id = #{projectId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysUserMapper.xml
View file @
c7944e30
...
...
@@ -263,4 +263,21 @@
where user_id = #{userId}
and status = 1
</update>
<select
id=
"getFirstNotInUserId"
resultType=
"java.lang.Integer"
>
select
1
from tab_sys_user
where status = 1
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"null != ids"
>
and user_id not in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/AuditedGroupController.java
0 → 100644
View file @
c7944e30
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.gic.auth.service.AuditedGroupApiService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-18 18:04
*/
@RestController
public
class
AuditedGroupController
{
@Autowired
private
AuditedGroupApiService
auditedGroupApiService
;
@RequestMapping
(
"/save-audited-group"
)
public
RestResponse
saveOrUpdateAuditedGroup
(
@Validated
(
AuditedGroupQO
.
SaveValid
.
class
)
AuditedGroupQO
auditedGroupQO
)
{
AuditedGroupDTO
auditedGroupDTO
=
EntityUtil
.
changeEntityByJSON
(
AuditedGroupDTO
.
class
,
auditedGroupQO
);
auditedGroupDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
List
<
String
>
list
=
Arrays
.
asList
(
auditedGroupQO
.
getUserIds
().
split
(
GlobalInfo
.
FLAG_COMMA
));
List
<
Integer
>
ids
=
list
.
stream
().
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
());
auditedGroupDTO
.
setUserIdList
(
ids
);
ServiceResponse
<
Integer
>
response
=
auditedGroupApiService
.
saveOrUpdateAuditedGroup
(
auditedGroupDTO
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/del-audited-group"
)
public
RestResponse
delAuditedGroup
(
@Validated
(
AuditedGroupQO
.
DelValid
.
class
)
AuditedGroupQO
auditedGroupQO
)
{
ServiceResponse
<
Integer
>
response
=
auditedGroupApiService
.
delAuditedGroup
(
auditedGroupQO
.
getAuditedGroupId
());
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/get-audited-group"
)
public
RestResponse
getAuditGroup
(
@Validated
(
AuditedGroupQO
.
DelValid
.
class
)
AuditedGroupQO
auditedGroupQO
)
{
ServiceResponse
<
AuditedGroupDTO
>
response
=
auditedGroupApiService
.
getAuditedGroup
(
auditedGroupQO
.
getAuditedGroupId
());
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/list-audited-group"
)
public
RestResponse
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
)
{
auditedGroupQO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
ServiceResponse
<
Page
<
AuditedGroupDTO
>>
response
=
auditedGroupApiService
.
listAuditedGroup
(
auditedGroupQO
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
}
gic-platform-auth-web/src/main/resources/dubbo-gic-platform-auth-web.xml
View file @
c7944e30
...
...
@@ -46,4 +46,7 @@
<!--角色-->
<dubbo:reference
interface=
"com.gic.auth.service.RoleApiService"
id=
"roleApiService"
timeout=
"6000"
/>
<!--受审组-->
<dubbo:reference
interface=
"com.gic.auth.service.AuditedGroupApiService"
id=
"auditedGroupApiService"
timeout=
"6000"
/>
</beans>
\ 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