Commit b88ed7d9 by 程裕兵

feat:latest success apply

parent 26220be3
...@@ -48,7 +48,7 @@ public interface StudioMerchantApi { ...@@ -48,7 +48,7 @@ public interface StudioMerchantApi {
@ApiOperation(value = "解绑前置校验请求", tags = {TAG}) @ApiOperation(value = "解绑前置校验请求", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/checkUnbind") @PostMapping(value = "/private/studioMerchant/checkUnbind")
JsonResult<Boolean> checkUnbind(CheckUnbindStudioMerchantRequest request); JsonResult<List<String>> checkUnbind(CheckUnbindStudioMerchantRequest request);
@ApiOperation(value = "场馆解绑商户", tags = {TAG}) @ApiOperation(value = "场馆解绑商户", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/unbind") @PostMapping(value = "/private/studioMerchant/unbind")
......
...@@ -50,7 +50,7 @@ public class StudioMerchantApiFallback implements FallbackFactory<StudioMerchant ...@@ -50,7 +50,7 @@ public class StudioMerchantApiFallback implements FallbackFactory<StudioMerchant
} }
@Override @Override
public JsonResult<Boolean> checkUnbind(CheckUnbindStudioMerchantRequest request) { public JsonResult<List<String>> checkUnbind(CheckUnbindStudioMerchantRequest request) {
return JsonResult.rpcError(); return JsonResult.rpcError();
} }
......
...@@ -74,7 +74,7 @@ public class StudioMerchantController implements StudioMerchantApi { ...@@ -74,7 +74,7 @@ public class StudioMerchantController implements StudioMerchantApi {
@ApiOperation(value = "解绑前置校验请求", tags = {TAG}) @ApiOperation(value = "解绑前置校验请求", tags = {TAG})
@PostMapping(value = "/private/studioMerchant/checkUnbind") @PostMapping(value = "/private/studioMerchant/checkUnbind")
@Override @Override
public JsonResult<Boolean> checkUnbind(@RequestBody @Valid CheckUnbindStudioMerchantRequest request) { public JsonResult<List<String>> checkUnbind(@RequestBody @Valid CheckUnbindStudioMerchantRequest request) {
return JsonResult.success( return JsonResult.success(
studioMerchantService.checkUnbind(request.getStudioId(), request.getMerchantId())); studioMerchantService.checkUnbind(request.getStudioId(), request.getMerchantId()));
} }
......
...@@ -134,7 +134,7 @@ public interface StudioMerchantService { ...@@ -134,7 +134,7 @@ public interface StudioMerchantService {
* @param merchantId 商户ID * @param merchantId 商户ID
* @return true:绑定过其他场馆;false-没有绑定过 * @return true:绑定过其他场馆;false-没有绑定过
*/ */
Boolean checkUnbind(Long studioId, Long merchantId); List<String> checkUnbind(Long studioId, Long merchantId);
/** /**
* 获取最后一条成功的申请记录 * 获取最后一条成功的申请记录
......
...@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.merchant.impl; ...@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.merchant.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.google.common.collect.Lists;
import com.jiejing.common.exception.BizException; import com.jiejing.common.exception.BizException;
import com.jiejing.common.model.PageVO; import com.jiejing.common.model.PageVO;
import com.jiejing.common.utils.collection.CollectionUtil; import com.jiejing.common.utils.collection.CollectionUtil;
...@@ -274,12 +275,18 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -274,12 +275,18 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
} }
@Override @Override
public Boolean checkUnbind(Long studioId, Long merchantId) { public List<String> checkUnbind(Long studioId, Long merchantId) {
List<PartyToMerchant> merchants = partyToMerchantRpService.listByMerchantIdAndPartyType(merchantId, PartyTypeEnum.STUDIO); List<PartyToMerchant> merchants = partyToMerchantRpService.listByMerchantIdAndPartyType(merchantId,
return Optional.ofNullable(merchants) PartyTypeEnum.STUDIO);
.orElse(new ArrayList<>(1)) if (CollectionUtil.isEmpty(merchants)) {
return Lists.newArrayList();
}
return studioRpcService.listStudio(
merchants.stream().map(PartyToMerchant::getPartyId).collect(Collectors.toList()))
.stream() .stream()
.anyMatch(e -> !e.getPartyId().equals(studioId)); .filter(e -> !e.getId().equals(studioId))
.map(StudioVO::getName)
.collect(Collectors.toList());
} }
@Override @Override
......
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