Browse Source

# 计划类型消息推送接口修改

zhongwei
haungxing 2 years ago
parent
commit
c304111c84
  1. 4
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  2. 5
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java
  3. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

4
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java

@ -49,6 +49,10 @@ public class MessageConstants {
EQUIPMENT("equipment","设备管理"),
SAFE_PRODUCT("safeProduct","安全管理"),
ASSETS("assets","资产管理"),
WARNING("warning","告警消息"),
DUTY("duty","值班消息"),
SAFE("safe","安全消息"),
ACCESS("access","检修消息"),
;
@Getter
private String key;

5
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java

@ -1,11 +1,14 @@
package com.hnac.hzims.message.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ -44,6 +47,8 @@ public class PlanMsgRecordDto implements Serializable {
private Long receiver;
@ApiModelProperty("消息推送计划时间")
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@NotNull
private LocalDateTime planTime;

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

@ -81,7 +81,9 @@ public class MessageClient extends BladeController implements IMessageClient{
if(Func.isNotEmpty(template.getType())) {
Func.toStrList(",",template.getType()).forEach(type -> {
MessagePushRecordEntity entity = BeanUtil.copy(template,MessagePushRecordEntity.class);
entity.setId(null);
entity.setType(type);
entity.setTaskId(request.getTaskId());
entity.setTemplateId(messageId);
entity.setDeptId(request.getDeptId());
entity.setCreateUser(request.getCreateUser());

Loading…
Cancel
Save