商家版注册与登录接口
This commit is contained in:
parent
6400672c49
commit
f10674ecb1
@ -3,6 +3,7 @@ package com.suisung.mall.account.controller;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.account.service.AccountUserBaseService;
|
||||
import com.suisung.mall.account.service.AccountUserInfoService;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
@ -18,10 +19,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -179,10 +177,8 @@ public class LoginController extends BaseControllerImpl {
|
||||
|
||||
@ApiOperation(value = "商家版注册与登录")
|
||||
@RequestMapping(value = "/doMerchSmsRegisterAndLogin", method = RequestMethod.POST)
|
||||
public CommonResult doMerchSmsRegisterAndLogin(@RequestParam(name = "user_mobile") String user_mobile,
|
||||
@RequestParam(name = "rand_key", required = false) String rand_key,
|
||||
@RequestParam(name = "verify_code") String verify_code) {
|
||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(user_mobile, rand_key, verify_code);
|
||||
public CommonResult doMerchSmsRegisterAndLogin(@RequestBody JSONObject paramJSON) {
|
||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"), paramJSON.getStr("rand_key"), paramJSON.getStr("verify_code"));
|
||||
}
|
||||
|
||||
@ApiOperation("退出登录")
|
||||
|
||||
@ -55,35 +55,26 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
@RequestMapping("/mobile/account/user")
|
||||
public class UserController extends BaseControllerImpl {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(UserController.class);
|
||||
@Autowired
|
||||
private AccountUserBaseService accountUserBaseService;
|
||||
|
||||
@Autowired
|
||||
private AccountBaseRoleLevelService accountBaseRoleLevelService;
|
||||
|
||||
@Autowired
|
||||
private AccountBaseUserLevelService accountBaseUserLevelService;
|
||||
|
||||
@Autowired
|
||||
private PayService payService;
|
||||
|
||||
@Autowired
|
||||
private ShopService shopService;
|
||||
|
||||
@Autowired
|
||||
private AccountUserSnsService accountUserSnsService;
|
||||
|
||||
@Autowired
|
||||
private AccountBaseConfigService accountBaseConfigService;
|
||||
|
||||
@Autowired
|
||||
private AccountUserInfoService accountUserInfoService;
|
||||
|
||||
@Autowired
|
||||
private ThreadPoolExecutor executor;
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(UserController.class);
|
||||
|
||||
/**
|
||||
* 用户基本信息管理界面
|
||||
*
|
||||
@ -275,17 +266,15 @@ public class UserController extends BaseControllerImpl {
|
||||
@RequestParam(name = "email", required = false) String email) {
|
||||
|
||||
// 2024-12-12 update
|
||||
if(StrUtil.isNotBlank(mobile)) {
|
||||
if(!StrUtil.startWith(mobile, CommonConstant.IDD_ZH_CN)) {
|
||||
if (StrUtil.isNotBlank(mobile)) {
|
||||
if (!StrUtil.startWith(mobile, CommonConstant.IDD_ZH_CN)) {
|
||||
mobile = CommonConstant.IDD_ZH_CN + mobile;
|
||||
}
|
||||
|
||||
if(!PhoneNumberUtils.isValidNumber(mobile)){
|
||||
if (!PhoneNumberUtils.isValidNumber(mobile)) {
|
||||
throw new ApiException(I18nUtil._("请输入正确的手机号!"));
|
||||
}
|
||||
}
|
||||
|
||||
else if (StrUtil.isNotBlank(email) && !CheckUtil.isEmail(email)) {
|
||||
} else if (StrUtil.isNotBlank(email) && !CheckUtil.isEmail(email)) {
|
||||
throw new ApiException(I18nUtil._("请输入正确邮箱格式!"));
|
||||
}
|
||||
|
||||
@ -297,7 +286,7 @@ public class UserController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "获取邮箱验证码找回密码")
|
||||
@RequestMapping(value = "/emailVerifyCode", method = RequestMethod.GET)
|
||||
public CommonResult getEmailMobileVerifyCode(@RequestParam(name = "mobile", required = false) String mobile,
|
||||
@RequestParam(name = "email", required = false) String email) {
|
||||
@RequestParam(name = "email", required = false) String email) {
|
||||
if (StrUtil.isNotBlank(mobile) && !PhoneUtil.isMobile(mobile)) {
|
||||
throw new ApiException(I18nUtil._("请输入正确的手机号!"));
|
||||
}
|
||||
|
||||
@ -202,11 +202,15 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
|
||||
data.put("callback_url", "");
|
||||
|
||||
if (params.get("is_merch") != null && params.get("is_merch").equals("1")) {
|
||||
if (StrUtil.isNotBlank(params.get("user_mobile"))
|
||||
&& StrUtil.isNotBlank(params.get("is_merch"))
|
||||
&& params.get("is_merch").equals("1")) {
|
||||
// 商家版app,显示申请入驻的状态
|
||||
data.put("is_merch", 1);
|
||||
//入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
data.put("merch_approval_status", 4);
|
||||
Map<String, Object> params2 = new HashMap<>();
|
||||
params2.put("user_mobile", params.get("user_mobile"));
|
||||
data.put("merch_approval_status", shopService.shopMerchEntryApprovalStatus(params2));
|
||||
}
|
||||
|
||||
return restResult;
|
||||
@ -1792,42 +1796,48 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
}
|
||||
// todo trigger
|
||||
// User_Resource初始化
|
||||
if (!payService.initUserPoints(user_id)) {
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
// 初始化用户经验表
|
||||
if (!accountUserInfoService.initUserExperience(user_id)) {
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
// 判断微信h5传递的活动id
|
||||
Integer activity_id = Convert.toInt(userInfo.get("activity_id"));
|
||||
|
||||
// 分销用户来源 - 平台推广员功能,佣金平台出
|
||||
// 修改用户上级关系
|
||||
Integer user_parent_id = getSourceUserId();
|
||||
if (CheckUtil.isNotEmpty(user_parent_id)) {
|
||||
AccountUserBase accountUserBase = get(user_parent_id);
|
||||
if (accountUserBase != null) {
|
||||
addSourceUserId(user_id, user_parent_id);
|
||||
// 远程调用异常忽略掉
|
||||
try {
|
||||
// todo trigger
|
||||
// User_Resource初始化
|
||||
if (!payService.initUserPoints(user_id)) {
|
||||
// throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
//todo 分享券
|
||||
// 分享券活动id
|
||||
Integer activityId = Convert.toInt(getParameter("activity_id"));
|
||||
if (CheckUtil.isEmpty(activityId) && CheckUtil.isNotEmpty(activity_id)) {
|
||||
activityId = Convert.toInt(activity_id);
|
||||
// 初始化用户经验表
|
||||
if (!accountUserInfoService.initUserExperience(user_id)) {
|
||||
// throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
if (CheckUtil.isNotEmpty(activityId)) {
|
||||
// 公钥钥加密处理
|
||||
String userParentId = RSAUtil.encrypt(user_parent_id.toString(), AuthConstant.publicKey);
|
||||
// 远程调用更新并计算发放分享卷
|
||||
shopService.updateCoupons(userParentId, activityId);
|
||||
// 判断微信h5传递的活动id
|
||||
Integer activity_id = Convert.toInt(userInfo.get("activity_id"));
|
||||
|
||||
// 分销用户来源 - 平台推广员功能,佣金平台出
|
||||
// 修改用户上级关系
|
||||
Integer user_parent_id = getSourceUserId();
|
||||
if (CheckUtil.isNotEmpty(user_parent_id)) {
|
||||
AccountUserBase accountUserBase = get(user_parent_id);
|
||||
if (accountUserBase != null) {
|
||||
addSourceUserId(user_id, user_parent_id);
|
||||
}
|
||||
|
||||
//todo 分享券
|
||||
// 分享券活动id
|
||||
Integer activityId = Convert.toInt(getParameter("activity_id"));
|
||||
if (CheckUtil.isEmpty(activityId) && CheckUtil.isNotEmpty(activity_id)) {
|
||||
activityId = Convert.toInt(activity_id);
|
||||
}
|
||||
|
||||
if (CheckUtil.isNotEmpty(activityId)) {
|
||||
// 公钥钥加密处理
|
||||
String userParentId = RSAUtil.encrypt(user_parent_id.toString(), AuthConstant.publicKey);
|
||||
// 远程调用更新并计算发放分享卷
|
||||
shopService.updateCoupons(userParentId, activityId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("用户注册,远程初始化用户周边资料(积分,经验值等)时,发生异常", e);
|
||||
}
|
||||
|
||||
//记录渠道来源
|
||||
@ -2667,7 +2677,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
throw new ApiException(_("缺少必要参数!"));
|
||||
}
|
||||
|
||||
if (!PhoneNumberUtils.isValidNumber(user_mobile)) {
|
||||
if (!PhoneNumberUtils.checkPhoneNumber(user_mobile)) {
|
||||
throw new ApiException(_("请输入正确的手机号!"));
|
||||
}
|
||||
|
||||
@ -2679,10 +2689,16 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
throw new ApiException(_("请输入验证码!"));
|
||||
}
|
||||
|
||||
// rmk 为什么随机数和手机号一致?
|
||||
if (ObjectUtil.notEqual(user_mobile, rand_key)) {
|
||||
throw new ApiException(_("非法数据,或者提交超时,请刷新页面重新提交!"));
|
||||
}
|
||||
|
||||
String verifyMobile = PhoneNumberUtils.convZhPhoneNumber(user_mobile);
|
||||
if (!checkVerifyCode(verifyMobile, verify_code)) {
|
||||
throw new ApiException(_("验证码错误!"));
|
||||
}
|
||||
|
||||
// 找出手机对应的绑定用户
|
||||
// 是否为手机号注册,密码6位随机数
|
||||
return doMobileBindLogin(user_mobile, true);
|
||||
@ -2738,29 +2754,29 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
}
|
||||
|
||||
if (ObjectUtil.notEqual(CommonConstant.USER_TYPE_MCH, accountUserBase.getUser_is_admin())) {
|
||||
// 不是入驻商家的情况
|
||||
// 不是入驻商家的情况,已经有普通用户使用了手机号了,提示已经被注册。
|
||||
throw new ApiException(_("已被注册,请换一个手机号码!"));
|
||||
}
|
||||
} else {
|
||||
// 手机号码未绑定的情况,直接去注册一个账号
|
||||
Map<String, Object> userInfo = new HashMap<>();
|
||||
userInfo.put("user_account", com.suisung.mall.common.utils.StringUtils.genLklOrderNo(4));// 时间 yyyyMMddHHmmss + 4位随机数
|
||||
userInfo.put("user_mobile", user_mobile);
|
||||
// userInfo.put("verify_code", verifyCode);
|
||||
// 密码要随机数
|
||||
String user_password = com.suisung.mall.common.utils.StringUtils.random(6, com.suisung.mall.common.utils.StringUtils.RandomType.STRING);
|
||||
userInfo.put("user_password", user_password);
|
||||
userInfo.put("is_admin", CommonConstant.USER_TYPE_MCH); // 商家入驻注册
|
||||
|
||||
// 注:注册商家账号,都是需要手机号绑定的。
|
||||
accountUserBase = register(userInfo);
|
||||
if (accountUserBase == null) {
|
||||
throw new ApiException(_("账号注册失败!"));
|
||||
}
|
||||
|
||||
// TODO 发送短信通知用户,告知用户随机密码:尊敬的商家用户,你们刚注册账号的账号密码为:" + user_password + ",请妥善保管,以免丢失。
|
||||
}
|
||||
|
||||
// 手机号码未绑定的情况,直接去注册一个账号
|
||||
Map<String, Object> userInfo = new HashMap<>();
|
||||
userInfo.put("user_account", com.suisung.mall.common.utils.StringUtils.genLklOrderNo(4));// 时间 yyyyMMddHHmmss + 4位随机数
|
||||
userInfo.put("user_mobile", user_mobile);
|
||||
// 密码要随机数
|
||||
String user_password = com.suisung.mall.common.utils.StringUtils.random(6, com.suisung.mall.common.utils.StringUtils.RandomType.STRING);
|
||||
userInfo.put("user_password", user_password);
|
||||
userInfo.put("is_admin", CommonConstant.USER_TYPE_MCH); // 商家入驻注册
|
||||
|
||||
// 注:注册商家账号,都是需要手机号绑定的。
|
||||
accountUserBase = register(userInfo);
|
||||
if (accountUserBase == null) {
|
||||
throw new ApiException(_("账号注册失败!"));
|
||||
}
|
||||
|
||||
// TODO 发送短信通知用户,告知用户随机密码:尊敬的商家用户,你们刚注册账号的账号密码为:" + user_password + ",请妥善保管,以免丢失。
|
||||
|
||||
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("client_id", isMerch ? AuthConstant.MCH_CLIENT_ID : AuthConstant.MOBILE_CLIENT_ID);
|
||||
params.put("client_secret", AuthConstant.AUTHORITY_MOBILE_SECRET);
|
||||
@ -2768,6 +2784,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
params.put("verify_pwd", "1001"); // 是否验证密码 1001:不验证;1002:验证(内部登录没有用户明文密码,只能不验证)
|
||||
params.put("username", accountUserBase.getUser_account());
|
||||
params.put("password", "");
|
||||
params.put("user_mobile", user_mobile);
|
||||
params.put("is_merch", "1"); // 是否为商家入驻 1-是;其他-否
|
||||
|
||||
return login(params);
|
||||
|
||||
@ -59,7 +59,15 @@ public class Oauth2ServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||
.scopes("all")
|
||||
.authorizedGrantTypes("password", "refresh_token")
|
||||
.accessTokenValiditySeconds(AuthConstant.ACCESS_TOKEN_VALIDITY_SECONDS)
|
||||
.refreshTokenValiditySeconds(AuthConstant.REFRESH_TOKEN_VALIDITY_SECONDS);
|
||||
.refreshTokenValiditySeconds(AuthConstant.REFRESH_TOKEN_VALIDITY_SECONDS)
|
||||
.and()
|
||||
.withClient(AuthConstant.MCH_CLIENT_ID)// 商家端登录标记
|
||||
.secret(passwordEncoder.encode(AuthConstant.AUTHORITY_MOBILE_SECRET))
|
||||
.scopes("all")
|
||||
.authorizedGrantTypes("password", "refresh_token")
|
||||
.accessTokenValiditySeconds(AuthConstant.ACCESS_TOKEN_VALIDITY_SECONDS)
|
||||
.refreshTokenValiditySeconds(AuthConstant.REFRESH_TOKEN_VALIDITY_SECONDS)
|
||||
;
|
||||
}
|
||||
|
||||
// 用来配置授权以及令牌的访问端点和令牌服务;
|
||||
|
||||
@ -113,7 +113,7 @@ public interface PayService {
|
||||
long getNumWithdraw(@RequestBody Map wrapper);
|
||||
|
||||
@PostMapping(value = "/admin/pay/payController/initUserPoints")
|
||||
boolean initUserPoints(@RequestParam(name = "user_id") Integer user_id);
|
||||
Boolean initUserPoints(@RequestParam(name = "user_id") Integer user_id);
|
||||
|
||||
@PostMapping(value = "/admin/pay/payController/getPayPlantformResource")
|
||||
PayPlantformResource getPayPlantformResource(@RequestParam(name = "plantform_resource_id") Integer plantform_resource_id);
|
||||
|
||||
@ -234,6 +234,7 @@ public interface ShopService {
|
||||
|
||||
/**
|
||||
* 获取店铺的拉卡拉商户号和终端号(仅仅两个字段)
|
||||
*
|
||||
* @param store_id
|
||||
* @return
|
||||
*/
|
||||
@ -270,5 +271,14 @@ public interface ShopService {
|
||||
@GetMapping(value = "/admin/shop/shopController/getWaitPayNum")
|
||||
Long getWaitPayNum(@RequestParam(name = "user_id") Integer user_id);
|
||||
|
||||
/**
|
||||
* 通过手机号mobile获取商家入驻审核状态
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/mobile/shop/merch/approval/status")
|
||||
Long shopMerchEntryApprovalStatus(@RequestBody Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package com.suisung.mall.common.utils.phone;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
import com.google.i18n.phonenumbers.Phonenumber;
|
||||
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@ -47,6 +49,16 @@ public class PhoneNumberUtils {
|
||||
return checkPhoneNumber(COUNTRY_CODE_CHINA, phoneNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果手机号码不带国家码,转换中国大陆区号86的手机号码
|
||||
*
|
||||
* @param phoneNumber
|
||||
* @return
|
||||
*/
|
||||
public static String convZhPhoneNumber(String phoneNumber) {
|
||||
return StrUtil.startWith(phoneNumber, "+") ? phoneNumber : CommonConstant.IDD_ZH_CN + phoneNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断手机号是否有效(国际)
|
||||
*
|
||||
|
||||
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderReturn;
|
||||
import com.suisung.mall.common.modules.pay.*;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import com.suisung.mall.common.utils.MybatisPlusQueryUtil;
|
||||
import com.suisung.mall.pay.service.*;
|
||||
import io.seata.core.context.RootContext;
|
||||
@ -37,35 +36,26 @@ import java.util.Map;
|
||||
@RequestMapping("/admin/pay/payController")
|
||||
public class PayController {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(PayController.class);
|
||||
@Autowired
|
||||
private PayUserResourceService payUserResourceService;
|
||||
|
||||
@Autowired
|
||||
private PayConsumeDepositService payConsumeDepositService;
|
||||
|
||||
@Autowired
|
||||
private PayPaymentChannelService payPaymentChannelService;
|
||||
|
||||
@Autowired
|
||||
private PayUserBankCardService payUserBankCardService;
|
||||
|
||||
@Autowired
|
||||
private PayConsumeWithdrawService payConsumeWithdrawService;
|
||||
|
||||
@Autowired
|
||||
private PayConsumeTradeService payConsumeTradeService;
|
||||
|
||||
@Autowired
|
||||
private PayConsumeRecordService payConsumeRecordService;
|
||||
|
||||
@Autowired
|
||||
private PayPlantformResourceService payPlantformResourceService;
|
||||
|
||||
@Autowired
|
||||
private PayUserPayService payUserPayService;
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(PayController.class);
|
||||
|
||||
@ApiOperation(value = "根据user_id 删除门店顾客关系数据", notes = "根据user_id 删除门店顾客关系数据")
|
||||
@RequestMapping(value = "/deleteUserChainByUid", method = RequestMethod.POST)
|
||||
@GlobalTransactional
|
||||
@ -247,7 +237,7 @@ public class PayController {
|
||||
} catch (TransactionException ex) {
|
||||
logger.error("seata 事务异常!");
|
||||
}
|
||||
return CommonResult.failed(e.getMessage());
|
||||
return CommonResult.failed(e.getMessage());
|
||||
}
|
||||
return CommonResult.success();
|
||||
}
|
||||
@ -266,28 +256,28 @@ public class PayController {
|
||||
} catch (TransactionException ex) {
|
||||
logger.error("seata 事务异常!");
|
||||
}
|
||||
return CommonResult.failed(e.getMessage());
|
||||
return CommonResult.failed(e.getMessage());
|
||||
}
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getOrderNum", method = RequestMethod.POST)
|
||||
public long getOrderNum(@RequestParam(name = "order_state_id", required = false) Integer order_state_id,
|
||||
@RequestParam(name = "store_id", required = false) Integer store_id,
|
||||
@RequestParam(name = "chain_id", required = false) Integer chain_id,
|
||||
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
||||
@RequestParam(name = "month_flag", required = false) Integer month_flag,
|
||||
@RequestParam(name = "trade_type_id", required = false) Integer trade_type_id,
|
||||
@RequestParam(name = "subsite_id", required = false) Integer subsite_id) {
|
||||
@RequestParam(name = "store_id", required = false) Integer store_id,
|
||||
@RequestParam(name = "chain_id", required = false) Integer chain_id,
|
||||
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
||||
@RequestParam(name = "month_flag", required = false) Integer month_flag,
|
||||
@RequestParam(name = "trade_type_id", required = false) Integer trade_type_id,
|
||||
@RequestParam(name = "subsite_id", required = false) Integer subsite_id) {
|
||||
return payConsumeTradeService.getOrderNum(order_state_id, store_id, chain_id, day_flag, month_flag, trade_type_id, subsite_id);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getOrderPaymentAmount", method = RequestMethod.POST)
|
||||
public BigDecimal getOrderPaymentAmount(@RequestParam(name = "trade_is_paid", required = false) Integer trade_is_paid,
|
||||
@RequestParam(name = "store_id", required = false) Integer store_id,
|
||||
@RequestParam(name = "subsite_id", required = false) Integer subsite_id,
|
||||
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
||||
@RequestParam(name = "month_flag", required = false) Integer month_flag) {
|
||||
@RequestParam(name = "store_id", required = false) Integer store_id,
|
||||
@RequestParam(name = "subsite_id", required = false) Integer subsite_id,
|
||||
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
||||
@RequestParam(name = "month_flag", required = false) Integer month_flag) {
|
||||
return payConsumeTradeService.getOrderPaymentAmount(trade_is_paid, store_id, subsite_id, day_flag, month_flag);
|
||||
}
|
||||
|
||||
@ -311,8 +301,8 @@ public class PayController {
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "初始化用户积分表", notes = "初始化用户积分表")
|
||||
@RequestMapping(value = "/initUserPoints", method = RequestMethod.POST)
|
||||
public boolean initUserPoints(@RequestParam(name = "user_id") Integer user_id) {
|
||||
boolean flag = false;
|
||||
public Boolean initUserPoints(@RequestParam(name = "user_id") Integer user_id) {
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = payUserResourceService.initUserPoints(user_id);
|
||||
} catch (Exception e) {
|
||||
@ -320,8 +310,10 @@ public class PayController {
|
||||
GlobalTransactionContext.reload(RootContext.getXID()).rollback();
|
||||
} catch (TransactionException ex) {
|
||||
logger.error("seata 事务异常!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@ -372,7 +364,7 @@ public class PayController {
|
||||
@ApiOperation(value = "微信退款", notes = "微信退款")
|
||||
@RequestMapping(value = "/wxPayRefund", method = RequestMethod.POST)
|
||||
public ShopOrderReturn wxPayRefund(@RequestBody ShopOrderReturn orderReturn) {
|
||||
return payUserPayService.wxPayRefund(orderReturn);
|
||||
return payUserPayService.wxPayRefund(orderReturn);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "支付宝退款", notes = "支付宝退款")
|
||||
|
||||
@ -54,4 +54,11 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
||||
approvalStatusList.add(3);
|
||||
return shopMerchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), approvalStatusList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态")
|
||||
@RequestMapping(value = "/approval/status", method = RequestMethod.POST)
|
||||
public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) {
|
||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
return shopMerchEntryService.shopMerchEntryApprovalStatus(jsonParam.getStr("mobile"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,4 +69,13 @@ public interface ShopMerchEntryService {
|
||||
* @return
|
||||
*/
|
||||
Boolean isApplied(String mobile, String bizLicenseNumber);
|
||||
|
||||
/**
|
||||
* 获取商家入驻审核状态
|
||||
* approval_status 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
*
|
||||
* @param loginMobile
|
||||
* @return
|
||||
*/
|
||||
Integer shopMerchEntryApprovalStatus(String loginMobile);
|
||||
}
|
||||
|
||||
@ -315,4 +315,28 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
||||
|
||||
return count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商家入驻审核状态
|
||||
* approval_status 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||
*
|
||||
* @param loginMobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer shopMerchEntryApprovalStatus(String loginMobile) {
|
||||
if (StrUtil.isBlank(loginMobile)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("login_mobile", loginMobile).orderByAsc("id");
|
||||
|
||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
return recordList.get(0).getApproval_status();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user