| | |
| | | package com.ruoyi.im.task; |
| | | |
| | | import cn.hutool.core.stream.CollectorUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.im.service.MedicalInsuranceAccountService; |
| | | import com.ruoyi.im.service.UserPolicyService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | |
| | | List<Integer> ids = list.stream() |
| | | .map(UserPolicy::getId) // 提取orderId字段 |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<PaymentRecord> records = paymentRecordService.list(new LambdaQueryWrapper<PaymentRecord>() |
| | | .in(PaymentRecord::getOrderId, ids) |
| | | ); |
| | | |
| | | userPolicyService.removeByIds(list); |
| | | userPolicyService.removeByIds(records); |
| | | if(!CollectionUtils.isEmpty(ids)){ |
| | | List<PaymentRecord> records = paymentRecordService.list(new LambdaQueryWrapper<PaymentRecord>() |
| | | .in(PaymentRecord::getOrderId, ids) |
| | | ); |
| | | paymentRecordService.removeByIds(records); |
| | | } |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | userPolicyService.removeByIds(list); |
| | | } |
| | | } |
| | | } |