|
@@ -257,16 +257,22 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
if (StringUtils.isNotEmpty(dto.getStatus())) {
|
|
|
wrapper.eq("t1", Contract::getStatus, dto.getStatus());
|
|
|
}
|
|
|
-
|
|
|
+ if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
+ //归属公司
|
|
|
+ List<Long> corporationIds = corporationService.listObject(Corporation::getId, q -> q.like(Corporation::getName, dto.getKeyword()));
|
|
|
+ List<Long> customerIds = customerService.listObject(Customer::getId, q -> q.like(Customer::getName, dto.getKeyword()));
|
|
|
+ wrapper.and(q -> q
|
|
|
+ .like("t1", Contract::getCode, dto.getKeyword())
|
|
|
+ .or().in("t1", Contract::getSellCorporationId, corporationIds)
|
|
|
+ .or().in("t1", Contract::getBuyCorporationId, customerIds)
|
|
|
+ );
|
|
|
+ }
|
|
|
if (StringUtils.isNotEmpty(dto.getSellCorporationId())) {
|
|
|
wrapper.eq("t1", Contract::getSellCorporationId, dto.getSellCorporationId());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(dto.getRefundStatusNew())) {
|
|
|
wrapper.in("t1.refund_status", Arrays.asList(dto.getRefundStatusNew().split(",")));
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
- wrapper.keyword(dto.getKeyword(), new SqlField("t1", Contract::getCode));
|
|
|
- }
|
|
|
if (StringUtils.isNotEmpty(dto.getUserId())) {
|
|
|
wrapper.eq("t1", Contract::getCreateUser, dto.getUserId());
|
|
|
}
|
|
@@ -1710,8 +1716,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
//过滤合同类型
|
|
|
wrapper.eq("t1.contract_type", dto.getContractType());
|
|
|
wrapper.groupBy("t1.sell_corporation_id");
|
|
|
- List<ContractVo> list;
|
|
|
- list = baseMapper.getCustomerMoney(wrapper);
|
|
|
+ List<ContractVo> list = baseMapper.getCustomerMoney(wrapper);
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
BigDecimal sumAmount = list.stream().map(ContractVo::getSumAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
|