|
|
@ -5,13 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
|
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
|
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.entity.MessagePushRecordEntity; |
|
|
|
import com.hnac.hzims.message.entity.MessagePushRecordEntity; |
|
|
|
import com.hnac.hzims.message.service.IMessagePushRecordService; |
|
|
|
import com.hnac.hzims.message.service.IMessagePushRecordService; |
|
|
|
import com.hnac.hzims.message.vo.UnreadMessageVO; |
|
|
|
import com.hnac.hzims.message.vo.UnreadMessageVO; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.annotation.Business; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.annotation.Operate; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.contants.BusinessType; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.log.contants.Risk; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
@ -30,6 +31,7 @@ import java.util.List; |
|
|
|
@RequestMapping("/message/record") |
|
|
|
@RequestMapping("/message/record") |
|
|
|
@Api(value = "消息推送记录", tags = "消息推送记录") |
|
|
|
@Api(value = "消息推送记录", tags = "消息推送记录") |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
|
|
|
|
@Business(module = MessageConstants.APP_NAME,value = "消息中心管理",ignore = false) |
|
|
|
public class MessagePushRecordController extends BladeController { |
|
|
|
public class MessagePushRecordController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
private final IMessagePushRecordService messagePushRecordService; |
|
|
|
private final IMessagePushRecordService messagePushRecordService; |
|
|
@ -37,6 +39,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
@ApiOperation("保存消息推送") |
|
|
|
@ApiOperation("保存消息推送") |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
|
|
|
@Operate(label = "保存消息推送记录",type = BusinessType.INSERT,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> save(@RequestBody MessagePushRecordEntity request) { |
|
|
|
public R<Boolean> save(@RequestBody MessagePushRecordEntity request) { |
|
|
|
return R.status(messagePushRecordService.save(request)); |
|
|
|
return R.status(messagePushRecordService.save(request)); |
|
|
|
} |
|
|
|
} |
|
|
@ -44,6 +47,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@PostMapping("/update") |
|
|
|
@PostMapping("/update") |
|
|
|
@ApiOperation("更新消息推送记录") |
|
|
|
@ApiOperation("更新消息推送记录") |
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
|
|
|
@Operate(label = "保存消息推送记录",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> update(@RequestBody MessagePushRecordEntity request) { |
|
|
|
public R<Boolean> update(@RequestBody MessagePushRecordEntity request) { |
|
|
|
return R.status(messagePushRecordService.updateById(request)); |
|
|
|
return R.status(messagePushRecordService.updateById(request)); |
|
|
|
} |
|
|
|
} |
|
|
@ -51,6 +55,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
@ApiOperation("查询消息推送记录列表") |
|
|
|
@ApiOperation("查询消息推送记录列表") |
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
|
|
|
@Operate(label = "查询消息推送记录列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<List<MessagePushRecordEntity>> list(MessagePushRecordEntity request) { |
|
|
|
public R<List<MessagePushRecordEntity>> list(MessagePushRecordEntity request) { |
|
|
|
return R.data(messagePushRecordService.listNoUserScope(request)); |
|
|
|
return R.data(messagePushRecordService.listNoUserScope(request)); |
|
|
|
} |
|
|
|
} |
|
|
@ -58,10 +63,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/listPage") |
|
|
|
@GetMapping("/listPage") |
|
|
|
@ApiOperation("分页查询消息推送记录列表") |
|
|
|
@ApiOperation("分页查询消息推送记录列表") |
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
@OperationAnnotation( |
|
|
|
@Operate(label = "查询消息推送记录分页列表",type = BusinessType.QUERY,ignore = false) |
|
|
|
moduleName = "消息管理", |
|
|
|
|
|
|
|
title = "消息管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, |
|
|
|
|
|
|
|
action = "分页查询消息推送记录列表") |
|
|
|
|
|
|
|
public R<IPage<MessagePushRecordEntity>> listPage(MessagePushRecordEntity request, Query query) { |
|
|
|
public R<IPage<MessagePushRecordEntity>> listPage(MessagePushRecordEntity request, Query query) { |
|
|
|
return R.data(messagePushRecordService.listPageNoUserScope(request, query)); |
|
|
|
return R.data(messagePushRecordService.listPageNoUserScope(request, query)); |
|
|
|
} |
|
|
|
} |
|
|
@ -69,6 +71,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/send/{id}") |
|
|
|
@GetMapping("/send/{id}") |
|
|
|
@ApiOperation("推送消息记录") |
|
|
|
@ApiOperation("推送消息记录") |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
|
|
|
@Operate(label = "根据消息记录发送消息",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> send(@PathVariable @ApiParam("消息记录ID") Long id) { |
|
|
|
public R<Boolean> send(@PathVariable @ApiParam("消息记录ID") Long id) { |
|
|
|
return R.data(messagePushRecordService.send(id)); |
|
|
|
return R.data(messagePushRecordService.send(id)); |
|
|
|
} |
|
|
|
} |
|
|
@ -76,6 +79,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/readMessage/{id}") |
|
|
|
@GetMapping("/readMessage/{id}") |
|
|
|
@ApiOperation("读取消息") |
|
|
|
@ApiOperation("读取消息") |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
@ApiOperationSupport(order = 6) |
|
|
|
|
|
|
|
@Operate(label = "将消息设为已读",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> readMessage(@PathVariable @ApiParam("消息记录ID") String id) { |
|
|
|
public R<Boolean> readMessage(@PathVariable @ApiParam("消息记录ID") String id) { |
|
|
|
MessagePushRecordEntity record = messagePushRecordService.getById(id); |
|
|
|
MessagePushRecordEntity record = messagePushRecordService.getById(id); |
|
|
|
if (!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) { |
|
|
|
if (!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) { |
|
|
@ -91,6 +95,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/readMessageBatch") |
|
|
|
@GetMapping("/readMessageBatch") |
|
|
|
@ApiOperation("批量处理消息") |
|
|
|
@ApiOperation("批量处理消息") |
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
|
|
|
@Operate(label = "批量将消息设为已读",type = BusinessType.UPDATE,risk = Risk.LOW,ignore = false) |
|
|
|
public R<Boolean> readMessageBatch(@RequestParam(required = false) String businessClassify,@RequestParam(required = false) String type) { |
|
|
|
public R<Boolean> readMessageBatch(@RequestParam(required = false) String businessClassify,@RequestParam(required = false) String type) { |
|
|
|
LambdaUpdateWrapper<MessagePushRecordEntity> eq = Wrappers.<MessagePushRecordEntity>lambdaUpdate() |
|
|
|
LambdaUpdateWrapper<MessagePushRecordEntity> eq = Wrappers.<MessagePushRecordEntity>lambdaUpdate() |
|
|
|
.set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) |
|
|
|
.set(MessagePushRecordEntity::getStatus, MessageConstants.CONFIRM) |
|
|
@ -113,6 +118,7 @@ public class MessagePushRecordController extends BladeController { |
|
|
|
@GetMapping("/getPersonalAppUnreadMessage") |
|
|
|
@GetMapping("/getPersonalAppUnreadMessage") |
|
|
|
@ApiOperation("获取当前登录人APP待办消息") |
|
|
|
@ApiOperation("获取当前登录人APP待办消息") |
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
|
|
|
|
@Operate(label = "获取当前登录人APP待办消息",type = BusinessType.QUERY,ignore = false) |
|
|
|
public R<List<UnreadMessageVO>> getPersonalAppUnreadMessage() { |
|
|
|
public R<List<UnreadMessageVO>> getPersonalAppUnreadMessage() { |
|
|
|
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); |
|
|
|
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); |
|
|
|
return R.data(personalUnreadMessage); |
|
|
|
return R.data(personalUnreadMessage); |
|
|
|