|
@@ -0,0 +1,99 @@
|
|
|
|
+package com.fs.his.controller;
|
|
|
|
+
|
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
+import com.fs.hisStore.domain.FsHomeArticleCategoryScrm;
|
|
|
|
+import com.fs.hisStore.service.IFsHomeArticleCategoryScrmService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 期刊分类Controller
|
|
|
|
+ *
|
|
|
|
+ * @author fs
|
|
|
|
+ * @date 2025-05-21
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/his/homeCategory")
|
|
|
|
+public class FsHomeArticleCategoryController extends BaseController {
|
|
|
|
+ @Autowired
|
|
|
|
+ private IFsHomeArticleCategoryScrmService fsHomeArticleCategoryService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询期刊分类列表
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:list')")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public TableDataInfo list(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
|
|
|
|
+ startPage();
|
|
|
|
+ List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出期刊分类列表
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:export')")
|
|
|
|
+ @Log(title = "期刊分类", businessType = BusinessType.EXPORT)
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ public AjaxResult export(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
|
|
|
|
+ List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
|
|
|
|
+ ExcelUtil<FsHomeArticleCategoryScrm> util = new ExcelUtil<FsHomeArticleCategoryScrm>(FsHomeArticleCategoryScrm.class);
|
|
|
|
+ return util.exportExcel(list, "homeCategory");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取期刊分类详细信息
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:query')")
|
|
|
|
+ @GetMapping(value = "/{categoryId}")
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("categoryId") Long categoryId) {
|
|
|
|
+ return AjaxResult.success(fsHomeArticleCategoryService.selectFsHomeArticleCategoryById(categoryId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增期刊分类
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:add')")
|
|
|
|
+ @Log(title = "期刊分类", businessType = BusinessType.INSERT)
|
|
|
|
+ @PostMapping
|
|
|
|
+ public AjaxResult add(@RequestBody FsHomeArticleCategoryScrm fsHomeArticleCategory) {
|
|
|
|
+ return toAjax(fsHomeArticleCategoryService.insertFsHomeArticleCategory(fsHomeArticleCategory));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改期刊分类
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:edit')")
|
|
|
|
+ @Log(title = "期刊分类", businessType = BusinessType.UPDATE)
|
|
|
|
+ @PutMapping
|
|
|
|
+ public AjaxResult edit(@RequestBody FsHomeArticleCategoryScrm fsHomeArticleCategory) {
|
|
|
|
+ return toAjax(fsHomeArticleCategoryService.updateFsHomeArticleCategory(fsHomeArticleCategory));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除期刊分类
|
|
|
|
+ */
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('store:homeCategory:remove')")
|
|
|
|
+ @Log(title = "期刊分类", businessType = BusinessType.DELETE)
|
|
|
|
+ @DeleteMapping("/{categoryIds}")
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] categoryIds) {
|
|
|
|
+ return toAjax(fsHomeArticleCategoryService.deleteFsHomeArticleCategoryByIds(categoryIds));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/allList")
|
|
|
|
+ public R getAllList(FsHomeArticleCategoryScrm fsHomeArticleCategory) {
|
|
|
|
+ fsHomeArticleCategory.setStatus(1);
|
|
|
|
+ List<FsHomeArticleCategoryScrm> list = fsHomeArticleCategoryService.selectFsHomeArticleCategoryList(fsHomeArticleCategory);
|
|
|
|
+ return R.ok().put("rows", list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|