|
@@ -12,6 +12,8 @@ import com.trade.admin.system.security.utils.SecurityUtils;
|
|
|
import com.trade.common.core.page.GridPage;
|
|
|
import com.trade.common.exception.ServiceException;
|
|
|
import com.trade.common.utils.bean.BeanCopyUtils;
|
|
|
+import com.trade.common.utils.uuid.BizNoUtil;
|
|
|
+import com.trade.service.business.separateaccounts.domain.SeparateAccounts;
|
|
|
import com.trade.service.business.separateaccounts.domain.SeparateAccountsInfo;
|
|
|
import com.trade.service.business.separateaccounts.service.SeparateAccountsInfoService;
|
|
|
import com.trade.service.filestorage.entity.BusinessRelateFile;
|
|
@@ -22,6 +24,7 @@ import com.trade.service.finance.disbursement.domain.BillingDisbursement;
|
|
|
import com.trade.service.finance.disbursement.dto.DisbursementSearchDto;
|
|
|
import com.trade.service.finance.disbursement.service.BillingDisbursementService;
|
|
|
import com.trade.service.finance.disbursement.vo.BillingDisbursementPageVo;
|
|
|
+import com.trade.service.finance.paymentcollection.domain.BillingIncomeInfo;
|
|
|
import com.trade.service.finance.paymentcollection.domain.PaymentCollectionOperate;
|
|
|
import com.trade.service.finance.paymentcollection.service.PaymentCollectionOperateService;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -85,6 +88,9 @@ public class BBillingDisbursementServiceImpl implements BBillingDisbursementServ
|
|
|
}
|
|
|
String userNickName = SecurityUtils.getUserNickName();
|
|
|
disbursement.setTransactionNumber(confirmedDisbursementDto.getTransactionNumber());
|
|
|
+ disbursement.setPaymentDate(confirmedDisbursementDto.getPaymentDate());
|
|
|
+ disbursement.setVoucherNo(confirmedDisbursementDto.getVoucherNo());
|
|
|
+ disbursement.setAccountNumber(confirmedDisbursementDto.getAccountNumber());
|
|
|
PaymentCollectionOperate paymentCollectionOperate = paymentCollectionOperateService
|
|
|
.getBusinessInfo(disbursement.getId(), 2);
|
|
|
if (paymentCollectionOperate != null) {
|
|
@@ -108,6 +114,7 @@ public class BBillingDisbursementServiceImpl implements BBillingDisbursementServ
|
|
|
businessRelateFile.setFileType(FileTypeEnum.DISBURSEMENT_ENTRY.getCode());
|
|
|
businessRelateFileBaseService.addBusinessRelateFiles(Collections.singletonList(businessRelateFile));
|
|
|
}
|
|
|
+ disbursement.setStatus(BillingConstant.DISBURSEMENT_STATUS_CONFIRMED);
|
|
|
return billingDisbursementService.save(disbursement);
|
|
|
}
|
|
|
|
|
@@ -147,4 +154,52 @@ public class BBillingDisbursementServiceImpl implements BBillingDisbursementServ
|
|
|
}
|
|
|
return billingDisbursementDetail;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public BillingDisbursementDetail queryDetailV2(Long id) {
|
|
|
+ BillingDisbursement billingDisbursement = billingDisbursementService.getById(id);
|
|
|
+ if (billingDisbursement == null) {
|
|
|
+ throw new ServiceException("出账记录不存在");
|
|
|
+ }
|
|
|
+ BillingDisbursementDetail billingDisbursementDetail = new BillingDisbursementDetail();
|
|
|
+ billingDisbursementDetail.setBillingDisbursement(billingDisbursement);
|
|
|
+ businessRelateFileBaseService.fillBizObjFiles(billingDisbursementDetail, billingDisbursement.getId(),
|
|
|
+ BillingConstant.PAYMENT_VOUCHER, FileTypeEnum.DISBURSEMENT_ENTRY.getCode());
|
|
|
+ PaymentCollectionOperate paymentCollectionOperate = paymentCollectionOperateService
|
|
|
+ .getBusinessInfo(billingDisbursement.getId(), 2);
|
|
|
+ billingDisbursementDetail.setPaymentCollectionOperate(paymentCollectionOperate);
|
|
|
+ SeparateAccountsInfo separateAccountsInfo = separateAccountsInfoService
|
|
|
+ .getById(billingDisbursement.getSeparateAccountsInfoId());
|
|
|
+ if (separateAccountsInfo != null) {
|
|
|
+ BankAccountDto receivePaymentAccount = new BankAccountDto();
|
|
|
+ receivePaymentAccount.setAccountNumber(separateAccountsInfo.getAccountNumber());
|
|
|
+ receivePaymentAccount.setAccountName(separateAccountsInfo.getAccountName());
|
|
|
+ receivePaymentAccount.setOpeningBank(separateAccountsInfo.getOpeningBank());
|
|
|
+ billingDisbursementDetail.setPaymentAccount(receivePaymentAccount);
|
|
|
+ }
|
|
|
+ return billingDisbursementDetail;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean saveBillingDisbursement(SeparateAccounts separateAccounts, SeparateAccountsInfo separateAccountsInfo,
|
|
|
+ String operator) {
|
|
|
+ BillingDisbursement billingDisbursement = BeanCopyUtils.copy(separateAccounts, BillingDisbursement.class);
|
|
|
+ billingDisbursement.setId(null);
|
|
|
+ billingDisbursement.setSeparateAccountsInfoId(separateAccountsInfo.getId());
|
|
|
+ billingDisbursement.setEntryBusinessNumber(separateAccounts.getBusinessNumber());
|
|
|
+ billingDisbursement.setPaymentAmount(separateAccountsInfo.getLedgerAmount());
|
|
|
+ billingDisbursement.setPaymentCurrency(separateAccountsInfo.getLedgerCurrency());
|
|
|
+ // billingDisbursement.setPaymentDate(paymentBasicInfo.getPaymentDate());
|
|
|
+ billingDisbursement.setStatus(BillingConstant.DISBURSEMENT_STATUS_UNCONFIRMED);
|
|
|
+ billingDisbursement.setPaymentType(separateAccountsInfo.getLedgerType());
|
|
|
+ billingDisbursement
|
|
|
+ .setBusinessNumber(BizNoUtil.generateBusinessNumber(separateAccounts.getBusinessNumber(), 2));
|
|
|
+ billingDisbursementService.save(billingDisbursement);
|
|
|
+ PaymentCollectionOperate paymentCollectionOperate = new PaymentCollectionOperate(billingDisbursement.getId(),
|
|
|
+ 2);
|
|
|
+ paymentCollectionOperate.setApplicant(operator);
|
|
|
+ paymentCollectionOperate.setApplyDate(LocalDateTime.now());
|
|
|
+ paymentCollectionOperateService.save(paymentCollectionOperate);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|