|
@@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.pms.message;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
|
|
|
|
+import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
|
|
import cn.iocoder.yudao.module.system.api.dingtalk.DingtalkSendApi;
|
|
import cn.iocoder.yudao.module.system.api.dingtalk.DingtalkSendApi;
|
|
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
|
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
|
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
|
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
|
@@ -20,6 +22,8 @@ public class PmsMessage {
|
|
private NotifyMessageSendApi notifyMessageSendApi;
|
|
private NotifyMessageSendApi notifyMessageSendApi;
|
|
@Resource
|
|
@Resource
|
|
private DingtalkSendApi dingtalkSendApi;
|
|
private DingtalkSendApi dingtalkSendApi;
|
|
|
|
+ @Resource
|
|
|
|
+ private IotOpeationFillService iotOpeationFillService;
|
|
|
|
|
|
public void sendMessage(Long businessId, String name, String businessType, Long userId, String mobile){
|
|
public void sendMessage(Long businessId, String name, String businessType, Long userId, String mobile){
|
|
Map<String, Object> templateParams = new HashMap<>();
|
|
Map<String, Object> templateParams = new HashMap<>();
|
|
@@ -40,7 +44,16 @@ public class PmsMessage {
|
|
if (PmsConstants.GENERATE_OPERATION.equals(businessType)) {
|
|
if (PmsConstants.GENERATE_OPERATION.equals(businessType)) {
|
|
msg = "您有新的运行记录工单 " + name + ",请处理。"+"["+ DateUtil.format(new Date(),"yyyy-MM-dd hh:mm:ss")+"]";
|
|
msg = "您有新的运行记录工单 " + name + ",请处理。"+"["+ DateUtil.format(new Date(),"yyyy-MM-dd hh:mm:ss")+"]";
|
|
}
|
|
}
|
|
- String url="https://iot.deepoil.cc/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
|
|
|
|
|
|
+ String url = "";
|
|
|
|
+
|
|
|
|
+ if(PmsConstants.GENERATE_OPERATION.equals(businessType)){
|
|
|
|
+ IotOpeationFillDO fillDO = iotOpeationFillService.getIotOpeationFill(businessId);
|
|
|
|
+ url="https://iot.deepoil.cc/dingding?deptId="+fillDO.getDeptId()+"&userId="+userId
|
|
|
|
+ +"&createTime="+fillDO.getCreateTime()+"&id="+businessId+"&orderStatus="+fillDO.getOrderStatus()+"&type="+businessType;
|
|
|
|
+ }else{
|
|
|
|
+ url="https://iot.deepoil.cc/dingding?id="+businessId+"&type="+businessType+"&userId="+userId;
|
|
|
|
+ }
|
|
|
|
+
|
|
dingtalkSendApi.send(mobile, msg,"link", url);
|
|
dingtalkSendApi.send(mobile, msg,"link", url);
|
|
}
|
|
}
|
|
}
|
|
}
|