修复已知问题
This commit is contained in:
@@ -68,8 +68,8 @@ public class PaymentController extends BaseController {
|
||||
|
||||
// 扣除余额
|
||||
final BigDecimal subtract = buyer.getBalance().subtract(order.getTotalPrice());
|
||||
final BigDecimal multiply = subtract.multiply(new BigDecimal(100));
|
||||
buyer.setBalance(multiply);
|
||||
// final BigDecimal multiply = subtract.multiply(new BigDecimal(100));
|
||||
buyer.setBalance(subtract);
|
||||
final boolean updateUser = userService.updateUser(buyer);
|
||||
|
||||
// 记录余额明细
|
||||
@@ -91,11 +91,11 @@ public class PaymentController extends BaseController {
|
||||
transaction.setTransactionId(order.getOrderNo());
|
||||
final TransactionAmount amount = new TransactionAmount();
|
||||
// 计算金额
|
||||
// BigDecimal decimal = order.getTotalPrice();
|
||||
// final BigDecimal multiply = decimal.multiply(new BigDecimal(100));
|
||||
// // 将 BigDecimal 转换为 Integer
|
||||
// Integer money = multiply.intValue();
|
||||
amount.setTotal(order.getPayPrice().intValue());
|
||||
BigDecimal decimal = order.getTotalPrice();
|
||||
final BigDecimal multiply = decimal.multiply(new BigDecimal(100));
|
||||
// 将 BigDecimal 转换为 Integer
|
||||
Integer money = multiply.intValue();
|
||||
amount.setTotal(money);
|
||||
amount.setCurrency("CNY");
|
||||
transaction.setAmount(amount);
|
||||
// 获取支付配置信息用于解密
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
@@ -134,9 +135,24 @@ public class UserRefereeController extends BaseController {
|
||||
|
||||
@ApiOperation("查询推荐人信息")
|
||||
@GetMapping("/getReferee/{id}")
|
||||
public ApiResult<User> getUserAndReferee(@PathVariable("id") Integer id) {
|
||||
final UserReferee referee = userRefereeService.getOne(new LambdaQueryWrapper<UserReferee>().eq(UserReferee::getDealerId, id));
|
||||
return success(userService.getByIdRel(referee.getUserId()));
|
||||
public ApiResult<User> getReferee(@PathVariable("id") Integer id) {
|
||||
if(id == null){
|
||||
return fail("参数错误",null);
|
||||
}
|
||||
|
||||
final UserReferee referee = userRefereeService.getOne(new LambdaQueryWrapper<UserReferee>()
|
||||
.eq(UserReferee::getUserId, id)
|
||||
.eq(UserReferee::getDeleted,0));
|
||||
|
||||
if (ObjectUtil.isEmpty(referee)) {
|
||||
return fail("查询失败",null);
|
||||
}
|
||||
|
||||
final User user = userService.getByIdRel(referee.getDealerId());
|
||||
if (ObjectUtil.isNotEmpty(user)) {
|
||||
return success(user);
|
||||
}
|
||||
return fail("查询失败",null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,6 +143,9 @@ public class WxLoginController extends BaseController {
|
||||
addUser.setNickname("微信用户");
|
||||
addUser.setPlatform(MP_WEIXIN);
|
||||
addUser.setGradeId(2);
|
||||
if(userParam.getGradeId() != null){
|
||||
addUser.setGradeId(userParam.getGradeId());
|
||||
}
|
||||
if(userParam.getPhone() != null){
|
||||
addUser.setPhone(userParam.getPhone());
|
||||
}
|
||||
@@ -201,7 +204,7 @@ public class WxLoginController extends BaseController {
|
||||
// 微信用户的手机号码
|
||||
final String phoneNumber = phoneInfo.getString("phoneNumber");
|
||||
// 验证手机号码
|
||||
if(!Validator.isMobile(phoneNumber)){
|
||||
if(userParam.getNotVerifyPhone() == null && !Validator.isMobile(phoneNumber)){
|
||||
String key = ACCESS_TOKEN_KEY.concat(":").concat(getTenantId().toString());
|
||||
redisTemplate.delete(key);
|
||||
throw new BusinessException("手机号码格式不正确");
|
||||
|
||||
@@ -235,6 +235,10 @@ public class UserParam extends BaseParam {
|
||||
@ApiModelProperty("unionid")
|
||||
private String unionid;
|
||||
|
||||
@ApiModelProperty(value = "不验证手机号码真实性")
|
||||
@TableField(exist = false)
|
||||
private Boolean notVerifyPhone;
|
||||
|
||||
@ApiModelProperty(value = "可管理的商户")
|
||||
@QueryField(type = QueryType.LIKE)
|
||||
private String merchants;
|
||||
|
||||
@@ -241,6 +241,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
addUser.setNickname(DesensitizedUtil.mobilePhone(userParam.getPhone()));
|
||||
addUser.setPlatform(WEB);
|
||||
addUser.setGradeId(2);
|
||||
if(userParam.getGradeId() != null){
|
||||
addUser.setGradeId(userParam.getGradeId());
|
||||
}
|
||||
if(userParam.getPhone() != null){
|
||||
addUser.setPhone(userParam.getPhone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user