Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-enterprise
Commits
47a8db29
Commit
47a8db29
authored
Feb 24, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源组编辑,如果已经授权给联合商户,则需要验证码
parent
9ae5fad9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
4 deletions
+61
-4
UnionEnterpriseAuthApiService.java
...gic/enterprise/service/UnionEnterpriseAuthApiService.java
+7
-0
TabSysUnionEnterpriseAuthMapper.java
...nterprise/dao/mapper/TabSysUnionEnterpriseAuthMapper.java
+8
-0
UnionEnterpriseAuthService.java
...om/gic/enterprise/service/UnionEnterpriseAuthService.java
+7
-0
UnionEnterpriseAuthServiceImpl.java
...terprise/service/impl/UnionEnterpriseAuthServiceImpl.java
+5
-0
UnionEnterpriseAuthApiServiceImpl.java
...e/outer/impl/union/UnionEnterpriseAuthApiServiceImpl.java
+23
-3
TabSysUnionEnterpriseAuthMapper.xml
...main/resources/mapper/TabSysUnionEnterpriseAuthMapper.xml
+10
-0
UnionEnterpriseAuthController.java
...e/web/controller/union/UnionEnterpriseAuthController.java
+1
-1
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/UnionEnterpriseAuthApiService.java
View file @
47a8db29
...
...
@@ -75,6 +75,13 @@ public interface UnionEnterpriseAuthApiService {
*/
ServiceResponse
<
List
<
UnionEnterpriseAuthDTO
>>
listUnionEnterpriseAuth
(
@NotNull
Integer
ownEnterpriseId
);
/**
* 产销联合商户数据
* @param resourceGroupId
* @return
*/
ServiceResponse
<
UnionEnterpriseAuthDTO
>
getUnionEnterpriseAuthByResourceGroupId
(
@NotNull
Integer
resourceGroupId
);
/**************应用策略************************/
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabSysUnionEnterpriseAuthMapper.java
View file @
47a8db29
...
...
@@ -107,4 +107,11 @@ public interface TabSysUnionEnterpriseAuthMapper {
* @return
*/
int
countUnionEnterpriseAuth
(
@Param
(
"resourceGroupId"
)
Integer
resourceGroupId
);
/**
* 资源组授权给的商户
* @param resourceGroupId
* @return
*/
List
<
TabSysUnionEnterpriseAuth
>
listUnionEnterpriseAuthByResourceGroupId
(
@Param
(
"resourceGroupId"
)
Integer
resourceGroupId
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/UnionEnterpriseAuthService.java
View file @
47a8db29
...
...
@@ -76,4 +76,11 @@ public interface UnionEnterpriseAuthService {
* @return
*/
Boolean
hasUnionEnterpriseAuth
(
Integer
resourceGroupId
);
/**
* 资源组授权商户
* @param resourceGroupId
* @return
*/
List
<
TabSysUnionEnterpriseAuth
>
listUnionEnterpriseAuthByResourceGroupId
(
Integer
resourceGroupId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/UnionEnterpriseAuthServiceImpl.java
View file @
47a8db29
...
...
@@ -81,4 +81,9 @@ public class UnionEnterpriseAuthServiceImpl implements UnionEnterpriseAuthServic
return
false
;
}
@Override
public
List
<
TabSysUnionEnterpriseAuth
>
listUnionEnterpriseAuthByResourceGroupId
(
Integer
resourceGroupId
)
{
return
tabSysUnionEnterpriseAuthMapper
.
listUnionEnterpriseAuthByResourceGroupId
(
resourceGroupId
);
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/union/UnionEnterpriseAuthApiServiceImpl.java
View file @
47a8db29
...
...
@@ -83,8 +83,20 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
Void
>
authResource
(
@Validated
UnionEnterpriseAuthResDTO
dto
)
{
TabSysUnionEnterpriseAuth
old
=
checkExistUnionEnterprise
(
dto
.
getOwnEnterpriseId
(),
dto
.
getUnionEnterpriseId
());
//授权数据
UnionEnterpriseAuthDTO
data
=
EntityUtil
.
changeEntityNew
(
UnionEnterpriseAuthDTO
.
class
,
dto
);
data
.
setUnionEnterpriseAuthId
(
old
.
getUnionEnterpriseAuthId
());
//同一个资源组只能授权给一个商户
List
<
TabSysUnionEnterpriseAuth
>
listByResourceGroup
=
unionEnterpriseAuthService
.
listUnionEnterpriseAuthByResourceGroupId
(
dto
.
getResourceGroupId
());
if
(
CollectionUtils
.
isNotEmpty
(
listByResourceGroup
))
{
if
(
listByResourceGroup
.
stream
().
filter
(
e
->
!
e
.
getUnionEnterpriseAuthId
().
equals
(
old
.
getUnionEnterpriseAuthId
())).
count
()
>
0
)
{
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"资源组不能授权给不同商户"
);
}
}
//是否是编辑。编辑和新增授权同步资源处理不同
boolean
isEdit
=
old
.
getResourceGroupId
()
!=
null
;
boolean
isEdit
=
!
dto
.
getResourceGroupId
().
equals
(
old
.
getResourceGroupId
())
;
//todo starrynight 通知业务方,同步数据
Integer
resourceGroupId
=
dto
.
getResourceGroupId
();
ServiceResponse
<
ResourceGroupDTO
>
resourceResponse
=
resourceGroupApiService
.
getResourceGroup
(
resourceGroupId
);
...
...
@@ -105,8 +117,7 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
storeAuthorizationApiService
.
authStore
(
resourceGroupDTO
.
getStoreResource
().
intValue
(),
dto
.
getUnionEnterpriseId
(),
dto
.
getOwnEnterpriseId
());
}
UnionEnterpriseAuthDTO
data
=
EntityUtil
.
changeEntityNew
(
UnionEnterpriseAuthDTO
.
class
,
dto
);
data
.
setUnionEnterpriseAuthId
(
old
.
getUnionEnterpriseAuthId
());
unionEnterpriseAuthService
.
update
(
data
);
//初始化未授权资源数据
...
...
@@ -241,6 +252,15 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
}
@Override
public
ServiceResponse
<
UnionEnterpriseAuthDTO
>
getUnionEnterpriseAuthByResourceGroupId
(
@NotNull
Integer
resourceGroupId
)
{
List
<
TabSysUnionEnterpriseAuth
>
listByResourceGroup
=
unionEnterpriseAuthService
.
listUnionEnterpriseAuthByResourceGroupId
(
resourceGroupId
);
if
(
CollectionUtils
.
isNotEmpty
(
listByResourceGroup
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
UnionEnterpriseAuthDTO
.
class
,
listByResourceGroup
.
get
(
0
)));
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
Void
>
saveOrUpdateUnionEnterpriseAuthApp
(
@Valid
UnionEnterpriseAuthAppDTO
dto
)
{
Integer
unionEnterpriseAuthAppId
=
dto
.
getUnionEnterpriseAuthAppId
();
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabSysUnionEnterpriseAuthMapper.xml
View file @
47a8db29
...
...
@@ -326,4 +326,13 @@
and status_flag != 3
and resource_group_id = #{resourceGroupId}
</select>
<select
id=
"listUnionEnterpriseAuthByResourceGroupId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
></include>
from tab_sys_union_enterprise_auth
where delete_flag = 0
and status_flag != 3
and resource_group_id = #{resourceGroupId}
</select>
</mapper>
\ No newline at end of file
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/union/UnionEnterpriseAuthController.java
View file @
47a8db29
...
...
@@ -119,7 +119,7 @@ public class UnionEnterpriseAuthController {
//生成6位数字验证码
String
authCode
=
CreateRandomUtils
.
generateNumberStr
(
6
);
authCodeDTO
.
setAuthCode
(
authCode
);
authCodeDTO
.
setExpirationTime
(
AuthCodeExpireTimeUtils
.
setAuthCodeExpireTime
(
1
));
authCodeDTO
.
setExpirationTime
(
AuthCodeExpireTimeUtils
.
setAuthCodeExpireTime
(
2
));
ServiceResponse
<
Integer
>
result
=
authCodeApiService
.
saveAuth
(
authCodeDTO
);
if
(
result
.
isSuccess
())
{
Integer
authCodeId
=
result
.
getResult
();
...
...
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