Commit 07a736e0 authored by Menethil's avatar Menethil
Browse files

添加时间格式化工具类,格式化模版消息通知的时间显示

parent 6becd5da
package org.linlinjava.litemall.core.util;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* 日期格式化工具类
*/
public class DateTimeUtil {
/**
* 格式 yyyy年MM月dd日 HH:mm:ss
*
* @param dateTime
* @return
*/
public static String getDateTimeDisplayString(LocalDateTime dateTime) {
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
String strDate2 = dtf2.format(dateTime);
return strDate2;
}
}
......@@ -11,6 +11,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.notify.NotifyService;
import org.linlinjava.litemall.core.notify.NotifyType;
import org.linlinjava.litemall.core.util.DateTimeUtil;
import org.linlinjava.litemall.core.util.JacksonUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.*;
......@@ -584,10 +585,10 @@ public class WxOrderController {
String[] parms = new String[]{
order.getOrderSn(),
order.getOrderPrice().toString(),
order.getAddTime().toString(),
DateTimeUtil.getDateTimeDisplayString(order.getAddTime()),
order.getConsignee(),
order.getMobile(),
order.getAddress(),
order.getConsignee()
order.getAddress()
};
notifyService.notifyWxTemplate(result.getOpenid(), NotifyType.PAY_SUCCEED, parms, "/pages/index/index?orderId=" + order.getId());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment