修复已知问题
This commit is contained in:
@@ -68,9 +68,9 @@ public class PaymentController extends BaseController {
|
||||
|
||||
// 扣除余额
|
||||
final BigDecimal subtract = buyer.getBalance().subtract(order.getTotalPrice());
|
||||
buyer.setBalance(subtract);
|
||||
final BigDecimal multiply = subtract.multiply(new BigDecimal(100));
|
||||
buyer.setBalance(multiply);
|
||||
final boolean updateUser = userService.updateUser(buyer);
|
||||
System.out.println("updateUser = " + updateUser);
|
||||
|
||||
// 记录余额明细
|
||||
UserBalanceLog userBalanceLog = new UserBalanceLog();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserGradeService;
|
||||
import com.gxwebsoft.common.system.entity.UserGrade;
|
||||
import com.gxwebsoft.common.system.param.UserGradeParam;
|
||||
@@ -116,4 +117,16 @@ public class UserGradeController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改用户会员等级表")
|
||||
@PutMapping("/updateGradeId")
|
||||
public ApiResult<?> updateGradeId(@RequestBody UserGrade userGrade) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser != null){
|
||||
if (userGradeService.updateById(userGrade)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserRefereeService;
|
||||
@@ -9,6 +10,7 @@ import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -29,6 +31,8 @@ import java.util.List;
|
||||
public class UserRefereeController extends BaseController {
|
||||
@Resource
|
||||
private UserRefereeService userRefereeService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userReferee:list')")
|
||||
@OperationLog
|
||||
@@ -128,4 +132,11 @@ public class UserRefereeController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@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()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -292,6 +292,10 @@ public class User implements UserDetails {
|
||||
@TableField(exist = false)
|
||||
private MerchantAccount merchantAccount;
|
||||
|
||||
@ApiModelProperty("推荐人用户信息")
|
||||
@TableField(exist = false)
|
||||
private User referee;
|
||||
|
||||
// @ApiModelProperty("企业信息")
|
||||
// @TableField(exist = false)
|
||||
// private Company companyInfo;
|
||||
|
||||
@@ -52,6 +52,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
@Resource
|
||||
private BCryptPasswordEncoder bCryptPasswordEncoder;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private CompanyService companyService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@@ -174,6 +176,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
.ne(User::getUserId, user.getUserId())) > 0) {
|
||||
throw new BusinessException("邮箱已存在");
|
||||
}
|
||||
// 更新用户等级
|
||||
if (user.getGradeId() != null && !user.getGradeId().equals(0)){
|
||||
userService.updateById(user);
|
||||
}
|
||||
boolean result = baseMapper.updateById(user) > 0;
|
||||
if (result && user.getRoles() != null && user.getRoles().size() > 0) {
|
||||
userRoleService.remove(new LambdaUpdateWrapper<UserRole>().eq(UserRole::getUserId, user.getUserId()));
|
||||
|
||||
Reference in New Issue
Block a user