From a27b6bcec4987853f625f2ac70d7606973094b42 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期二, 23 九月 2025 10:59:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
index c7753c2..30e838f 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -138,7 +138,9 @@
*/
@Override
public int updatePaymentRegistration(PaymentRegistration paymentRegistration) {
- TicketRegistration ticketRegistration = ticketRegistrationMapper.selectById(paymentRegistration.getTicketRegistrationId());
+ PaymentRegistration paymentRegistration1 = paymentRegistrationMapper.selectById(paymentRegistration.getId());
+
+ TicketRegistration ticketRegistration = ticketRegistrationMapper.selectById(paymentRegistration.getTicketRegistrationId()==null?paymentRegistration1.getTicketRegistrationId():paymentRegistration.getTicketRegistrationId());
List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper.selectList(new QueryWrapper<PaymentRegistration>()
.eq("ticket_registration_id", paymentRegistration.getTicketRegistrationId()).ne("id", paymentRegistration.getId()));
@@ -367,6 +369,7 @@
public List<PaymentHistoryRecordVo> getPaymentRecordList(Long supplierId) {
List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationMapper.getPaymentRecordList(supplierId);
List<PaymentHistoryRecordVo> result = new ArrayList<>();
+ List<PaymentHistoryRecordVo> newResult = new ArrayList<>();
// 搴斾粯鎬婚噾棰濋噾棰濊绠�
BigDecimal amountTotal = BigDecimal.ZERO;
if(CollectionUtils.isNotEmpty(paymentRecordList)) {
@@ -403,8 +406,20 @@
result.add(paymentHistoryRecordVo);
}
+
+ for (int i = 0; i < result.size(); i++) {
+ PaymentHistoryRecordVo paymentHistoryRecordVo = result.get(i);
+ if (i == 0) {
+ paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo.getInvoiceAmount().subtract(paymentHistoryRecordVo.getCurrentPaymentAmount()));
+ }else {
+ PaymentHistoryRecordVo paymentHistoryRecordVo1 = result.get(i-1);
+ paymentHistoryRecordVo.setPayableAmount(paymentHistoryRecordVo1.getPayableAmount()
+ .add(paymentHistoryRecordVo.getInvoiceAmount()).subtract(paymentHistoryRecordVo.getCurrentPaymentAmount()));
+ }
+ newResult.add(paymentHistoryRecordVo);
+ }
}
- return result;
+ return newResult;
}
/**
@@ -418,6 +433,37 @@
return paymentRegistrationMapper.paymentHistoryListPage(page, paymentRegistrationDto);
}
+ @Override
+ public Boolean delete(Long[] ids) {
+ for (Long id : ids) {
+ List<ProductRecord> productRecords = productRecordMapper.selectList(new QueryWrapper<ProductRecord>().lambda().eq(ProductRecord::getTicketRegistrationId, id));
+ for (ProductRecord productRecord : productRecords) {
+ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(productRecord.getSaleLedgerProjectId());
+ salesLedgerProduct.setTicketsNum(salesLedgerProduct.getTicketsNum().subtract(productRecord.getTicketsNum()));
+ salesLedgerProduct.setTicketsAmount(salesLedgerProduct.getTicketsAmount().subtract(productRecord.getTicketsAmount()));
+ salesLedgerProduct.setFutureTickets(salesLedgerProduct.getFutureTickets().add(productRecord.getTicketsNum()));
+ salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getFutureTicketsAmount().add(productRecord.getTicketsAmount()));
+ salesLedgerProductMapper.updateById(salesLedgerProduct);
+ }
+ ticketRegistrationMapper.delete(new QueryWrapper<TicketRegistration>().lambda().eq(TicketRegistration::getId, id));
+ productRecordMapper.delete(new QueryWrapper<ProductRecord>().lambda().eq(ProductRecord::getTicketRegistrationId, id));
+ }
+ return true;
+ }
+
+ @Override
+ public int delPaymentRegistration(Long id) {
+// PaymentRegistration paymentRegistration = paymentRegistrationMapper.selectById(id);
+// TicketRegistration ticketRegistration = ticketRegistrationMapper.selectById(paymentRegistration.getTicketRegistrationId());
+// if (ticketRegistration != null) {
+// ticketRegistration.setPaymentAmountTotal(ticketRegistration.getPaymentAmountTotal().subtract(paymentRegistration.getCurrentPaymentAmount()));
+// ticketRegistration.setUnPaymentAmountTotal(ticketRegistration.getUnPaymentAmountTotal().add(paymentRegistration.getCurrentPaymentAmount()));
+// ticketRegistrationMapper.updateById(ticketRegistration);
+// }
+
+ return paymentRegistrationMapper.deleteById(id);
+ }
+
// 鎵归噺鏌ヨ閲囪喘鍙拌处锛堝綋鏈堬級
private Map<Long, List<PurchaseLedger>> batchQueryPurchaseLedgers(List<Long> supplierIds, LocalDate startDate, LocalDate endDate) {
LambdaQueryWrapper<PurchaseLedger> query = new LambdaQueryWrapper<>();
--
Gitblit v1.9.3