From c304111c84645de0454f86cd113c5f93eb51ab5a Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 14 Apr 2023 16:15:16 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E8=AE=A1=E5=88=92=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/message/MessageConstants.java | 4 ++++ .../src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java | 5 +++++ .../src/main/java/com/hnac/hzims/message/fegin/MessageClient.java | 2 ++ 3 files changed, 11 insertions(+) diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java index f8d51ff..e6a42b3 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java +++ b/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; diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java index e449437..0fa7270 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/PlanMsgRecordDto.java +++ b/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; diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java index 60ac7bc..b997af9 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java +++ b/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());