Просмотр исходного кода

//sharing

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
e35a1158f3
3 измененных файлов: 55 добавлений и 30 удалений
  1. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023021300001__add_分账类型.sql
  2. +51
    -28
      mallinkBApi/src/main/java/com/iformall/controller/WxMerchantController.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/enums/EnumProfitPaymentReceiverType.java

+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V2023021300001__add_分账类型.sql Просмотреть файл

@@ -31,6 +31,8 @@ INSERT INTO `mallink`.`wx_profit_payment_receiver`(`id`, `tenant_id`, `parent_te
(select `id`, `tenant_id`, `parent_tenant_id`, `merchant_id`, `receiver_type`, `receiver_account`, `create_time`, `update_time`, `status`, `plat`, `tt_import_status`, `tt_import_url`, `tt_balance_url` from wx_profit_sharing_receiver
where plat = 3 and sharing_type = 3);

update wx_profit_payment_receiver set receiver_type = 10 where plat = 3;

update wx_profit_sharing_receiver set receiver_type = 10 where plat = 3 and sharing_type = 3;

update wx_profit_sharing_receiver set sharing_type = 1 where sharing_type != 2;

+ 51
- 28
mallinkBApi/src/main/java/com/iformall/controller/WxMerchantController.java Просмотреть файл

@@ -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());
}

}

+ 2
- 2
mallinkService/src/main/java/com/iformall/enums/EnumProfitPaymentReceiverType.java Просмотреть файл

@@ -4,9 +4,9 @@ package com.iformall.enums;
* Created by Stormeye on 2018/08/09.
*/
public enum EnumProfitPaymentReceiverType {
wx_special_merchant_number(0, "MERCHANT_ID"),//微信特约商户号
wx_special_merchant_number(0, "MERCHANT_ID"),//微信商户号
wx_personal_wechatid(1, "PERSONAL_WECHATID"),//微信号 已不支持
wx_personal_openid(2, "PERSONAL_OPENID"),//v2,v3
wx_personal_openid(2, "PERSONAL_OPENID"),//
wx_personal_sub_openid(3, "PERSONAL_SUB_OPENID"),

tt_merchant_number(10,"")//抖音商户号


Загрузка…
Отмена
Сохранить