Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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-webapp-plug
Commits
81fdc198
Commit
81fdc198
authored
Mar 05, 2020
by
何文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加商品选择器权限
parent
84f42e1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
GoodsBrandController.java
...m/gic/plug/web/controller/goods/GoodsBrandController.java
+3
-2
GoodsDomainController.java
.../gic/plug/web/controller/goods/GoodsDomainController.java
+3
-2
GoodsSelectorController.java
...ic/plug/web/controller/goods/GoodsSelectorController.java
+4
-3
No files found.
src/main/java/com/gic/plug/web/controller/goods/GoodsBrandController.java
View file @
81fdc198
...
...
@@ -16,6 +16,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.contants.SortType
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.goods.api.dto.BrandDTO
;
import
com.gic.goods.api.dto.GoodsRightsSelectorDTO
;
import
com.gic.goods.api.service.BrandApiService
;
...
...
@@ -34,14 +35,14 @@ public class GoodsBrandController {
@RequestMapping
(
"/goods-brand-list"
)
public
RestResponse
goodsBrandList
(
int
pageSize
,
int
currentPage
,
String
search
,
Long
goodsDomainId
,
String
channelCode
)
{
ServiceResponse
<
GoodsRightsSelectorDTO
>
selectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
,
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
selectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
,
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
selectorDTOServiceResponse
.
isSuccess
()
||
selectorDTOServiceResponse
.
getResult
()
==
null
||
selectorDTOServiceResponse
.
getResult
().
getHasRights
()
==
Constant
.
NO
)
{
return
RestResponse
.
success
(
Collections
.
EMPTY_LIST
);
}
// 是否最高权限
List
<
Long
>
branIdList
=
new
ArrayList
<>();
if
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
!=
null
)
{
if
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
!=
null
)
{
if
(
selectorDTOServiceResponse
.
isSuccess
())
{
GoodsRightsSelectorDTO
goodsRightsSelectorDTO
=
selectorDTOServiceResponse
.
getResult
();
if
(
goodsRightsSelectorDTO
!=
null
)
{
...
...
src/main/java/com/gic/plug/web/controller/goods/GoodsDomainController.java
View file @
81fdc198
...
...
@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.goods.api.dto.GoodsDomainDTO
;
import
com.gic.goods.api.dto.GoodsRightsSelectorDTO
;
import
com.gic.goods.api.service.GoodsDomainApiService
;
...
...
@@ -53,7 +54,7 @@ public class GoodsDomainController {
*/
@RequestMapping
(
"/get-all-goods-domain-list"
)
public
RestResponse
getAllGoodsDomianList
()
{
ServiceResponse
<
GoodsRightsSelectorDTO
>
selectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
,
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
selectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
,
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
selectorDTOServiceResponse
.
isSuccess
()
||
selectorDTOServiceResponse
.
getResult
()
==
null
||
selectorDTOServiceResponse
.
getResult
().
getHasRights
()
==
Constant
.
NO
)
{
return
RestResponse
.
success
(
Collections
.
EMPTY_LIST
);
...
...
@@ -62,7 +63,7 @@ public class GoodsDomainController {
// 是否最高权限
boolean
isHighestRights
=
true
;
JSONObject
json
=
null
;
if
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
!=
null
)
{
if
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
!=
null
)
{
isHighestRights
=
false
;
if
(
selectorDTOServiceResponse
.
isSuccess
())
{
GoodsRightsSelectorDTO
goodsRightsSelectorDTO
=
selectorDTOServiceResponse
.
getResult
();
...
...
src/main/java/com/gic/plug/web/controller/goods/GoodsSelectorController.java
View file @
81fdc198
...
...
@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.goods.api.dto.GoodsRightsSelectorDTO
;
import
com.gic.goods.api.dto.GoodsSelectorDTO
;
import
com.gic.goods.api.service.GoodsRightsSelectorApiService
;
...
...
@@ -58,7 +59,7 @@ public class GoodsSelectorController {
public
RestResponse
goodsSelectorSave
(
GoodsSelectorSaveQO
goodsSelectorSaveQO
)
{
GoodsSelectorDTO
goodsSelectorDTO
=
EntityUtil
.
changeEntityByOrika
(
GoodsSelectorDTO
.
class
,
goodsSelectorSaveQO
);
goodsSelectorDTO
.
setEnterpriseId
(
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
,
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
,
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
goodsRightsSelectorDTOServiceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
goodsRightsSelectorDTOServiceResponse
.
getCode
(),
goodsRightsSelectorDTOServiceResponse
.
getMessage
());
}
...
...
@@ -79,7 +80,7 @@ public class GoodsSelectorController {
public
RestResponse
goodsSelectorShow
(
GoodsSelectorSaveQO
goodsSelectorSaveQO
)
{
GoodsSelectorDTO
goodsSelectorDTO
=
EntityUtil
.
changeEntityByOrika
(
GoodsSelectorDTO
.
class
,
goodsSelectorSaveQO
);
goodsSelectorDTO
.
setEnterpriseId
(
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
,
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
,
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
goodsRightsSelectorDTOServiceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
goodsRightsSelectorDTOServiceResponse
.
getCode
(),
goodsRightsSelectorDTOServiceResponse
.
getMessage
());
}
...
...
@@ -99,7 +100,7 @@ public class GoodsSelectorController {
@RequestMapping
(
"change-goods-rights-for-selector"
)
public
RestResponse
changeGoodsRightsForSelector
(
Long
goodsSelectorId
)
{
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
Constant
.
TEST_GOODS_RIGHTS_SELECTOR_ID
,
Constant
.
TEST_ENTERPRISE_ID
);
ServiceResponse
<
GoodsRightsSelectorDTO
>
goodsRightsSelectorDTOServiceResponse
=
goodsRightsSelectorApiService
.
getGoodsRightsSelector
(
UserDetailUtils
.
getUserDetail
().
getUserResourceInfo
().
getGoodsResourceId
()
,
Constant
.
TEST_ENTERPRISE_ID
);
if
(!
goodsRightsSelectorDTOServiceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
goodsRightsSelectorDTOServiceResponse
.
getCode
(),
goodsRightsSelectorDTOServiceResponse
.
getMessage
());
}
...
...
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