|
|
@@ -0,0 +1,94 @@
|
|
|
+package cn.iocoder.yudao.module.iscs.controller.admin.notifyconfig;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.notifyconfig.vo.NotifyMessagePlanPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.notifyconfig.vo.NotifyMessagePlanRespVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.notifyconfig.vo.NotifyMessagePlanSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.dal.dataobject.notifyconfig.NotifyMessagePlanDO;
|
|
|
+import cn.iocoder.yudao.module.iscs.service.notifyconfig.NotifyMessagePlanService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 计划发送的站内信消息")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iscs/notify-message-plan")
|
|
|
+@Validated
|
|
|
+public class NotifyMessagePlanController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private NotifyMessagePlanService notifyMessagePlanService;
|
|
|
+
|
|
|
+ @PostMapping("/insertNotifyMessagePlan")
|
|
|
+ @Operation(summary = "创建计划发送的站内信消息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:create')")
|
|
|
+ public CommonResult<Long> insertNotifyMessagePlan(@Valid @RequestBody NotifyMessagePlanSaveReqVO createReqVO) {
|
|
|
+ return success(notifyMessagePlanService.createNotifyMessagePlan(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/updateNotifyMessagePlan")
|
|
|
+ @Operation(summary = "更新计划发送的站内信消息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:update')")
|
|
|
+ public CommonResult<Boolean> updateNotifyMessagePlan(@Valid @RequestBody NotifyMessagePlanSaveReqVO updateReqVO) {
|
|
|
+ notifyMessagePlanService.updateNotifyMessagePlan(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deleteNotifyMessagePlanList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除计划发送的站内信消息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:delete')")
|
|
|
+ public CommonResult<Boolean> deleteNotifyMessagePlanList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ notifyMessagePlanService.deleteNotifyMessagePlanListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/selectNotifyMessagePlanById")
|
|
|
+ @Operation(summary = "获得计划发送的站内信消息")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:query')")
|
|
|
+ public CommonResult<NotifyMessagePlanRespVO> selectNotifyMessagePlanById(@RequestParam("id") Long id) {
|
|
|
+ NotifyMessagePlanDO notifyMessagePlan = notifyMessagePlanService.getNotifyMessagePlan(id);
|
|
|
+ return success(BeanUtils.toBean(notifyMessagePlan, NotifyMessagePlanRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getNotifyMessagePlanPage")
|
|
|
+ @Operation(summary = "获得计划发送的站内信消息分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:query')")
|
|
|
+ public CommonResult<PageResult<NotifyMessagePlanRespVO>> getNotifyMessagePlanPage(@Valid NotifyMessagePlanPageReqVO pageReqVO) {
|
|
|
+ PageResult<NotifyMessagePlanDO> pageResult = notifyMessagePlanService.getNotifyMessagePlanPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, NotifyMessagePlanRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/exportNotifyMessagePlanExcel")
|
|
|
+ @Operation(summary = "导出计划发送的站内信消息 Excel")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:notify-message-plan:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportNotifyMessagePlanExcel(@Valid NotifyMessagePlanPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<NotifyMessagePlanDO> list = notifyMessagePlanService.getNotifyMessagePlanPage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "计划发送的站内信消息.xls", "数据", NotifyMessagePlanRespVO.class,
|
|
|
+ BeanUtils.toBean(list, NotifyMessagePlanRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|