| | |
| | | .in(ContractSubjectMatter::getMaterialCode, addDTO.getSubjectMatterList().stream().map(item -> item.getSubjectMatterCode()).collect(Collectors.toList())) |
| | | .exists(Contract.class, contractQuery -> |
| | | contractQuery.select(ContractSubjectMatter::getId) |
| | | .eq(Contract::getContractStatus,2) |
| | | .eq(Contract::getId, ContractSubjectMatter::getContractId) |
| | | .eq(StrUtil.isNotBlank(addDTO.getBusGuestName()), Contract::getPartyA, addDTO.getBusGuestName()) |
| | | .eq(ObjUtil.isNotNull(addDTO.getBusGuestId()), Contract::getPartyAId, addDTO.getBusGuestId()) |
| | |
| | | if (subjectMatter.getDeliveredQuantity().compareTo(new BigDecimal("0")) > 0) { |
| | | remainNum = remainNum.subtract(subjectMatter.getRemainingQuantity()); |
| | | //部分交付状态下 全部出库 |
| | | if (remainNum.compareTo(new BigDecimal("0")) >= 0) { |
| | | if (remainNum.compareTo(new BigDecimal("0")) > 0) { |
| | | BigDecimal currentOut = subjectMatter.getRemainingQuantity(); |
| | | subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity()); |
| | | subjectMatter.setRemainingQuantity(new BigDecimal("0")); |
| | |
| | | } else { |
| | | //未交付状态下 |
| | | remainNum = remainNum.subtract(subjectMatter.getQuantity()); |
| | | if (remainNum.compareTo(new BigDecimal("0")) >= 0) { |
| | | if (remainNum.compareTo(new BigDecimal("0")) > 0) { |
| | | subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity()); |
| | | subjectMatter.setRemainingQuantity(new BigDecimal("0")); |
| | | subjectMatter.setActualDeliveryDate(DateUtil.today()); |
| | |
| | | contractOutBound.setOutBoundAttPaths(addDTO.getOutBoundAttPaths()); |
| | | contractOutBound.setOutBoundId(outBoundId); |
| | | contractOutBound.setInvoiceStatus("0"); |
| | | contractOutBound.setInvoiceNum(new BigDecimal("0")); |
| | | contractOutBoundMapper.insert(contractOutBound); |
| | | if (StrUtil.isEmpty(contract.getContractCategory())){ |
| | | if (DateUtil.compare(addDTO.getOutBoundTime(),contract.getExpirationDate())>0){ |