|
|
|
@@ -63,22 +63,9 @@ public class WxMerchantController extends BaseController { |
|
|
|
if(payAccount == null){ |
|
|
|
return new ResultData(ErrorCode.API_KEY_NOT_FOUND); |
|
|
|
} |
|
|
|
|
|
|
|
return new ResultData(wxProfitSharingReceiverService.findReceiver(tenantInfo,wxMerchant.getId(), EnumAppPlat.WX)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("抖音查询收款账户信息") |
|
|
|
@GetMapping("/findTtAccountById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findTtAccountById(@ModelAttribute WxMerchant wxMerchant) { |
|
|
|
log.debug("[" + getIpAddr() + "] WxMerchantController::findTtAccountById"); |
|
|
|
if (wxMerchant.getId() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); |
|
|
|
} |
|
|
|
wxMerchant.updateTenantInfo(getTenantInfo()); |
|
|
|
return new ResultData(wxProfitPaymentReceiverService.findReceiver(getTenantInfo(),wxMerchant.getId(), EnumAppPlat.TOUTIAO)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("更新收款账户信息:必填项 id(商户ID) name(商户名称) accountId(账号ID) accountTypeValue(账号类型) accountName(账号名称)") |
|
|
|
@PostMapping("/updateAccount") |
|
|
|
public ResultData addAccount(@RequestBody WxMerchant wxMerchant) { |
|
|
|
@@ -120,13 +107,7 @@ public class WxMerchantController extends BaseController { |
|
|
|
return wxProfitSharingReceiverService.delReceiver(receiver, EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode()); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("查询是否有权限修改账户") |
|
|
|
@GetMapping("/permitModifiy") |
|
|
|
public ResultData permitModifiy() { |
|
|
|
log.debug("[" + getIpAddr() + "] WxMerchantController::permitModifiy"); |
|
|
|
boolean has = hasPermission(); |
|
|
|
return new ResultData(has); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TenantIgnore |
|
|
|
@ApiOperation("获取微信OpenId") |
|
|
|
@@ -160,6 +141,56 @@ public class WxMerchantController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("微信查询收款信息") |
|
|
|
@GetMapping("/findPaymentAccountById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findPaymentAccountById(@ModelAttribute WxMerchant wxMerchant) { |
|
|
|
log.debug("[" + getIpAddr() + "] WxMerchantController::findPaymentAccountById"); |
|
|
|
if (wxMerchant.getId() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); |
|
|
|
} |
|
|
|
TenantEntity tenantInfo = getTenantInfo(); |
|
|
|
wxMerchant.updateTenantInfo(tenantInfo); |
|
|
|
|
|
|
|
WxPayAccount payAccount = payAccountService.getPayAccount(tenantInfo, EnumAppPlat.WX); |
|
|
|
if(payAccount == null){ |
|
|
|
return new ResultData(ErrorCode.API_KEY_NOT_FOUND); |
|
|
|
} |
|
|
|
return new ResultData(wxProfitPaymentReceiverService.findReceiver(tenantInfo,wxMerchant.getId(), EnumAppPlat.WX)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询是否有权限修改账户") |
|
|
|
@GetMapping("/permitModifiy") |
|
|
|
public ResultData permitModifiy() { |
|
|
|
log.debug("[" + getIpAddr() + "] WxMerchantController::permitModifiy"); |
|
|
|
boolean has = hasPermission(); |
|
|
|
return new ResultData(has); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean hasPermission() { |
|
|
|
WxMerchantBUser user = getLoginBUser(); |
|
|
|
CUser buser = getCUser(); |
|
|
|
WxMerchant wxMerchant = wxMerchantService.selectById(user.getMerchantId()); |
|
|
|
return wxMerchant != null && wxMerchant.getLinkPhone().equals(buser.getPhone()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("抖音查询收款账户信息") |
|
|
|
@GetMapping("/findTtAccountById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findTtAccountById(@ModelAttribute WxMerchant wxMerchant) { |
|
|
|
log.debug("[" + getIpAddr() + "] WxMerchantController::findTtAccountById"); |
|
|
|
if (wxMerchant.getId() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); |
|
|
|
} |
|
|
|
wxMerchant.updateTenantInfo(getTenantInfo()); |
|
|
|
return new ResultData(wxProfitPaymentReceiverService.findReceiver(getTenantInfo(),wxMerchant.getId(), EnumAppPlat.TOUTIAO)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RedisCache() |
|
|
|
@ApiOperation("获取进件/余额页面") |
|
|
|
@GetMapping("/getTtReceiverUrl") |
|
|
|
@@ -189,14 +220,6 @@ public class WxMerchantController extends BaseController { |
|
|
|
}else{ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public boolean hasPermission() { |
|
|
|
WxMerchantBUser user = getLoginBUser(); |
|
|
|
CUser buser = getCUser(); |
|
|
|
WxMerchant wxMerchant = wxMerchantService.selectById(user.getMerchantId()); |
|
|
|
return wxMerchant != null && wxMerchant.getLinkPhone().equals(buser.getPhone()); |
|
|
|
} |
|
|
|
|
|
|
|
} |