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
6504702d
Commit
6504702d
authored
Sep 03, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取超级管理员菜单接口
parent
9c413dc8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
84 additions
and
2 deletions
+84
-2
ResourceTypeEnum.java
...src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
+2
-1
UnionEnterpriseDTO.java
...pi/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
+10
-0
UnionEnterpriseApiService.java
.../java/com/gic/auth/service/UnionEnterpriseApiService.java
+4
-0
TabSysUnionEnterpriseMapper.java
.../com/gic/auth/dao/mapper/TabSysUnionEnterpriseMapper.java
+6
-0
UnionEnterpriseService.java
...ain/java/com/gic/auth/service/UnionEnterpriseService.java
+3
-0
UnionEnterpriseServiceImpl.java
...com/gic/auth/service/impl/UnionEnterpriseServiceImpl.java
+6
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+1
-1
UnionEnterpriseApiServiceImpl.java
...uth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
+19
-0
TabSysUnionEnterpriseMapper.xml
...src/main/resources/mapper/TabSysUnionEnterpriseMapper.xml
+14
-0
UnionEnterpriseController.java
...om/gic/auth/web/controller/UnionEnterpriseController.java
+10
-0
UnionEnterpriseQO.java
.../src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
+9
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/constant/ResourceTypeEnum.java
View file @
6504702d
...
...
@@ -5,7 +5,8 @@ public enum ResourceTypeEnum {
FWH_RESOURCE
(
2
,
"服务号资源"
),
APPLET_RESOURCE
(
3
,
"小程序资源"
),
STORE_RESOURCE
(
4
,
"门店资源"
),
GOODS_RESOURCE
(
5
,
"商品资源"
);
GOODS_RESOURCE
(
5
,
"商品资源"
),
ORDER_RESOURCE
(
6
,
"订单资源"
);
private
Integer
code
;
private
String
message
;
...
...
gic-platform-auth-api/src/main/java/com/gic/auth/dto/UnionEnterpriseDTO.java
View file @
6504702d
...
...
@@ -44,6 +44,7 @@ public class UnionEnterpriseDTO implements Serializable {
private
Long
appletResourceId
;
private
Long
storeResourceId
;
private
Long
goodsResourceId
;
private
Long
orderResourceId
;
public
Integer
getUnionId
()
{
return
unionId
;
...
...
@@ -140,4 +141,12 @@ public class UnionEnterpriseDTO implements Serializable {
public
void
setGoodsResourceId
(
Long
goodsResourceId
)
{
this
.
goodsResourceId
=
goodsResourceId
;
}
public
Long
getOrderResourceId
()
{
return
orderResourceId
;
}
public
void
setOrderResourceId
(
Long
orderResourceId
)
{
this
.
orderResourceId
=
orderResourceId
;
}
}
\ No newline at end of file
gic-platform-auth-api/src/main/java/com/gic/auth/service/UnionEnterpriseApiService.java
View file @
6504702d
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
...
...
@@ -11,4 +12,7 @@ public interface UnionEnterpriseApiService {
ServiceResponse
<
Integer
>
delUnionEnterprise
(
Integer
unionId
,
Integer
enterpriseId
);
ServiceResponse
<
UnionEnterpriseDTO
>
getUnionEnterpriseById
(
Integer
unionId
);
ServiceResponse
<
Page
<
UnionEnterpriseDTO
>>
pageUnionEnterprise
(
String
search
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
,
Integer
authorizationStatus
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUnionEnterpriseMapper.java
View file @
6504702d
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -55,4 +56,8 @@ public interface TabSysUnionEnterpriseMapper {
int
updateByPrimaryKey
(
TabSysUnionEnterprise
record
);
List
<
TabSysUnionEnterprise
>
getEnterpriseByUnionEnterpriseId
(
@Param
(
"unionEnterpriseId"
)
Integer
unionEnterpriseId
);
Page
<
TabSysUnionEnterprise
>
pageUnionEnterprise
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"authorizationStatus"
)
Integer
authorizationStatus
,
@Param
(
"search"
)
String
search
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/UnionEnterpriseService.java
View file @
6504702d
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
com.github.pagehelper.Page
;
public
interface
UnionEnterpriseService
{
int
saveUnionEnterprise
(
TabSysUnionEnterprise
tabSysUnionEnterprise
);
...
...
@@ -12,4 +13,6 @@ public interface UnionEnterpriseService {
int
delUnionEnterprise
(
Integer
id
);
TabSysUnionEnterprise
getUnionEnterpriseById
(
Integer
unionId
);
Page
<
TabSysUnionEnterprise
>
pageUnionEnterprise
(
Integer
enterpriseId
,
Integer
authorizationStatus
,
String
search
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UnionEnterpriseServiceImpl.java
View file @
6504702d
...
...
@@ -4,6 +4,7 @@ import com.gic.auth.dao.mapper.TabSysUnionEnterpriseMapper;
import
com.gic.auth.entity.TabSysUnionEnterprise
;
import
com.gic.auth.service.UnionEnterpriseService
;
import
com.gic.enterprise.constants.Constants
;
import
com.github.pagehelper.Page
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -46,4 +47,9 @@ public class UnionEnterpriseServiceImpl implements UnionEnterpriseService {
public
TabSysUnionEnterprise
getUnionEnterpriseById
(
Integer
unionId
)
{
return
this
.
tabSysUnionEnterpriseMapper
.
selectByPrimaryKey
(
unionId
);
}
@Override
public
Page
<
TabSysUnionEnterprise
>
pageUnionEnterprise
(
Integer
enterpriseId
,
Integer
authorizationStatus
,
String
search
)
{
return
this
.
tabSysUnionEnterpriseMapper
.
pageUnionEnterprise
(
enterpriseId
,
authorizationStatus
,
search
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
6504702d
...
...
@@ -27,7 +27,7 @@ public class MenuApiServiceImpl implements MenuApiService {
int
parentId
=
0
;
if
(
currentMenu
!=
null
){
TabSysMenu
menu
=
this
.
menuService
.
getMenuById
(
currentMenu
);
parentId
=
menu
.
getParentId
()
;
parentId
=
currentMenu
;
level
=
menu
.
getLevel
()+
1
;
}
return
ServiceResponse
.
success
(
this
.
treeMenu
(
menuList
,
level
,
parentId
));
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UnionEnterpriseApiServiceImpl.java
View file @
6504702d
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.constant.AuthorizationStatusEnum
;
import
com.gic.auth.constant.ResourceTypeEnum
;
...
...
@@ -10,7 +11,9 @@ import com.gic.auth.service.UnionEnterpriseApiService;
import
com.gic.auth.service.UnionEnterpriseResourceService
;
import
com.gic.auth.service.UnionEnterpriseService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.constants.Constants
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -73,6 +76,13 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
return
ServiceResponse
.
success
(
enterpriseDTO
);
}
@Override
public
ServiceResponse
<
Page
<
UnionEnterpriseDTO
>>
pageUnionEnterprise
(
String
search
,
Integer
enterpriseId
,
Integer
pageNum
,
Integer
pageSize
,
Integer
authorizationStatus
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
com
.
github
.
pagehelper
.
Page
<
TabSysUnionEnterprise
>
page
=
this
.
unionEnterpriseService
.
pageUnionEnterprise
(
enterpriseId
,
authorizationStatus
,
search
);
return
ServiceResponse
.
success
(
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
,
UnionEnterpriseDTO
.
class
));
}
private
int
saveResource
(
Integer
unionId
,
UnionEnterpriseDTO
enterpriseDTO
){
int
i
=
0
;
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getMemberCardResourceId
(),
...
...
@@ -100,6 +110,11 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
if
(
i
==
0
){
throw
new
RuntimeException
();
}
i
=
this
.
unionEnterpriseResourceService
.
saveResource
(
unionId
,
enterpriseDTO
.
getOrderResourceId
(),
ResourceTypeEnum
.
ORDER_RESOURCE
.
getCode
(),
enterpriseDTO
.
getEnterpriseId
());
if
(
i
==
0
){
throw
new
RuntimeException
();
}
return
i
;
}
...
...
@@ -124,5 +139,9 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
if
(
resource
!=
null
){
enterpriseDTO
.
setGoodsResourceId
(
resource
.
getResource
());
}
resource
=
this
.
unionEnterpriseResourceService
.
getByUnionIdAndType
(
unionId
,
ResourceTypeEnum
.
ORDER_RESOURCE
.
getCode
());
if
(
resource
!=
null
){
enterpriseDTO
.
setOrderResourceId
(
resource
.
getResource
());
}
}
}
gic-platform-auth-service/src/main/resources/mapper/TabSysUnionEnterpriseMapper.xml
View file @
6504702d
...
...
@@ -146,4 +146,17 @@
where union_enterprise_id = #{unionId,jdbcType=INTEGER}
and status=1
</select>
<select
id=
"pageUnionEnterprise"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_union_enterprise
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and status=1
<if
test=
"search != null and search !=''"
>
and union_enterprise_name like concat('%',#{search}, '%')
</if>
<if
test=
"authorizationStatus != null"
>
and authorization_status = #{authorizationStatus}
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UnionEnterpriseController.java
View file @
6504702d
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.AuthCodeDTO
;
import
com.gic.auth.dto.UnionEnterpriseDTO
;
import
com.gic.auth.service.AuthCodeApiService
;
import
com.gic.auth.service.UnionEnterpriseApiService
;
import
com.gic.auth.web.qo.PageQO
;
import
com.gic.auth.web.qo.UnionEnterpriseQO
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
...
...
@@ -65,6 +67,14 @@ public class UnionEnterpriseController {
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"page-union-enterprise"
)
public
RestResponse
pageUnionEnterprise
(
String
search
,
Integer
authorizationStatus
,
PageQO
pageQO
){
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
ServiceResponse
<
Page
<
UnionEnterpriseDTO
>>
pageServiceResponse
=
this
.
unionEnterpriseApiService
.
pageUnionEnterprise
(
search
,
enterpriseId
,
pageQO
.
getCurrentPage
(),
pageQO
.
getPageSize
(),
authorizationStatus
);
return
RestResponse
.
success
(
pageServiceResponse
.
getResult
());
}
private
RestResponse
validateAuthCode
(
UnionEnterpriseQO
unionEnterpriseQO
){
ServiceResponse
<
AuthCodeDTO
>
authCode
=
this
.
authCodeApiService
.
getAuthCode
(
unionEnterpriseQO
.
getAuthCodeId
());
if
(
authCode
.
isSuccess
()){
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/qo/UnionEnterpriseQO.java
View file @
6504702d
...
...
@@ -11,6 +11,7 @@ public class UnionEnterpriseQO implements Serializable {
private
Long
appletResourceId
;
private
Long
storeResourceId
;
private
Long
goodsResourceId
;
private
Long
orderResourceId
;
private
Integer
authCodeId
;
private
Integer
unionId
;
...
...
@@ -93,4 +94,12 @@ public class UnionEnterpriseQO implements Serializable {
public
void
setGoodsResourceId
(
Long
goodsResourceId
)
{
this
.
goodsResourceId
=
goodsResourceId
;
}
public
Long
getOrderResourceId
()
{
return
orderResourceId
;
}
public
void
setOrderResourceId
(
Long
orderResourceId
)
{
this
.
orderResourceId
=
orderResourceId
;
}
}
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