Browse Source

# 计划推送消息接口修改

zhongwei
haungxing 2 years ago
parent
commit
34b1d1fc34
  1. 1
      hzims-service/inspect/pom.xml
  2. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java
  3. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

1
hzims-service/inspect/pom.xml

@ -13,6 +13,7 @@
<groupId>com.hnac.hzinfo.inspect</groupId> <groupId>com.hnac.hzinfo.inspect</groupId>
<artifactId>hzinfo-inspect</artifactId> <artifactId>hzinfo-inspect</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>

2
hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java

@ -70,7 +70,7 @@ public class MessagePushRecordController extends BladeController {
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
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(!record.getPusher().equals(AuthUtil.getUserId())) { if(!(Long.parseLong(record.getPusher()) == AuthUtil.getUserId())) {
return R.fail("当前登录人不是消息推送人,修改状态失败"); return R.fail("当前登录人不是消息推送人,修改状态失败");
} }
LambdaUpdateWrapper<MessagePushRecordEntity> eq = Wrappers.<MessagePushRecordEntity>lambdaUpdate() LambdaUpdateWrapper<MessagePushRecordEntity> eq = Wrappers.<MessagePushRecordEntity>lambdaUpdate()

4
hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

@ -25,6 +25,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.SpringUtil; import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -32,6 +33,7 @@ import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Arrays; import java.util.Arrays;
import java.util.Optional;
/** /**
* @author hx * @author hx
@ -98,7 +100,7 @@ public class MessageClient extends BladeController implements IMessageClient{
entity.setPlanTime(request.getPlanTime()); entity.setPlanTime(request.getPlanTime());
entity.setPushType(MessageConstants.PLAN); entity.setPushType(MessageConstants.PLAN);
entity.setPusher(request.getReceiver().toString()); entity.setPusher(request.getReceiver().toString());
entity.setPusherName(UserCache.getUser(request.getReceiver()).getName()); entity.setPusherName(Optional.ofNullable(UserCache.getUser(request.getReceiver())).map(User::getName).orElse(""));
entity.setAccount(request.getReceiver().toString()); entity.setAccount(request.getReceiver().toString());
entity.setContent(request.getContent()); entity.setContent(request.getContent());
entity.setSmsParam(request.getSmsParam()); entity.setSmsParam(request.getSmsParam());

Loading…
Cancel
Save