|
@@ -11,6 +11,7 @@ import com.fjhx.common.service.contract.ContractTemplateService;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
+import com.fjhx.item.entity.product.po.ProductInfo;
|
|
|
import com.fjhx.item.service.product.ProductClassifyService;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
|
|
@@ -92,6 +93,8 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
|
|
|
wrapper.isNull("co.id");
|
|
|
}
|
|
|
}
|
|
|
+ //下发交接单过滤
|
|
|
+ wrapper.eq("t2", Contract::getIssue, 1);
|
|
|
return commPage(wrapper, dto);
|
|
|
}
|
|
|
|
|
@@ -120,12 +123,20 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
|
|
|
} 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){//未采购
|
|
|
+ } else if (ObjectUtil.isNotEmpty(dto.getPurchaseStatus()) && dto.getPurchaseStatus() == 0) {//未采购
|
|
|
wrapper.apply("t1.expend_quantity = t1.quantity");
|
|
|
}
|
|
|
- wrapper.eq("t2",Contract::getIssue,1);
|
|
|
if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
- wrapper.keyword(dto.getKeyword(), new SqlField("t2.`code`"), new SqlField("t2.`user_name`"));
|
|
|
+ List<Long> pids = productInfoService.listObject(ProductInfo::getId, q -> q
|
|
|
+ .like(ProductInfo::getCode, dto.getKeyword())
|
|
|
+ .or().like(ProductInfo::getName, dto.getKeyword())
|
|
|
+ .or().like(ProductInfo::getSpec, dto.getKeyword())
|
|
|
+ );
|
|
|
+ wrapper.and(q -> q
|
|
|
+ .like("t2.`code`", dto.getKeyword())
|
|
|
+ .or().like("t2.`user_name`", dto.getKeyword())
|
|
|
+ .or().in(ContractProductVo::getProductId, pids)
|
|
|
+ );
|
|
|
}
|
|
|
//所属公司id过滤
|
|
|
if (ObjectUtil.isNotEmpty(dto.getCorporationId())) {
|