|
@@ -5,8 +5,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.system.domain.PoNotice;
|
|
|
import com.ruoyi.system.service.IPoNoticeService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -30,17 +32,31 @@ public class PoNoticeController extends BaseController {
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
|
|
@GetMapping("/list")
|
|
|
+ @ApiOperation("获取通知公告")
|
|
|
public TableDataInfo list(PoNotice poNotice) {
|
|
|
startPage();
|
|
|
List<PoNotice> list = poNoticeService.selectPoNoticeList(poNotice);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取通知公告列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:notice:list')")
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出通知公告")
|
|
|
+ public AjaxResult export(PoNotice poNotice) {
|
|
|
+ List<PoNotice> list = poNoticeService.selectPoNoticeList(poNotice);
|
|
|
+ ExcelUtil<PoNotice> util = new ExcelUtil<>(PoNotice.class);
|
|
|
+ return util.exportExcel(list, "通知公告列表");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据通知公告编号获取详细信息
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
|
|
@GetMapping(value = "/{poNoticeId}")
|
|
|
+ @ApiOperation("获取通知公告内容")
|
|
|
public AjaxResult getInfo(@PathVariable Long poNoticeId) {
|
|
|
return success(poNoticeService.selectPoNoticeById(poNoticeId));
|
|
|
}
|
|
@@ -50,6 +66,7 @@ public class PoNoticeController extends BaseController {
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
|
|
+ @ApiOperation("添加通知公告")
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@Validated @RequestBody PoNotice poNotice) {
|
|
|
System.out.println(poNotice);
|
|
@@ -61,6 +78,7 @@ public class PoNoticeController extends BaseController {
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
|
|
+ @ApiOperation("编辑通知公告")
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@Validated @RequestBody PoNotice poNotice) {
|
|
|
List<PoNotice> poNotice1 = poNoticeService.selectPoNoticeList(poNotice);
|
|
@@ -76,6 +94,7 @@ public class PoNoticeController extends BaseController {
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
|
|
+ @ApiOperation("删除通知公告")
|
|
|
@DeleteMapping("/{poNoticeIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] poNoticeIds) {
|
|
|
return toAjax(poNoticeService.deletePoNoticeByIds(poNoticeIds));
|