Browse Source

事件处置过程记录--信息发布

develop
lau572 7 months ago
parent
commit
e0de329a8c
  1. 21
      zc-business/src/main/java/com/zc/business/controller/MsmController.java

21
zc-business/src/main/java/com/zc/business/controller/MsmController.java

@ -3,8 +3,11 @@ package com.zc.business.controller;
import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.zc.business.domain.DcEventProcess;
import com.zc.business.domain.DcWarning;
import com.zc.business.service.IMsmService;
import com.zc.business.service.impl.DcEventProcessServiceImpl;
import com.zc.business.utils.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.INTERNAL;
@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.Array;
import java.rmi.MarshalledObject;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
/**
@ -28,6 +32,8 @@ import java.util.HashMap;
public class MsmController extends BaseController {
@Autowired
private IMsmService msmService;
@Autowired
private DcEventProcessServiceImpl dcEventProcessService;
/**
* 短信推送业务,阿里云短信业务
@ -58,6 +64,10 @@ public class MsmController extends BaseController {
if (map == null ||!map.containsKey("content")|| StringUtils.isBlank(map.get("content").toString())) {
return AjaxResult.error("内容为空");
}
if (!map.containsKey("eventId")|| StringUtils.isBlank(map.get("eventId").toString())) {
return AjaxResult.error("事件id为空");
}
String eventId = map.get("eventId").toString();//事件id
String content = map.get("content").toString();//信息内容
ArrayList<String> array = (ArrayList<String>) map.get("type");
Boolean send = null;
@ -89,6 +99,17 @@ public class MsmController extends BaseController {
}else if (data==0){
weiXin = "微信推送成功"; // 如果所有 dateValue 都为0,则微信推送成功
}
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(eventId);
dcEventProcess.setOperationTime(new Date());
dcEventProcess.setOperator(SecurityUtils.getUserId().toString());
dcEventProcess.setSource(1);
dcEventProcess.setProcessType(2);
String context = "出行信息发布:" + content;
dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess);
if (message!=null&&"短信推送成功".equals(message) &&weiXin!=null&&"微信推送成功".equals(weiXin)) {
return AjaxResult.success(message +","+ weiXin);
} else if (message==null&&weiXin!=null&&"微信推送成功".equals(weiXin)){

Loading…
Cancel
Save