|
@@ -1709,7 +1709,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
wrapper.in("t1.refundStatusNew", Arrays.asList(dto.getRefundStatusNew().split(",")));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
- wrapper.keyword(dto.getKeyword(), new SqlField("t1", Contract::getCode));
|
|
|
+ //归属公司
|
|
|
+ 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.getUserId())) {
|
|
|
+ wrapper.eq("t1", Contract::getCreateUser, dto.getUserId());
|
|
|
}
|
|
|
//根据客户id关联
|
|
|
wrapper.eq(ContractVo::getBuyCorporationId, dto.getCustomerId());
|
|
@@ -1746,6 +1756,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
}
|
|
|
contract.setCreateTimeEn(sdf.format(contract.getCreateTime()));
|
|
|
map.put("contract",contract);
|
|
|
+ QueryWrapper<Contract> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.select("IFNULL(SUM( amount ),0) AS amount").in("id",contractIds);
|
|
|
+ contract.setAmount(contractService.getOne(queryWrapper).getAmount());
|
|
|
//查询合同产品
|
|
|
List<ContractProduct> contractProductList = contractProductService.list(Wrappers.<ContractProduct>query().lambda().in(ContractProduct::getContractId,contractIds));
|
|
|
//查询合同产品
|