|
|
@@ -0,0 +1,106 @@
|
|
|
+package org.dromara.backstage.basics.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import jakarta.validation.constraints.*;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
+import org.dromara.common.log.annotation.Log;
|
|
|
+import org.dromara.common.web.core.BaseController;
|
|
|
+import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
+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.log.enums.BusinessType;
|
|
|
+import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
+import org.dromara.backstage.basics.domain.vo.XfInorouttypeVo;
|
|
|
+import org.dromara.backstage.basics.domain.bo.XfInorouttypeBo;
|
|
|
+import org.dromara.backstage.basics.service.IXfInorouttypeService;
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 收支类型
|
|
|
+ * 前端访问路由地址为:/basicParameter/xfInorouttype
|
|
|
+ *
|
|
|
+ * @author Yz
|
|
|
+ * @date 2024-08-05
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/basicParameter/xfInorouttype")
|
|
|
+public class XfInorouttypeController extends BaseController {
|
|
|
+
|
|
|
+ private final IXfInorouttypeService xfInorouttypeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询收支类型列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:list")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<XfInorouttypeVo> list(XfInorouttypeBo bo, PageQuery pageQuery) {
|
|
|
+ return xfInorouttypeService.queryPageList(bo, pageQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出收支类型列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:export")
|
|
|
+ @Log(title = "收支类型", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(XfInorouttypeBo bo, HttpServletResponse response) {
|
|
|
+ List<XfInorouttypeVo> list = xfInorouttypeService.queryList(bo);
|
|
|
+ ExcelUtil.exportExcel(list, "收支类型", XfInorouttypeVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取收支类型详细信息
|
|
|
+ *
|
|
|
+ * @param typeId 主键
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:query")
|
|
|
+ @GetMapping("/{typeId}")
|
|
|
+ public R<XfInorouttypeVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
+ @PathVariable Long typeId) {
|
|
|
+ return R.ok(xfInorouttypeService.queryById(typeId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增收支类型
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:add")
|
|
|
+ @Log(title = "收支类型", businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping()
|
|
|
+ public R<Void> add(@Validated(AddGroup.class) @RequestBody XfInorouttypeBo bo) {
|
|
|
+ return toAjax(xfInorouttypeService.insertByBo(bo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改收支类型
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:edit")
|
|
|
+ @Log(title = "收支类型", businessType = BusinessType.UPDATE)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PutMapping()
|
|
|
+ public R<Void> edit(@Validated(EditGroup.class) @RequestBody XfInorouttypeBo bo) {
|
|
|
+ return toAjax(xfInorouttypeService.updateByBo(bo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除收支类型
|
|
|
+ *
|
|
|
+ * @param typeIds 主键串
|
|
|
+ */
|
|
|
+ @SaCheckPermission("basicParameter:xfInorouttype:remove")
|
|
|
+ @Log(title = "收支类型", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{typeIds}")
|
|
|
+ public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable Long[] typeIds) {
|
|
|
+ return toAjax(xfInorouttypeService.deleteWithValidByIds(List.of(typeIds), true));
|
|
|
+ }
|
|
|
+}
|