无关风月
22 小时以前 27ce12d3ed00ed5d70ce785653a16db092c3ef88
cloud-server-account/src/main/java/com/dsh/account/controller/FinanceController.java
@@ -118,19 +118,23 @@
        List<VipPaymentListVO> vipPaymentListVOS = new ArrayList<>();
        List<Integer> payStatus = new ArrayList<>();
        payStatus.add(2);
        LambdaQueryWrapper<VipPayment> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>();
        vipPaymentLambdaQueryWrapper.in(vipPaymentDto.getUserIds()!=null&&!vipPaymentDto.getUserIds().isEmpty(),VipPayment::getAppUserId, vipPaymentDto.getUserIds());
        vipPaymentLambdaQueryWrapper.in(vipPaymentDto.getVipIds()!=null&&!vipPaymentDto.getVipIds().isEmpty(),VipPayment::getVipId, vipPaymentDto.getVipIds());
        vipPaymentLambdaQueryWrapper.in(VipPayment::getPayStatus,payStatus);
        vipPaymentLambdaQueryWrapper.ge(StringUtils.hasLength(vipPaymentDto.getStartTime()), VipPayment::getInsertTime, vipPaymentDto.getStartTime());
        vipPaymentLambdaQueryWrapper.le(StringUtils.hasLength(vipPaymentDto.getEndTime()), VipPayment::getInsertTime, vipPaymentDto.getEndTime());
        if (vipPaymentDto.getIsRefund()==null){
            payStatus.add(3);
            payStatus.add(2);
        }
        if (vipPaymentDto.getIsRefund()!=null&&vipPaymentDto.getIsRefund()==1){
            payStatus.add(3);
        }
        if (vipPaymentDto.getIsRefund()!=null&&vipPaymentDto.getIsRefund()==2){
            payStatus.add(2);
        }
        vipPaymentLambdaQueryWrapper.in(VipPayment::getPayStatus,payStatus);
        vipPaymentLambdaQueryWrapper.orderByDesc(VipPayment::getInsertTime);
        List<VipPayment> list = vipPaymentService.list(vipPaymentLambdaQueryWrapper);
        // 使用 Stream + 手动拷贝提升性能和可读性(或使用 MapStruct)