소스 검색

没有文件时不进行附件查询

tags/24080901
WendyYang 1 년 전
부모
커밋
15cda0c835
2개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java
  2. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java

+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java 파일 보기

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.sys.entity.req.NoticeListReq;
import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq;
import com.ningdatech.pmapi.sys.entity.req.NoticeStatusModifyReq;
@@ -24,7 +25,7 @@ import javax.validation.Valid;
* @since 2022-07-21
*/
@RestController
@Api(tags = "消息管理")
@Api(tags = "公告管理")
@RequiredArgsConstructor
@RequestMapping("/api/v1/notice")
public class NoticeController {
@@ -33,6 +34,7 @@ public class NoticeController {

@PostMapping("/save")
@ApiOperation("新增通知")
@WebLog("新增公告")
public IdVo<Long> save(@Valid @RequestBody NoticeSaveReq req) {
return noticeManage.saveOrModify(req);
}
@@ -45,6 +47,7 @@ public class NoticeController {

@PostMapping("/enabled")
@ApiOperation("启用禁用")
@WebLog("启用禁用")
public Boolean save(@Valid @RequestBody NoticeStatusModifyReq req) {
return noticeManage.changeEnabled(req);
}
@@ -63,6 +66,7 @@ public class NoticeController {

@DeleteMapping("/del")
@ApiOperation("删除公告")
@WebLog("删除公告")
public void delNotice(@RequestBody IdVo<Long> req) {
noticeManage.delNotice(req.getId());
}


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java 파일 보기

@@ -50,8 +50,10 @@ public class NoticeManage {
Notice notice = noticeService.getById(id);
NoticeDetailVO detail = BeanUtil.copyProperties(notice, NoticeDetailVO.class);
List<Long> fileIds = BizUtils.splitToLong(notice.getAttachment());
List<AttachFileVo> attachFiles = fileService.getByIds(fileIds);
detail.setAttachments(attachFiles);
if (!fileIds.isEmpty()) {
List<AttachFileVo> attachFiles = fileService.getByIds(fileIds);
detail.setAttachments(attachFiles);
}
return detail;
}

@@ -92,7 +94,7 @@ public class NoticeManage {
return PageVo.of(tempDataList, page.getTotal());
}

public void delNotice(Long id){
public void delNotice(Long id) {
noticeService.removeById(id);
}



불러오는 중...
취소
저장