|
|
|
|
@ -378,6 +378,32 @@ public class ErpFinInvoiceInfoServiceImpl extends AbstractWorkflowService<ErpFin
|
|
|
|
|
return erpContractPaymentMethodVoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 按合同查询累计回款比例最大的开票单累计回款金额
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public BigDecimal getMaxReturnedMoneyByContractId(Long contractId, Long excludeInvoiceId) {
|
|
|
|
|
if (contractId == null) {
|
|
|
|
|
return ZERO;
|
|
|
|
|
}
|
|
|
|
|
LambdaQueryWrapper<ErpFinInvoiceInfo> qw = Wrappers.lambdaQuery(ErpFinInvoiceInfo.class)
|
|
|
|
|
.eq(ErpFinInvoiceInfo::getContractId, contractId)
|
|
|
|
|
.eq(ErpFinInvoiceInfo::getDelFlag, DataConstants.DEL_FLAG_NORMAL)
|
|
|
|
|
.ne(ErpFinInvoiceInfo::getInvoiceStatus, OAStatusEnum.INVALID.getStatus())
|
|
|
|
|
.isNotNull(ErpFinInvoiceInfo::getReturnedRate)
|
|
|
|
|
.orderByDesc(ErpFinInvoiceInfo::getReturnedRate)
|
|
|
|
|
.orderByDesc(ErpFinInvoiceInfo::getInvoiceId)
|
|
|
|
|
.last("LIMIT 1");
|
|
|
|
|
if (excludeInvoiceId != null) {
|
|
|
|
|
qw.ne(ErpFinInvoiceInfo::getInvoiceId, excludeInvoiceId);
|
|
|
|
|
}
|
|
|
|
|
ErpFinInvoiceInfo invoiceInfo = baseMapper.selectOne(qw);
|
|
|
|
|
if (invoiceInfo == null || invoiceInfo.getReturnedMoney() == null) {
|
|
|
|
|
return ZERO;
|
|
|
|
|
}
|
|
|
|
|
return invoiceInfo.getReturnedMoney();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改发票附件信息
|
|
|
|
|
|