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
f307c1f6
Commit
f307c1f6
authored
Sep 26, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加审批接口 查询审核项对应的所有审核员
parent
38795ead
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
743 additions
and
9 deletions
+743
-9
OrderAppResourceDTO.java
...i/src/main/java/com/gic/auth/dto/OrderAppResourceDTO.java
+104
-0
AuditorListQO.java
...auth-api/src/main/java/com/gic/auth/qo/AuditorListQO.java
+11
-0
AuditorApiService.java
...src/main/java/com/gic/auth/service/AuditorApiService.java
+25
-0
OrderAppResourceApiService.java
...java/com/gic/auth/service/OrderAppResourceApiService.java
+35
-0
TabAuditedGroupUserRelMapper.java
...com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
+3
-0
TabAuditorAuditedGroupRelMapper.java
.../gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
+5
-0
TabAuditorProjectItemRelMapper.java
...m/gic/auth/dao/mapper/TabAuditorProjectItemRelMapper.java
+3
-0
TabSysOrderAppResourceMapper.java
...com/gic/auth/dao/mapper/TabSysOrderAppResourceMapper.java
+54
-0
TabSysOrderAppResource.java
...main/java/com/gic/auth/entity/TabSysOrderAppResource.java
+100
-0
AuditedGroupUserRelService.java
...java/com/gic/auth/service/AuditedGroupUserRelService.java
+2
-0
AuditorAuditedGroupRelService.java
...a/com/gic/auth/service/AuditorAuditedGroupRelService.java
+2
-0
AuditorProjectItemRelService.java
...va/com/gic/auth/service/AuditorProjectItemRelService.java
+2
-0
AuditorService.java
...ce/src/main/java/com/gic/auth/service/AuditorService.java
+2
-0
OrderAppResourceService.java
...in/java/com/gic/auth/service/OrderAppResourceService.java
+21
-0
AuditedGroupUserRelServiceImpl.java
...gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
+5
-0
AuditorAuditedGroupRelServiceImpl.java
.../auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
+5
-0
AuditorProjectItemRelServiceImpl.java
...c/auth/service/impl/AuditorProjectItemRelServiceImpl.java
+6
-1
AuditorServiceImpl.java
...in/java/com/gic/auth/service/impl/AuditorServiceImpl.java
+8
-0
OrderAppResourceServiceImpl.java
...om/gic/auth/service/impl/OrderAppResourceServiceImpl.java
+55
-0
AuditorApiServiceImpl.java
...om/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
+69
-7
OrderAppResourceApiServiceImpl.java
...th/service/outer/impl/OrderAppResourceApiServiceImpl.java
+47
-0
TabAuditedGroupUserRelMapper.xml
...rc/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
+13
-1
TabAuditorAuditedGroupRelMapper.xml
...main/resources/mapper/TabAuditorAuditedGroupRelMapper.xml
+22
-0
TabAuditorMapper.xml
...th-service/src/main/resources/mapper/TabAuditorMapper.xml
+10
-0
TabAuditorProjectItemRelMapper.xml
.../main/resources/mapper/TabAuditorProjectItemRelMapper.xml
+13
-0
TabSysOrderAppResourceMapper.xml
...rc/main/resources/mapper/TabSysOrderAppResourceMapper.xml
+121
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/OrderAppResourceDTO.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:42
*/
public
class
OrderAppResourceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7478354440089304864L
;
/**
*
*/
private
Integer
orderAppResourceId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 类型 1:订单 2:应用
*/
private
Integer
type
;
/**
* json内容
*/
private
String
content
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
*
*/
private
Integer
status
;
public
Integer
getOrderAppResourceId
()
{
return
orderAppResourceId
;
}
public
void
setOrderAppResourceId
(
Integer
orderAppResourceId
)
{
this
.
orderAppResourceId
=
orderAppResourceId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
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
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/AuditorListQO.java
View file @
f307c1f6
...
...
@@ -2,6 +2,8 @@ package com.gic.auth.qo;
import
com.gic.enterprise.qo.PageQO
;
import
java.util.List
;
/**
*
* @Description:
...
...
@@ -14,6 +16,7 @@ public class AuditorListQO extends PageQO {
private
String
auditorName
;
private
Integer
auditedGroupId
;
private
Integer
isUse
;
private
List
<
Integer
>
auditorIdList
;
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
...
...
@@ -46,4 +49,12 @@ public class AuditorListQO extends PageQO {
public
void
setIsUse
(
Integer
isUse
)
{
this
.
isUse
=
isUse
;
}
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/service/AuditorApiService.java
View file @
f307c1f6
...
...
@@ -82,4 +82,29 @@ public interface AuditorApiService {
* @throws
*/
ServiceResponse
<
List
<
AuditorDTO
>>
listAuditor
(
AuditorListQO
auditorListQO
);
/**
* 查所有的审核员
* @Title: listAuditorByProject
* @Description:
* @author zhiwj
* @param projectItemId 审批项id
* @param userId 管理员id
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.AuditorDTO>>
* @throws
*/
ServiceResponse
<
List
<
AuditorDTO
>>
listAuditorByProject
(
Integer
projectItemId
,
Integer
userId
,
Integer
enterpriseId
);
/**
* 审核员审核受审项目审批项
* @Title: genAuditProject
* @Description:
* @author zhiwj
* @param projectItemId 审批项id
* @param userId 管理员id
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Void
>
genAuditProject
(
Integer
projectItemId
,
Integer
userId
,
Integer
enterpriseId
);
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/OrderAppResourceApiService.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:52
*/
public
interface
OrderAppResourceApiService
{
/**
*
* @Title: saveOrUpdate
* @Description:
* @author zhiwj
* @param orderAppResourceDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
Integer
>
saveOrUpdate
(
OrderAppResourceDTO
orderAppResourceDTO
);
/**
*
* @Title: getById
* @Description:
* @author zhiwj
* @param orderAppResourceId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.OrderAppResourceDTO>
* @throws
*/
ServiceResponse
<
OrderAppResourceDTO
>
getById
(
Integer
orderAppResourceId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditedGroupUserRelMapper.java
View file @
f307c1f6
...
...
@@ -65,4 +65,6 @@ public interface TabAuditedGroupUserRelMapper {
List
<
Map
<
Integer
,
Object
>>
getUserCountByAuditedGroup
(
@Param
(
"ids"
)
List
<
Integer
>
auditedGroupIds
);
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
AuditedGroupUserRelDTO
groupUserRel
);
List
<
Integer
>
listAuditedGroupByUserId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"userId"
)
Integer
userId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorAuditedGroupRelMapper.java
View file @
f307c1f6
...
...
@@ -67,4 +67,8 @@ public interface TabAuditorAuditedGroupRelMapper {
List
<
TabAuditorAuditedGroupRel
>
listRel
(
AuditorAuditedGroupRelDTO
auditorAuditedGroupRel
);
List
<
Map
<
String
,
Object
>>
getCountByAuditorIds
(
@Param
(
"ids"
)
List
<
Integer
>
auditorIdList
);
List
<
Integer
>
listRelByAuditedGroupIdAndAuditId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"auditedGroupIds"
)
List
<
Integer
>
auditedGroupIds
,
@Param
(
"projectAuditorIds"
)
List
<
Integer
>
projectAuditorIds
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabAuditorProjectItemRelMapper.java
View file @
f307c1f6
...
...
@@ -64,4 +64,6 @@ public interface TabAuditorProjectItemRelMapper {
List
<
TabAuditorProjectItemRel
>
listRelByAuditorId
(
TabAuditorProjectItemRel
auditorProjectItemRel
);
List
<
Map
<
String
,
Object
>>
getCountByAuditorIds
(
@Param
(
"ids"
)
List
<
Integer
>
auditorIdList
);
List
<
Integer
>
listAuditorIdByProjectId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"projectId"
)
Integer
projectId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysOrderAppResourceMapper.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
public
interface
TabSysOrderAppResourceMapper
{
/**
* 根据主键删除
*
* @param orderAppResourceId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
Integer
orderAppResourceId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabSysOrderAppResource
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabSysOrderAppResource
record
);
/**
* 根据主键查询
*
* @param orderAppResourceId 主键
* @return 实体对象
*/
TabSysOrderAppResource
selectByPrimaryKey
(
Integer
orderAppResourceId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabSysOrderAppResource
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabSysOrderAppResource
record
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabSysOrderAppResource.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
entity
;
import
java.util.Date
;
/**
* tab_sys_order_app_resource
*/
public
class
TabSysOrderAppResource
{
/**
*
*/
private
Integer
orderAppResourceId
;
/**
*
*/
private
Integer
enterpriseId
;
/**
* 类型 1:订单 2:应用
*/
private
Integer
type
;
/**
* json内容
*/
private
String
content
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
*
*/
private
Integer
status
;
public
Integer
getOrderAppResourceId
()
{
return
orderAppResourceId
;
}
public
void
setOrderAppResourceId
(
Integer
orderAppResourceId
)
{
this
.
orderAppResourceId
=
orderAppResourceId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
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
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditedGroupUserRelService.java
View file @
f307c1f6
...
...
@@ -22,4 +22,6 @@ public interface AuditedGroupUserRelService {
List
<
TabAuditedGroupUserRel
>
listAuditedGroup
(
Integer
auditedGroupId
);
List
<
TabAuditedGroupUserRel
>
getUserIdListByAuditedGroup
(
List
<
Integer
>
auditedGroupIds
);
List
<
Integer
>
listAuditedGroupByUserId
(
Integer
enterpriseId
,
Integer
userId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorAuditedGroupRelService.java
View file @
f307c1f6
...
...
@@ -22,4 +22,6 @@ public interface AuditorAuditedGroupRelService {
List
<
TabAuditorAuditedGroupRel
>
listRelByAuditorId
(
Integer
auditorId
);
Map
<
Integer
,
Integer
>
getUserCountByAuditorIds
(
List
<
Integer
>
auditorIdList
);
List
<
Integer
>
listRelByAuditedGroupIdAndAuditId
(
Integer
enterpriseId
,
List
<
Integer
>
auditedGroupIds
,
List
<
Integer
>
projectAuditorIds
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorProjectItemRelService.java
View file @
f307c1f6
...
...
@@ -19,4 +19,6 @@ public interface AuditorProjectItemRelService {
List
<
TabAuditorProjectItemRel
>
listRelByAuditorId
(
Integer
auditorId
);
Map
<
Integer
,
Integer
>
getCountByAuditorIds
(
List
<
Integer
>
auditorIdList
);
List
<
Integer
>
listAuditorIdByProjectId
(
Integer
enterpriseId
,
Integer
projectId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AuditorService.java
View file @
f307c1f6
...
...
@@ -31,4 +31,6 @@ public interface AuditorService {
Page
<
TabAuditor
>
pageAuditor
(
AuditorListQO
auditorListQO
);
List
<
TabAuditor
>
listAuditor
(
AuditorListQO
auditorListQO
);
TabAuditor
getAuditorByUserId
(
Integer
enterpriseId
,
Integer
userId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/OrderAppResourceService.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:53
*/
public
interface
OrderAppResourceService
{
Integer
save
(
OrderAppResourceDTO
orderAppResourceDTO
);
Integer
update
(
OrderAppResourceDTO
orderAppResourceDTO
);
Integer
del
(
Integer
orderAppResourceId
);
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditedGroupUserRelServiceImpl.java
View file @
f307c1f6
...
...
@@ -72,4 +72,9 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
groupUserRel
.
setAuditedGroupIdList
(
auditedGroupIds
);
return
this
.
tabAuditedGroupUserRelMapper
.
listAuditedGroup
(
groupUserRel
);
}
@Override
public
List
<
Integer
>
listAuditedGroupByUserId
(
Integer
enterpriseId
,
Integer
userId
)
{
return
tabAuditedGroupUserRelMapper
.
listAuditedGroupByUserId
(
enterpriseId
,
userId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorAuditedGroupRelServiceImpl.java
View file @
f307c1f6
...
...
@@ -95,6 +95,11 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
return
resultMap
;
}
@Override
public
List
<
Integer
>
listRelByAuditedGroupIdAndAuditId
(
Integer
enterpriseId
,
List
<
Integer
>
auditedGroupIds
,
List
<
Integer
>
projectAuditorIds
)
{
return
tabAuditorAuditedGroupRelMapper
.
listRelByAuditedGroupIdAndAuditId
(
enterpriseId
,
auditedGroupIds
,
projectAuditorIds
);
}
private
Map
<
Integer
,
Integer
>
getAuditedGroupBelongAuditor
(
List
<
TabAuditorAuditedGroupRel
>
relList
)
{
Map
<
Integer
,
Integer
>
groupAuditorMap
=
new
HashMap
<>();
for
(
TabAuditorAuditedGroupRel
tabAuditorAuditedGroupRel
:
relList
)
{
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorProjectItemRelServiceImpl.java
View file @
f307c1f6
...
...
@@ -57,10 +57,15 @@ public class AuditorProjectItemRelServiceImpl implements AuditorProjectItemRelSe
@Override
public
Map
<
Integer
,
Integer
>
getCountByAuditorIds
(
List
<
Integer
>
auditorIdList
)
{
List
<
Map
<
String
,
Object
>>
mapList
=
tabAuditorProjectItemRelMapper
.
getCountByAuditorIds
(
auditorIdList
);
HashMap
<
Integer
,
Integer
>
resultMap
=
new
HashMap
<>();
HashMap
<
Integer
,
Integer
>
resultMap
=
new
HashMap
<>(
mapList
.
size
()
);
for
(
Map
<
String
,
Object
>
map
:
mapList
)
{
resultMap
.
put
(
Integer
.
valueOf
(
map
.
get
(
"auditorId"
).
toString
()),
Integer
.
valueOf
(
map
.
get
(
"projectItemCount"
).
toString
()));
}
return
resultMap
;
}
@Override
public
List
<
Integer
>
listAuditorIdByProjectId
(
Integer
enterpriseId
,
Integer
projectId
)
{
return
tabAuditorProjectItemRelMapper
.
listAuditorIdByProjectId
(
enterpriseId
,
projectId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AuditorServiceImpl.java
View file @
f307c1f6
...
...
@@ -107,4 +107,12 @@ public class AuditorServiceImpl implements AuditorService {
public
List
<
TabAuditor
>
listAuditor
(
AuditorListQO
auditorListQO
)
{
return
tabAuditorMapper
.
listAuditor
(
auditorListQO
);
}
@Override
public
TabAuditor
getAuditorByUserId
(
Integer
enterpriseId
,
Integer
userId
)
{
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setEnterpriseId
(
enterpriseId
);
auditorDTO
.
setUserId
(
userId
);
return
tabAuditorMapper
.
getFirstAuditor
(
auditorDTO
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/OrderAppResourceServiceImpl.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
service
.
impl
;
import
com.gic.auth.dao.mapper.TabSysOrderAppResourceMapper
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.service.OrderAppResourceService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:53
*/
@Service
public
class
OrderAppResourceServiceImpl
implements
OrderAppResourceService
{
@Autowired
private
TabSysOrderAppResourceMapper
tabSysOrderAppResourceMapper
;
@Override
public
Integer
save
(
OrderAppResourceDTO
orderAppResourceDTO
)
{
TabSysOrderAppResource
resource
=
EntityUtil
.
changeEntityByJSON
(
TabSysOrderAppResource
.
class
,
orderAppResourceDTO
);
resource
.
setCreateTime
(
new
Date
());
resource
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
tabSysOrderAppResourceMapper
.
insertSelective
(
resource
);
return
resource
.
getOrderAppResourceId
();
}
@Override
public
Integer
update
(
OrderAppResourceDTO
orderAppResourceDTO
)
{
TabSysOrderAppResource
orderAppResource
=
new
TabSysOrderAppResource
();
orderAppResource
.
setOrderAppResourceId
(
orderAppResourceDTO
.
getOrderAppResourceId
());
orderAppResource
.
setContent
(
orderAppResourceDTO
.
getContent
());
return
tabSysOrderAppResourceMapper
.
updateByPrimaryKeySelective
(
orderAppResource
);
}
@Override
public
Integer
del
(
Integer
orderAppResourceId
)
{
TabSysOrderAppResource
orderAppResource
=
new
TabSysOrderAppResource
();
orderAppResource
.
setOrderAppResourceId
(
orderAppResourceId
);
orderAppResource
.
setStatus
(
GlobalInfo
.
DATA_STATUS_DELETE
);
return
tabSysOrderAppResourceMapper
.
updateByPrimaryKeySelective
(
orderAppResource
);
}
@Override
public
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
)
{
return
tabSysOrderAppResourceMapper
.
selectByPrimaryKey
(
orderAppResourceId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
View file @
f307c1f6
...
...
@@ -3,12 +3,11 @@ 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.entity.*
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.gic.auth.service.*
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.dto.ProjectItemDTO
;
import
com.gic.enterprise.error.ErrorCode
;
...
...
@@ -26,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -48,6 +48,8 @@ public class AuditorApiServiceImpl implements AuditorApiService {
@Autowired
private
AuditorAuditedGroupRelService
auditorAuditedGroupRelService
;
@Autowired
private
AuditedGroupUserRelService
auditedGroupUserRelService
;
@Autowired
private
ProjectItemApiService
projectItemApiService
;
@Autowired
private
AuditedGroupService
auditedGroupService
;
...
...
@@ -55,6 +57,8 @@ public class AuditorApiServiceImpl implements AuditorApiService {
private
WeixinBaseFunService
weixinBaseFunService
;
@Autowired
private
ServiceUserApiService
serviceUserApiService
;
@Autowired
private
UserService
userService
;
public
static
final
String
APPKEY
=
"wxc6fd9beaf9a9dbe9"
;
...
...
@@ -211,11 +215,52 @@ public class AuditorApiServiceImpl implements AuditorApiService {
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
AuditorDTO
.
class
,
list
));
}
@Override
public
ServiceResponse
<
List
<
AuditorDTO
>>
listAuditorByProject
(
Integer
projectItemId
,
Integer
userId
,
Integer
enterpriseId
)
{
ServiceResponse
<
ProjectItemDTO
>
projectItemResponse
=
projectItemApiService
.
getById
(
projectItemId
);
if
(
projectItemResponse
.
isSuccess
())
{
ProjectItemDTO
projectItemDTO
=
projectItemResponse
.
getResult
();
Integer
projectId
=
projectItemDTO
.
getProjectId
();
// 找到审批项对应的审核员
List
<
Integer
>
projectAuditorIds
=
auditorProjectItemRelService
.
listAuditorIdByProjectId
(
enterpriseId
,
projectId
);
if
(
CollectionUtils
.
isNotEmpty
(
projectAuditorIds
))
{
// 找到管理员所在的受审组
List
<
Integer
>
auditedGroupIds
=
auditedGroupUserRelService
.
listAuditedGroupByUserId
(
enterpriseId
,
userId
);
if
(
CollectionUtils
.
isNotEmpty
(
auditedGroupIds
))
{
List
<
Integer
>
auditorIds
=
auditorAuditedGroupRelService
.
listRelByAuditedGroupIdAndAuditId
(
enterpriseId
,
auditedGroupIds
,
projectAuditorIds
);
if
(
CollectionUtils
.
isNotEmpty
(
auditorIds
))
{
AuditorListQO
listQO
=
new
AuditorListQO
();
listQO
.
setEnterpriseId
(
enterpriseId
);
listQO
.
setIsUse
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
listQO
.
setAuditorIdList
(
auditorIds
);
List
<
TabAuditor
>
auditorList
=
this
.
auditorService
.
listAuditor
(
listQO
);
if
(
CollectionUtils
.
isNotEmpty
(
auditorList
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
AuditorDTO
.
class
,
auditorList
));
}
}
}
}
AuditorDTO
adminAuditor
=
this
.
getAdminAuditor
(
enterpriseId
);
return
ServiceResponse
.
success
(
Collections
.
singletonList
(
adminAuditor
));
}
else
{
return
ServiceResponse
.
failure
(
projectItemResponse
.
getCode
(),
projectItemResponse
.
getMessage
());
}
}
@Override
public
ServiceResponse
<
Void
>
genAuditProject
(
Integer
projectItemId
,
Integer
userId
,
Integer
enterpriseId
)
{
ServiceResponse
<
List
<
AuditorDTO
>>
serviceResponse
=
this
.
listAuditorByProject
(
projectItemId
,
userId
,
enterpriseId
);
if
(
serviceResponse
.
isSuccess
())
{
List
<
AuditorDTO
>
auditorList
=
serviceResponse
.
getResult
();
// todo 发送微信模板消息
// todo 如果审核员是管理员 插入后台待办事项
return
ServiceResponse
.
success
();
}
else
{
return
EnterpriseServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
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;
logger
.
info
(
"生成临时带参二维码 auditorId:{}"
,
auditorId
);
ServiceResponse
<
String
>
serviceResponse
=
weixinBaseFunService
.
getTemporaryQRcodeURL
(
APPKEY
,
"auditor_"
+
auditorId
,
300
);
if
(
serviceResponse
.
isSuccess
())
{
...
...
@@ -227,4 +272,21 @@ public class AuditorApiServiceImpl implements AuditorApiService {
}
// return "qrCodeUrl";
}
private
AuditorDTO
getAdminAuditor
(
Integer
enterpriseId
)
{
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
enterpriseId
);
TabAuditor
auditor
=
auditorService
.
getAuditorByUserId
(
enterpriseId
,
adminUser
.
getUserId
());
if
(
auditor
==
null
)
{
// 如果超级管理员不是审核员, 就封装一个
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setEnterpriseId
(
adminUser
.
getEnterpriseId
());
auditorDTO
.
setAuditorName
(
adminUser
.
getUserName
());
auditorDTO
.
setPhone
(
adminUser
.
getPhoneNumber
());
auditorDTO
.
setUserId
(
adminUser
.
getUserId
());
return
auditorDTO
;
}
else
{
return
EntityUtil
.
changeEntityByJSON
(
AuditorDTO
.
class
,
auditor
);
}
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/OrderAppResourceApiServiceImpl.java
0 → 100644
View file @
f307c1f6
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.service.OrderAppResourceApiService
;
import
com.gic.auth.service.OrderAppResourceService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:52
*/
@Service
(
"orderAppResourceApiService"
)
public
class
OrderAppResourceApiServiceImpl
implements
OrderAppResourceApiService
{
@Autowired
private
OrderAppResourceService
orderAppResourceService
;
@Override
public
ServiceResponse
<
Integer
>
saveOrUpdate
(
OrderAppResourceDTO
orderAppResourceDTO
)
{
if
(
orderAppResourceDTO
.
getOrderAppResourceId
()
==
null
)
{
orderAppResourceService
.
save
(
orderAppResourceDTO
);
}
else
{
orderAppResourceService
.
update
(
orderAppResourceDTO
);
}
return
ServiceResponse
.
success
(
orderAppResourceDTO
.
getOrderAppResourceId
());
}
@Override
public
ServiceResponse
<
OrderAppResourceDTO
>
getById
(
Integer
orderAppResourceId
)
{
TabSysOrderAppResource
orderAppResource
=
orderAppResourceService
.
getById
(
orderAppResourceId
);
if
(
orderAppResource
!=
null
)
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
OrderAppResourceDTO
.
class
,
orderAppResource
));
}
else
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
}
}
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditedGroupUserRelMapper.xml
View file @
f307c1f6
...
...
@@ -183,6 +183,17 @@
#{item}
</foreach>
</if>
</select>
<select
id=
"listAuditedGroupByUserId"
resultType=
"java.lang.Integer"
>
select
audited_group_id
from tab_audited_group_user_rel
where status = 1
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"userId != null "
>
and user_id = #{userId}
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabAuditorAuditedGroupRelMapper.xml
View file @
f307c1f6
...
...
@@ -195,4 +195,25 @@
</if>
group by auditor_id
</select>
<select
id=
"listRelByAuditedGroupIdAndAuditId"
resultType=
"java.lang.Integer"
>
select
auditor_id
from tab_auditor_audited_group_rel
where status = 1
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"null != auditedGroupIds"
>
and audited_group_id in
<foreach
collection=
"auditedGroupIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"null != projectAuditorIds"
>
and auditor_id in
<foreach
collection=
"projectAuditorIds"
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/TabAuditorMapper.xml
View file @
f307c1f6
...
...
@@ -173,6 +173,9 @@
<if
test=
"openid != null and openid != '' "
>
and openid = #{openid}
</if>
<if
test=
"userId != null "
>
and user_id = #{userId}
</if>
limit 1
</select>
<update
id=
"delAuditor"
>
...
...
@@ -195,5 +198,11 @@
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"null != auditorIdList"
>
and auditor_id in
<foreach
collection=
"auditorIdList"
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/TabAuditorProjectItemRelMapper.xml
View file @
f307c1f6
...
...
@@ -183,4 +183,16 @@
</if>
group by auditor_id
</select>
<select
id=
"listAuditorIdByProjectId"
resultType=
"java.lang.Integer"
>
select
auditor_id
from tab_auditor_project_item_rel
where status = 1
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"projectId != null "
>
and project_id = #{projectId}
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabSysOrderAppResourceMapper.xml
0 → 100644
View file @
f307c1f6
<?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.TabSysOrderAppResourceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.auth.entity.TabSysOrderAppResource"
>
<id
column=
"order_app_resource_id"
jdbcType=
"INTEGER"
property=
"orderAppResourceId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"content"
jdbcType=
"VARCHAR"
property=
"content"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
order_app_resource_id, enterprise_id, type, content, create_time, update_time, status
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.auth.entity.TabSysOrderAppResource"
>
insert into tab_sys_order_app_resource (order_app_resource_id, enterprise_id,
type, content, create_time,
update_time, status)
values (#{orderAppResourceId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabSysOrderAppResource"
>
<selectKey
keyProperty=
"orderAppResourceId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_sys_order_app_resource
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderAppResourceId != null"
>
order_app_resource_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"type != null"
>
type,
</if>
<if
test=
"content != null"
>
content,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"status != null"
>
status,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"orderAppResourceId != null"
>
#{orderAppResourceId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"content != null"
>
#{content,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabSysOrderAppResource"
>
update tab_sys_order_app_resource
<set>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
</set>
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.auth.entity.TabSysOrderAppResource"
>
update tab_sys_order_app_resource
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
</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