|
@@ -57,7 +57,7 @@ public class PoNoticeController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
|
|
@GetMapping(value = "/{poNoticeId}")
|
|
|
@ApiOperation("获取通知公告内容")
|
|
|
- public AjaxResult getInfo(@PathVariable Long poNoticeId) {
|
|
|
+ public AjaxResult getInfo(@PathVariable("poNoticeId") Long poNoticeId) {
|
|
|
return success(poNoticeService.selectPoNoticeById(poNoticeId));
|
|
|
}
|
|
|
|
|
@@ -69,8 +69,10 @@ public class PoNoticeController extends BaseController {
|
|
|
@ApiOperation("添加通知公告")
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@Validated @RequestBody PoNotice poNotice) {
|
|
|
- System.out.println(poNotice);
|
|
|
- return toAjax(poNoticeService.insertPoNotice(poNotice));
|
|
|
+ List<PoNotice> poNoticeList = poNoticeService.selectPoNoticeList(poNotice);
|
|
|
+ if (poNoticeList == null || poNoticeList.isEmpty())
|
|
|
+ return toAjax(poNoticeService.insertPoNotice(poNotice));
|
|
|
+ return error("重复的公告");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -83,7 +85,7 @@ public class PoNoticeController extends BaseController {
|
|
|
public AjaxResult edit(@Validated @RequestBody PoNotice poNotice) {
|
|
|
List<PoNotice> poNotice1 = poNoticeService.selectPoNoticeList(poNotice);
|
|
|
if (poNotice1 == null || poNotice1.isEmpty())
|
|
|
- return toAjax(false);
|
|
|
+ return error("要修改的公告不存在");
|
|
|
poNotice.setUpdateBy(getUsername());
|
|
|
poNotice.setPublisherId(getUserId());
|
|
|
return toAjax(poNoticeService.updatePoNotice(poNotice));
|