| | |
| | | import com.dsh.account.entity.RechargeRecords; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.VipPayment; |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | | import com.dsh.account.model.IncomeQuery; |
| | | import com.dsh.account.model.dto.VipPaymentDto; |
| | | import com.dsh.account.model.dto.VipRefundDto; |
| | |
| | | private IVipPaymentService vipPaymentService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @Autowired |
| | | private UserConponClient userConponClient; |
| | | |
| | | |
| | | /** |
| | |
| | | if (parse.before(new Date())){ |
| | | appUser.setIsVip(0); |
| | | } |
| | | vipPayment.setRemark(vipRefundDto.getRemark()); |
| | | appUserService.updateById(appUser); |
| | | vipPayment.setState(3); |
| | | vipPayment.setPayStatus(3); |
| | | vipPaymentService.updateById(vipPayment); |
| | | // 将未使用的门票优惠券设置为已过期 |
| | | userConponClient.setStatusVipDetail(vipPayment.getId()); |
| | | return "200"; |
| | | } |
| | | |
| | |
| | | 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) |