From dfc095ba02ffc6ad1fb10d69d06ac6c15a333262 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 23 Oct 2020 14:22:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E8=AE=A2=E9=98=85=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=B7=BB=E5=8A=A0messageTime=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java | 6 ++++++ .../java/com/epmet/service/impl/WxmpMessageServiceImpl.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java index 1dc30e2f8c..84ec028cc5 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java @@ -48,4 +48,10 @@ public class WxSubscribeMessageFormDTO implements Serializable { @NotBlank(message = "消息内容不能为空") private String messageContent; + /** + * 消息时间 + */ + @NotNull(message = "消息时间不能为空") + private Date messageTime; + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index bf9d8ed39c..b83429496b 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -196,7 +196,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { jsonObject.put(WxmpMessageConstant.TEMPLATE_ID, templateId); data.put(WxmpMessageConstant.TITLE, new JSONObject().put("value", ("您有一条" + msg.getBehaviorType()).substring(0, WxmpMessageConstant.TITLE_LIMIT))); data.put(WxmpMessageConstant.MESSAGE_CONTENT, new JSONObject().put("value", msg.getMessageContent().substring(0, WxmpMessageConstant.MESSAGE_CONTENT_LIMIT))); - data.put(WxmpMessageConstant.MESSAGE_TIME, new JSONObject().put("value", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()))); + data.put(WxmpMessageConstant.MESSAGE_TIME, new JSONObject().put("value", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(msg.getMessageTime()))); jsonObject.put(WxmpMessageConstant.DATA, data); EnvEnum envEnum = EnvEnum.getCurrentEnv(); //选填项 @@ -289,7 +289,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { wxmpMsgSendRecordEntity.setBehaviorType(msg.getBehaviorType()); wxmpMsgSendRecordEntity.setTitle("您有一条" + msg.getBehaviorType()); wxmpMsgSendRecordEntity.setMessageContent(msg.getMessageContent()); - wxmpMsgSendRecordEntity.setMessageTime(new Date()); + wxmpMsgSendRecordEntity.setMessageTime(msg.getMessageTime()); wxmpMsgSendRecordEntity.setResult(status); return wxmpMsgSendRecordEntity; }