chenhj
2026-04-24 88f0547100843be5c5edba3fcc7a5552b566fd24
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -19,17 +19,16 @@
import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.service.ICommonFileService;
import com.ruoyi.sales.service.ISalesLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiParam;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import jakarta.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -48,18 +47,13 @@
@RestController
@RequestMapping("/sales/ledger")
@AllArgsConstructor
@Api(tags = "销售台账")
@Tag(name = "销售台账")
@Slf4j
public class SalesLedgerController extends BaseController {
    private ISalesLedgerService salesLedgerService;
    private ICommonFileService commonFileService;
    @Autowired
    private InvoiceLedgerMapper invoiceLedgerMapper;
    @Autowired
    private ReceiptPaymentMapper receiptPaymentMapper;
    /**
@@ -67,14 +61,14 @@
     */
    @Log(title = "导入销售台账", businessType = BusinessType.INSERT)
    @PostMapping("/import")
    @ApiOperation("导入销售台账")
    @Operation(summary = "导入销售台账")
    public AjaxResult importData(@RequestParam("file")
                                 @ApiParam(value = "Excel文件", required = true)
                                 MultipartFile file) {
        return salesLedgerService.importData(file);
    }
    @ApiOperation("导出销售台账模板")
    @Operation(summary = "导出销售台账模板")
    @PostMapping("/exportTemplate")
    public void exportTemplate(HttpServletResponse response) {
        // 1. 模板文件在resources/static下的路径
@@ -344,7 +338,7 @@
        return iPage;
    }
    @ApiOperation("查询销售台账消耗物料信息")
    @Operation(summary = "查询销售台账消耗物料信息")
    @GetMapping("/getSalesLedgerWithProductsLoss")
    public R getSalesLedgerWithProductsLoss(Long salesLedgerId) {
        return R.ok(salesLedgerService.getSalesLedgerWithProductsLoss(salesLedgerId));