Commit 6d121d86 by 何文超

更新代码

parent 4fdb48f2
......@@ -56,6 +56,25 @@ public class GoodsBrandController {
}
}
}
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search);
}
/**
* 权限商品筛选器的品牌接口
* @param pageSize
* @param currentPage
* @param search
* @param goodsDomainId
* @return
*/
@RequestMapping("/goods-brand-list-for-rights")
public RestResponse goodsBrandListForRights(int pageSize, int currentPage, String search, Long goodsDomainId) {
return findBrandListByParams(currentPage, pageSize,goodsDomainId, search);
}
private RestResponse findBrandListByParams(int currentPage, int pageSize, Long goodsDomainId, String search) {
List<Long> branIdList = new ArrayList<>();
ServiceResponse<Page<BrandDTO>> serviceResponse = brandApiService.findBrandPage(currentPage, pageSize, goodsDomainId, search, branIdList, SortType.sortDescType);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......
......@@ -29,6 +29,22 @@ public class GoodsDomainController {
private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
/**
* @Title: getAllGoodsDomianListWith
* @Description: 权限筛选器选择权限
* @author majia
* @return com.gic.commons.webapi.reponse.RestResponse
* @throws
*/
@RequestMapping("/get-all-goods-domain-list-for-rights")
public RestResponse getAllGoodsDomainListForRights() {
ServiceResponse<List<GoodsDomainDTO>> serviceResponse = goodsDomainApiService.listAll(Constant.TEST_ENTERPRISE_ID, null);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
return listGoodsDomain(true, serviceResponse.getResult(), null);
}
/**
* @Title: getAllGoodsDomianListWith
* @Description: 查询企业下所有的域,拼接成channelVO返回
* @author majia
......@@ -36,7 +52,7 @@ public class GoodsDomainController {
* @throws
*/
@RequestMapping("/get-all-goods-domain-list")
private RestResponse getAllGoodsDomianListWith() {
public RestResponse getAllGoodsDomianList() {
ServiceResponse<GoodsRightsSelectorDTO> selectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(Constant.TEST_GOODS_RIGHTS_SELECTOR_ID);
if (!selectorDTOServiceResponse.isSuccess() || selectorDTOServiceResponse.getResult() == null ||
selectorDTOServiceResponse.getResult().getHasRights() == Constant.NO) {
......@@ -61,7 +77,10 @@ public class GoodsDomainController {
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
List<GoodsDomainDTO> goodsDomainDTOList = serviceResponse.getResult();
return listGoodsDomain(isHighestRights, serviceResponse.getResult(), json);
}
private RestResponse listGoodsDomain(boolean isHighestRights, List<GoodsDomainDTO> goodsDomainDTOList, JSONObject json) {
Map<String, List<GoodsDomainDTO>> map = new TreeMap<>();
if (CollectionUtils.isEmpty(goodsDomainDTOList)) {
return RestResponse.success(Collections.EMPTY_LIST);
......
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