| | |
| | | import cn.hutool.core.date.LocalDateTimeUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan.CrmReceivablePlanPageReqVO; |
| | | import cn.iocoder.yudao.module.crm.dal.dataobject.contract.CrmContractDO; |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | return selectCount(query); |
| | | } |
| | | |
| | | /** |
| | | * 查询一批客户的欠费回款计划(未回款 + 已逾期) |
| | | * |
| | | * 口径与 {@link #selectPage(CrmReceivablePlanPageReqVO, Long)} 的「已逾期」一致: |
| | | * receivableId 为空(未回款)且 returnTime 早于当前时间 |
| | | * |
| | | * @param customerIds 客户编号集合 |
| | | * @param now 当前时间(逾期判定时间点) |
| | | * @return 欠费的回款计划列表 |
| | | */ |
| | | default List<CrmReceivablePlanDO> selectOverdueListByCustomerIds(Collection<Long> customerIds, |
| | | LocalDateTime now) { |
| | | return selectList(new LambdaQueryWrapperX<CrmReceivablePlanDO>() |
| | | .in(CrmReceivablePlanDO::getCustomerId, customerIds) |
| | | .isNull(CrmReceivablePlanDO::getReceivableId) // 未回款 |
| | | .lt(CrmReceivablePlanDO::getReturnTime, now)); // 已逾期 |
| | | } |
| | | |
| | | } |