package com.ruoyi.account.controller.sales;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.bean.dto.sales.AccountSalesCollectionDto;
import com.ruoyi.account.bean.vo.sales.AccountSalesCollectionVo;
import com.ruoyi.account.pojo.sales.AccountSalesCollection;
import com.ruoyi.account.service.sales.AccountSalesCollectionService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
/**
*
* 财务管理--收款单 前端控制器
*
*
* @author 芯导软件(江苏)有限公司
* @since 2026-05-18 03:49:56
*/
@RestController
@RequestMapping("/accountSalesCollection")
@Tag(name = "财务管理--收款单")
@RequiredArgsConstructor
public class AccountSalesCollectionController {
private final AccountSalesCollectionService accountSalesCollectionService;
@GetMapping("/listPageAccountSalesCollection")
@Log(title = "收款单台账", businessType = BusinessType.OTHER)
@Operation(summary = "财务管理--收款单台账")
public R> listPageAccountSalesCollection(Page page, AccountSalesCollectionDto accountSalesCollectionDto) {
IPage listPage = accountSalesCollectionService.listPageAccountSalesCollection(page,accountSalesCollectionDto);
return R.ok(listPage);
}
@GetMapping("/getOutboundBatchesByCustomer")
@Log(title = "根据客户查询出库单号(收款单)", businessType = BusinessType.OTHER)
@Operation(summary = "财务管理--根据客户查询出库单号(收款单)")
public R getOutboundBatchesByCustomer(Integer customerId) {
return R.ok(accountSalesCollectionService.getOutboundBatchesByCustomer(customerId));
}
@PostMapping("/addAccountSalesCollection")
@Log(title = "新增收款单", businessType = BusinessType.INSERT)
@Operation(summary = "财务管理--新增收款单")
public R addAccountSalesCollection(@RequestBody AccountSalesCollection accountSalesCollection) {
return R.ok(accountSalesCollectionService.addAccountSalesCollection(accountSalesCollection));
}
@PutMapping("/updateAccountSalesCollection")
@Log(title = "编辑收款单", businessType = BusinessType.UPDATE)
@Operation(summary = "财务管理--编辑收款单")
public R updateAccountSalesCollection(@RequestBody AccountSalesCollection accountSalesCollection) {
return R.ok(accountSalesCollectionService.updateById(accountSalesCollection));
}
@DeleteMapping("/deleteAccountSalesCollection")
@Log(title = "删除收款单", businessType = BusinessType.DELETE)
@Operation(summary = "财务管理--删除收款单")
public R deleteAccountSalesCollection(@RequestParam("ids") Long[] ids) {
return R.ok(accountSalesCollectionService.deleteAccountSalesCollection(Arrays.asList(ids)));
}
@PostMapping("/exportAccountSalesCollection")
@Operation(summary = "导出收款单文件")
@Log(title = "导出收款单文件", businessType = BusinessType.EXPORT)
public void exportAccountSalesCollection(HttpServletResponse response, AccountSalesCollectionDto accountSalesCollectionDto) {
accountSalesCollectionService.exportAccountSalesCollection(response,accountSalesCollectionDto);
}
}