package com.ruoyi.sales.controller;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.sales.dto.InvoiceLedgerDto;
|
import com.ruoyi.sales.service.InvoiceLedgerService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("/invoiceLedger")
|
public class InvoiceLedgerController {
|
|
@Autowired
|
private InvoiceLedgerService invoiceLedgerService;
|
|
/**
|
* 开票台账新增
|
* @param invoiceLedgerDto
|
* @return
|
*/
|
@PostMapping("/saveOrUpdate")
|
public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
|
invoiceLedgerService.invoiceLedgerSaveOrUpdate(invoiceLedgerDto);
|
return AjaxResult.success();
|
}
|
|
/**
|
* 开票台账删除
|
* @param ids
|
* @return
|
*/
|
@DeleteMapping("/del")
|
public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) {
|
invoiceLedgerService.invoiceLedgerDel(ids);
|
return AjaxResult.success();
|
}
|
|
/**
|
* 开票台账分页查询
|
* @param page
|
* @param invoiceLedgerDto
|
* @return
|
*/
|
@GetMapping("/page")
|
public AjaxResult invoiceLedgerPage(Page page, InvoiceLedgerDto invoiceLedgerDto) {
|
return AjaxResult.success(invoiceLedgerService.invoiceLedgerPage(page, invoiceLedgerDto));
|
}
|
|
/**
|
* 开票台账文件查询
|
* @param invoiceLedgerId
|
* @return
|
*/
|
@GetMapping("/fileList")
|
public AjaxResult invoiceLedgerFileList(Integer invoiceLedgerId) {
|
return AjaxResult.success(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId));
|
}
|
|
/**
|
* 开票台账文件上传
|
* @param file
|
* @return
|
*/
|
@PostMapping("/uploadFile")
|
public AjaxResult invoiceLedgerUploadFile(MultipartFile file) {
|
try {
|
return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file));
|
}catch (Exception e) {
|
return AjaxResult.error(e.getMessage());
|
}
|
}
|
|
/**
|
* 开票台账导出
|
* @param response
|
* @param invoiceLedgerDto
|
* @return
|
*/
|
@PostMapping("/export")
|
public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) {
|
invoiceLedgerService.invoiceLedgerExport(response, invoiceLedgerDto);
|
}
|
|
/**
|
* 开票台账详情
|
* @param id
|
* @return
|
*/
|
@GetMapping("/info")
|
public AjaxResult invoiceLedgerInfo(Integer id) {
|
return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id));
|
}
|
|
/**
|
* 文件提交
|
* @param invoiceLedgerDto
|
* @return
|
*/
|
@PostMapping("/commitFile")
|
public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
|
try {
|
invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto);
|
return AjaxResult.success();
|
}catch (Exception e) {
|
return AjaxResult.error(e.getMessage());
|
}
|
}
|
|
/**
|
* 开票台账查询
|
* @param invoiceLedgerDto
|
* @return
|
*/
|
@GetMapping("/list")
|
public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) {
|
return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto));
|
}
|
|
}
|