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
308f5731
Commit
308f5731
authored
Sep 20, 2019
by
314581947
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审核员接口添加参数判断
parent
d87033c9
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
4 deletions
+75
-4
TabAuditedGroupMapper.java
...n/java/com/gic/auth/dao/mapper/TabAuditedGroupMapper.java
+5
-0
TabSysUserMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
+3
-0
AuditedGroupService.java
...c/main/java/com/gic/auth/service/AuditedGroupService.java
+4
-0
UserService.java
...rvice/src/main/java/com/gic/auth/service/UserService.java
+2
-0
AuditedGroupServiceImpl.java
...va/com/gic/auth/service/impl/AuditedGroupServiceImpl.java
+7
-0
UserServiceImpl.java
.../main/java/com/gic/auth/service/impl/UserServiceImpl.java
+6
-0
AuditedGroupApiServiceImpl.java
...c/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
+5
-0
AuditorApiServiceImpl.java
...om/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
+23
-4
dubbo-gic-platform-auth-service.xml
...ce/src/main/resources/dubbo-gic-platform-auth-service.xml
+1
-0
TabAuditedGroupMapper.xml
...rvice/src/main/resources/mapper/TabAuditedGroupMapper.xml
+11
-0
TabSysUserMapper.xml
...th-service/src/main/resources/mapper/TabSysUserMapper.xml
+8
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditedGroupMapper.java
View file @
308f5731
...
...
@@ -6,6 +6,8 @@ import com.gic.auth.qo.AuditedGroupQO;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabAuditedGroupMapper
{
/**
* 根据主键删除
...
...
@@ -60,4 +62,6 @@ public interface TabAuditedGroupMapper {
Integer
delAuditedGroup
(
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
);
Page
<
TabAuditedGroup
>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
);
int
countByAuditedGroupIds
(
@Param
(
"ids"
)
List
<
Integer
>
auditedGroupIdList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
View file @
308f5731
...
...
@@ -94,4 +94,6 @@ public interface TabSysUserMapper {
int
deleteById
(
@Param
(
"userId"
)
Integer
userId
);
Integer
getFirstNotInUserId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"ids"
)
List
<
Integer
>
userIdList
);
Integer
countUserByUserIds
(
@Param
(
"ids"
)
List
<
Integer
>
userIdList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupService.java
View file @
308f5731
...
...
@@ -5,6 +5,8 @@ import com.gic.auth.entity.TabAuditedGroup;
import
com.gic.auth.qo.AuditedGroupQO
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
/**
*
* @Description:
...
...
@@ -24,4 +26,6 @@ public interface AuditedGroupService {
Page
<
TabAuditedGroup
>
listAuditedGroup
(
AuditedGroupQO
auditedGroupQO
);
TabAuditedGroup
getAuditedGroup
(
Integer
auditedGroupId
);
boolean
validAuditedGroupIsNotExist
(
List
<
Integer
>
auditedGroupIdList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/UserService.java
View file @
308f5731
...
...
@@ -77,4 +77,6 @@ public interface UserService {
void
delete
(
Integer
userId
);
Integer
getAllCheckValue
(
Integer
enterpriseId
,
List
<
Integer
>
userIdList
);
boolean
validUserIsNotExist
(
List
<
Integer
>
userIdList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupServiceImpl.java
View file @
308f5731
...
...
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
*
...
...
@@ -70,4 +71,10 @@ public class AuditedGroupServiceImpl implements AuditedGroupService {
TabAuditedGroup
tabAuditedGroup
=
tabAuditedGroupMapper
.
selectByPrimaryKey
(
auditedGroupId
);
return
tabAuditedGroup
!=
null
&&
(
GlobalInfo
.
DATA_STATUS_NORMAL
==
tabAuditedGroup
.
getStatus
())
?
tabAuditedGroup
:
null
;
}
@Override
public
boolean
validAuditedGroupIsNotExist
(
List
<
Integer
>
auditedGroupIdList
)
{
int
count
=
tabAuditedGroupMapper
.
countByAuditedGroupIds
(
auditedGroupIdList
);
return
count
!=
auditedGroupIdList
.
size
();
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UserServiceImpl.java
View file @
308f5731
...
...
@@ -91,4 +91,10 @@ public class UserServiceImpl implements UserService {
Integer
line
=
tabSysUserMapper
.
getFirstNotInUserId
(
enterpriseId
,
userIdList
);
return
line
==
null
?
GlobalInfo
.
DATA_STATUS_NORMAL
:
GlobalInfo
.
DATA_STATUS_DELETE
;
}
@Override
public
boolean
validUserIsNotExist
(
List
<
Integer
>
userIdList
)
{
Integer
count
=
tabSysUserMapper
.
countUserByUserIds
(
userIdList
);
return
count
!=
userIdList
.
size
();
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
View file @
308f5731
...
...
@@ -51,6 +51,11 @@ public class AuditedGroupApiServiceImpl implements AuditedGroupApiService {
if
(
repeat
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"受审组名称重复"
);
}
// 验证suerId是否合法
boolean
notExist
=
userService
.
validUserIsNotExist
(
auditedGroupDTO
.
getUserIdList
());
if
(
notExist
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
);
}
// 判断该受审组是否是全选的
Integer
allCheck
=
userService
.
getAllCheckValue
(
auditedGroupDTO
.
getEnterpriseId
(),
auditedGroupDTO
.
getUserIdList
());
auditedGroupDTO
.
setAllCheck
(
allCheck
);
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
View file @
308f5731
...
...
@@ -7,14 +7,14 @@ import com.gic.auth.entity.TabAuditor;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
com.gic.auth.entity.TabAuditorProjectItemRel
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.gic.auth.service.AuditorApiService
;
import
com.gic.auth.service.AuditorAuditedGroupRelService
;
import
com.gic.auth.service.AuditorProjectItemRelService
;
import
com.gic.auth.service.AuditorService
;
import
com.gic.auth.service.*
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.dto.ProjectItemDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.qo.ProjectItemQO
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.enterprise.service.ProjectItemApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -44,6 +44,10 @@ public class AuditorApiServiceImpl implements AuditorApiService {
private
AuditorProjectItemRelService
auditorProjectItemRelService
;
@Autowired
private
AuditorAuditedGroupRelService
auditorAuditedGroupRelService
;
@Autowired
private
ProjectItemApiService
projectItemApiService
;
@Autowired
private
AuditedGroupService
auditedGroupService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -56,6 +60,14 @@ public class AuditorApiServiceImpl implements AuditorApiService {
if
(
phoneIsRepeat
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"审核员手机号重复"
);
}
boolean
projectItemIsNotExist
=
validProjectItemIsNotExist
(
auditorDTO
.
getProjectItemList
());
if
(
projectItemIsNotExist
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
);
}
boolean
auditedGroupIsNotExist
=
auditedGroupService
.
validAuditedGroupIsNotExist
(
auditorDTO
.
getAuditedGroupIdList
());
if
(
auditedGroupIsNotExist
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
);
}
auditorDTO
.
setIsUse
(
auditorDTO
.
getUserId
()
==
null
?
0
:
1
);
// 这里进来的 不会去修改openid,所以把openid设为null
auditorDTO
.
setOpenid
(
null
);
...
...
@@ -84,6 +96,13 @@ public class AuditorApiServiceImpl implements AuditorApiService {
return
ServiceResponse
.
success
(
tempQrCodeUrl
);
}
private
boolean
validProjectItemIsNotExist
(
List
<
Integer
>
projectItemList
)
{
ProjectItemQO
qo
=
new
ProjectItemQO
();
qo
.
setProjectItemList
(
projectItemList
);
ServiceResponse
<
Page
<
ProjectItemDTO
>>
serviceResponse
=
projectItemApiService
.
listProjectItem
(
qo
);
return
!
serviceResponse
.
isSuccess
()
||
serviceResponse
.
getResult
().
getTotalCount
()
!=
projectItemList
.
size
();
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
Void
>
delAuditor
(
Integer
auditorId
)
{
...
...
gic-platform-auth-service/src/main/resources/dubbo-gic-platform-auth-service.xml
View file @
308f5731
...
...
@@ -32,4 +32,5 @@
<dubbo:reference
interface=
"com.gic.open.api.service.ApplicationApiService"
id=
"applicationApiService"
timeout=
"6000"
/>
<!--审核员-->
<dubbo:service
interface=
"com.gic.auth.service.AuditorApiService"
ref=
"auditorApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.ProjectItemApiService"
id=
"projectItemApiService"
timeout=
"6000"
/>
</beans>
gic-platform-auth-service/src/main/resources/mapper/TabAuditedGroupMapper.xml
View file @
308f5731
...
...
@@ -151,4 +151,14 @@
</if>
</where>
</select>
<select
id=
"countByAuditedGroupIds"
resultType=
"java.lang.Integer"
>
select count(1)
from tab_audited_group 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>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabSysUserMapper.xml
View file @
308f5731
...
...
@@ -280,4 +280,11 @@
</if>
limit 1
</select>
<select
id=
"countUserByUserIds"
resultType=
"java.lang.Integer"
>
select count(1) from tab_sys_user where status = 1
and user_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</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