| | |
| | | import com.ruoyi.business.mapper.PurchaseRegistrationMapper; |
| | | import com.ruoyi.business.service.PurchaseRegistrationService; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | .map(CoalInfo::getId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // 组装查询条件:煤种ID在匹配的列表中 或 供应商名称匹配 |
| | | // 组装查询条件:煤种ID在匹配的列表中 |
| | | queryWrapper.and(w -> { |
| | | if (!matchedCoalIds.isEmpty()) { |
| | | w.in(PurchaseRegistration::getCoalId, matchedCoalIds).or(); |
| | | } |
| | | w.like(PurchaseRegistration::getSupplierName, keyword); |
| | | }); |
| | | queryWrapper.and(wapper -> { |
| | | if (StringUtils.isEmpty(dto.getStartDateStr()) && StringUtils.isEmpty(dto.getEndDateStr())) { |
| | | wapper.ge(PurchaseRegistration::getRegistrationDate, DateUtils.dateTime("yyyy-MM-dd", dto.getStartDateStr())) |
| | | .le(PurchaseRegistration::getRegistrationDate, DateUtils.dateTime("yyyy-MM-dd", dto.getEndDateStr())); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | |
| | | queryWrapper.orderByDesc(PurchaseRegistration::getCreateTime); |