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