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

[微信分账][升级]:微信分账2020.7.1起不支持微信号,必须换成openid

release_toaliyun_real
Stormeye Wu 6 лет назад
Родитель
Сommit
c3b0cf3d8e
2 измененных файлов: 24 добавлений и 5 удалений
  1. +23
    -4
      mallinkBApi/src/main/java/com/iformall/controller/WxMerchantController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java

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

@@ -2,11 +2,9 @@ package com.iformall.controller;


import com.iformall.common.ErrorCode; import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBuser;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.po.*;
import com.iformall.enums.EnumMsgSend; import com.iformall.enums.EnumMsgSend;
import com.iformall.service.WxCUserService;
import com.iformall.service.WxMerchantService; import com.iformall.service.WxMerchantService;
import com.iformall.service.WxProfitSharingReceiverService; import com.iformall.service.WxProfitSharingReceiverService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@@ -29,6 +27,9 @@ public class WxMerchantController extends BaseController {
@Autowired @Autowired
private WxProfitSharingReceiverService wxProfitSharingReceiverService; private WxProfitSharingReceiverService wxProfitSharingReceiverService;


@Autowired
private WxCUserService cUserService;

@ApiOperation("查询当前租户下商户名称列表") @ApiOperation("查询当前租户下商户名称列表")
@GetMapping("/name_list") @GetMapping("/name_list")
public ResultData nameList() { public ResultData nameList() {
@@ -97,6 +98,24 @@ public class WxMerchantController extends BaseController {
return new ResultData(has); return new ResultData(has);
} }


@ApiOperation("获取微信OpenId")
@GetMapping("/getOpenIdByPhone")
@ApiImplicitParam(name = "phone", value = "商户C端注册手机号", dataType = "String", paramType = "query", required = true)
public ResultData getOpenIdByPhone(@ModelAttribute String phone) {
log.debug("[" + getIpAddr() + "] WxMerchantController::getOpenIdByPhone");
if (!hasPermission()) {
return new ResultData(ErrorCode.USER_NO_PERMISSION);
}
if (StringUtils.isBlank(phone)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户C端注册手机号不能为空");
}
WxCUser cuUser = new WxCUser();
cuUser.updateTenantInfo(getTenantInfo());
cuUser.setPhone(phone);
WxCUser mUser = cUserService.getByObject(cuUser);
return new ResultData(mUser.getOpenId());
}

public boolean hasPermission() { public boolean hasPermission() {
WxMerchantBUser user = getUser(); WxMerchantBUser user = getUser();
WxBuser buser = getBuser(); WxBuser buser = getBuser();


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Просмотреть файл

@@ -81,7 +81,7 @@ public class WxMerchant extends TenantEntity {
} }


@TableField(exist = false) @TableField(exist = false)
@Excel(name="账户类型",width = 20,orderNum = "7",replace = {"_null","商户号_0","微信号_1"})
@Excel(name="账户类型",width = 20,orderNum = "7",replace = {"_null","商户号_0","微信号_1","OPENID_3"})
@io.swagger.annotations.ApiModelProperty(value="账户类型",name="accountTypeValue") @io.swagger.annotations.ApiModelProperty(value="账户类型",name="accountTypeValue")
private Integer accountTypeValue; private Integer accountTypeValue;




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