Commit 383e8ed2 by 程裕兵

feat:subsidy condition

parent 9299924e
......@@ -23,8 +23,4 @@ public class CheckUnbindStudioMerchantRequest {
@NotNull(message = "场馆ID不能为空")
private Long studioId;
@ApiModelProperty(value = "商户ID", required = true)
@NotNull(message = "商户ID不能为空")
private Long merchantId;
}
......@@ -75,8 +75,7 @@ public class StudioMerchantController implements StudioMerchantApi {
@PostMapping(value = "/private/studioMerchant/checkUnbind")
@Override
public JsonResult<List<String>> checkUnbind(@RequestBody @Valid CheckUnbindStudioMerchantRequest request) {
return JsonResult.success(
studioMerchantService.checkUnbind(request.getStudioId(), request.getMerchantId()));
return JsonResult.success(studioMerchantService.checkUnbind(request.getStudioId());
}
@ApiOperation(value = "场馆解绑商户", tags = {TAG})
......
......@@ -131,10 +131,9 @@ public interface StudioMerchantService {
* 解绑前置校验
*
* @param studioId 场馆ID
* @param merchantId 商户ID
* @return true:绑定过其他场馆;false-没有绑定过
*/
List<String> checkUnbind(Long studioId, Long merchantId);
List<String> checkUnbind(Long studioId);
/**
* 获取最后一条成功的申请记录
......
......@@ -275,7 +275,12 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
@Override
public List<String> checkUnbind(Long studioId, Long merchantId) {
public List<String> checkUnbind(Long studioId) {
List<PartyToMerchant> relation = partyToMerchantRpService.listByParty(studioId, PartyTypeEnum.STUDIO, config.getCashier());
if (CollectionUtil.isEmpty(relation)) {
return Lists.newArrayList();
}
Long merchantId = relation.stream().findFirst().orElse(new PartyToMerchant()).getMerchantId();
List<PartyToMerchant> merchants = partyToMerchantRpService.listByMerchantIdAndPartyType(merchantId,
PartyTypeEnum.STUDIO);
if (CollectionUtil.isEmpty(merchants)) {
......
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