| | |
| | | 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; |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/receiptPayment") |
| | | @AllArgsConstructor |
| | | public class ReceiptPaymentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentService receiptPaymentService; |
| | | |
| | | /** |
| | |
| | | * @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(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/customerInteractions") |
| | | public AjaxResult customerInteractions (InvoiceLedgerDto receiptPaymentDto) { |
| | | return AjaxResult.success(receiptPaymentService.customerInteractions(receiptPaymentDto)); |
| | | public R<?> customerInteractions (InvoiceLedgerDto receiptPaymentDto) { |
| | | return R.ok(receiptPaymentService.customerInteractions(receiptPaymentDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @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()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @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()) { |
| | |
| | | * @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()); |
| | | } |
| | | |
| | | /** |