|
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
-import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
import com.fjhx.common.service.contract.ContractTemplateService;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
@@ -19,7 +18,6 @@ import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
|
|
|
import com.fjhx.purchase.service.purchase.PurchaseDetailService;
|
|
|
import com.fjhx.sale.entity.contract.dto.ContractProductDto;
|
|
|
import com.fjhx.sale.entity.contract.dto.ContractProductSelectDto;
|
|
|
-import com.fjhx.sale.entity.contract.po.Contract;
|
|
|
import com.fjhx.sale.entity.contract.po.ContractProduct;
|
|
|
import com.fjhx.sale.entity.contract.vo.ContractProductVo;
|
|
|
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
|
|
@@ -93,20 +91,20 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
|
|
|
public Page<ContractProductVo> getPage(ContractProductSelectDto dto) {
|
|
|
IWrapper<ContractProduct> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("t1", ContractProduct::getCreateTime);
|
|
|
- wrapper.ne("t1", ContractProduct::getExpendQuantity, 0);
|
|
|
- wrapper.between("t2", Contract::getStatus, FlowStatusEnum1.PASS.getKey(), FlowStatusEnum1.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, 0);
|
|
|
+// wrapper.between("t2", Contract::getStatus, FlowStatusEnum1.PASS.getKey(), FlowStatusEnum1.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);
|
|
|
if (StringUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
wrapper.keyword(dto.getKeyword(), new SqlField("t2.`code`"), new SqlField("t2.`user_name`"));
|
|
|
}
|
|
@@ -121,7 +119,6 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
|
|
|
wrapper.groupBy("t1.id");
|
|
|
Page<ContractProductVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<ContractProductVo> list = page.getRecords();
|
|
|
- List<Long> idList = list.stream().map(ContractProductVo::getId).collect(Collectors.toList());
|
|
|
if (list.size() == 0) {
|
|
|
return page;
|
|
|
}
|