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; }