|
@@ -354,7 +354,13 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
wrapper.le("t1", Contract::getCreateTime, dto.getEndTime());
|
|
|
|
|
|
//产品id过滤
|
|
|
- wrapper.eq("t1.product_id", dto.getProductId());
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getProductId())) {
|
|
|
+ List<Long> contractIds = contractProductService.listObject(ContractProduct::getContractId, q -> q.eq(ContractProduct::getProductId, dto.getProductId()));
|
|
|
+ if (ObjectUtil.isNotEmpty(contractIds)) {
|
|
|
+ contractIds = contractIds.stream().distinct().collect(Collectors.toList());
|
|
|
+ wrapper.in("t1.id", contractIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//是否结清过滤
|
|
|
wrapper.eq("t1", Contract::getIsSettled, dto.getIsSettled());
|