会员积分问题修复
This commit is contained in:
@@ -47,8 +47,8 @@ public class UMemberPointsController {
|
||||
*/
|
||||
@GetMapping("myPoints")
|
||||
public CzgResult<MemberPoints> getMemberPoints() {
|
||||
long userId = StpKit.USER.getLoginIdAsLong();
|
||||
MemberPoints data = memberPointsService.getMemberPoints(userId);
|
||||
long shopUserId = StpKit.USER.getLoginIdAsLong();
|
||||
MemberPoints data = memberPointsService.getMemberPoints(shopUserId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class UMemberPointsController {
|
||||
* @param orderAmount 订单金额
|
||||
*/
|
||||
@GetMapping("calcUsablePoints")
|
||||
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam("userId") Long shopUserId, @RequestParam BigDecimal orderAmount) {
|
||||
public CzgResult<OrderDeductionPointsDTO> getMemberUsablePoints(@RequestParam Long shopUserId, @RequestParam BigDecimal orderAmount) {
|
||||
OrderDeductionPointsDTO usablePoints = memberPointsService.getMemberUsablePoints(shopUserId, orderAmount);
|
||||
return CzgResult.success(usablePoints);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class UMemberPointsController {
|
||||
* @param deductionAmount 抵扣金额
|
||||
*/
|
||||
@GetMapping("calcUsedPoints")
|
||||
public CzgResult<Integer> calcUsedPoints(@RequestParam("userId") Long shopUserId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
||||
public CzgResult<Integer> calcUsedPoints(@RequestParam Long shopUserId, @RequestParam BigDecimal orderAmount, @RequestParam BigDecimal deductionAmount) {
|
||||
int points = memberPointsService.calcUsedPoints(shopUserId, orderAmount, deductionAmount);
|
||||
return CzgResult.success(points);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class UMemberPointsController {
|
||||
* @param points 使用积分
|
||||
*/
|
||||
@GetMapping("calcDeductionAmount")
|
||||
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam("userId") Long shopUserId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
||||
public CzgResult<BigDecimal> calcDeductionAmount(@RequestParam Long shopUserId, @RequestParam BigDecimal orderAmount, @RequestParam Integer points) {
|
||||
BigDecimal deductionAmount = memberPointsService.calcDeductionAmount(shopUserId, orderAmount, points);
|
||||
return CzgResult.success(deductionAmount);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.czg.account.dto.shopuser.ShopUserAddDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserDetailDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserVipCardDTO;
|
||||
import com.czg.account.entity.PointsExchangeRecord;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.czg.account.service.PointsExchangeRecordService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
@@ -105,7 +104,7 @@ public class UShopUserController {
|
||||
@GetMapping("/pointsRecord")
|
||||
public CzgResult<Page<PointsExchangeRecord>> getPointsRecord() {
|
||||
return CzgResult.success(pointsExchangeRecordService.page(PageUtil.buildPage(), new QueryWrapper().eq(PointsExchangeRecord::getShopId, StpKit.USER.getShopId())
|
||||
.eq(PointsExchangeRecord::getUserId, StpKit.USER.getLoginIdAsLong()).orderBy(PointsExchangeRecord::getId, false)));
|
||||
.eq(PointsExchangeRecord::getShopUserId, StpKit.USER.getLoginIdAsLong()).orderBy(PointsExchangeRecord::getId, false)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +115,7 @@ public class UShopUserController {
|
||||
@GetMapping("/pointsRecord/detail")
|
||||
public CzgResult<PointsExchangeRecord> getPointsRecordDetail(@RequestParam Long id) {
|
||||
return CzgResult.success(pointsExchangeRecordService.getOne(new QueryWrapper().eq(PointsExchangeRecord::getShopId, StpKit.USER.getShopId())
|
||||
.eq(PointsExchangeRecord::getUserId, StpKit.USER.getLoginIdAsLong()).eq(PointsExchangeRecord::getId, id)));
|
||||
.eq(PointsExchangeRecord::getShopUserId, StpKit.USER.getLoginIdAsLong()).eq(PointsExchangeRecord::getId, id)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user