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
85ed977c
Commit
85ed977c
authored
Nov 07, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过电话号码查询商户
parent
98919f79
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
84 deletions
+79
-84
ResourceTypeEnum.java
...src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
+4
-6
UnionEnterpriseDTO.java
...pi/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
+20
-27
UnionEnterpriseApiService.java
.../java/com/gic/auth/service/UnionEnterpriseApiService.java
+2
-0
TabSysUnionEnterpriseResourceMapper.java
.../auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
+3
-0
UnionEnterpriseResourceService.java
.../com/gic/auth/service/UnionEnterpriseResourceService.java
+2
-0
UnionEnterrpiseResourceServiceImpl.java
...auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
+5
-0
UnionEnterpriseApiServiceImpl.java
...uth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
+11
-23
TabSysUnionEnterpriseResourceMapper.xml
.../resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
+8
-0
UnionEnterpriseController.java
...om/gic/auth/web/controller/UnionEnterpriseController.java
+15
-1
UnionEnterpriseQO.java
.../src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
+9
-27
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
View file @
85ed977c
package
com
.
gic
.
auth
.
constant
;
public
enum
ResourceTypeEnum
{
MEMBER_CARD_RESOURCE
(
1
,
"会员卡资源"
),
FWH_RESOURCE
(
2
,
"服务号资源"
),
APPLET_RESOURCE
(
3
,
"小程序资源"
),
STORE_RESOURCE
(
4
,
"门店资源"
),
GOODS_RESOURCE
(
5
,
"商品资源"
),
ORDER_RESOURCE
(
6
,
"订单资源"
);
MEMBER_RESOURCE
(
1
,
"用户资源"
),
STORE_RESOURCE
(
2
,
"门店资源"
),
GOODS_RESOURCE
(
3
,
"商品资源"
),
ORDER_RESOURCE
(
4
,
"订单资源"
);
private
Integer
code
;
private
String
message
;
...
...
gic-platform-auth-api/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
View file @
85ed977c
...
...
@@ -2,6 +2,7 @@ package com.gic.auth.dto;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* tab_sys_union_enterprise
...
...
@@ -39,12 +40,11 @@ public class UnionEnterpriseDTO implements Serializable {
private
Integer
enterpriseId
;
private
Long
memberCardResourceId
;
private
Long
fwhResourceId
;
private
Long
appletResourceId
;
private
Long
memberResourceId
;
private
Long
storeResourceId
;
private
Long
goodsResourceId
;
private
Long
orderResourceId
;
private
List
<
UnionEnterpriseResourceDTO
>
resourceList
;
public
Integer
getUnionId
()
{
return
unionId
;
...
...
@@ -102,30 +102,6 @@ public class UnionEnterpriseDTO implements Serializable {
this
.
enterpriseId
=
enterpriseId
;
}
public
Long
getMemberCardResourceId
()
{
return
memberCardResourceId
;
}
public
void
setMemberCardResourceId
(
Long
memberCardResourceId
)
{
this
.
memberCardResourceId
=
memberCardResourceId
;
}
public
Long
getFwhResourceId
()
{
return
fwhResourceId
;
}
public
void
setFwhResourceId
(
Long
fwhResourceId
)
{
this
.
fwhResourceId
=
fwhResourceId
;
}
public
Long
getAppletResourceId
()
{
return
appletResourceId
;
}
public
void
setAppletResourceId
(
Long
appletResourceId
)
{
this
.
appletResourceId
=
appletResourceId
;
}
public
Long
getStoreResourceId
()
{
return
storeResourceId
;
}
...
...
@@ -149,4 +125,20 @@ public class UnionEnterpriseDTO implements Serializable {
public
void
setOrderResourceId
(
Long
orderResourceId
)
{
this
.
orderResourceId
=
orderResourceId
;
}
public
Long
getMemberResourceId
()
{
return
memberResourceId
;
}
public
void
setMemberResourceId
(
Long
memberResourceId
)
{
this
.
memberResourceId
=
memberResourceId
;
}
public
List
<
UnionEnterpriseResourceDTO
>
getResourceList
()
{
return
resourceList
;
}
public
void
setResourceList
(
List
<
UnionEnterpriseResourceDTO
>
resourceList
)
{
this
.
resourceList
=
resourceList
;
}
}
\ No newline at end of file
gic-platform-auth-api/src/main/java/com/gic/auth/service/UnionEnterpriseApiService.java
View file @
85ed977c
...
...
@@ -22,4 +22,6 @@ public interface UnionEnterpriseApiService {
ServiceResponse
<
Void
>
updateStoreAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
String
...
message
);
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
listStoreResourceByEnterpriseId
(
Integer
enterpriseId
);
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
listResourceByUnionId
(
Integer
unionId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUnionEnterpriseResourceMapper.java
View file @
85ed977c
...
...
@@ -67,4 +67,6 @@ public interface TabSysUnionEnterpriseResourceMapper {
List
<
UnionEnterpriseResourceDTO
>
listResourceByEnterpriseIdAndType
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"type"
)
int
type
);
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
@Param
(
"unionId"
)
Integer
unionId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/UnionEnterpriseResourceService.java
View file @
85ed977c
...
...
@@ -16,4 +16,6 @@ public interface UnionEnterpriseResourceService {
void
updateAuthorizationStatus
(
int
authOrizationStatus
,
Integer
enterpriseId
,
Integer
resourceType
,
String
authOrizationMessage
);
List
<
UnionEnterpriseResourceDTO
>
listResourceByEnterpriseIdAndType
(
Integer
enterpriseId
,
int
type
);
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
Integer
unionId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UnionEnterrpiseResourceServiceImpl.java
View file @
85ed977c
...
...
@@ -62,4 +62,9 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
public
List
<
UnionEnterpriseResourceDTO
>
listResourceByEnterpriseIdAndType
(
Integer
enterpriseId
,
int
type
)
{
return
this
.
tabSysUnionEnterpriseResourceMapper
.
listResourceByEnterpriseIdAndType
(
enterpriseId
,
type
);
}
@Override
public
List
<
TabSysUnionEnterpriseResource
>
listResourceByUnionId
(
Integer
unionId
)
{
return
this
.
listResourceByUnionId
(
unionId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
View file @
85ed977c
...
...
@@ -95,7 +95,7 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
authOrizationMessage
=
message
[
0
];
}
this
.
unionEnterpriseResourceService
.
updateAuthorizationStatus
(
authOrizationStatus
,
enterpriseId
,
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
(),
authOrizationMessage
);
return
null
;
return
ServiceResponse
.
success
()
;
}
@Override
...
...
@@ -104,20 +104,16 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
return
ServiceResponse
.
success
(
longList
);
}
@Override
public
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
listResourceByUnionId
(
Integer
unionId
)
{
List
<
TabSysUnionEnterpriseResource
>
list
=
this
.
unionEnterpriseResourceService
.
listResourceByUnionId
(
unionId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
UnionEnterpriseResourceDTO
.
class
,
list
));
}
private
int
saveResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
int
i
=
0
;
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getMemberCardResourceId
(),
ResourceTypeEnum
.
MEMBER_CARD_RESOURCE
.
getCode
(),
enterpriseDTO
.
getEnterpriseId
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getFwhResourceId
(),
ResourceTypeEnum
.
FWH_RESOURCE
.
getCode
(),
enterpriseDTO
.
getEnterpriseId
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getAppletResourceId
(),
ResourceTypeEnum
.
APPLET_RESOURCE
.
getCode
(),
enterpriseDTO
.
getEnterpriseId
());
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getMemberResourceId
(),
ResourceTypeEnum
.
MEMBER_RESOURCE
.
getCode
(),
enterpriseDTO
.
getEnterpriseId
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
...
...
@@ -143,17 +139,9 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
}
private
void
getResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
TabSysUnionEnterpriseResource
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
MEMBER_CARD_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setMemberCardResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
FWH_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setFwhResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
APPLET_RESOURCE
.
getCode
());
TabSysUnionEnterpriseResource
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
MEMBER_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
set
Applet
ResourceId
(
resource
.
getResource
());
enterpriseDTO
.
set
Member
ResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
STORE_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysUnionEnterpriseResourceMapper.xml
View file @
85ed977c
...
...
@@ -191,4 +191,11 @@
and t2.resource_type = #{type}
and t1.status = 1
</select>
<select
id=
"listResourceByUnionId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_union_enterprise_resource
where t1.union_id=#{unionId}
and t1.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 @
85ed977c
...
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuthCodeDTO
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
import
com.gic.auth.dto.UnionEnterpriseResourceDTO
;
import
com.gic.auth.service.AuthCodeApiService
;
import
com.gic.auth.service.UnionEnterpriseApiService
;
import
com.gic.auth.web.qo.PageQO
;
...
...
@@ -21,12 +22,14 @@ import com.gic.goods.api.dto.GoodsRightsSelectorDTO;
import
com.gic.goods.api.service.GoodsRightsSelectorApiService
;
import
com.gic.store.dto.StoreWidgetDTO
;
import
com.gic.store.service.StoreWidgetApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.List
;
@RestController
public
class
UnionEnterpriseController
{
...
...
@@ -118,7 +121,18 @@ public class UnionEnterpriseController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
Page
<
UnionEnterpriseDTO
>>
pageServiceResponse
=
this
.
unionEnterpriseApiService
.
pageUnionEnterprise
(
search
,
enterpriseId
,
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
(),
authorizationStatus
);
return
RestResponse
.
success
(
pageServiceResponse
.
getResult
());
Page
<
UnionEnterpriseDTO
>
result
=
pageServiceResponse
.
getResult
();
if
(
result
!=
null
){
List
<
UnionEnterpriseDTO
>
list
=
result
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
UnionEnterpriseDTO
dto
:
list
){
ServiceResponse
<
List
<
UnionEnterpriseResourceDTO
>>
response
=
this
.
unionEnterpriseApiService
.
listResourceByUnionId
(
dto
.
getUnionId
());
dto
.
setResourceList
(
response
.
getResult
());
}
}
return
RestResponse
.
success
(
list
);
}
return
RestResponse
.
success
();
}
private
RestResponse
validateAuthCode
(
UnionEnterpriseQO
unionEnterpriseQO
){
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
View file @
85ed977c
...
...
@@ -6,9 +6,7 @@ public class UnionEnterpriseQO implements Serializable {
private
Integer
unionEnterpriseId
;
private
String
unionEnterpriseName
;
private
String
authCode
;
private
Long
memberCardResourceId
;
private
Long
fwhResourceId
;
private
Long
appletResourceId
;
private
Long
memberResourceId
;
private
StoreResouceQO
storeResouce
;
private
GoodsResouceQO
goodsResource
;
private
Long
orderResourceId
;
...
...
@@ -55,30 +53,6 @@ public class UnionEnterpriseQO implements Serializable {
this
.
unionId
=
unionId
;
}
public
Long
getMemberCardResourceId
()
{
return
memberCardResourceId
;
}
public
void
setMemberCardResourceId
(
Long
memberCardResourceId
)
{
this
.
memberCardResourceId
=
memberCardResourceId
;
}
public
Long
getFwhResourceId
()
{
return
fwhResourceId
;
}
public
void
setFwhResourceId
(
Long
fwhResourceId
)
{
this
.
fwhResourceId
=
fwhResourceId
;
}
public
Long
getAppletResourceId
()
{
return
appletResourceId
;
}
public
void
setAppletResourceId
(
Long
appletResourceId
)
{
this
.
appletResourceId
=
appletResourceId
;
}
public
Long
getOrderResourceId
()
{
return
orderResourceId
;
}
...
...
@@ -102,4 +76,12 @@ public class UnionEnterpriseQO implements Serializable {
public
void
setGoodsResource
(
GoodsResouceQO
goodsResource
)
{
this
.
goodsResource
=
goodsResource
;
}
public
Long
getMemberResourceId
()
{
return
memberResourceId
;
}
public
void
setMemberResourceId
(
Long
memberResourceId
)
{
this
.
memberResourceId
=
memberResourceId
;
}
}
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