Commit 2b804566 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-webapp-plug into developer
parents 2fb7955b 4fdb48f2
package com.gic.plug.web.controller.goods;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
......@@ -33,10 +34,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);
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) {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (selectorDTOServiceResponse.isSuccess()) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = selectorDTOServiceResponse.getResult();
if (goodsRightsSelectorDTO != null) {
......
......@@ -37,17 +37,24 @@ public class GoodsDomainController {
*/
@RequestMapping("/get-all-goods-domain-list")
private RestResponse getAllGoodsDomianListWith() {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
return RestResponse.success(Collections.EMPTY_LIST);
}
ServiceResponse<List<GoodsDomainDTO>> serviceResponse = goodsDomainApiService.listAll(Constant.TEST_ENTERPRISE_ID, null);
// 是否最高权限
boolean isHighestRights = true;
JSONObject json = null;
if (Constant.TEST_GOODS_RIGHTS_SELECTOR_ID != null) {
isHighestRights = false;
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (selectorDTOServiceResponse.isSuccess()) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = selectorDTOServiceResponse.getResult();
if (goodsRightsSelectorDTO != null) {
json = JSONObject.parseObject(goodsRightsSelectorDTO.getGoodsRightsDomains());
if (json.isEmpty()) {
isHighestRights = true;
}
}
}
}
......
......@@ -58,7 +58,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(46703961214504960L);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
......@@ -78,7 +78,7 @@ public class GoodsSelectorController {
@RequestMapping("change-goods-rights-for-selector")
public RestResponse changeGoodsRightsForSelector(Long goodsSelectorId) {
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(48157557076766720L);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment