Browse Source

fix cashout

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
72362c715a
1 changed files with 16 additions and 4 deletions
  1. +16
    -4
      mallinkBApi/src/main/java/com/iformall/controller/WxCashOutController.java

+ 16
- 4
mallinkBApi/src/main/java/com/iformall/controller/WxCashOutController.java View File

@@ -116,7 +116,12 @@ public class WxCashOutController extends BaseController {
if (payAccount.getShare().intValue() == EnumPayShare.YES.getCode().intValue()) {
resultMap.put("cashOutSupport", 0);
}else {
resultMap.put("cashOutSupport", mall.getCashOutSupport());
WxBuser wxBUser = getWxBuser();
if (!currentWxBUserIsAdmin(wxBUser,merchant)) {
resultMap.put("cashOutSupport", 0);
}else {
resultMap.put("cashOutSupport", mall.getCashOutSupport());
}
}
resultMap.put("cashOutLimit", mall.getCashOutLimit());
resultMap.put("cashOutOpenNickName", mUser.getNickName());
@@ -132,15 +137,22 @@ public class WxCashOutController extends BaseController {
return wxCUserService.getByObject(cuUser);
}
private boolean currentWxBUserIsAdmin(WxBuser wxBUser,WxMerchant merchant) {
if ((!StringUtils.isBlank(wxBUser.getPhone())) && wxBUser.getPhone().equals(merchant.getLinkPhone()) ) {
return true;
}else {
return false;
}
}
@ApiOperation("微信B端提现")
@PostMapping("cashout")
public ResultData cashout(@RequestBody WxCashOut wxCashOut) {
WxMerchantBUser buser = getLoginBUser();
WxBuser wxBUser = getWxBuser();
WxMerchant merchant = wxMerchantService.getById(buser.getMerchantId());
if ((!StringUtils.isBlank(wxBUser.getPhone())) && wxBUser.getPhone().equals(merchant.getLinkPhone()) ) {
//do nothing
}else {
if (!currentWxBUserIsAdmin(wxBUser,merchant)) {
return new ResultData(Result.ERROR,"当前微信绑定的手机号["+wxBUser.getPhone()+"]非商户的联系手机号");
}


Loading…
Cancel
Save