From 1ab612fa454477bfaec03b0fe9133f8881ce29cc Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 16 一月 2026 16:16:02 +0800
Subject: [PATCH] yys 回款---财务收入,付款---财务支出
---
src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java | 57 ++++--
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java | 3
src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java | 2
src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java | 6
src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java | 4
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java | 26 ---
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java | 71 ++++++++
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml | 3
src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java | 3
src/main/resources/application-new.yml | 244 ++++++++++++++++++++++++++++++
src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java | 3
11 files changed, 366 insertions(+), 56 deletions(-)
diff --git a/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java b/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java
index 1df5374..86950fd 100644
--- a/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java
+++ b/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java
@@ -34,8 +34,8 @@
{
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 绉熸埛鎻掍欢
- TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor(new CustomTenantLineHandler());
- interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
+// TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor(new CustomTenantLineHandler());
+// interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
// 鍒嗛〉鎻掍欢
interceptor.addInnerInterceptor(paginationInnerInterceptor());
// 涔愯閿佹彃浠�
diff --git a/src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java b/src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java
index 6cf4b7a..d6cffe4 100644
--- a/src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java
+++ b/src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java
@@ -121,8 +121,10 @@
BeanUtils.copyProperties(timingTaskDto, timingTask);
// 1. 瑙f瀽瀛楃涓蹭负 LocalDate锛堝彧鍖呭惈骞存湀鏃ワ級
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
- LocalDate localDate = LocalDate.parse(timingTaskDto.getDateStr(), formatter);
-
+ LocalDate localDate = LocalDate.now();
+ if(StringUtils.isNotEmpty(timingTaskDto.getDateStr())){
+ localDate = LocalDate.parse(timingTaskDto.getDateStr(), formatter);
+ }
// 2. 鑾峰彇褰撳墠绯荤粺鐨� LocalTime锛堝寘鍚椂鍒嗙锛�
LocalTime currentTime = LocalTime.now();
diff --git a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
index 3d61f2c..e895ea6 100644
--- a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
@@ -14,6 +14,7 @@
import com.ruoyi.purchase.pojo.PaymentRegistration;
import com.ruoyi.purchase.service.IPaymentRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -69,6 +70,7 @@
*/
@Log(title = "浠樻鐧昏", businessType = BusinessType.INSERT)
@PostMapping
+ @Transactional(rollbackFor = Exception.class)
public AjaxResult add(@RequestBody List<PaymentRegistration> paymentRegistration) {
return toAjax(paymentRegistrationService.insertPaymentRegistration(paymentRegistration));
}
@@ -78,6 +80,7 @@
*/
@Log(title = "浠樻鐧昏", businessType = BusinessType.UPDATE)
@PutMapping
+ @Transactional(rollbackFor = Exception.class)
public AjaxResult edit(@RequestBody PaymentRegistration paymentRegistration) {
return toAjax(paymentRegistrationService.updatePaymentRegistration(paymentRegistration));
}
diff --git a/src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java b/src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java
index d3a230f..eb5ed21 100644
--- a/src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/TicketRegistrationController.java
@@ -88,7 +88,8 @@
@ApiOperation("鍒犻櫎浠樻娴佹按")
@DeleteMapping("/delPaymentRegistration")
- public AjaxResult delPaymentRegistration(@RequestBody Long id) {
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult delPaymentRegistration(@RequestBody List<Long> id) {
return toAjax(paymentRegistrationService.delPaymentRegistration(id));
}
diff --git a/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java b/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
index f0b9738..88052fa 100644
--- a/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
+++ b/src/main/java/com/ruoyi/purchase/service/IPaymentRegistrationService.java
@@ -98,7 +98,7 @@
Boolean delete(Long[] ids);
- int delPaymentRegistration(Long ids);
+ int delPaymentRegistration(List<Long> ids);
IPage<PaymentRegistrationDto> supplierNameListPage(Page page, PaymentLedgerDto paymentLedgerDto);
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 ec3be20..a32b6f6 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -124,7 +124,7 @@
salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getTicketsTotal()));
paymentRegistrationMapper.insert(paymentRegistration);
salesLedgerProductMapper.updateById(salesLedgerProduct);
- // 2. 澶勭悊璐︽埛鏀跺叆
+ // 2. 澶勭悊璐︽埛鏀嚭
AccountExpense accountExpense = new AccountExpense();
accountExpense.setExpenseDate(purchaseLedger.getEntryDate());
accountExpense.setExpenseType("0");
@@ -151,18 +151,29 @@
@Override
public int updatePaymentRegistration(PaymentRegistration paymentRegistration) {
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()));
- BigDecimal total = paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-
- if (total.add(paymentRegistration.getCurrentPaymentAmount()).compareTo(ticketRegistration.getInvoiceAmount()) > 0) {
- throw new RuntimeException("浠樻閲戦瓒呭嚭鍙戠エ閲戦");
+ if(null==paymentRegistration1) throw new RuntimeException("鏈壘鍒颁粯娆剧櫥璁�");
+ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(paymentRegistration1.getSalesLedgerProductId());
+ if(null==salesLedgerProduct) throw new RuntimeException("鏈壘鍒伴噰璐崟浜у搧");
+ // 鍒ゆ柇浠樻閲戦涓嶅彲澶т簬寰呬粯娆鹃噾棰�
+ BigDecimal subtract = paymentRegistration.getCurrentPaymentAmount().subtract(paymentRegistration1.getCurrentPaymentAmount());
+ if (subtract.compareTo(salesLedgerProduct.getPendingTicketsTotal()) > 0) {
+ throw new RuntimeException("浠樻閲戦瓒呭嚭寰呬粯娆鹃噾棰�");
}
-
paymentRegistration.setUpdateTime(DateUtils.getNowDate());
+ // 鍚屾淇敼璐︽埛鏀嚭
+ LambdaQueryWrapper<AccountExpense> accountExpenseLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ accountExpenseLambdaQueryWrapper.eq(AccountExpense::getBusinessId, paymentRegistration.getId())
+ .eq(AccountExpense::getBusinessType, 1)
+ .last("limit 1");
+ AccountExpense accountExpense = accountExpenseService.getOne(accountExpenseLambdaQueryWrapper);
+ if(null!=accountExpense){
+ accountExpense.setExpenseMoney(paymentRegistration.getCurrentPaymentAmount());
+ accountExpenseService.updateById(accountExpense);
+ }
+ // 淇敼閲囪喘浜у搧浠樻閲戦
+ salesLedgerProduct.setTicketsTotal(salesLedgerProduct.getTicketsTotal().add(subtract));
+ salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getTicketsTotal()));
+ salesLedgerProductMapper.updateById(salesLedgerProduct);
return paymentRegistrationMapper.updateById(paymentRegistration);
}
@@ -464,16 +475,20 @@
}
@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);
+ public int delPaymentRegistration(List<Long> ids) {
+ LambdaQueryWrapper<AccountExpense> accountExpenseLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ accountExpenseLambdaQueryWrapper.in(AccountExpense::getBusinessId, ids)
+ .eq(AccountExpense::getBusinessType, 1);
+ accountExpenseService.remove(accountExpenseLambdaQueryWrapper);
+ // 淇敼閲囪喘浜у搧鐨勫凡浠樻閲戦,寰呬粯娆鹃噾棰�
+ List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper.selectBatchIds(ids);
+ for (PaymentRegistration paymentRegistration : paymentRegistrations) {
+ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(paymentRegistration.getSalesLedgerProductId());
+ salesLedgerProduct.setTicketsTotal(salesLedgerProduct.getTicketsTotal().subtract(paymentRegistration.getCurrentPaymentAmount()));
+ salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getPendingTicketsTotal().add(paymentRegistration.getCurrentPaymentAmount()));
+ salesLedgerProductMapper.updateById(salesLedgerProduct);
+ }
+ return paymentRegistrationMapper.deleteBatchIds(ids);
}
@Override
diff --git a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
index 9bce200..aa10b54 100644
--- a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
@@ -19,6 +19,7 @@
import com.ruoyi.sales.service.ReceiptPaymentService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -52,6 +53,7 @@
* @return
*/
@PostMapping("/update")
+ @Transactional(rollbackFor = Exception.class)
public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) {
return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment));
}
@@ -62,6 +64,7 @@
* @return
*/
@DeleteMapping("/del")
+ @Transactional(rollbackFor = Exception.class)
public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) {
return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids));
}
diff --git a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
index 5a19bde..7f9b4cd 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -4,6 +4,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.account.pojo.AccountIncome;
+import com.ruoyi.account.service.AccountIncomeService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sales.dto.CustomerInteractionDto;
@@ -46,6 +48,9 @@
@Autowired
private InvoiceLedgerMapper invoiceLedgerMapper;
+ @Autowired
+ private AccountIncomeService accountIncomeService;
+
/**
* 鍥炴鐧昏鏂板
* @param receiptPaymentList
@@ -59,7 +64,6 @@
if (!ObjectUtils.isEmpty(receiptPayment.getId())){
receiptPayment = this.getById(receiptPayment.getId());
}
-// InvoiceLedger invoiceLedger = invoiceLedgerMapper.selectById(byId.getInvoiceLedgerId());
SalesLedger salesLedger = salesLedgerMapper.selectById(receiptPayment.getSalesLedgerId());
if(null==salesLedger) throw new RuntimeException("鏈壘鍒伴攢鍞崟");
// 宸插洖娆鹃噾棰�
@@ -72,11 +76,35 @@
salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(receiptPayment.getReceiptPaymentAmount()));
salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
receiptPaymentMapper.insert(receiptPayment);
+ // 澧炲姞璐㈠姟鏀跺叆璁板綍
+ AccountIncome accountIncome = new AccountIncome();
+ accountIncome.setIncomeDate(salesLedger.getEntryDate());
+ accountIncome.setIncomeType("0");
+ accountIncome.setCustomerName(salesLedger.getCustomerName());
+ accountIncome.setIncomeMoney(salesLedger.getContractAmount());
+ accountIncome.setIncomeMethod("0");
+ accountIncome.setInputTime(new Date());
+ accountIncome.setInputUser(salesLedger.getEntryPerson());
+ accountIncome.setIncomeDescribed("鍥炴鏀跺叆");
+ accountIncome.setBusinessId(Long.parseLong(receiptPayment.getId().toString()));
+ accountIncome.setBusinessType(1);
+ accountIncomeService.save(accountIncome);
}else {
BigDecimal subtract = receiptPayment.getReceiptPaymentAmount().subtract(byId.getReceiptPaymentAmount());
salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(subtract));
salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
+ receiptPayment.setReceiptPaymentAmount(byId.getReceiptPaymentAmount());
+ receiptPayment.setReceiptPaymentType(byId.getReceiptPaymentType());
receiptPaymentMapper.updateById(receiptPayment);
+ // 淇敼璐㈠姟鏀跺叆璁板綍
+ LambdaQueryWrapper<AccountIncome> accountIncomeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ accountIncomeLambdaQueryWrapper.eq(AccountIncome::getBusinessId, receiptPayment.getId())
+ .eq(AccountIncome::getBusinessType, 1);
+ AccountIncome accountIncome = accountIncomeService.getOne(accountIncomeLambdaQueryWrapper);
+ if(null!=accountIncome){
+ accountIncome.setIncomeMoney(receiptPayment.getReceiptPaymentAmount());
+ accountIncomeService.updateById(accountIncome);
+ }
}
salesLedgerProductMapper.updateById(salesLedgerProduct);
}
@@ -90,6 +118,33 @@
*/
@Override
public int receiptPaymentUpdate(ReceiptPayment receiptPayment) {
+ ReceiptPayment byId = receiptPayment;
+ if (!ObjectUtils.isEmpty(receiptPayment.getId())){
+ receiptPayment = this.getById(receiptPayment.getId());
+ }
+ SalesLedger salesLedger = salesLedgerMapper.selectById(receiptPayment.getSalesLedgerId());
+ if(null==salesLedger) throw new RuntimeException("鏈壘鍒伴攢鍞崟");
+ // 宸插洖娆鹃噾棰�
+ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(receiptPayment.getSalesLedgerProductId());
+ if(null==salesLedgerProduct) throw new RuntimeException("鏈壘鍒伴攢鍞崟浜у搧");
+ if (salesLedgerProduct.getPendingInvoiceTotal().compareTo(receiptPayment.getReceiptPaymentAmount())<0){
+ throw new RuntimeException("鏈鍥炴閲戦涓嶈兘澶т簬寰呭洖娆鹃噾棰�");
+ }
+ BigDecimal subtract = receiptPayment.getReceiptPaymentAmount().subtract(byId.getReceiptPaymentAmount());
+ salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(subtract));
+ salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
+ // 淇敼璐㈠姟鏀跺叆璁板綍
+ LambdaQueryWrapper<AccountIncome> accountIncomeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ accountIncomeLambdaQueryWrapper.eq(AccountIncome::getBusinessId, receiptPayment.getId())
+ .eq(AccountIncome::getBusinessType, 1);
+ AccountIncome accountIncome = accountIncomeService.getOne(accountIncomeLambdaQueryWrapper);
+ if(null!=accountIncome){
+ accountIncome.setIncomeMoney(receiptPayment.getReceiptPaymentAmount());
+ accountIncomeService.updateById(accountIncome);
+ }
+ salesLedgerProductMapper.updateById(salesLedgerProduct);
+ receiptPayment.setReceiptPaymentAmount(byId.getReceiptPaymentAmount());
+ receiptPayment.setReceiptPaymentType(byId.getReceiptPaymentType());
return receiptPaymentMapper.updateById(receiptPayment);
}
@@ -102,6 +157,20 @@
public int receiptPaymentDel(List<Integer> ids) {
LambdaQueryWrapper<ReceiptPayment> delQuery = new LambdaQueryWrapper<>();
delQuery.in(ReceiptPayment::getId, ids);
+ List<ReceiptPayment> receiptPayments = receiptPaymentMapper.selectList(delQuery);
+ if(CollectionUtils.isEmpty(receiptPayments)) throw new RuntimeException("鏈壘鍒板洖娆剧櫥璁�");
+ // 閲嶆柊璁$畻閿�鍞骇鍝佸洖娆鹃噾棰�
+ for (ReceiptPayment receiptPayment : receiptPayments) {
+ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(receiptPayment.getSalesLedgerProductId());
+ salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().subtract(receiptPayment.getReceiptPaymentAmount()));
+ salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
+ salesLedgerProductMapper.updateById(salesLedgerProduct);
+ }
+ // 鍒犻櫎璐㈠姟鏀跺叆璁板綍
+ LambdaQueryWrapper<AccountIncome> accountIncomeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ accountIncomeLambdaQueryWrapper.in(AccountIncome::getBusinessId, ids)
+ .eq(AccountIncome::getBusinessType, 1);
+ accountIncomeService.remove(accountIncomeLambdaQueryWrapper);
return receiptPaymentMapper.delete(delQuery);
}
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index ef909fc..ad5d908 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -522,39 +522,13 @@
SalesLedger salesLedger = convertToEntity(salesLedgerDto);
salesLedger.setCustomerName(customer.getCustomerName());
salesLedger.setTenantId(customer.getTenantId());
-
- AccountIncome accountIncome = new AccountIncome();
- accountIncome.setIncomeDate(salesLedger.getEntryDate());
- accountIncome.setIncomeType("0");
- accountIncome.setCustomerName(customer.getCustomerName());
- accountIncome.setIncomeMoney(salesLedger.getContractAmount());
- accountIncome.setIncomeMethod("0");
- accountIncome.setInputTime(new Date());
- accountIncome.setInputUser(salesLedger.getEntryPerson());
// 3. 鏂板鎴栨洿鏂颁富琛�
if (salesLedger.getId() == null) {
String contractNo = generateSalesContractNo();
salesLedger.setSalesContractNo(contractNo);
salesLedgerMapper.insert(salesLedger);
- accountIncome.setIncomeDescribed("閿�鍞悎鍚岋細" + salesLedger.getSalesContractNo());
- accountIncome.setInvoiceNumber(salesLedger.getSalesContractNo());
- accountIncomeService.save(accountIncome);
} else {
salesLedgerMapper.updateById(salesLedger);
- SalesLedger salesLedgerDB = salesLedgerMapper.selectById(salesLedger.getId());
- List<AccountIncome> accountIncomeDBs = accountIncomeService.getByInvoiceNumberList(salesLedger.getSalesContractNo());
- if (!org.springframework.util.CollectionUtils.isEmpty(accountIncomeDBs)) {
- accountIncomeDBs.forEach(accountIncomeDB -> {
- accountIncomeDB.setCustomerName(salesLedgerDB.getCustomerName());
- accountIncomeDB.setIncomeMoney(salesLedgerDB.getContractAmount());
- accountIncomeDB.setIncomeDescribed("閿�鍞悎鍚岋細" + salesLedgerDB.getSalesContractNo());
- accountIncomeDB.setInvoiceNumber(salesLedgerDB.getSalesContractNo());
- accountIncomeDB.setInputTime(new Date());
- accountIncomeDB.setInputUser(salesLedgerDB.getEntryPerson());
- accountIncomeService.updateById(accountIncomeDB);
- });
- }
-
}
// 4. 澶勭悊瀛愯〃鏁版嵁
diff --git a/src/main/resources/application-new.yml b/src/main/resources/application-new.yml
new file mode 100644
index 0000000..d882b7d
--- /dev/null
+++ b/src/main/resources/application-new.yml
@@ -0,0 +1,244 @@
+# 椤圭洰鐩稿叧閰嶇疆
+ruoyi:
+ # 鍚嶇О
+ name: RuoYi
+ # 鐗堟湰
+ version: 3.8.9
+ # 鐗堟潈骞翠唤
+ copyrightYear: 2025
+ # 鏂囦欢璺緞 绀轰緥锛� Windows閰嶇疆D:/ruoyi/uploadPath锛孡inux閰嶇疆 /home/ruoyi/uploadPath锛�
+ profile: /javaWork/product-inventory-management/file
+
+ # 鑾峰彇ip鍦板潃寮�鍏�
+ addressEnabled: false
+ # 楠岃瘉鐮佺被鍨� math 鏁板瓧璁$畻 char 瀛楃楠岃瘉
+ captchaType: math
+
+# 寮�鍙戠幆澧冮厤缃�
+server:
+ # 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080
+ port: 9003
+ servlet:
+ # 搴旂敤鐨勮闂矾寰�
+ context-path: /
+ tomcat:
+ # tomcat鐨刄RI缂栫爜
+ uri-encoding: UTF-8
+ # 杩炴帴鏁版弧鍚庣殑鎺掗槦鏁帮紝榛樿涓�100
+ accept-count: 1000
+ threads:
+ # tomcat鏈�澶х嚎绋嬫暟锛岄粯璁や负200
+ max: 800
+ # Tomcat鍚姩鍒濆鍖栫殑绾跨▼鏁帮紝榛樿鍊�10
+ min-spare: 100
+
+# 鏃ュ織閰嶇疆
+logging:
+ level:
+ com.ruoyi: warn
+ org.springframework: warn
+
+minio:
+ endpoint: http://114.132.189.42/
+ port: 7019
+ secure: false
+ accessKey: admin
+ secretKey: 12345678
+ preview-expiry: 24 # 棰勮鍦板潃榛樿24灏忔椂
+ default-bucket: jxc
+# 鐢ㄦ埛閰嶇疆
+user:
+ password:
+ # 瀵嗙爜鏈�澶ч敊璇鏁�
+ maxRetryCount: 5
+ # 瀵嗙爜閿佸畾鏃堕棿锛堥粯璁�10鍒嗛挓锛�
+ lockTime: 10
+
+# Spring閰嶇疆
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ driverClassName: com.mysql.cj.jdbc.Driver
+ druid:
+ # 涓诲簱鏁版嵁婧�
+ master:
+ url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ username: root
+ password: xd@123456..
+ # 浠庡簱鏁版嵁婧�
+ slave:
+ # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴
+ enabled: false
+ url:
+ username:
+ password:
+ # 鍒濆杩炴帴鏁�
+ initialSize: 5
+ # 鏈�灏忚繛鎺ユ睜鏁伴噺
+ minIdle: 10
+ # 鏈�澶ц繛鎺ユ睜鏁伴噺
+ maxActive: 20
+ # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
+ maxWait: 60000
+ # 閰嶇疆杩炴帴瓒呮椂鏃堕棿
+ connectTimeout: 30000
+ # 閰嶇疆缃戠粶瓒呮椂鏃堕棿
+ socketTimeout: 60000
+ # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
+ timeBetweenEvictionRunsMillis: 60000
+ # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+ minEvictableIdleTimeMillis: 300000
+ # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+ maxEvictableIdleTimeMillis: 900000
+ # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
+ validationQuery: SELECT 1 FROM DUAL
+ testWhileIdle: true
+ testOnBorrow: false
+ testOnReturn: false
+ webStatFilter:
+ enabled: true
+ statViewServlet:
+ enabled: true
+ # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂�
+ allow:
+ url-pattern: /druid/*
+ # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮�
+ login-username: ruoyi
+ login-password: 123456
+ filter:
+ stat:
+ enabled: true
+ # 鎱QL璁板綍
+ log-slow-sql: true
+ slow-sql-millis: 1000
+ merge-sql: true
+ wall:
+ config:
+ multi-statement-allow: true
+ # 璧勬簮淇℃伅
+ messages:
+ # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
+ basename: i18n/messages
+ # 鏂囦欢涓婁紶
+ servlet:
+ multipart:
+ # 鍗曚釜鏂囦欢澶у皬
+ max-file-size: 1GB
+ # 璁剧疆鎬讳笂浼犵殑鏂囦欢澶у皬
+ max-request-size: 2GB
+ # 鏈嶅姟妯″潡
+ devtools:
+ restart:
+ # 鐑儴缃插紑鍏�
+ enabled: false
+ # redis 閰嶇疆
+ redis:
+ # 鍦板潃
+ # host: 127.0.0.1
+ host: 172.17.0.1
+ # 绔彛锛岄粯璁や负6379
+ port: 6379
+ # 鏁版嵁搴撶储寮�
+ database: 0
+ # 瀵嗙爜
+ # password: root2022!
+ password:
+
+ # 杩炴帴瓒呮椂鏃堕棿
+ timeout: 10s
+ lettuce:
+ pool:
+ # 杩炴帴姹犱腑鐨勬渶灏忕┖闂茶繛鎺�
+ min-idle: 0
+ # 杩炴帴姹犱腑鐨勬渶澶х┖闂茶繛鎺�
+ max-idle: 8
+ # 杩炴帴姹犵殑鏈�澶ф暟鎹簱杩炴帴鏁�
+ max-active: 8
+ # #杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級
+ max-wait: -1ms
+
+ # Quartz瀹氭椂浠诲姟閰嶇疆锛堟柊澧為儴鍒嗭級
+ quartz:
+ job-store-type: jdbc # 浣跨敤鏁版嵁搴撳瓨鍌�
+ jdbc:
+ initialize-schema: never # 棣栨杩愯鏃惰嚜鍔ㄥ垱寤鸿〃缁撴瀯锛屾垚鍔熷悗鏀逛负never
+ schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQL琛ㄧ粨鏋勮剼鏈�
+ properties:
+ org:
+ quartz:
+ scheduler:
+ instanceName: RuoYiScheduler
+ instanceId: AUTO
+ jobStore:
+ class: org.quartz.impl.jdbcjobstore.JobStoreTX
+ driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQL閫傞厤
+ tablePrefix: qrtz_ # 琛ㄥ悕鍓嶇紑锛屼笌鑴氭湰涓�鑷�
+ isClustered: false # 鍗曡妭鐐规ā寮忥紙闆嗙兢闇�鏀逛负true锛�
+ clusterCheckinInterval: 10000
+ txIsolationLevelSerializable: true
+ threadPool:
+ class: org.quartz.simpl.SimpleThreadPool
+ threadCount: 10 # 绾跨▼姹犲ぇ灏�
+ threadPriority: 5
+ makeThreadsDaemons: true
+ updateCheck: false # 鍏抽棴鐗堟湰妫�鏌�
+# token閰嶇疆
+token:
+ # 浠ょ墝鑷畾涔夋爣璇�
+ header: Authorization
+ # 浠ょ墝瀵嗛挜
+ secret: abcdefghijklmnopqrstuvwxyz
+ # 浠ょ墝鏈夋晥鏈燂紙榛樿30鍒嗛挓锛�
+ expireTime: 450
+
+# MyBatis Plus閰嶇疆
+mybatis-plus:
+ # 鎼滅储鎸囧畾鍖呭埆鍚� 鏍规嵁鑷繁鐨勯」鐩潵
+ typeAliasesPackage: com.ruoyi.**.pojo
+ # 閰嶇疆mapper鐨勬壂鎻忥紝鎵惧埌鎵�鏈夌殑mapper.xml鏄犲皠鏂囦欢
+ mapperLocations: classpath*:mapper/**/*Mapper.xml
+ # 鍔犺浇鍏ㄥ眬鐨勯厤缃枃浠�
+ configLocation: classpath:mybatis/mybatis-config.xml
+ global-config:
+ enable-sql-runner: true
+ db-config:
+ id-type: auto
+
+# PageHelper鍒嗛〉鎻掍欢
+pagehelper:
+ helperDialect: mysql
+ supportMethodsArguments: true
+ params: count=countSql
+
+# Swagger閰嶇疆
+swagger:
+ # 鏄惁寮�鍚痵wagger
+ enabled: true
+ # 璇锋眰鍓嶇紑
+ pathMapping: /dev-api
+
+# 闃叉XSS鏀诲嚮
+xss:
+ # 杩囨护寮�鍏�
+ enabled: true
+ # 鎺掗櫎閾炬帴锛堝涓敤閫楀彿鍒嗛殧锛�
+ excludes: /system/notice
+ # 鍖归厤閾炬帴
+ urlPatterns: /system/*,/monitor/*,/tool/*
+
+# 浠g爜鐢熸垚
+gen:
+ # 浣滆��
+ author: ruoyi
+ # 榛樿鐢熸垚鍖呰矾寰� system 闇�鏀规垚鑷繁鐨勬ā鍧楀悕绉� 濡� system monitor tool
+ packageName: com.ruoyi.project.system
+ # 鑷姩鍘婚櫎琛ㄥ墠缂�锛岄粯璁ゆ槸true
+ autoRemovePre: false
+ # 琛ㄥ墠缂�锛堢敓鎴愮被鍚嶄笉浼氬寘鍚〃鍓嶇紑锛屽涓敤閫楀彿鍒嗛殧锛�
+ tablePrefix: sys_
+ # 鏄惁鍏佽鐢熸垚鏂囦欢瑕嗙洊鍒版湰鍦帮紙鑷畾涔夎矾寰勶級锛岄粯璁や笉鍏佽
+ allowOverwrite: false
+
+file:
+ temp-dir: /javaWork/product-inventory-management/file/temp/uploads
+ upload-dir: /javaWork/product-inventory-management/file/prod/uploads
\ No newline at end of file
diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index b513ac1..c4f4e88 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -77,8 +77,7 @@
supplier_manage T2 ON T1.supplier_id = T2.id
LEFT JOIN
sys_user T3 ON T3.user_id = T1.registrant_id
- left join ticket_registration T4 on T1.ticket_registration_id = T4.id
WHERE
- T4.id = #{id}
+ T1.sales_ledger_product_id = #{id}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3