|
@@ -84,8 +84,18 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
|
|
|
IWrapper<ContractProduct> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("t1", ContractProduct::getCreateTime);
|
|
|
wrapper.between("t2", Contract::getStatus, FlowStatusEnum.PASS.getKey(), FlowStatusEnum.CANCELLATION.getKey() - 1);
|
|
|
+ if(ObjectUtil.isNotEmpty(dto.getDataType())&&dto.getDataType()==0){//合同交接单
|
|
|
+ wrapper.ne("t1", ContractProduct::getExpendQuantity, BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(dto.getPurchaseStatus())&&dto.getPurchaseStatus()==2){//已采购
|
|
|
+ wrapper.eq("t1", ContractProduct::getExpendQuantity, BigDecimal.ZERO);
|
|
|
+ }else if(ObjectUtil.isNotEmpty(dto.getPurchaseStatus())&&dto.getPurchaseStatus()==1){//部分采购
|
|
|
+ wrapper.gt("t1", ContractProduct::getExpendQuantity, BigDecimal.ZERO);
|
|
|
+ wrapper.apply("t1.expend_quantity <t1.quantity");
|
|
|
+ }else if(ObjectUtil.isNotEmpty(dto.getPurchaseStatus())&&dto.getPurchaseStatus()==0){//未采购
|
|
|
+ wrapper.apply("t1.expend_quantity = t1.quantity");
|
|
|
+ }
|
|
|
wrapper.eq("t2",Contract::getIssue,1);
|
|
|
- wrapper.ne("t1", ContractProduct::getExpendQuantity, BigDecimal.ZERO);
|
|
|
if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t2.`code`"), new SqlField("t2.`user_name`"));
|
|
|
}
|