Commit c40881a2 by chenxi

优加门店上架改造

1 parent e5b65b9c
...@@ -298,7 +298,7 @@ public class SceneAndCategoryController { ...@@ -298,7 +298,7 @@ public class SceneAndCategoryController {
@ApiOperation("查询所有场景和类目") @ApiOperation("查询所有场景和类目")
@ServiceMethod(method = "dj.api.goodsCategoryConfiguration.queryAll", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.goodsCategoryConfiguration.queryAll", needInSession = NeedInSessionType.NO)
public RopResponse<List<GoodsCategoryDTO>> queryAll(FeaturedGoodsRequest request) { public RopResponse<List<GoodsCategoryDTO>> queryAll(FeaturedGoodsRequest request) {
RpcResponse<List<GoodsCategoryDTO>> res = goodsCategoryConfigurationRemote.queryAll(); RpcResponse<List<GoodsCategoryDTO>> res = goodsCategoryConfigurationRemote.queryAll();
return RopResponse.success(res.getResult()); return RopResponse.success(res.getResult());
......
...@@ -158,7 +158,7 @@ public class ServiceMerchantController { ...@@ -158,7 +158,7 @@ public class ServiceMerchantController {
* @date 2021年4月8日 上午11:17:48 * @date 2021年4月8日 上午11:17:48
*/ */
@ApiOperation("分页查询服务门店") @ApiOperation("分页查询服务门店")
@ServiceMethod(method = "dj.api.serviceMerchant.listWithPage", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.serviceMerchant.listWithPage", needInSession = NeedInSessionType.NO)
public RopResponse<RpcPagination<ServiceMerchantDTO>> listWithPage(ServiceMerchantPageRequest request){ public RopResponse<RpcPagination<ServiceMerchantDTO>> listWithPage(ServiceMerchantPageRequest request){
RpcPagination<ServiceMerchantDTO> pagination = CommonUtil.getRpcPagination(ServiceMerchantDTO.class); RpcPagination<ServiceMerchantDTO> pagination = CommonUtil.getRpcPagination(ServiceMerchantDTO.class);
if (request.getMerchantId() != null && request.getChannelType() != null) { if (request.getMerchantId() != null && request.getChannelType() != null) {
...@@ -169,7 +169,13 @@ public class ServiceMerchantController { ...@@ -169,7 +169,13 @@ public class ServiceMerchantController {
pagination.getCondition().setMerchantId(null); pagination.getCondition().setMerchantId(null);
pagination.getCondition().setChannelType(null); pagination.getCondition().setChannelType(null);
} }
pagination.getCondition().setYqMerchantIds(CommonUtil.getMerchantIds()); // 商户可见范围过滤:
// CommonUtil.getMerchantIds() 依赖 ROP 会话中的登录用户;当调用方以 needInSession=NO
// 方式(系统间调用)接入时没有登录用户,它会返回占位值 [-1],导致 SQL 变成
// `b.yq_merchant_id in (-1)` 而查不到任何数据。因此仅在存在登录用户时才施加该限制。
if (CommonUtil.getLoginUser() != null) {
pagination.getCondition().setYqMerchantIds(CommonUtil.getMerchantIds());
}
RpcResponse<RpcPagination<ServiceMerchantDTO>> res = serviceMerchantRemote.listWithPage(pagination); RpcResponse<RpcPagination<ServiceMerchantDTO>> res = serviceMerchantRemote.listWithPage(pagination);
return RopResponse.success(res.getResult()); return RopResponse.success(res.getResult());
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!