|
@@ -6,6 +6,9 @@ import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import cn.hutool.json.JSONArray;
|
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
@@ -29,6 +32,7 @@ import com.ruoyi.zhdd.domain.vo.IncidentTaskCommandVo;
|
|
import com.ruoyi.zhdd.domain.vo.IncidentTaskVo;
|
|
import com.ruoyi.zhdd.domain.vo.IncidentTaskVo;
|
|
import com.ruoyi.zhdd.domain.vo.IncidentVo;
|
|
import com.ruoyi.zhdd.domain.vo.IncidentVo;
|
|
import com.ruoyi.zhdd.domain.vo.PlanVo;
|
|
import com.ruoyi.zhdd.domain.vo.PlanVo;
|
|
|
|
+import com.ruoyi.zhdd.feign.FeignNoticeInfoService;
|
|
import com.ruoyi.zhdd.service.IIncidentProcessService;
|
|
import com.ruoyi.zhdd.service.IIncidentProcessService;
|
|
import com.ruoyi.zhdd.service.IIncidentService;
|
|
import com.ruoyi.zhdd.service.IIncidentService;
|
|
import com.ruoyi.zhdd.service.IIncidentTaskCommandService;
|
|
import com.ruoyi.zhdd.service.IIncidentTaskCommandService;
|
|
@@ -41,6 +45,7 @@ import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -88,6 +93,11 @@ public class IncidentController extends BaseController {
|
|
|
|
|
|
private final ISysDictDataService sysDictDataService;
|
|
private final ISysDictDataService sysDictDataService;
|
|
|
|
|
|
|
|
+ private final FeignNoticeInfoService feignNoticeInfoService;
|
|
|
|
+
|
|
|
|
+ @Value("${spring.profiles.active}")
|
|
|
|
+ private String env;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询事件基础列表
|
|
* 查询事件基础列表
|
|
*/
|
|
*/
|
|
@@ -130,8 +140,45 @@ public class IncidentController extends BaseController {
|
|
}
|
|
}
|
|
// 查询处置方案
|
|
// 查询处置方案
|
|
map.put("task", incidentTaskService.listTaskInfo(id));
|
|
map.put("task", incidentTaskService.listTaskInfo(id));
|
|
- map.put("process", iIncidentProcessService.list(Wrappers.<IncidentProcess>lambdaQuery()
|
|
|
|
- .eq(IncidentProcess::getIncidentId, id).orderByAsc(IncidentProcess::getCreateTime)));
|
|
|
|
|
|
+ List<IncidentProcess> list = iIncidentProcessService.list(Wrappers.<IncidentProcess>lambdaQuery()
|
|
|
|
+ .eq(IncidentProcess::getIncidentId, id).orderByAsc(IncidentProcess::getCreateTime));
|
|
|
|
+ if (!"dev".equals(env)) {
|
|
|
|
+ for (IncidentProcess incidentProcess : list) {
|
|
|
|
+ if (incidentProcess.getStatus() == 1) {
|
|
|
|
+ // 查询阅读情况
|
|
|
|
+ JSONObject o = feignNoticeInfoService.messagePushInfoList("1", "2", incidentProcess.getId());
|
|
|
|
+ System.out.println(o);
|
|
|
|
+ // 解析
|
|
|
|
+ if (ObjectUtil.isNotEmpty(o)) {
|
|
|
|
+ Integer total = o.getInt("total");
|
|
|
|
+ if (total > 0) {
|
|
|
|
+ JSONArray jsonArray = JSONUtil.parseObj(o.getJSONArray("rows").get(0)).getJSONArray("messageReadInfoList");
|
|
|
|
+ String unMessage = "";
|
|
|
|
+ String message = "";
|
|
|
|
+ for (Object o1 : jsonArray) {
|
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(o1);
|
|
|
|
+ if ("0".equals(jsonObject.getStr("readState"))) {
|
|
|
|
+ // 未读
|
|
|
|
+ unMessage = jsonObject.getStr("nickName") + "、";
|
|
|
|
+ } else if ("1".equals(jsonObject.getStr("readState"))) {
|
|
|
|
+ // 已读
|
|
|
|
+ message = jsonObject.getStr("nickName") + "、";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 循环完之后,去除最后一个顿号
|
|
|
|
+ if (StrUtil.isNotBlank(unMessage)) {
|
|
|
|
+ unMessage = StrUtil.removeSuffix(unMessage, "、") + "未读。";
|
|
|
|
+ }
|
|
|
|
+ if (StrUtil.isNotBlank(message)) {
|
|
|
|
+ message = StrUtil.removeSuffix(message, "、") + "已读。";
|
|
|
|
+ }
|
|
|
|
+ incidentProcess.setUserRead(unMessage + message);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("process", list);
|
|
return AjaxResult.success(map);
|
|
return AjaxResult.success(map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -277,5 +324,4 @@ public class IncidentController extends BaseController {
|
|
file.delete();
|
|
file.delete();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|