智慧保安后台管理-外网项目备份
zengh
2021-08-19 8b464ee379c5b35ac8b22b4e5dde25c4f6fb75cf
src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -21,6 +21,7 @@
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.common.utils.arg;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.mp.support.Condition;
@@ -32,6 +33,8 @@
import org.springblade.modules.desk.service.INoticeService;
import org.springblade.modules.desk.vo.NoticeVO;
import org.springblade.modules.desk.wrapper.NoticeWrapper;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.service.IDeptService;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@@ -51,6 +54,8 @@
public class NoticeController extends BladeController {
   private final INoticeService noticeService;
   private final IDeptService iDeptService;
   /**
    * 详情
@@ -89,6 +94,13 @@
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "分页", notes = "传入notice")
   public R<IPage<NoticeVO>> page(@ApiIgnore NoticeVO notice, Query query) {
      //通过deptId获取组织机构信息
//      Dept dept = iDeptService.getById(notice.getDeptId());
//      if (dept.getDeptCategory() == 1) {
//         notice.setCategory(1);
//      } else {
//         notice.setCategory(2);
//      }
      IPage<NoticeVO> pages = noticeService.selectNoticePage(Condition.getPage(query), notice);
      return R.data(pages);
   }
@@ -119,7 +131,7 @@
   @PostMapping("/submit")
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入notice")
   public R submit(@RequestBody Notice notice) {
   public R submit(@RequestBody Notice notice) throws Exception {
      return R.status(noticeService.saveOrUpdate(notice));
   }
@@ -129,7 +141,7 @@
   @PostMapping("/remove")
   @ApiOperationSupport(order = 7)
   @ApiOperation(value = "逻辑删除", notes = "传入notice")
   public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
   public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) throws Exception {
      boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
      return R.status(temp);
   }