| src/main/java/com/ruoyi/account/mapper/AccountStatementMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/purchase/dto/VatDto.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/purchase/service/PurchaseReportService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/purchase/service/impl/PurchaseReportServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/purchase/vo/PurchaseReportVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/ruoyi/sales/mapper/SalesLedgerMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/mapper/account/AccountStatementMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/resources/mapper/sales/SalesLedgerMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/ruoyi/account/mapper/AccountStatementMapper.java
@@ -6,6 +6,7 @@ import com.ruoyi.account.bean.dto.StatementAccountDto; import com.ruoyi.account.bean.vo.StatementAccountVo; import com.ruoyi.account.pojo.AccountStatement; import com.ruoyi.purchase.dto.VatDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,4 +23,6 @@ IPage<StatementAccountVo> listPageAccountStatement(Page page, @Param("req") StatementAccountDto statementAccountDto); IPage<VatDto> selectVatDtoPage(Page page, @Param("month") String month); } src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java
@@ -2,10 +2,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.service.ISupplierService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.R; import com.ruoyi.purchase.dto.VatDto; import com.ruoyi.purchase.service.PurchaseReportService; import com.ruoyi.purchase.vo.PurchaseReportVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletResponse; @@ -15,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @Tag(name = "éè´æ¥è¡¨") @RequestMapping("/purchase/report") @@ -22,31 +27,38 @@ public class AccountingReportController { private final ISupplierService supplierService; private final PurchaseReportService purchaseReportService; @GetMapping("/list") @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦", businessType = BusinessType.OTHER) public AjaxResult list(Page page) { return AjaxResult.success(); public R list(Page page, String customerName) { return R.ok(purchaseReportService.list(page,customerName)); } @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº", businessType = BusinessType.EXPORT) @PostMapping("/export") @Operation(summary = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº") public void export(HttpServletResponse response) { public void export(HttpServletResponse response, String customerName) { List<PurchaseReportVo> list = purchaseReportService.list(new Page(1,-1),customerName).getRecords(); ExcelUtil<PurchaseReportVo> util = new ExcelUtil<>(PurchaseReportVo.class); util.exportExcel(response, list , "项ç®å©æ¶¦"); } @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.OTHER) @GetMapping("/listVat") public AjaxResult listVat(Page page,String month) { return AjaxResult.success(); public R listVat(Page page,String month) { return R.ok(purchaseReportService.listVat(page,month)); } @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.EXPORT) @PostMapping("/exportTwo") @Operation(summary = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹") public void exportTwo(HttpServletResponse response) { public void exportTwo(HttpServletResponse response,String month) { List<VatDto> list = purchaseReportService.listVat(new Page(1,-1),month).getRecords(); ExcelUtil<VatDto> util = new ExcelUtil<>(VatDto.class); util.exportExcel(response, list , "å¢å¼ç¨æ¯å¯¹"); } @GetMapping("/supplierTransactions") src/main/java/com/ruoyi/purchase/dto/VatDto.java
@@ -1,27 +1,30 @@ package com.ruoyi.purchase.dto; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; import java.time.LocalDate; @Data @Schema(name = "VatDto", description = "管ç驾驶è±--å¢å¼ç¨æ¯å¯¹åæ°") @ExcelIgnoreUnannotated public class VatDto { //æä»½ @Excel(name = "æä»½") @Schema(description = "æä»½") private String month ; //è¿é¡¹ç¨ @Excel(name = "è¿é¡¹ç¨é¢") @Excel(name = "é项ç¨é¢") @Schema(description = "é项ç¨é¢") private BigDecimal jTaxAmount; //éé¡¹ç¨ @Excel(name = "é项ç¨é¢") @Excel(name = "è¿é¡¹ç¨é¢") @Schema(description = "è¿é¡¹ç¨é¢") private BigDecimal xTaxAmount; @Excel(name = "é-è¿") @Schema(description = "é-è¿") private BigDecimal taxAmount; } src/main/java/com/ruoyi/purchase/service/PurchaseReportService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.ruoyi.purchase.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.purchase.dto.VatDto; import com.ruoyi.purchase.vo.PurchaseReportVo; public interface PurchaseReportService { IPage<PurchaseReportVo> list(Page page, String customerName); IPage<VatDto> listVat(Page page, String month); } src/main/java/com/ruoyi/purchase/service/impl/PurchaseReportServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,32 @@ package com.ruoyi.purchase.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.account.mapper.AccountStatementMapper; import com.ruoyi.purchase.dto.VatDto; import com.ruoyi.purchase.service.PurchaseReportService; import com.ruoyi.purchase.vo.PurchaseReportVo; import com.ruoyi.sales.mapper.SalesLedgerMapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @Service @Slf4j @RequiredArgsConstructor public class PurchaseReportServiceImpl implements PurchaseReportService { private final SalesLedgerMapper salesLedgerMapper; private final AccountStatementMapper accountStatementMapper; @Override public IPage<PurchaseReportVo> list(Page page, String customerName) { return salesLedgerMapper.selectPurchaseReportVoPage(page, customerName); } @Override public IPage<VatDto> listVat(Page page, String month) { return accountStatementMapper.selectVatDtoPage(page, month); } } src/main/java/com/ruoyi/purchase/vo/PurchaseReportVo.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ package com.ruoyi.purchase.vo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.math.BigDecimal; @Data @Schema(name = "PurchaseReportVo", description = "管ç驾驶è±--项ç®å©æ¶¦åæ°") @ExcelIgnoreUnannotated public class PurchaseReportVo { @Schema(description = "éå®ååå·") @Excel(name = "éå®ååå·") private String customerContractNo; @Schema(description = "客æ·åç§°") @Excel(name = "客æ·åç§°") private String customerName; @Schema(description = "项ç®åç§°") @Excel(name = "项ç®åç§°") private String projectName; @Excel(name = "ååéé¢") @Schema(description = "ååéé¢") private BigDecimal contractAmount; @Excel(name = "éè´éé¢") @Schema(description = "éè´éé¢") private BigDecimal purchaseAmount; @Schema(description = "婿¶¦") @Excel(name = "婿¶¦") private BigDecimal balance; @Schema(description = "婿¶¦ç") @Excel(name = "婿¶¦ç") private BigDecimal balanceRatio; } src/main/java/com/ruoyi/sales/mapper/SalesLedgerMapper.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.home.dto.IncomeExpenseAnalysisDto; import com.ruoyi.purchase.vo.PurchaseReportVo; import com.ruoyi.sales.dto.SalesLedgerDto; import com.ruoyi.sales.dto.SalesTrendDto; import com.ruoyi.sales.dto.StatisticsTableDto; @@ -86,4 +87,7 @@ List<SalesTrendDto> statisticsTable(@Param("statisticsTableDto")StatisticsTableDto statisticsTableDto); IPage<SalesLedgerDto> listSalesLedgerAndShipped(Page page, @Param("ew") SalesLedgerDto salesLedgerDto); IPage<PurchaseReportVo> selectPurchaseReportVoPage(Page page, @Param("customerName") String customerName); } src/main/resources/application.yml
@@ -3,7 +3,7 @@ main: allow-circular-references: true profiles: active: dev active: dev-pro langchain4j: mcp: # MCP æå¡ç«¯å°åï¼æ ¹æ®å®é é¨ç½²ç MCP æå¡è°æ´ï¼ src/main/resources/mapper/account/AccountStatementMapper.xml
@@ -40,4 +40,39 @@ </if> ORDER BY lj.statement_month DESC </select> <select id="selectVatDtoPage" resultType="com.ruoyi.purchase.dto.VatDto"> SELECT month, jTaxAmount, xTaxAmount, (jTaxAmount - xTaxAmount) AS taxAmount FROM ( SELECT month, SUM(IF(type = 'purchase', tax_price, 0)) AS xTaxAmount, SUM(IF(type = 'sales', tax_price, 0)) AS jTaxAmount FROM ( SELECT DATE_FORMAT(issue_date, '%Y-%m') AS month, tax_price, 'sales' AS type FROM account_sales_invoice WHERE status != 1 UNION ALL SELECT DATE_FORMAT(issue_date, '%Y-%m') AS month, tax_price, 'purchase' AS type FROM account_purchase_invoice WHERE status != 1 ) AS all_data GROUP BY month ) AS TT <where> <if test="month != null"> and TT.month = #{month} </if> </where> ORDER BY TT.month </select> </mapper> src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -121,5 +121,21 @@ </if> order by sl.execution_date desc </select> <select id="selectPurchaseReportVoPage" resultType="com.ruoyi.purchase.vo.PurchaseReportVo"> select sl.sales_contract_no customerContractNo, c.customer_name, sl.project_name, sl.contract_amount contractAmount, pl.contract_amount purchaseAmount, sl.contract_amount-pl.contract_amount balance, (sl.contract_amount-pl.contract_amount)/sl.contract_amount balanceRatio from sales_ledger sl left join purchase_ledger pl on sl.id = pl.sales_ledger_id left join customer c on sl.customer_id = c.id where 1=1 <if test="customerName != null and customerName != '' "> and c.customer_name like concat('%',#{customerName},'%') </if> </select> </mapper>