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
15a39174
Commit
15a39174
authored
Sep 20, 2019
by
314581947
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审核员接口
parent
936d4e13
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1435 additions
and
75 deletions
+1435
-75
AuditedGroupUserRelDTO.java
...rc/main/java/com/gic/auth/dto/AuditedGroupUserRelDTO.java
+113
-0
AuditorAuditedGroupRelDTO.java
...main/java/com/gic/auth/dto/AuditorAuditedGroupRelDTO.java
+114
-0
AuditorDTO.java
...m-auth-api/src/main/java/com/gic/auth/dto/AuditorDTO.java
+60
-0
AuditorListQO.java
...auth-api/src/main/java/com/gic/auth/qo/AuditorListQO.java
+49
-0
AuditorApiService.java
...src/main/java/com/gic/auth/service/AuditorApiService.java
+58
-0
TabAuditedGroupUserRelMapper.java
...com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
+3
-1
TabAuditorAuditedGroupRelMapper.java
.../gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
+15
-0
TabAuditorMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabAuditorMapper.java
+11
-0
TabAuditorProjectItemRelMapper.java
...m/gic/auth/dao/mapper/TabAuditorProjectItemRelMapper.java
+25
-10
TabAuditor.java
...service/src/main/java/com/gic/auth/entity/TabAuditor.java
+13
-0
TabAuditorProjectItemRel.java
...in/java/com/gic/auth/entity/TabAuditorProjectItemRel.java
+13
-13
AuditedGroupUserRelService.java
...java/com/gic/auth/service/AuditedGroupUserRelService.java
+2
-0
AuditorAuditedGroupRelService.java
...a/com/gic/auth/service/AuditorAuditedGroupRelService.java
+13
-0
AuditorProjectItemRelService.java
...va/com/gic/auth/service/AuditorProjectItemRelService.java
+22
-0
AuditorService.java
...ce/src/main/java/com/gic/auth/service/AuditorService.java
+34
-0
AuditedGroupUserRelServiceImpl.java
...gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
+9
-1
AuditorAuditedGroupRelServiceImpl.java
.../auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
+82
-0
AuditorProjectItemRelServiceImpl.java
...c/auth/service/impl/AuditorProjectItemRelServiceImpl.java
+66
-0
AuditorServiceImpl.java
...in/java/com/gic/auth/service/impl/AuditorServiceImpl.java
+110
-0
AuditedGroupApiServiceImpl.java
...c/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
+0
-7
AuditorApiServiceImpl.java
...om/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
+175
-0
dubbo-gic-platform-auth-service.xml
...ce/src/main/resources/dubbo-gic-platform-auth-service.xml
+2
-0
TabAuditedGroupUserRelMapper.xml
...rc/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
+11
-1
TabAuditorAuditedGroupRelMapper.xml
...main/resources/mapper/TabAuditorAuditedGroupRelMapper.xml
+75
-0
TabAuditorMapper.xml
...th-service/src/main/resources/mapper/TabAuditorMapper.xml
+66
-8
TabAuditorProjectItemRelMapper.xml
.../main/resources/mapper/TabAuditorProjectItemRelMapper.xml
+103
-34
AuditorController.java
...n/java/com/gic/auth/web/controller/AuditorController.java
+78
-0
AuditorQO.java
...auth-web/src/main/java/com/gic/auth/web/qo/AuditorQO.java
+110
-0
dubbo-gic-platform-auth-web.xml
...th-web/src/main/resources/dubbo-gic-platform-auth-web.xml
+3
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/AuditedGroupUserRelDTO.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-20 16:07
*/
public
class
AuditedGroupUserRelDTO
implements
Serializable
{
/**
*
*/
private
Integer
auditedGroupUserRelId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 受审组id
*/
private
Integer
auditedGroupId
;
/**
* 管理员id
*/
private
Integer
userId
;
/**
*
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
private
List
<
Integer
>
auditedGroupIdList
;
public
Integer
getAuditedGroupUserRelId
()
{
return
auditedGroupUserRelId
;
}
public
void
setAuditedGroupUserRelId
(
Integer
auditedGroupUserRelId
)
{
this
.
auditedGroupUserRelId
=
auditedGroupUserRelId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
public
void
setAuditedGroupId
(
Integer
auditedGroupId
)
{
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
void
setAuditedGroupIdList
(
List
<
Integer
>
auditedGroupIdList
)
{
this
.
auditedGroupIdList
=
auditedGroupIdList
;
}
public
List
<
Integer
>
getAuditedGroupIdList
()
{
return
auditedGroupIdList
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/AuditorAuditedGroupRelDTO.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-20 11:00
*/
public
class
AuditorAuditedGroupRelDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3336969578120506485L
;
/**
*
*/
private
Integer
auditorAuditedGroupRelId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 审核员id
*/
private
Integer
auditorId
;
/**
* 受审组id
*/
private
Integer
auditedGroupId
;
/**
*
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
private
List
<
Integer
>
auditorIdList
;
public
Integer
getAuditorAuditedGroupRelId
()
{
return
auditorAuditedGroupRelId
;
}
public
void
setAuditorAuditedGroupRelId
(
Integer
auditorAuditedGroupRelId
)
{
this
.
auditorAuditedGroupRelId
=
auditorAuditedGroupRelId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getAuditorId
()
{
return
auditorId
;
}
public
void
setAuditorId
(
Integer
auditorId
)
{
this
.
auditorId
=
auditorId
;
}
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
public
void
setAuditedGroupId
(
Integer
auditedGroupId
)
{
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
void
setAuditorIdList
(
List
<
Integer
>
auditorIdList
)
{
this
.
auditorIdList
=
auditorIdList
;
}
public
List
<
Integer
>
getAuditorIdList
()
{
return
auditorIdList
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/AuditorDTO.java
View file @
15a39174
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
/**
*
...
...
@@ -32,6 +33,11 @@ public class AuditorDTO implements Serializable {
private
String
phone
;
/**
* 关联管理员id
*/
private
Integer
userId
;
/**
* 微信openid
*/
private
String
openid
;
...
...
@@ -41,6 +47,20 @@ public class AuditorDTO implements Serializable {
*/
private
Integer
isUse
;
/**
* 受审项目审批项id
*/
private
List
<
Integer
>
projectItemList
;
/**
* 受审组id
*/
private
List
<
Integer
>
auditedGroupIdList
;
private
Integer
projectItemCount
;
private
Integer
auditedGroupCount
;
public
Integer
getAuditorId
()
{
return
auditorId
;
}
...
...
@@ -73,6 +93,14 @@ public class AuditorDTO implements Serializable {
this
.
phone
=
phone
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
String
getOpenid
()
{
return
openid
;
}
...
...
@@ -88,4 +116,36 @@ public class AuditorDTO implements Serializable {
public
void
setIsUse
(
Integer
isUse
)
{
this
.
isUse
=
isUse
;
}
public
List
<
Integer
>
getProjectItemList
()
{
return
projectItemList
;
}
public
void
setProjectItemList
(
List
<
Integer
>
projectItemList
)
{
this
.
projectItemList
=
projectItemList
;
}
public
List
<
Integer
>
getAuditedGroupIdList
()
{
return
auditedGroupIdList
;
}
public
void
setAuditedGroupIdList
(
List
<
Integer
>
auditedGroupIdList
)
{
this
.
auditedGroupIdList
=
auditedGroupIdList
;
}
public
Integer
getProjectItemCount
()
{
return
projectItemCount
;
}
public
void
setProjectItemCount
(
Integer
projectItemCount
)
{
this
.
projectItemCount
=
projectItemCount
;
}
public
Integer
getAuditedGroupCount
()
{
return
auditedGroupCount
;
}
public
void
setAuditedGroupCount
(
Integer
auditedGroupCount
)
{
this
.
auditedGroupCount
=
auditedGroupCount
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/AuditorListQO.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
qo
;
import
com.gic.enterprise.qo.PageQO
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-19 14:18
*/
public
class
AuditorListQO
extends
PageQO
{
private
Integer
enterpriseId
;
private
String
auditorName
;
private
Integer
auditedGroupId
;
private
Integer
isUse
;
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getAuditorName
()
{
return
auditorName
;
}
public
void
setAuditorName
(
String
auditorName
)
{
this
.
auditorName
=
auditorName
;
}
public
Integer
getAuditedGroupId
()
{
return
auditedGroupId
;
}
public
void
setAuditedGroupId
(
Integer
auditedGroupId
)
{
this
.
auditedGroupId
=
auditedGroupId
;
}
public
Integer
getIsUse
()
{
return
isUse
;
}
public
void
setIsUse
(
Integer
isUse
)
{
this
.
isUse
=
isUse
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/AuditorApiService.java
View file @
15a39174
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuditorDTO
;
import
com.gic.auth.qo.AuditorListQO
;
import
java.util.List
;
/**
* 审核员
...
...
@@ -23,5 +27,59 @@ public interface AuditorApiService {
*/
ServiceResponse
<
String
>
saveOrUpdateAuditor
(
AuditorDTO
auditorDTO
);
/**
* 删除审核员
* @Title: delAuditor
* @Description:
* @author zhiwj
* @param auditorId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
Void
>
delAuditor
(
Integer
auditorId
);
/**
*
* @Title: getAuditor
* @Description:
* @author zhiwj
* @param auditorId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
AuditorDTO
>
getAuditor
(
Integer
auditorId
);
/**
*
* @Title: pageAuditor
* @Description:
* @author zhiwj
* @param auditorListQO
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.auth.dto.AuditorDTO>>
* @throws
*/
ServiceResponse
<
Page
<
AuditorDTO
>>
pageAuditor
(
AuditorListQO
auditorListQO
);
/**
* 接收扫描二维码之后的回调
* @Title: receiveOpenid
* @Description:
* @author zhiwj
* @param qrCodeParam
* @param openid
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Void
>
receiveOpenid
(
String
qrCodeParam
,
String
openid
);
/**
* 不分頁列表
* @Title: listAuditor
* @Description:
* @author zhiwj
* @param auditorListQO
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.AuditorDTO>>
* @throws
*/
ServiceResponse
<
List
<
AuditorDTO
>>
listAuditor
(
AuditorListQO
auditorListQO
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
View file @
15a39174
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AuditedGroupUserRelDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -63,5 +64,5 @@ public interface TabAuditedGroupUserRelMapper {
List
<
Map
<
Integer
,
Object
>>
getUserCountByAuditedGroup
(
@Param
(
"ids"
)
List
<
Integer
>
auditedGroupIds
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
TabAuditedGroupUserRel
groupUserRel
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
AuditedGroupUserRelDTO
groupUserRel
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
View file @
15a39174
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AuditorAuditedGroupRelDTO
;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
TabAuditorAuditedGroupRelMapper
{
/**
* 根据主键删除
...
...
@@ -53,4 +57,14 @@ public interface TabAuditorAuditedGroupRelMapper {
int
updateByPrimaryKey
(
TabAuditorAuditedGroupRel
record
);
int
delRel
(
@Param
(
"auditedGroupId"
)
Integer
auditedGroupId
);
void
delByAuditorId
(
@Param
(
"auditorId"
)
Integer
auditorId
);
void
insertSelectiveByNotExist
(
TabAuditorAuditedGroupRel
itemRel
);
void
updateStatusByAuditedGroupIds
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"auditorId"
)
Integer
auditorId
,
@Param
(
"ids"
)
List
<
Integer
>
auditedGroupIdList
);
List
<
TabAuditorAuditedGroupRel
>
listRel
(
AuditorAuditedGroupRelDTO
auditorAuditedGroupRel
);
List
<
Map
<
String
,
Object
>>
getCountByAuditorIds
(
@Param
(
"ids"
)
List
<
Integer
>
auditorIdList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorMapper.java
View file @
15a39174
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AuditorDTO
;
import
com.gic.auth.entity.TabAuditor
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabAuditorMapper
{
/**
...
...
@@ -50,4 +54,10 @@ public interface TabAuditorMapper {
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabAuditor
record
);
TabAuditor
getFirstAuditor
(
AuditorDTO
auditorDTO
);
Integer
delAuditor
(
@Param
(
"auditorId"
)
Integer
auditorId
);
Page
<
TabAuditor
>
listAuditor
(
AuditorListQO
auditorListQO
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorProjectRelMapper.java
→
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorProject
Item
RelMapper.java
View file @
15a39174
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabAuditorProjectRel
;
import
com.gic.auth.entity.TabAuditorProjectItemRel
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TabAuditorProjectRelMapper
{
import
java.util.List
;
import
java.util.Map
;
public
interface
TabAuditorProjectItemRelMapper
{
/**
* 根据主键删除
*
* @param auditorProjectRelId 主键
* @param auditorProject
Item
RelId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
Integer
auditorProjectRelId
);
int
deleteByPrimaryKey
(
Integer
auditorProject
Item
RelId
);
/**
* 插入一条记录
...
...
@@ -17,7 +21,7 @@ public interface TabAuditorProjectRelMapper {
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabAuditorProjectRel
record
);
int
insert
(
TabAuditorProject
Item
Rel
record
);
/**
* 动态插入一条记录
...
...
@@ -25,15 +29,15 @@ public interface TabAuditorProjectRelMapper {
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabAuditorProjectRel
record
);
int
insertSelective
(
TabAuditorProject
Item
Rel
record
);
/**
* 根据主键查询
*
* @param auditorProjectRelId 主键
* @param auditorProject
Item
RelId 主键
* @return 实体对象
*/
TabAuditorProject
Rel
selectByPrimaryKey
(
Integer
auditorProject
RelId
);
TabAuditorProject
ItemRel
selectByPrimaryKey
(
Integer
auditorProjectItem
RelId
);
/**
* 根据主键动态更新记录
...
...
@@ -41,7 +45,7 @@ public interface TabAuditorProjectRelMapper {
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabAuditorProjectRel
record
);
int
updateByPrimaryKeySelective
(
TabAuditorProject
Item
Rel
record
);
/**
* 根据主键更新记录
...
...
@@ -49,5 +53,15 @@ public interface TabAuditorProjectRelMapper {
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabAuditorProjectRel
record
);
int
updateByPrimaryKey
(
TabAuditorProjectItemRel
record
);
int
delByAuditorId
(
@Param
(
"auditorId"
)
Integer
auditorId
);
int
insertSelectiveByNotExist
(
TabAuditorProjectItemRel
itemRel
);
int
updateStatusByProjectItemIds
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"auditorId"
)
Integer
auditorId
,
@Param
(
"ids"
)
List
<
Integer
>
projectItemList
);
List
<
TabAuditorProjectItemRel
>
listRelByAuditorId
(
TabAuditorProjectItemRel
auditorProjectItemRel
);
List
<
Map
<
String
,
Object
>>
getCountByAuditorIds
(
@Param
(
"ids"
)
List
<
Integer
>
auditorIdList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditor.java
View file @
15a39174
...
...
@@ -27,6 +27,11 @@ public class TabAuditor {
private
String
phone
;
/**
* 关联管理员id
*/
private
Integer
userId
;
/**
* 微信openid
*/
private
String
openid
;
...
...
@@ -83,6 +88,14 @@ public class TabAuditor {
this
.
phone
=
phone
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
String
getOpenid
()
{
return
openid
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditorProjectRel.java
→
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabAuditorProject
Item
Rel.java
View file @
15a39174
...
...
@@ -3,13 +3,13 @@ package com.gic.auth.entity;
import
java.util.Date
;
/**
* tab_auditor_project_rel
* tab_auditor_project_
item_
rel
*/
public
class
TabAuditorProjectRel
{
public
class
TabAuditorProject
Item
Rel
{
/**
*
*/
private
Integer
auditorProjectRelId
;
private
Integer
auditorProject
Item
RelId
;
/**
*
...
...
@@ -22,9 +22,9 @@ public class TabAuditorProjectRel {
private
Integer
auditorId
;
/**
*
项目
*
审批项
*/
private
Integer
projectId
;
private
Integer
projectI
temI
d
;
/**
*
...
...
@@ -41,12 +41,12 @@ public class TabAuditorProjectRel {
*/
private
Date
updateTime
;
public
Integer
getAuditorProjectRelId
()
{
return
auditorProjectRelId
;
public
Integer
getAuditorProject
Item
RelId
()
{
return
auditorProject
Item
RelId
;
}
public
void
setAuditorProject
RelId
(
Integer
auditorProject
RelId
)
{
this
.
auditorProject
RelId
=
auditorProject
RelId
;
public
void
setAuditorProject
ItemRelId
(
Integer
auditorProjectItem
RelId
)
{
this
.
auditorProject
ItemRelId
=
auditorProjectItem
RelId
;
}
public
Integer
getEnterpriseId
()
{
...
...
@@ -65,12 +65,12 @@ public class TabAuditorProjectRel {
this
.
auditorId
=
auditorId
;
}
public
Integer
getProjectId
()
{
return
projectId
;
public
Integer
getProjectI
temI
d
()
{
return
projectI
temI
d
;
}
public
void
setProjectI
d
(
Integer
project
Id
)
{
this
.
projectI
d
=
project
Id
;
public
void
setProjectI
temId
(
Integer
projectItem
Id
)
{
this
.
projectI
temId
=
projectItem
Id
;
}
public
Integer
getStatus
()
{
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupUserRelService.java
View file @
15a39174
...
...
@@ -20,4 +20,6 @@ public interface AuditedGroupUserRelService {
Map
<
Integer
,
Integer
>
getUserCountByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
Integer
auditedGroupId
);
List
<
TabAuditedGroupUserRel
>
getUserIdListByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorAuditedGroupRelService.java
View file @
15a39174
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
java.util.List
;
import
java.util.Map
;
/**
*
* @Description:
...
...
@@ -9,4 +14,12 @@ package com.gic.auth.service;
public
interface
AuditorAuditedGroupRelService
{
int
delRel
(
Integer
auditedGroupId
);
void
addOrUpdateRel
(
Integer
enterpriseId
,
Integer
auditorId
,
List
<
Integer
>
auditedGroupIdList
);
void
delRelByAuditorId
(
Integer
auditorId
);
List
<
TabAuditorAuditedGroupRel
>
listRelByAuditorId
(
Integer
auditorId
);
Map
<
Integer
,
Integer
>
getUserCountByAuditorIds
(
List
<
Integer
>
auditorIdList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorProjectItemRelService.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.entity.TabAuditorProjectItemRel
;
import
java.util.List
;
import
java.util.Map
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-19 16:56
*/
public
interface
AuditorProjectItemRelService
{
void
addOrUpdateRel
(
Integer
enterpriseId
,
Integer
auditorId
,
List
<
Integer
>
projectItemList
);
void
delRelByAuditorId
(
Integer
auditorId
);
List
<
TabAuditorProjectItemRel
>
listRelByAuditorId
(
Integer
auditorId
);
Map
<
Integer
,
Integer
>
getCountByAuditorIds
(
List
<
Integer
>
auditorIdList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorService.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.AuditorDTO
;
import
com.gic.auth.entity.TabAuditor
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-19 16:40
*/
public
interface
AuditorService
{
boolean
validAuditorNameIsRepeat
(
Integer
enterpriseId
,
String
auditorName
,
Integer
auditorId
);
boolean
validPhoneIsRepeat
(
Integer
enterpriseId
,
String
phone
,
Integer
auditorId
);
boolean
validOpenidIsRepeat
(
Integer
enterpriseId
,
String
openid
,
Integer
auditorId
);
Integer
save
(
AuditorDTO
auditorDTO
);
Integer
update
(
AuditorDTO
auditorDTO
);
TabAuditor
getAuditor
(
Integer
auditorId
);
Integer
delAuditor
(
Integer
auditorId
);
Page
<
TabAuditor
>
pageAuditor
(
AuditorListQO
auditorListQO
);
List
<
TabAuditor
>
listAuditor
(
AuditorListQO
auditorListQO
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
View file @
15a39174
...
...
@@ -2,6 +2,7 @@ package com.gic.auth.service.impl;
import
com.gic.auth.dao.mapper.TabAuditedGroupUserRelMapper
;
import
com.gic.auth.dto.AuditedGroupDTO
;
import
com.gic.auth.dto.AuditedGroupUserRelDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.service.AuditedGroupUserRelService
;
import
com.gic.commons.util.GlobalInfo
;
...
...
@@ -60,8 +61,15 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
@Override
public
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
Integer
auditedGroupId
)
{
TabAuditedGroupUserRel
groupUserRel
=
new
TabAuditedGroupUserRel
();
AuditedGroupUserRelDTO
groupUserRel
=
new
AuditedGroupUserRelDTO
();
groupUserRel
.
setAuditedGroupId
(
auditedGroupId
);
return
this
.
tabAuditedGroupUserRelMapper
.
listAuditedGroup
(
groupUserRel
);
}
@Override
public
List
<
TabAuditedGroupUserRel
>
getUserIdListByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
)
{
AuditedGroupUserRelDTO
groupUserRel
=
new
AuditedGroupUserRelDTO
();
groupUserRel
.
setAuditedGroupIdList
(
auditedGroupIds
);
return
this
.
tabAuditedGroupUserRelMapper
.
listAuditedGroup
(
groupUserRel
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
View file @
15a39174
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper
;
import
com.gic.auth.dto.AuditorAuditedGroupRelDTO
;
import
com.gic.auth.entity.TabAuditedGroupUserRel
;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
com.gic.auth.service.AuditedGroupUserRelService
;
import
com.gic.auth.service.AuditorAuditedGroupRelService
;
import
com.gic.commons.util.GlobalInfo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
*
* @Description:
...
...
@@ -16,9 +25,82 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
@Autowired
private
TabAuditorAuditedGroupRelMapper
tabAuditorAuditedGroupRelMapper
;
@Autowired
private
AuditedGroupUserRelService
auditedGroupUserRelService
;
@Override
public
int
delRel
(
Integer
auditedGroupId
)
{
return
tabAuditorAuditedGroupRelMapper
.
delRel
(
auditedGroupId
);
}
@Override
public
void
addOrUpdateRel
(
Integer
enterpriseId
,
Integer
auditorId
,
List
<
Integer
>
auditedGroupIdList
)
{
// 把所有auditorId的关联status设置为0
tabAuditorAuditedGroupRelMapper
.
delByAuditorId
(
auditorId
);
// 插入不存在的关联
for
(
Integer
auditedGroupId
:
auditedGroupIdList
)
{
TabAuditorAuditedGroupRel
itemRel
=
new
TabAuditorAuditedGroupRel
();
itemRel
.
setEnterpriseId
(
enterpriseId
);
itemRel
.
setAuditorId
(
auditorId
);
itemRel
.
setAuditedGroupId
(
auditedGroupId
);
itemRel
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
itemRel
.
setCreateTime
(
new
Date
());
tabAuditorAuditedGroupRelMapper
.
insertSelectiveByNotExist
(
itemRel
);
}
// 把所有auditedGroup关联status都设置为1
tabAuditorAuditedGroupRelMapper
.
updateStatusByAuditedGroupIds
(
enterpriseId
,
auditorId
,
auditedGroupIdList
);
}
@Override
public
void
delRelByAuditorId
(
Integer
auditorId
)
{
tabAuditorAuditedGroupRelMapper
.
delByAuditorId
(
auditorId
);
}
@Override
public
List
<
TabAuditorAuditedGroupRel
>
listRelByAuditorId
(
Integer
auditorId
)
{
AuditorAuditedGroupRelDTO
auditorAuditedGroupRel
=
new
AuditorAuditedGroupRelDTO
();
auditorAuditedGroupRel
.
setAuditorId
(
auditorId
);
return
tabAuditorAuditedGroupRelMapper
.
listRel
(
auditorAuditedGroupRel
);
}
@Override
public
Map
<
Integer
,
Integer
>
getUserCountByAuditorIds
(
List
<
Integer
>
auditorIdList
)
{
// getAuditedGroupBelongAuditor
AuditorAuditedGroupRelDTO
auditorAuditedGroupRelDTO
=
new
AuditorAuditedGroupRelDTO
();
auditorAuditedGroupRelDTO
.
setAuditorIdList
(
auditorIdList
);
List
<
TabAuditorAuditedGroupRel
>
relList
=
tabAuditorAuditedGroupRelMapper
.
listRel
(
auditorAuditedGroupRelDTO
);
if
(
CollectionUtils
.
isEmpty
(
relList
))
{
return
Collections
.
emptyMap
();
}
// 根据受审组查询受审组对应的用户
List
<
Integer
>
auditedGroupIds
=
relList
.
stream
().
map
(
TabAuditorAuditedGroupRel:
:
getAuditedGroupId
).
collect
(
Collectors
.
toList
());
List
<
TabAuditedGroupUserRel
>
userList
=
auditedGroupUserRelService
.
getUserIdListByAuditedGroup
(
auditedGroupIds
);
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
return
Collections
.
emptyMap
();
}
// 获取 受审组 -> 审核员 的map
Map
<
Integer
,
Integer
>
groupAuditorMap
=
getAuditedGroupBelongAuditor
(
relList
);
Map
<
Integer
,
Set
<
Integer
>>
tmpMap
=
new
HashMap
<>();
for
(
TabAuditedGroupUserRel
userRel
:
userList
)
{
Integer
auditedGroupId
=
userRel
.
getAuditedGroupId
();
Integer
auditorId
=
groupAuditorMap
.
get
(
auditedGroupId
);
Set
<
Integer
>
set
=
tmpMap
.
computeIfAbsent
(
auditorId
,
k
->
new
HashSet
<>());
set
.
add
(
userRel
.
getUserId
());
}
Map
<
Integer
,
Integer
>
resultMap
=
new
HashMap
<>();
for
(
Map
.
Entry
<
Integer
,
Set
<
Integer
>>
entry
:
tmpMap
.
entrySet
())
{
Set
<
Integer
>
set
=
entry
.
getValue
();
resultMap
.
put
(
entry
.
getKey
(),
set
==
null
?
0
:
set
.
size
());
}
return
resultMap
;
}
private
Map
<
Integer
,
Integer
>
getAuditedGroupBelongAuditor
(
List
<
TabAuditorAuditedGroupRel
>
relList
)
{
Map
<
Integer
,
Integer
>
groupAuditorMap
=
new
HashMap
<>();
for
(
TabAuditorAuditedGroupRel
tabAuditorAuditedGroupRel
:
relList
)
{
groupAuditorMap
.
put
(
tabAuditorAuditedGroupRel
.
getAuditedGroupId
(),
tabAuditorAuditedGroupRel
.
getAuditorId
());
}
return
groupAuditorMap
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorProjectItemRelServiceImpl.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditorProjectItemRelMapper
;
import
com.gic.auth.entity.TabAuditorProjectItemRel
;
import
com.gic.auth.service.AuditorProjectItemRelService
;
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-19 16:56
*/
@Service
public
class
AuditorProjectItemRelServiceImpl
implements
AuditorProjectItemRelService
{
@Autowired
private
TabAuditorProjectItemRelMapper
tabAuditorProjectItemRelMapper
;
@Override
public
void
addOrUpdateRel
(
Integer
enterpriseId
,
Integer
auditorId
,
List
<
Integer
>
projectItemList
)
{
// 把所有auditorId的关联status设置为0
tabAuditorProjectItemRelMapper
.
delByAuditorId
(
auditorId
);
// 插入不存在的关联
for
(
Integer
projectItemId
:
projectItemList
)
{
TabAuditorProjectItemRel
itemRel
=
new
TabAuditorProjectItemRel
();
itemRel
.
setEnterpriseId
(
enterpriseId
);
itemRel
.
setAuditorId
(
auditorId
);
itemRel
.
setProjectItemId
(
projectItemId
);
itemRel
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
itemRel
.
setCreateTime
(
new
Date
());
tabAuditorProjectItemRelMapper
.
insertSelectiveByNotExist
(
itemRel
);
}
// 把所有projectItemId关联status都设置为1
tabAuditorProjectItemRelMapper
.
updateStatusByProjectItemIds
(
enterpriseId
,
auditorId
,
projectItemList
);
}
@Override
public
void
delRelByAuditorId
(
Integer
auditorId
)
{
tabAuditorProjectItemRelMapper
.
delByAuditorId
(
auditorId
);
}
@Override
public
List
<
TabAuditorProjectItemRel
>
listRelByAuditorId
(
Integer
auditorId
)
{
TabAuditorProjectItemRel
auditorProjectItemRel
=
new
TabAuditorProjectItemRel
();
auditorProjectItemRel
.
setAuditorId
(
auditorId
);
return
tabAuditorProjectItemRelMapper
.
listRelByAuditorId
(
auditorProjectItemRel
);
}
@Override
public
Map
<
Integer
,
Integer
>
getCountByAuditorIds
(
List
<
Integer
>
auditorIdList
)
{
List
<
Map
<
String
,
Object
>>
mapList
=
tabAuditorProjectItemRelMapper
.
getCountByAuditorIds
(
auditorIdList
);
HashMap
<
Integer
,
Integer
>
resultMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
map
:
mapList
)
{
resultMap
.
put
(
Integer
.
valueOf
(
map
.
get
(
"auditorId"
).
toString
()),
Integer
.
valueOf
(
map
.
get
(
"projectItemCount"
).
toString
()));
}
return
resultMap
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorServiceImpl.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabAuditorMapper
;
import
com.gic.auth.dto.AuditorDTO
;
import
com.gic.auth.entity.TabAuditor
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.gic.auth.service.AuditorService
;
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
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-19 16:40
*/
@Service
public
class
AuditorServiceImpl
implements
AuditorService
{
@Autowired
private
TabAuditorMapper
tabAuditorMapper
;
@Override
public
boolean
validAuditorNameIsRepeat
(
Integer
enterpriseId
,
String
auditorName
,
Integer
auditorId
)
{
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setEnterpriseId
(
enterpriseId
);
auditorDTO
.
setAuditorName
(
auditorName
);
TabAuditor
auditor
=
tabAuditorMapper
.
getFirstAuditor
(
auditorDTO
);
return
auditor
!=
null
;
}
@Override
public
boolean
validPhoneIsRepeat
(
Integer
enterpriseId
,
String
phone
,
Integer
auditorId
)
{
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setEnterpriseId
(
enterpriseId
);
auditorDTO
.
setPhone
(
phone
);
TabAuditor
auditor
=
tabAuditorMapper
.
getFirstAuditor
(
auditorDTO
);
return
auditor
!=
null
;
}
@Override
public
boolean
validOpenidIsRepeat
(
Integer
enterpriseId
,
String
openid
,
Integer
auditorId
)
{
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setEnterpriseId
(
enterpriseId
);
auditorDTO
.
setOpenid
(
openid
);
TabAuditor
auditor
=
tabAuditorMapper
.
getFirstAuditor
(
auditorDTO
);
return
auditor
!=
null
;
}
@Override
public
Integer
save
(
AuditorDTO
copy
)
{
TabAuditor
auditor
=
new
TabAuditor
();
auditor
.
setEnterpriseId
(
copy
.
getEnterpriseId
());
auditor
.
setAuditorName
(
copy
.
getAuditorName
());
auditor
.
setPhone
(
copy
.
getPhone
());
auditor
.
setUserId
(
copy
.
getUserId
());
auditor
.
setIsUse
(
copy
.
getIsUse
());
auditor
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
auditor
.
setCreateTime
(
new
Date
());
tabAuditorMapper
.
insertSelective
(
auditor
);
return
auditor
.
getAuditorId
();
}
@Override
public
Integer
update
(
AuditorDTO
copy
)
{
TabAuditor
auditor
=
new
TabAuditor
();
auditor
.
setAuditorId
(
copy
.
getAuditorId
());
auditor
.
setEnterpriseId
(
copy
.
getEnterpriseId
());
auditor
.
setAuditorName
(
copy
.
getAuditorName
());
auditor
.
setOpenid
(
copy
.
getOpenid
());
auditor
.
setPhone
(
copy
.
getPhone
());
auditor
.
setUserId
(
copy
.
getUserId
());
auditor
.
setIsUse
(
copy
.
getIsUse
());
return
tabAuditorMapper
.
updateByPrimaryKeySelective
(
auditor
);
}
@Override
public
TabAuditor
getAuditor
(
Integer
auditorId
)
{
TabAuditor
auditor
=
tabAuditorMapper
.
selectByPrimaryKey
(
auditorId
);
if
(
auditor
!=
null
&&
auditor
.
getStatus
()
==
GlobalInfo
.
DATA_STATUS_NORMAL
)
{
return
auditor
;
}
return
null
;
}
@Override
public
Integer
delAuditor
(
Integer
auditorId
)
{
return
tabAuditorMapper
.
delAuditor
(
auditorId
);
}
@Override
public
Page
<
TabAuditor
>
pageAuditor
(
AuditorListQO
auditorListQO
)
{
PageHelper
.
startPage
(
auditorListQO
.
getCurrentPage
(),
auditorListQO
.
getPageSize
());
return
tabAuditorMapper
.
listAuditor
(
auditorListQO
);
}
@Override
public
List
<
TabAuditor
>
listAuditor
(
AuditorListQO
auditorListQO
)
{
return
tabAuditorMapper
.
listAuditor
(
auditorListQO
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditedGroupApiServiceImpl.java
View file @
15a39174
...
...
@@ -17,7 +17,6 @@ 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
;
...
...
@@ -61,23 +60,17 @@ public class AuditedGroupApiServiceImpl implements AuditedGroupApiService {
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
);
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
0 → 100644
View file @
15a39174
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.AuditorDTO
;
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.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.commons.lang3.StringUtils
;
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
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-19 14:26
*/
@Service
(
"auditorApiService"
)
public
class
AuditorApiServiceImpl
implements
AuditorApiService
{
private
Logger
logger
=
LogManager
.
getLogger
(
AuditorApiServiceImpl
.
class
);
@Autowired
private
AuditorService
auditorService
;
@Autowired
private
AuditorProjectItemRelService
auditorProjectItemRelService
;
@Autowired
private
AuditorAuditedGroupRelService
auditorAuditedGroupRelService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
String
>
saveOrUpdateAuditor
(
AuditorDTO
auditorDTO
)
{
boolean
nameIsRepeat
=
auditorService
.
validAuditorNameIsRepeat
(
auditorDTO
.
getEnterpriseId
(),
auditorDTO
.
getAuditorName
(),
auditorDTO
.
getAuditorId
());
if
(
nameIsRepeat
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"审核员姓名重复"
);
}
boolean
phoneIsRepeat
=
auditorService
.
validPhoneIsRepeat
(
auditorDTO
.
getEnterpriseId
(),
auditorDTO
.
getPhone
(),
auditorDTO
.
getAuditorId
());
if
(
phoneIsRepeat
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"审核员手机号重复"
);
}
auditorDTO
.
setIsUse
(
auditorDTO
.
getUserId
()
==
null
?
0
:
1
);
// 这里进来的 不会去修改openid,所以把openid设为null
auditorDTO
.
setOpenid
(
null
);
// 保存审核员信息
if
(
auditorDTO
.
getAuditorId
()
==
null
)
{
// save
Integer
auditorId
=
auditorService
.
save
(
auditorDTO
);
auditorDTO
.
setAuditorId
(
auditorId
);
}
else
{
// update
Integer
line
=
auditorService
.
update
(
auditorDTO
);
if
(
line
==
0
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
}
// 受审项目
auditorProjectItemRelService
.
addOrUpdateRel
(
auditorDTO
.
getEnterpriseId
(),
auditorDTO
.
getAuditorId
(),
auditorDTO
.
getProjectItemList
());
// 受审组
auditorAuditedGroupRelService
.
addOrUpdateRel
(
auditorDTO
.
getEnterpriseId
(),
auditorDTO
.
getAuditorId
(),
auditorDTO
.
getAuditedGroupIdList
());
// 查询二维码
TabAuditor
auditor
=
auditorService
.
getAuditor
(
auditorDTO
.
getAuditorId
());
String
tempQrCodeUrl
=
null
;
if
(
StringUtils
.
isNotBlank
(
auditor
.
getOpenid
()))
{
tempQrCodeUrl
=
this
.
getTempQrCodeUrl
(
auditorDTO
.
getAuditorId
());
}
return
ServiceResponse
.
success
(
tempQrCodeUrl
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
Void
>
delAuditor
(
Integer
auditorId
)
{
// 删除审核员
Integer
line
=
auditorService
.
delAuditor
(
auditorId
);
if
(
line
==
0
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
// 删除受审项目关联
auditorProjectItemRelService
.
delRelByAuditorId
(
auditorId
);
// 删除受审组关联
auditorAuditedGroupRelService
.
delRelByAuditorId
(
auditorId
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
AuditorDTO
>
getAuditor
(
Integer
auditorId
)
{
TabAuditor
auditor
=
this
.
auditorService
.
getAuditor
(
auditorId
);
if
(
auditor
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
AuditorDTO
auditorDTO
=
EntityUtil
.
changeEntityByJSON
(
AuditorDTO
.
class
,
auditor
);
List
<
TabAuditorProjectItemRel
>
projectList
=
auditorProjectItemRelService
.
listRelByAuditorId
(
auditorId
);
if
(
CollectionUtils
.
isNotEmpty
(
projectList
))
{
List
<
Integer
>
projectIds
=
projectList
.
stream
().
map
(
TabAuditorProjectItemRel:
:
getProjectItemId
).
collect
(
Collectors
.
toList
());
auditorDTO
.
setProjectItemList
(
projectIds
);
}
List
<
TabAuditorAuditedGroupRel
>
groupList
=
auditorAuditedGroupRelService
.
listRelByAuditorId
(
auditorId
);
if
(
CollectionUtils
.
isNotEmpty
(
groupList
))
{
List
<
Integer
>
groupIds
=
groupList
.
stream
().
map
(
TabAuditorAuditedGroupRel:
:
getAuditedGroupId
).
collect
(
Collectors
.
toList
());
auditorDTO
.
setAuditedGroupIdList
(
groupIds
);
}
return
ServiceResponse
.
success
(
auditorDTO
);
}
@Override
public
ServiceResponse
<
Page
<
AuditorDTO
>>
pageAuditor
(
AuditorListQO
auditorListQO
)
{
com
.
github
.
pagehelper
.
Page
<
TabAuditor
>
page
=
this
.
auditorService
.
pageAuditor
(
auditorListQO
);
Page
<
AuditorDTO
>
resultPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
,
AuditorDTO
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
resultPage
.
getResult
()))
{
List
<
Integer
>
auditorIdList
=
resultPage
.
getResult
().
stream
().
map
(
AuditorDTO:
:
getAuditorId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
Integer
>
projectItemMap
=
auditorProjectItemRelService
.
getCountByAuditorIds
(
auditorIdList
);
Map
<
Integer
,
Integer
>
userCountMap
=
auditorAuditedGroupRelService
.
getUserCountByAuditorIds
(
auditorIdList
);
for
(
AuditorDTO
auditorDTO:
resultPage
.
getResult
())
{
auditorDTO
.
setProjectItemCount
(
projectItemMap
.
get
(
auditorDTO
.
getAuditorId
()));
auditorDTO
.
setAuditedGroupCount
(
userCountMap
.
get
(
auditorDTO
.
getAuditorId
()));
}
}
return
ServiceResponse
.
success
(
resultPage
);
}
@Override
public
ServiceResponse
<
Void
>
receiveOpenid
(
String
qrCodeParam
,
String
openid
)
{
logger
.
info
(
"二维码参数:{},openid:{}"
,
qrCodeParam
,
openid
);
if
(
StringUtils
.
isNotBlank
(
qrCodeParam
)
&&
StringUtils
.
isNotBlank
(
openid
)){
if
(
qrCodeParam
.
startsWith
(
"auditor_"
)){
String
auditorIdStr
=
qrCodeParam
.
substring
(
qrCodeParam
.
indexOf
(
"auditor_"
)
+
8
);
Integer
auditorId
=
Integer
.
valueOf
(
auditorIdStr
);
TabAuditor
auditor
=
this
.
auditorService
.
getAuditor
(
auditorId
);
if
(
auditor
!=
null
)
{
boolean
repeat
=
this
.
auditorService
.
validOpenidIsRepeat
(
auditor
.
getEnterpriseId
(),
openid
,
null
);
if
(
repeat
)
{
logger
.
info
(
"receiveOpenid失败,商户:{}下,存在重复的openid:{}"
,
auditor
.
getEnterpriseId
(),
openid
);
}
else
{
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setOpenid
(
openid
);
this
.
auditorService
.
update
(
auditorDTO
);
}
}
}
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
List
<
AuditorDTO
>>
listAuditor
(
AuditorListQO
auditorListQO
)
{
List
<
TabAuditor
>
list
=
this
.
auditorService
.
listAuditor
(
auditorListQO
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
AuditorDTO
.
class
,
list
));
}
private
String
getTempQrCodeUrl
(
Integer
auditorId
){
// String enterpriseId = GlobalVar.ctxPropertiesMap.get("data_security_enterpriseId");
// EnterpriseDTO enterpriseDTO = this.enterpriseService.getEnterpriseById(enterpriseId);
// String qrCodeUrl = this.weixinBaseFunService.getTemporaryQRcodeURL(enterpriseDTO.getAppkey(), "auditor_"+auditorId, 300);
// return qrCodeUrl;
return
"qrCodeUrl"
;
}
}
gic-platform-auth-service/src/main/resources/dubbo-gic-platform-auth-service.xml
View file @
15a39174
...
...
@@ -29,4 +29,6 @@
<!--应用市场应用列表-->
<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"
/>
</beans>
gic-platform-auth-service/src/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
View file @
15a39174
...
...
@@ -174,6 +174,15 @@
<include
refid=
"Base_Column_List"
/>
from tab_audited_group_user_rel
where status = 1
and audited_group_id = #{auditedGroupId}
<if
test=
"auditedGroupId != null "
>
and audited_group_id = #{auditedGroupId}
</if>
<if
test=
"null != auditedGroupIdList"
>
and audited_group_id in
<foreach
collection=
"auditedGroupIdList"
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/TabAuditorAuditedGroupRelMapper.xml
View file @
15a39174
...
...
@@ -121,4 +121,78 @@
where audited_group_id = #{auditedGroupId}
and status = 1
</update>
<update
id=
"delByAuditorId"
>
update tab_auditor_audited_group_rel
set status = 0
where auditor_id = #{auditorId}
and status = 1
</update>
<insert
id=
"insertSelectiveByNotExist"
>
INSERT INTO tab_auditor_audited_group_rel (
enterprise_id,
auditor_id,
audited_group_id,
status,
create_time
) SELECT
#{enterpriseId},
#{auditorId},
#{auditedGroupId},
#{status},
#{createTime}
FROM
DUAL
WHERE
NOT EXISTS (
SELECT
1
FROM
tab_auditor_audited_group_rel tb
WHERE
tb.enterprise_id = #{enterpriseId}
AND tb.auditor_id = #{auditorId}
AND tb.audited_group_id = #{auditedGroupId}
)
</insert>
<update
id=
"updateStatusByAuditedGroupIds"
>
update tab_auditor_audited_group_rel
set status = 1
where auditor_id = #{auditorId}
and enterprise_id = #{enterpriseId}
<if
test=
"null != ids"
>
and audited_group_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</update>
<select
id=
"listRel"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_auditor_audited_group_rel
where status = 1
<if
test=
"auditorId != null "
>
and auditor_id = #{auditorId}
</if>
<if
test=
"null != auditorIdList"
>
and auditor_id in
<foreach
collection=
"auditorIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"getCountByAuditorIds"
resultType=
"java.util.HashMap"
>
select
auditor_id auditorId, count(1) auditedGroupCount
from
tab_auditor_audited_group_rel
where status = 1
<if
test=
"null != ids"
>
and auditor_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
group by auditor_id
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditorMapper.xml
View file @
15a39174
...
...
@@ -6,6 +6,7 @@
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"auditor_name"
jdbcType=
"VARCHAR"
property=
"auditorName"
/>
<result
column=
"phone"
jdbcType=
"VARCHAR"
property=
"phone"
/>
<result
column=
"user_id"
jdbcType=
"INTEGER"
property=
"userId"
/>
<result
column=
"openid"
jdbcType=
"VARCHAR"
property=
"openid"
/>
<result
column=
"is_use"
jdbcType=
"INTEGER"
property=
"isUse"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
...
...
@@ -13,8 +14,8 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
auditor_id, enterprise_id, auditor_name, phone,
openid, is_use, status, create_time
,
update_time
auditor_id, enterprise_id, auditor_name, phone,
user_id, openid, is_use, status
,
create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -28,15 +29,18 @@
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditor"
>
insert into tab_auditor (auditor_id, enterprise_id, auditor_name,
phone,
openid, is_use
,
status, create_time, update_time
)
phone,
user_id, openid
,
is_use, status, create_time,
update_time
)
values (#{auditorId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{auditorName,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{
openid,jdbcType=VARCHAR}, #{isUse,jdbcType=INTEGE
R},
#{
status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
#{phone,jdbcType=VARCHAR}, #{
userId,jdbcType=INTEGER}, #{openid,jdbcType=VARCHA
R},
#{
isUse,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditor"
>
<selectKey
keyProperty=
"auditorId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_auditor
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditorId != null"
>
...
...
@@ -51,6 +55,9 @@
<if
test=
"phone != null"
>
phone,
</if>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"openid != null"
>
openid,
</if>
...
...
@@ -80,6 +87,9 @@
<if
test=
"phone != null"
>
#{phone,jdbcType=VARCHAR},
</if>
<if
test=
"userId != null"
>
#{userId,jdbcType=INTEGER},
</if>
<if
test=
"openid != null"
>
#{openid,jdbcType=VARCHAR},
</if>
...
...
@@ -109,6 +119,9 @@
<if
test=
"phone != null"
>
phone = #{phone,jdbcType=VARCHAR},
</if>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=INTEGER},
</if>
<if
test=
"openid != null"
>
openid = #{openid,jdbcType=VARCHAR},
</if>
...
...
@@ -132,6 +145,7 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_name = #{auditorName,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=INTEGER},
openid = #{openid,jdbcType=VARCHAR},
is_use = #{isUse,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
...
...
@@ -139,4 +153,47 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_id = #{auditorId,jdbcType=INTEGER}
</update>
<select
id=
"getFirstAuditor"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_auditor
where status = 1
<if
test=
"phone != null and phone != '' "
>
and phone = #{phone}
</if>
<if
test=
"auditorId != null "
>
and auditor_id
<>
#{auditorId}
</if>
<if
test=
"auditorName != null and auditorName != '' "
>
and auditor_name = #{auditorName}
</if>
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"openid != null and openid != '' "
>
and openid = #{openid}
</if>
limit 1
</select>
<update
id=
"delAuditor"
>
update tab_auditor set status = 0 where status = 1 and auditor_id = #{auditorId}
</update>
<select
id=
"listAuditor"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_auditor
where status = 1
<if
test=
"auditorName != null and auditorName != '' "
>
and auditor_name like concat('%', #{auditorName}, '%')
</if>
<if
test=
"auditedGroupId != null "
>
and audited_group_id = #{auditedGroupId}
</if>
<if
test=
"isUse != null "
>
and is_use = #{isUse}
</if>
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditorProjectRelMapper.xml
→
gic-platform-auth-service/src/main/resources/mapper/TabAuditorProject
Item
RelMapper.xml
View file @
15a39174
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<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=
"auditorProject
RelId"
/>
<mapper
namespace=
"com.gic.auth.dao.mapper.TabAuditorProject
Item
RelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabAuditorProject
Item
Rel"
>
<id
column=
"auditor_project_
item_rel_id"
jdbcType=
"INTEGER"
property=
"auditorProjectItem
RelId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"auditor_id"
jdbcType=
"INTEGER"
property=
"auditorId"
/>
<result
column=
"project_i
d"
jdbcType=
"INTEGER"
property=
"project
Id"
/>
<result
column=
"project_i
tem_id"
jdbcType=
"INTEGER"
property=
"projectItem
Id"
/>
<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"
>
auditor_project_
rel_id, enterprise_id, auditor_id, project_id, status, create_time
,
update_time
auditor_project_
item_rel_id, enterprise_id, auditor_id, project_item_id, status
,
create_time,
update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_auditor_project_rel
where auditor_project_
rel_id = #{auditorProject
RelId,jdbcType=INTEGER}
from tab_auditor_project_
item_
rel
where auditor_project_
item_rel_id = #{auditorProjectItem
RelId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tab_auditor_project_rel
where auditor_project_
rel_id = #{auditorProject
RelId,jdbcType=INTEGER}
delete from tab_auditor_project_
item_
rel
where auditor_project_
item_rel_id = #{auditorProjectItem
RelId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
insert into tab_auditor_project_
rel (auditor_project
_rel_id, enterprise_id,
auditor_id, project_id, status,
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabAuditorProject
Item
Rel"
>
insert into tab_auditor_project_
item_rel (auditor_project_item
_rel_id, enterprise_id,
auditor_id, project_i
tem_i
d, status,
create_time, update_time)
values (#{auditorProjectRelId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
values (#{auditorProject
Item
RelId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{projectI
temI
d,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
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabAuditorProject
Item
Rel"
>
insert into tab_auditor_project_
item_
rel
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditorProjectRelId != null"
>
auditor_project_rel_id,
<if
test=
"auditorProject
Item
RelId != null"
>
auditor_project_
item_
rel_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
...
...
@@ -44,8 +44,8 @@
<if
test=
"auditorId != null"
>
auditor_id,
</if>
<if
test=
"projectId != null"
>
project_id,
<if
test=
"projectI
temI
d != null"
>
project_i
tem_i
d,
</if>
<if
test=
"status != null"
>
status,
...
...
@@ -58,8 +58,8 @@
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"auditorProjectRelId != null"
>
#{auditorProjectRelId,jdbcType=INTEGER},
<if
test=
"auditorProject
Item
RelId != null"
>
#{auditorProject
Item
RelId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
...
...
@@ -67,8 +67,8 @@
<if
test=
"auditorId != null"
>
#{auditorId,jdbcType=INTEGER},
</if>
<if
test=
"projectId != null"
>
#{projectId,jdbcType=INTEGER},
<if
test=
"projectI
temI
d != null"
>
#{projectI
temI
d,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
...
...
@@ -81,8 +81,8 @@
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
update tab_auditor_project_rel
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabAuditorProject
Item
Rel"
>
update tab_auditor_project_
item_
rel
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
...
...
@@ -90,8 +90,8 @@
<if
test=
"auditorId != null"
>
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if
test=
"projectId != null"
>
project_i
d = #{project
Id,jdbcType=INTEGER},
<if
test=
"projectI
temI
d != null"
>
project_i
tem_id = #{projectItem
Id,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
...
...
@@ -103,16 +103,84 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where auditor_project_
rel_id = #{auditorProject
RelId,jdbcType=INTEGER}
where auditor_project_
item_rel_id = #{auditorProjectItem
RelId,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditorProjectRel"
>
update tab_auditor_project_rel
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabAuditorProject
Item
Rel"
>
update tab_auditor_project_
item_
rel
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER},
project_i
d = #{project
Id,jdbcType=INTEGER},
project_i
tem_id = #{projectItem
Id,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_project_
rel_id = #{auditorProject
RelId,jdbcType=INTEGER}
where auditor_project_
item_rel_id = #{auditorProjectItem
RelId,jdbcType=INTEGER}
</update>
<update
id=
"delByAuditorId"
>
update tab_auditor_project_item_rel
set status = 0
where status = 1
and auditor_id = #{auditorId}
</update>
<insert
id=
"insertSelectiveByNotExist"
>
INSERT INTO tab_auditor_project_item_rel (
enterprise_id,
auditor_id,
project_item_id,
status,
create_time
) SELECT
#{enterpriseId},
#{auditorId},
#{projectItemId},
#{status},
#{createTime}
FROM
DUAL
WHERE
NOT EXISTS (
SELECT
1
FROM
tab_auditor_project_item_rel tb
WHERE
tb.enterprise_id = #{enterpriseId}
AND tb.auditor_id = #{auditorId}
AND tb.project_item_id = #{projectItemId}
)
</insert>
<update
id=
"updateStatusByProjectItemIds"
>
update tab_auditor_project_item_rel
set status = 1
where auditor_id = #{auditorId}
and enterprise_id = #{enterpriseId}
<if
test=
"null != ids"
>
and project_item_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</update>
<select
id=
"listRelByAuditorId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_auditor_project_item_rel
where status = 1
<if
test=
"auditorId != null "
>
and auditor_id = #{auditorId}
</if>
order by create_time desc
</select>
<select
id=
"getCountByAuditorIds"
resultType=
"java.util.HashMap"
>
select
auditor_id auditorId, count(1) projectItemCount
from tab_auditor_project_item_rel
where status = 1
<if
test=
"null != ids"
>
and auditor_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
group by auditor_id
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/AuditorController.java
0 → 100644
View file @
15a39174
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.AuditorDTO
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.gic.auth.service.AuditorApiService
;
import
com.gic.auth.web.qo.AuditorQO
;
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.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-20 10:31
*/
@RestController
public
class
AuditorController
{
private
Logger
logger
=
LogManager
.
getLogger
(
AuditorController
.
class
);
@Autowired
private
AuditorApiService
auditorApiService
;
@RequestMapping
(
"/save-auditor"
)
public
RestResponse
saveAuditor
(
AuditorQO
auditorQO
)
{
AuditorDTO
auditorDTO
=
EntityUtil
.
changeEntityByJSON
(
AuditorDTO
.
class
,
auditorQO
);
auditorDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
List
<
Integer
>
projectItemList
=
Stream
.
of
(
auditorQO
.
getProjectItems
().
split
(
GlobalInfo
.
FLAG_COMMA
)).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
());
auditorDTO
.
setProjectItemList
(
projectItemList
);
List
<
Integer
>
auditedGroupIdList
=
Stream
.
of
(
auditorQO
.
getAuditedGroupIds
().
split
(
GlobalInfo
.
FLAG_COMMA
)).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
());
auditorDTO
.
setAuditedGroupIdList
(
auditedGroupIdList
);
ServiceResponse
<
String
>
response
=
auditorApiService
.
saveOrUpdateAuditor
(
auditorDTO
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/del-auditor"
)
public
RestResponse
delAuditor
(
Integer
auditorId
)
{
ServiceResponse
<
Void
>
response
=
auditorApiService
.
delAuditor
(
auditorId
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/get-auditor"
)
public
RestResponse
getAuditor
(
Integer
auditorId
)
{
ServiceResponse
<
AuditorDTO
>
response
=
auditorApiService
.
getAuditor
(
auditorId
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/list-auditor"
)
public
RestResponse
pageAuditor
(
AuditorListQO
auditorListQO
)
{
auditorListQO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
ServiceResponse
<
Page
<
AuditorDTO
>>
response
=
auditorApiService
.
pageAuditor
(
auditorListQO
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
@RequestMapping
(
"/list-auditor-nopage"
)
public
RestResponse
listAuditor
(
AuditorListQO
auditorListQO
)
{
auditorListQO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
ServiceResponse
<
List
<
AuditorDTO
>>
response
=
auditorApiService
.
listAuditor
(
auditorListQO
);
return
ResultControllerUtils
.
commonResult
(
response
);
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/qo/AuditorQO.java
0 → 100644
View file @
15a39174
package
com
.
gic
.
auth
.
web
.
qo
;
import
javax.validation.constraints.NotBlank
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-20 13:43
*/
public
class
AuditorQO
{
public
interface
SaveValid
{}
/**
*
*/
private
Integer
auditorId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 审核员姓名
*/
@NotBlank
(
message
=
"审核员姓名不能为空"
,
groups
=
SaveValid
.
class
)
private
String
auditorName
;
/**
* 手机号
*/
@NotBlank
(
message
=
"手机号不能为空"
,
groups
=
SaveValid
.
class
)
private
String
phone
;
/**
* 关联管理员id
*/
private
Integer
userId
;
/**
* 受审项目审批项id
*/
@NotBlank
(
message
=
"受审项目不能为空"
,
groups
=
SaveValid
.
class
)
private
String
projectItems
;
/**
* 受审组id
*/
@NotBlank
(
message
=
"受审组不能为空"
,
groups
=
SaveValid
.
class
)
private
String
auditedGroupIds
;
public
Integer
getAuditorId
()
{
return
auditorId
;
}
public
void
setAuditorId
(
Integer
auditorId
)
{
this
.
auditorId
=
auditorId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getAuditorName
()
{
return
auditorName
;
}
public
void
setAuditorName
(
String
auditorName
)
{
this
.
auditorName
=
auditorName
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
String
getProjectItems
()
{
return
projectItems
;
}
public
void
setProjectItems
(
String
projectItems
)
{
this
.
projectItems
=
projectItems
;
}
public
String
getAuditedGroupIds
()
{
return
auditedGroupIds
;
}
public
void
setAuditedGroupIds
(
String
auditedGroupIds
)
{
this
.
auditedGroupIds
=
auditedGroupIds
;
}
}
gic-platform-auth-web/src/main/resources/dubbo-gic-platform-auth-web.xml
View file @
15a39174
...
...
@@ -48,5 +48,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"
/>
<!--审核员-->
<dubbo:reference
interface=
"com.gic.auth.service.AuditorApiService"
id=
"auditorApiService"
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