Pu Zhibing
2025-04-03 1f09f6daaf73bc83cceb4ae22b862b7b365635cf
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java
@@ -54,9 +54,7 @@
    @Resource
    private UserPointCopyMapper userPointCopyMapper;
    @Resource
    private AppUserService appUserService;
    @Resource
    private TokenService tokenService;
    private OrderClient orderClient;
    /**
@@ -131,6 +129,14 @@
    }
    
    
    @DeleteMapping("/deleteUserPointCopyByIds")
    public R deleteUserPointCopyByIds(@RequestParam("ids") List<Long> ids){
        userPointCopyMapper.deleteBatchIds(ids);
        return R.ok();
    }
    @PostMapping("/getUserPointCopy")
    public R<List<UserPointCopy>> getUserPointCopy(@RequestParam("orderId") Long orderId, @RequestParam("type") List<Integer> type) {
        List<UserPointCopy> list = userPointCopyMapper.selectList(new LambdaQueryWrapper<UserPointCopy>().in(UserPointCopy::getType, type)
@@ -157,17 +163,11 @@
        IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint);
        return R.ok(userPointPage);
    }
    @Resource
    private OrderClient orderClient;
    @GetMapping("/user/list")
    @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台")
    public R<Page<UserPoint>> userlist(UserPoint userPoint) {
        Page<UserPoint> page = userPointService.lambdaQuery()
                .eq(userPoint.getType()!=null,UserPoint::getType, userPoint.getType())
                .eq(UserPoint::getAppUserId, userPoint.getAppUserId())
                .orderByDesc(UserPoint::getCreateTime)
                .page(Page.of(userPoint.getPageNum(), userPoint.getPageSize()));
    public R<IPage<UserPoint>> userlist(UserPoint userPoint) {
        IPage<UserPoint> page = userPointService.getUserPointPage(Page.of(userPoint.getPageNum(), userPoint.getPageSize()), userPoint);
        for (UserPoint record : page.getRecords()) {
            if (record.getType()==1 || record.getType()==11){
                Order data = orderClient.getOrderById(record.getObjectId()).getData();
@@ -175,13 +175,10 @@
                    record.setExtention(data.getOrderNumber());
                }
            }
            int i = record.getHistoricalPoint() - record.getBalance();
            if (i>0){
            if (record.getChangeDirection() == -1){
                record.setVariableType(2);
            }else if (i<0){
                record.setVariableType(1);
            }else{
                record.setVariableType(0);
                record.setVariableType(1);
            }
        }
        return R.ok(page);