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
596aa78c
Commit
596aa78c
authored
Nov 11, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过电话号码查询商户
parent
48926546
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
20 deletions
+95
-20
UnionEnterpriseApiService.java
.../java/com/gic/auth/service/UnionEnterpriseApiService.java
+5
-1
TabSysUnionEnterpriseResourceMapper.java
.../auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
+7
-1
UnionEnterpriseResourceService.java
.../com/gic/auth/service/UnionEnterpriseResourceService.java
+6
-1
UnionEnterrpiseResourceServiceImpl.java
...auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
+18
-2
UnionEnterpriseApiServiceImpl.java
...uth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
+23
-6
TabSysUnionEnterpriseResourceMapper.xml
.../resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
+14
-1
UnionEnterpriseController.java
...om/gic/auth/web/controller/UnionEnterpriseController.java
+22
-8
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/UnionEnterpriseApiService.java
View file @
596aa78c
...
...
@@ -14,14 +14,18 @@ public interface UnionEnterpriseApiService {
ServiceResponse
<
Integer
>
delUnionEnterprise
(
Integer
unionId
,
Integer
enterpriseId
);
ServiceResponse
<
Integer
>
delUnionEnterpriseSource
(
Long
resourceId
);
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseById
(
Integer
unionId
);
ServiceResponse
<
Page
<
UnionEnterpriseDTO
>>
pageUnionEnterprise
(
String
search
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
,
Integer
authorizationStatus
);
ServiceResponse
<
Void
>
updateStoreAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
String
...
message
);
ServiceResponse
<
Void
>
updateStoreAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
String
message
,
String
key
);
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
listStoreResourceByEnterpriseId
(
Integer
enterpriseId
);
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
listResourceByUnionId
(
Integer
unionId
);
ServiceResponse
<
Void
>
reAuthorizationResource
(
Long
resourceId
,
Integer
resourceType
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
View file @
596aa78c
...
...
@@ -63,10 +63,15 @@ public interface TabSysUnionEnterpriseResourceMapper {
int
updateAuthorizationStatus
(
@Param
(
"authOrizationStatus"
)
int
authOrizationStatus
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"resourceType"
)
Integer
resourceType
,
@Param
(
"authOrizationMessage"
)
String
authOrizationMessage
);
@Param
(
"authOrizationMessage"
)
String
authOrizationMessage
,
@Param
(
"key"
)
String
key
);
List
<
UnionEnterpriseResourceDTO
>
listResourceByEnterpriseIdAndType
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"type"
)
int
type
);
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
@Param
(
"unionId"
)
Integer
unionId
);
int
delResourceByResourceId
(
Long
resourceId
);
List
<
String
>
getKeyByResourceId
(
@Param
(
"resourceId"
)
Long
resourceId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/UnionEnterpriseResourceService.java
View file @
596aa78c
...
...
@@ -13,9 +13,14 @@ public interface UnionEnterpriseResourceService {
int
delResource
(
Integer
unionId
,
Integer
enterpriseId
);
void
updateAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
Integer
resourceType
,
String
authOrizationMessage
);
int
delResource
(
Long
resouceId
);
void
updateAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
Integer
resourceType
,
String
authOrizationMessage
,
String
key
);
List
<
UnionEnterpriseResourceDTO
>
listResourceByEnterpriseIdAndType
(
Integer
enterpriseId
,
int
type
);
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
Integer
unionId
);
String
getKeyByResourceId
(
Long
resourceId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
View file @
596aa78c
...
...
@@ -54,8 +54,15 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
}
@Override
public
void
updateAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
Integer
resourceType
,
String
authOrizationMessage
)
{
this
.
tabSysUnionEnterpriseResourceMapper
.
updateAuthorizationStatus
(
authOrizationStatus
,
enterpriseId
,
resourceType
,
authOrizationMessage
);
public
int
delResource
(
Long
resouceId
)
{
return
this
.
tabSysUnionEnterpriseResourceMapper
.
delResourceByResourceId
(
resouceId
);
}
@Override
public
void
updateAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
Integer
resourceType
,
String
authOrizationMessage
,
String
key
)
{
this
.
tabSysUnionEnterpriseResourceMapper
.
updateAuthorizationStatus
(
authOrizationStatus
,
enterpriseId
,
resourceType
,
authOrizationMessage
,
key
);
}
@Override
...
...
@@ -67,4 +74,13 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
public
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
Integer
unionId
)
{
return
this
.
tabSysUnionEnterpriseResourceMapper
.
listResourceByUnionId
(
unionId
);
}
@Override
public
String
getKeyByResourceId
(
Long
resourceId
)
{
List
<
String
>
list
=
this
.
tabSysUnionEnterpriseResourceMapper
.
getKeyByResourceId
(
resourceId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
return
list
.
get
(
0
);
}
return
null
;
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
View file @
596aa78c
...
...
@@ -74,6 +74,12 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
}
@Override
public
ServiceResponse
<
Integer
>
delUnionEnterpriseSource
(
Long
resourceId
)
{
int
i
=
this
.
unionEnterpriseResourceService
.
delResource
(
resourceId
);
return
ServiceResponse
.
success
(
i
);
}
@Override
public
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseById
(
Integer
unionId
)
{
TabSysUnionEnterprise
enterprise
=
this
.
unionEnterpriseService
.
getUnionEnterpriseById
(
unionId
);
UnionEnterpriseDTO
enterpriseDTO
=
EntityUtil
.
changeEntityByJSON
(
UnionEnterpriseDTO
.
class
,
enterprise
);
...
...
@@ -89,12 +95,9 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
}
@Override
public
ServiceResponse
<
Void
>
updateStoreAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
String
...
message
)
{
String
authOrizationMessage
=
null
;
if
(
message
!=
null
&&
message
.
length
!=
0
){
authOrizationMessage
=
message
[
0
];
}
this
.
unionEnterpriseResourceService
.
updateAuthorizationStatus
(
authOrizationStatus
,
enterpriseId
,
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
(),
authOrizationMessage
);
public
ServiceResponse
<
Void
>
updateStoreAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
String
message
,
String
key
)
{
this
.
unionEnterpriseResourceService
.
updateAuthorizationStatus
(
authOrizationStatus
,
enterpriseId
,
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
(),
message
,
key
);
return
ServiceResponse
.
success
();
}
...
...
@@ -110,6 +113,20 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
UnionEnterpriseResourceDTO
.
class
,
list
));
}
@Override
public
ServiceResponse
<
Void
>
reAuthorizationResource
(
Long
resourceId
,
Integer
resourceType
)
{
if
(
resourceType
==
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
()){
}
else
if
(
resourceType
==
ResourceTypeEnum
.
GOODS_RESOURCE
.
getCode
()){
}
else
if
(
resourceType
==
ResourceTypeEnum
.
MEMBER_RESOURCE
.
getCode
()){
}
else
if
(
resourceType
==
ResourceTypeEnum
.
ORDER_RESOURCE
.
getCode
()){
}
return
ServiceResponse
.
success
();
}
private
int
saveResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
int
i
=
0
;
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getMemberResourceId
(),
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
View file @
596aa78c
...
...
@@ -179,7 +179,7 @@
</update>
<update
id=
"updateAuthorizationStatus"
>
update tab_sys_union_enterprise_resource
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}
, key=#{key}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
</update>
<select
id=
"listResourceByEnterpriseIdAndType"
resultType=
"com.gic.auth.dto.UnionEnterpriseResourceDTO"
>
...
...
@@ -198,4 +198,16 @@
where union_id=#{unionId}
and status = 1
</select>
<update
id=
"delResourceByResourceId"
>
update tab_sys_union_enterprise_resource
set status=0
where resource = #{resourceId}
</update>
<select
id=
"getKeyByResourceId"
resultMap=
"BaseResultMap"
>
select
key
from tab_sys_union_enterprise_resource
where resource=#{resourceId}
and status = 1
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UnionEnterpriseController.java
View file @
596aa78c
...
...
@@ -2,6 +2,7 @@ package com.gic.auth.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.ResourceTypeEnum
;
import
com.gic.auth.dto.AuthCodeDTO
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
import
com.gic.auth.dto.UnionEnterpriseResourceDTO
;
...
...
@@ -17,6 +18,7 @@ import com.gic.auth.web.vo.StoreResouceVO;
import
com.gic.auth.web.vo.UnionEnterpriseVO
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
...
...
@@ -67,6 +69,7 @@ public class UnionEnterpriseController {
}
ServiceResponse
<
Integer
>
response
=
this
.
unionEnterpriseApiService
.
saveUnionEnterprise
(
enterpriseDTO
);
if
(
response
.
isSuccess
()){
LogUtils
.
createLog
(
"联合商户创建"
,
unionEnterpriseQO
.
getUnionEnterpriseName
());
return
RestResponse
.
success
(
response
.
getResult
());
}
return
EnterpriseRestResponse
.
failure
(
response
);
...
...
@@ -112,17 +115,28 @@ public class UnionEnterpriseController {
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"del-union-enterprise"
)
public
RestResponse
delUnionEnterprise
(
Integer
unionId
){
if
(
union
Id
==
null
){
@RequestMapping
(
"del-union-enterprise
-resource
"
)
public
RestResponse
delUnionEnterprise
(
Long
resourceId
,
Integer
resourceType
){
if
(
resource
Id
==
null
){
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
MISS_PARAMETER
);
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
Integer
>
response
=
this
.
unionEnterpriseApiService
.
delUnionEnterprise
(
unionId
,
enterpriseId
);
if
(
response
.
isSuccess
()){
return
RestResponse
.
success
(
response
.
getResult
());
ServiceResponse
<
Integer
>
response
=
this
.
unionEnterpriseApiService
.
delUnionEnterpriseSource
(
resourceId
);
if
(
response
.
getResult
()>
0
){
ResourceTypeEnum
[]
values
=
ResourceTypeEnum
.
values
();
for
(
ResourceTypeEnum
typeEnum
:
values
){
if
(
resourceType
==
typeEnum
.
getCode
()){
LogUtils
.
createLog
(
typeEnum
.
getMessage
(),
"资源id:"
+
resourceId
);
}
}
return
RestResponse
.
success
();
}
return
EnterpriseRestResponse
.
failure
(
response
);
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"资源不存在"
);
}
@RequestMapping
(
"re-authorization-resource"
)
public
RestResponse
reAuthorizationResouce
(
Long
resourceId
,
int
resourceType
){
this
.
unionEnterpriseApiService
.
reAuthorizationResource
(
resourceId
,
resourceType
);
return
RestResponse
.
success
();
}
@RequestMapping
(
"page-union-enterprise"
)
...
...
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