消息通知
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.srs.web.controller.routine;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.srs.routine.domain.NotificationManagement;
|
||||
import com.srs.routine.domain.dto.SendNotificationDto;
|
||||
import com.srs.routine.service.INotificationManagementService;
|
||||
@@ -15,6 +17,7 @@ import com.srs.common.enums.BusinessType;
|
||||
import com.srs.common.annotation.Log;
|
||||
import com.srs.common.core.page.TableDataInfo;
|
||||
import com.srs.comprehensive.domain.SrsGrade;
|
||||
|
||||
/**
|
||||
* 通知管理Controller
|
||||
*
|
||||
@@ -31,11 +34,10 @@ public class NotificationManagementController extends BaseController {
|
||||
/**
|
||||
* 查询通知管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询通知管理列表")
|
||||
public TableDataInfo list(NotificationManagement notificationManagement)
|
||||
{
|
||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询通知管理列表")
|
||||
public TableDataInfo list(NotificationManagement notificationManagement) {
|
||||
startPage();
|
||||
List<NotificationManagement> list = notificationManagementService.selectNotificationManagementList(notificationManagement);
|
||||
return getDataTable(list);
|
||||
@@ -48,8 +50,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@Log(title = "通知管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ApiOperation("导出通知管理列表")
|
||||
public void export(HttpServletResponse response, NotificationManagement notificationManagement)
|
||||
{
|
||||
public void export(HttpServletResponse response, NotificationManagement notificationManagement) {
|
||||
List<NotificationManagement> list = notificationManagementService.selectNotificationManagementList(notificationManagement);
|
||||
ExcelUtil<NotificationManagement> util = new ExcelUtil<NotificationManagement>(NotificationManagement.class);
|
||||
util.exportExcel(response, list, "通知管理数据");
|
||||
@@ -61,8 +62,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取通知管理详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(notificationManagementService.selectNotificationManagementById(id));
|
||||
}
|
||||
|
||||
@@ -73,8 +73,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@Log(title = "通知管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增通知管理")
|
||||
public AjaxResult add(@RequestBody NotificationManagement notificationManagement)
|
||||
{
|
||||
public AjaxResult add(@RequestBody NotificationManagement notificationManagement) {
|
||||
return toAjax(notificationManagementService.insertNotificationManagement(notificationManagement));
|
||||
}
|
||||
|
||||
@@ -85,8 +84,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@Log(title = "通知管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改通知管理")
|
||||
public AjaxResult edit(@RequestBody NotificationManagement notificationManagement)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody NotificationManagement notificationManagement) {
|
||||
return toAjax(notificationManagementService.updateNotificationManagement(notificationManagement));
|
||||
}
|
||||
|
||||
@@ -97,8 +95,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@Log(title = "通知管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/{ids}")
|
||||
@ApiOperation("删除通知管理")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(notificationManagementService.deleteNotificationManagementByIds(ids));
|
||||
}
|
||||
|
||||
@@ -108,8 +105,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:list')")
|
||||
@GetMapping("/gradeList")
|
||||
@ApiOperation("获取年级列表")
|
||||
public AjaxResult getGradeList()
|
||||
{
|
||||
public AjaxResult getGradeList() {
|
||||
List<SrsGrade> gradeList = notificationManagementService.getGradeList();
|
||||
return success(gradeList);
|
||||
}
|
||||
@@ -121,8 +117,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@Log(title = "按年级发送通知", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/sendByGrades")
|
||||
@ApiOperation("按年级发送通知")
|
||||
public AjaxResult sendNotificationByGrades(@RequestBody SendNotificationDto sendNotificationDto)
|
||||
{
|
||||
public AjaxResult sendNotificationByGrades(@RequestBody SendNotificationDto sendNotificationDto) {
|
||||
int result = notificationManagementService.sendNotificationByGrades(sendNotificationDto);
|
||||
return toAjax(result);
|
||||
}
|
||||
@@ -133,8 +128,7 @@ public class NotificationManagementController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:list')")
|
||||
@GetMapping("/my-sent")
|
||||
@ApiOperation("查询当前用户发送的通知列表")
|
||||
public TableDataInfo mySentList(NotificationManagement notificationManagement)
|
||||
{
|
||||
public TableDataInfo mySentList(NotificationManagement notificationManagement) {
|
||||
startPage();
|
||||
List<NotificationManagement> list = notificationManagementService.selectNotificationManagementListBySender(notificationManagement);
|
||||
return getDataTable(list);
|
||||
|
@@ -139,7 +139,12 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量插入
|
||||
return notificationManagementMapper.batchInsertNotification(notifications);
|
||||
int i= notificationManagementMapper.batchInsertNotification(notifications);
|
||||
if (i > 0){
|
||||
// todo 给这些学生发送企业微信消息
|
||||
// 先给:20200016
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user