From 0d7d874912d0147376826b55667a1deb6547ed91 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 21 五月 2026 15:25:27 +0800
Subject: [PATCH] Merge branch 'dev_New_pro' into dev_宁夏_英泽防锈
---
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java | 57 +++++++++++++++++++++++++++++----------------------------
1 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
index 0748154..7d91849 100644
--- a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
@@ -7,20 +7,19 @@
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.domain.R;
import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.purchase.dto.InvoicePurchaseDto;
+import com.ruoyi.sales.dto.InvoiceLedgerDto;
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.dto.ReceiptPaymentRecordDto;
-import com.ruoyi.sales.dto.SalesLedgerDto;
import com.ruoyi.sales.pojo.ReceiptPayment;
-import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.service.ReceiptPaymentService;
-import io.swagger.annotations.ApiModelProperty;
-import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.AllArgsConstructor;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
-import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
@@ -29,9 +28,9 @@
@RestController
@RequestMapping("/receiptPayment")
+@AllArgsConstructor
public class ReceiptPaymentController extends BaseController {
- @Autowired
private ReceiptPaymentService receiptPaymentService;
/**
@@ -40,9 +39,9 @@
* @return
*/
@PostMapping("/saveOrUpdate")
- public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) {
+ public R<?> receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) {
receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment);
- return AjaxResult.success();
+ return R.ok();
}
/**
@@ -51,8 +50,9 @@
* @return
*/
@PostMapping("/update")
- public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) {
- return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment));
+ @Transactional(rollbackFor = Exception.class)
+ public R<?> receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) {
+ return R.ok(receiptPaymentService.receiptPaymentUpdate(receiptPayment));
}
/**
@@ -61,8 +61,9 @@
* @return
*/
@DeleteMapping("/del")
- public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) {
- return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids));
+ @Transactional(rollbackFor = Exception.class)
+ public R<?> receiptPaymentDel (@RequestBody List<Integer> ids) {
+ return R.ok(receiptPaymentService.receiptPaymentDel(ids));
}
/**
@@ -71,8 +72,8 @@
* @return
*/
@GetMapping("/customerInteractions")
- public AjaxResult customerInteractions (ReceiptPaymentDto receiptPaymentDto) {
- return AjaxResult.success(receiptPaymentService.customerInteractions(receiptPaymentDto));
+ public R<?> customerInteractions (InvoiceLedgerDto receiptPaymentDto) {
+ return R.ok(receiptPaymentService.customerInteractions(receiptPaymentDto));
}
/**
@@ -81,20 +82,20 @@
* @return
*/
@GetMapping("/info")
- public AjaxResult receiptPaymentInfo (Integer id) {
- return AjaxResult.success(receiptPaymentService.receiptPaymentInfo(id));
+ public R<?> receiptPaymentInfo (Integer id) {
+ return R.ok(receiptPaymentService.receiptPaymentInfo(id));
}
/**
* 鏈湀鍥炴閲戦
*/
@GetMapping("/getReceiptAmount")
- public AjaxResult getReceiptAmount() {
+ public R<?> getReceiptAmount() {
try {
BigDecimal receiptAmount = receiptPaymentService.getReceiptAmount();
- return AjaxResult.success(receiptAmount != null ? receiptAmount : BigDecimal.ZERO);
+ return R.ok(receiptAmount != null ? receiptAmount : BigDecimal.ZERO);
} catch (Exception e) {
- return AjaxResult.error("鑾峰彇鍥炴閲戦澶辫触锛�" + e.getMessage());
+ return R.fail("鑾峰彇鍥炴閲戦澶辫触锛�" + e.getMessage());
}
}
@@ -105,11 +106,11 @@
* @return
*/
@GetMapping("/bindInvoiceNoRegPage")
- public AjaxResult bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
- return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto));
+ public R<?> bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
+ return R.ok(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto));
}
- @ApiModelProperty("瀵煎嚭鍥炴鐧昏")
+ @Schema(description = "瀵煎嚭鍥炴鐧昏")
@PostMapping("/export")
public void export(HttpServletResponse response, String ids) {
if (ids == null || ids.isEmpty()) {
@@ -130,16 +131,16 @@
* @return
*/
@GetMapping("/invoiceInfo")
- public AjaxResult invoiceInfo (Integer id) {
- return AjaxResult.success(receiptPaymentService.invoiceInfo(id));
+ public R<?> invoiceInfo (Integer id) {
+ return R.ok(receiptPaymentService.invoiceInfo(id));
}
/**
* 鏈湀搴旀敹,鍥炴閲戦
*/
@GetMapping("/getAmountMouth")
- public AjaxResult getAmountMouth() {
- return AjaxResult.success(receiptPaymentService.getAmountMouth());
+ public R<?> getAmountMouth() {
+ return R.ok(receiptPaymentService.getAmountMouth());
}
/**
--
Gitblit v1.9.3