Commit 7a6b52a9 by 何文超

bugfix

parent 8b1576dc
...@@ -35,7 +35,8 @@ public class GoodsBrandController { ...@@ -35,7 +35,8 @@ public class GoodsBrandController {
@RequestMapping("/goods-brand-list") @RequestMapping("/goods-brand-list")
public RestResponse goodsBrandList(int pageSize, int currentPage, String search, Long goodsDomainId, String channelCode) { public RestResponse goodsBrandList(int pageSize, int currentPage, String search, Long goodsDomainId, String channelCode) {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(),
Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null || if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) { selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
return RestResponse.success(Collections.EMPTY_LIST); return RestResponse.success(Collections.EMPTY_LIST);
......
...@@ -54,7 +54,9 @@ public class GoodsDomainController { ...@@ -54,7 +54,9 @@ public class GoodsDomainController {
*/ */
@RequestMapping("/get-all-goods-domain-list") @RequestMapping("/get-all-goods-domain-list")
public RestResponse getAllGoodsDomianList() { public RestResponse getAllGoodsDomianList() {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService
.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId()
, Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null || if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) { selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
return RestResponse.success(Collections.EMPTY_LIST); return RestResponse.success(Collections.EMPTY_LIST);
...@@ -63,14 +65,18 @@ public class GoodsDomainController { ...@@ -63,14 +65,18 @@ public class GoodsDomainController {
// 是否最高权限 // 是否最高权限
boolean isHighestRights = true; boolean isHighestRights = true;
JSONObject json = null; JSONObject json = null;
if (UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId() != null) { if (UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin() != 1) {
isHighestRights = false; isHighestRights = false;
if (selectorDTOServiceResponse.isSuccess()) { if (selectorDTOServiceResponse.isSuccess()) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = selectorDTOServiceResponse.getResult(); GoodsRightsSelectorDTO goodsRightsSelectorDTO = selectorDTOServiceResponse.getResult();
if (goodsRightsSelectorDTO != null) { if (goodsRightsSelectorDTO != null) {
json = JSONObject.parseObject(goodsRightsSelectorDTO.getGoodsRightsDomains()); if (goodsRightsSelectorDTO.getHasRights() == 0) {
if (json.isEmpty()) { json = JSONObject.parseObject(JSONObject.toJSONString(Collections.EMPTY_LIST));
isHighestRights = true; } else {
json = JSONObject.parseObject(goodsRightsSelectorDTO.getGoodsRightsDomains());
if (json.isEmpty()) {
isHighestRights = true;
}
} }
} }
} }
......
package com.gic.plug.web.controller.goods; package com.gic.plug.web.controller.goods;
import com.gic.enterprise.utils.UserDetailUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -80,7 +81,8 @@ public class GoodsRightsSelectorController { ...@@ -80,7 +81,8 @@ public class GoodsRightsSelectorController {
@RequestMapping("/get-goods-rights-selector") @RequestMapping("/get-goods-rights-selector")
public RestResponse getGoodsRightsSelector(Long goodsRightsSelectorId) { public RestResponse getGoodsRightsSelector(Long goodsRightsSelectorId) {
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(goodsRightsSelectorId, Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(goodsRightsSelectorId,
Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (serviceResponse.isSuccess()) { if (serviceResponse.isSuccess()) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = serviceResponse.getResult(); GoodsRightsSelectorDTO goodsRightsSelectorDTO = serviceResponse.getResult();
return RestResponse.success(EntityUtil.changeEntityByOrika(GoodsRightsSelectorVO.class, goodsRightsSelectorDTO)); return RestResponse.success(EntityUtil.changeEntityByOrika(GoodsRightsSelectorVO.class, goodsRightsSelectorDTO));
......
...@@ -60,7 +60,8 @@ public class GoodsSelectorController { ...@@ -60,7 +60,8 @@ public class GoodsSelectorController {
public RestResponse goodsSelectorSave(GoodsSelectorSaveQO goodsSelectorSaveQO) { public RestResponse goodsSelectorSave(GoodsSelectorSaveQO goodsSelectorSaveQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO); GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID); goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId()
, Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) { if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage()); return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
} }
...@@ -81,7 +82,8 @@ public class GoodsSelectorController { ...@@ -81,7 +82,8 @@ public class GoodsSelectorController {
public RestResponse goodsSelectorShow(GoodsSelectorSaveQO goodsSelectorSaveQO) { public RestResponse goodsSelectorShow(GoodsSelectorSaveQO goodsSelectorSaveQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO); GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID); goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(),
Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) { if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage()); return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
} }
...@@ -103,7 +105,7 @@ public class GoodsSelectorController { ...@@ -103,7 +105,7 @@ public class GoodsSelectorController {
public RestResponse changeGoodsRightsForSelector(Long goodsSelectorId) { public RestResponse changeGoodsRightsForSelector(Long goodsSelectorId) {
if (goodsSelectorId == null) { if (goodsSelectorId == null) {
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(),
Constant.TEST_ENTERPRISE_ID); Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId() == null) { if (UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId() == null) {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "没有权限"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "没有权限");
} }
...@@ -116,7 +118,8 @@ public class GoodsSelectorController { ...@@ -116,7 +118,8 @@ public class GoodsSelectorController {
goodsRightsSelectorDTO.setGoodsRightsSearchValue(serviceResponse.getResult().getGoodsRightsSearchValue()); goodsRightsSelectorDTO.setGoodsRightsSearchValue(serviceResponse.getResult().getGoodsRightsSearchValue());
return RestResponse.success(goodsRightsSelectorDTO); return RestResponse.success(goodsRightsSelectorDTO);
} }
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(), Constant.TEST_ENTERPRISE_ID); ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(UserDetailUtils.getUserDetail().getUserResourceInfo().getGoodsResourceId(),
Constant.TEST_ENTERPRISE_ID, UserDetailUtils.getUserDetail().getUserInfo().getSuperAdmin());
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) { if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage()); 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