Explorar o código

消息通知1

yuanchao hai 2 meses
pai
achega
1d357d1204

+ 12 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/message/PmsMessage.java

@@ -12,6 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -40,6 +43,13 @@ public class PmsMessage {
             templateParams.put("deptId",fillDO.getDeptId());
             templateParams.put("userId",userId);
             templateParams.put("orderStatus",fillDO.getOrderStatus());
+            ZoneId zoneId = ZoneId.of("UTC");
+            ZonedDateTime zonedDateTime = fillDO.getCreateTime().atZone(zoneId);
+            Instant instant = zonedDateTime.toInstant();
+            long timestamp = instant.toEpochMilli();
+            templateParams.put("createTime",timestamp);
+            templateParams.put("userName",fillDO.getUserName());
+            templateParams.put("orderName",fillDO.getOrderName());
 
         }else{
             templateParams.put("name", name);
@@ -65,7 +75,8 @@ public class PmsMessage {
 
             if(PmsConstants.GENERATE_OPERATION.equals(businessType)){
                 url="https://iot.deepoil.cc/dingding?deptId="+fillDO.getDeptId()+"&userId="+userId
-                        +"&createTime="+fillDO.getCreateTime()+"&id="+businessId+"&orderStatus="+fillDO.getOrderStatus()+"&type="+businessType;
+                        +"&createTime="+fillDO.getCreateTime()+"&id="
+                        +businessId+"&orderStatus="+fillDO.getOrderStatus()+"&type="+businessType+"&userName="+fillDO.getUserName()+"&orderName="+fillDO.getOrderName();
             }else{
                 url="https://iot.deepoil.cc/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
             }