diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java index bb67a7a27..6c4383629 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java @@ -420,10 +420,15 @@ public class ContractManageApplicationService { if(null == contractManagePO){ if(contractType==1){ //仓储合同 - resultContract = contractManagePOList.stream().filter(item -> item.getContractType()==1).findFirst().orElse(null); + resultContract = contractManagePOList.stream() + .filter(item -> + item.getContractType()==1 && + item.getCommonContractFlag() == 1 && item.getContractState() ==2) + .findFirst().orElse(null); }else{ //运输合同 - resultContract = contractManagePOList.stream().filter(item -> item.getContractType()==2).findFirst().orElse(null); + resultContract = contractManagePOList.stream().filter(item -> item.getContractType()==2 + && item.getCommonContractFlag() == 1 && item.getContractState() ==2).findFirst().orElse(null); } }else { resultContract = contractManagePO; @@ -431,10 +436,12 @@ public class ContractManageApplicationService { }else { if(contractType==1){ //仓储合同 - resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==1).findFirst().orElse(null); + resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==1 + && contractManagePO.getCommonContractFlag() == 1 && contractManagePO.getContractState() ==2).findFirst().orElse(null); }else{ //运输合同 - resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==2).findFirst().orElse(null); + resultContract = contractManagePOList.stream().filter(contractManagePO -> contractManagePO.getContractType()==2 + && contractManagePO.getCommonContractFlag() == 1 && contractManagePO.getContractState() ==2).findFirst().orElse(null); } } if(null == resultContract){