123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package org.dromara.web.controller;
- import cn.dev33.satoken.annotation.SaCheckPermission;
- import jakarta.servlet.http.HttpServletResponse;
- import jakarta.validation.constraints.NotEmpty;
- import jakarta.validation.constraints.NotNull;
- import lombok.RequiredArgsConstructor;
- import org.dromara.common.core.domain.R;
- import org.dromara.common.core.validate.AddGroup;
- import org.dromara.common.core.validate.EditGroup;
- import org.dromara.common.excel.utils.ExcelUtil;
- import org.dromara.common.idempotent.annotation.RepeatSubmit;
- import org.dromara.common.log.annotation.Log;
- import org.dromara.common.log.enums.BusinessType;
- import org.dromara.common.mybatis.core.page.PageQuery;
- import org.dromara.common.mybatis.core.page.TableDataInfo;
- import org.dromara.common.web.core.BaseController;
- import org.dromara.web.domain.bo.SettlementBo;
- import org.dromara.web.domain.vo.SettlementVo;
- import org.dromara.web.service.ISettlementService;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- /**
- * 结算管理
- *
- * @author Lion Li
- * @date 2025-07-22
- */
- @Validated
- @RequiredArgsConstructor
- @RestController
- @RequestMapping("/system/settlement")
- public class SettlementController extends BaseController {
- private final ISettlementService settlementService;
- /**
- * 查询结算管理列表
- */
- @SaCheckPermission("system:settlement:list")
- @GetMapping("/list")
- public TableDataInfo<SettlementVo> list(SettlementBo bo, PageQuery pageQuery) {
- return settlementService.queryPageList(bo, pageQuery);
- }
- /**
- * 导出结算管理列表
- */
- @SaCheckPermission("system:settlement:export")
- @Log(title = "结算管理", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(SettlementBo bo, HttpServletResponse response) {
- List<SettlementVo> list = settlementService.queryList(bo);
- ExcelUtil.exportExcel(list, "结算管理", SettlementVo.class, response);
- }
- /**
- * 获取结算管理详细信息
- *
- * @param id 主键
- */
- @SaCheckPermission("system:settlement:query")
- @GetMapping("/{id}")
- public R<SettlementVo> getInfo(@NotNull(message = "主键不能为空")
- @PathVariable Long id) {
- return R.ok(settlementService.queryById(id));
- }
- /**
- * 新增结算管理
- */
- @SaCheckPermission("system:settlement:add")
- @Log(title = "结算管理", businessType = BusinessType.INSERT)
- @RepeatSubmit()
- @PostMapping()
- public R<Void> add(@Validated(AddGroup.class) @RequestBody SettlementBo bo) {
- return toAjax(settlementService.insertByBo(bo));
- }
- /**
- * 修改结算管理
- */
- @SaCheckPermission("system:settlement:edit")
- @Log(title = "结算管理", businessType = BusinessType.UPDATE)
- @RepeatSubmit()
- @PutMapping()
- public R<Void> edit(@Validated(EditGroup.class) @RequestBody SettlementBo bo) {
- return toAjax(settlementService.updateByBo(bo));
- }
- /**
- * 删除结算管理
- *
- * @param ids 主键串
- */
- @SaCheckPermission("system:settlement:remove")
- @Log(title = "结算管理", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public R<Void> remove(@NotEmpty(message = "主键不能为空")
- @PathVariable Long[] ids) {
- return toAjax(settlementService.deleteWithValidByIds(List.of(ids), true));
- }
- }
|