package com.ruoyi.web.controller.zhdd; import cn.afterturn.easypoi.entity.ImageEntity; import cn.afterturn.easypoi.word.WordExportUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpStatus; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.annotation.Security; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.validate.AddGroup; import com.ruoyi.common.core.validate.EditGroup; import com.ruoyi.common.core.validate.QueryGroup; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.RedisUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.UserUtil; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ISysUserService; import com.ruoyi.zhdd.domain.Incident; import com.ruoyi.zhdd.domain.IncidentProcess; import com.ruoyi.zhdd.domain.IncidentTask; import com.ruoyi.zhdd.domain.IncidentUser; import com.ruoyi.zhdd.domain.Plan; import com.ruoyi.zhdd.domain.PlanFile; import com.ruoyi.zhdd.domain.bo.IncidentBo; import com.ruoyi.zhdd.domain.bo.IncidentTasksBo; import com.ruoyi.zhdd.domain.bo.MessagePushUser; import com.ruoyi.zhdd.domain.vo.IncidentTaskVo; import com.ruoyi.zhdd.domain.vo.IncidentVo; import com.ruoyi.zhdd.domain.vo.PlanFileVo; import com.ruoyi.zhdd.domain.vo.PlanVo; import com.ruoyi.zhdd.feign.FeignNoticeInfoService; import com.ruoyi.zhdd.service.IIncidentProcessService; import com.ruoyi.zhdd.service.IIncidentService; import com.ruoyi.zhdd.service.IIncidentTaskService; import com.ruoyi.zhdd.service.IIncidentUserService; import com.ruoyi.zhdd.service.IPlanFileService; import com.ruoyi.zhdd.service.IPlanService; import com.ruoyi.zhdd.service.IPlanTaskService; import com.ruoyi.zhdd.service.IResourceDetailService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.*; import java.util.stream.Collectors; /** * 事件基础Controller * * @author xitong * @date 2021-09-28 */ @Validated @Api(value = "事件基础控制器", tags = {"事件基础管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/zhdd/incident") @Slf4j public class IncidentController extends BaseController { private final IIncidentService iIncidentService; private final IIncidentTaskService incidentTaskService; private final IIncidentProcessService processService; private final IPlanTaskService planTaskService; private final IPlanService planService; private final IPlanFileService planFileService; private final ISysDictDataService sysDictDataService; private final FeignNoticeInfoService feignNoticeInfoService; private final IResourceDetailService resourceDetailService; private final ISysUserService sysUserService; private final ISysDeptService sysDeptService; private final IIncidentUserService incidentUserService; @Value("${spring.profiles.active}") private String env; public static final String NEW_LINE = "\r\n"; /** * 查询事件基础列表 */ @ApiOperation("查询事件基础列表") @GetMapping("/list") @Security public TableDataInfo list(@Validated(QueryGroup.class) IncidentBo bo) { if ("app".equals(bo.getQuerySource())) { bo.setStatus(3); } if (StrUtil.isNotBlank(bo.getStatuss())) { bo.setStatuss(bo.getStatuss().replace("-", "")); } // 根据当前用户的角色及部门筛选可以查询到的事件 LoginUser cacheLoginUser = UserUtil.getCacheLoginUser(); // 查询角色如果包含admin的,直接查询全部 Set userRole = cacheLoginUser.getUserRole(); boolean admin = CollUtil.containsAny(userRole, CollUtil.newHashSet("admin")); if (!admin) { // 查询当前用户和哪些事件相关 List objects = incidentUserService.listObjs(Wrappers.lambdaQuery().select(IncidentUser::getIncidentId).eq(IncidentUser::getUserId, cacheLoginUser.getUserId())); if (objects.size() == 0) { TableDataInfo rspData = new TableDataInfo<>(); rspData.setCode(HttpStatus.HTTP_OK); rspData.setMsg("查询成功"); rspData.setRows(Collections.emptyList()); rspData.setTotal(0); rspData.setPageSize(bo.getPageSize()); rspData.setPageNum(bo.getPageNum()); return rspData; } HashSet incidentIdSet = CollUtil.newHashSet(objects); bo.setIds(incidentIdSet); } return iIncidentService.queryPageList(bo); } /** * 获取事件基础详细信息 */ @ApiOperation("获取事件基础详细信息") @GetMapping("/{id}") // @Security public AjaxResult> getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") String id) { Map map = new HashMap<>(); List planFileVos = new ArrayList<>(); IncidentVo incidentVo = iIncidentService.queryById(id); if (incidentVo == null) { return AjaxResult.success(map); } // 查询上报人、上报组织信息 SysUser sysUser = sysUserService.selectUserByUserName(incidentVo.getCreateBy()); if (sysUser != null) { incidentVo.setCreateBy(sysUser.getNickName()); } SysDept sysDept = sysDeptService.selectDeptById(incidentVo.getCreateDept()); if (sysDept != null) { incidentVo.setCreateDept(sysDept.getDeptName()); } // 组装主办和协办部门数据树 List madinList = new ArrayList<>(); if (StrUtil.isNotBlank(incidentVo.getMadinDept())) { TreeSelect madin = new TreeSelect(); madin.setId(incidentVo.getMadinDept()); madin.setLabel(incidentVo.getMadinDeptText()); madinList.add(madin); } incidentVo.setMadinDeptList(madinList); List assistList = new ArrayList<>(); if (StrUtil.isNotBlank(incidentVo.getAssistDept())) { for (int i = 0; i < incidentVo.getAssistDept().split(",").length; i++) { TreeSelect assist = new TreeSelect(); assist.setId(incidentVo.getAssistDept().split(",")[i]); if (incidentVo.getAssistDept().split(",").length == incidentVo.getAssistDeptText().split(",").length) { assist.setLabel(incidentVo.getAssistDeptText().split(",")[i]); } assistList.add(assist); } } incidentVo.setAssistDeptList(assistList); // 查询所属预案 List voOne = planService.listVo(Wrappers.lambdaQuery().eq(Plan::getType, incidentVo.getType()).eq(Plan::getCreateDept, incidentVo.getPlanDept())); if (voOne != null && voOne.size() > 0) { map.put("baseTask", planTaskService.queryPlanTaskByPlanId(voOne.get(0).getId())); // 查询预案附件 planFileVos = planFileService.listVo(Wrappers.lambdaQuery().eq(PlanFile::getPlanId, voOne.get(0).getId())); } else { map.put("baseTask", null); } map.put("planFile", planFileVos); // 查询处置方案 List incidentTaskVos = incidentTaskService.listTaskInfo(id); map.put("task", incidentTaskVos); // 查询应急资源待办的发送时间 Date resourceSendTime = null; Optional any = incidentTaskVos.stream().filter(a -> StrUtil.equals(a.getSendFlag(), "3") && StrUtil.equals(a.getTaskSend(), "1")).findAny(); if (any.isPresent()) { resourceSendTime = any.get().getCreateTime(); } // 查询有没有发送过指令 Optional sendAny = incidentTaskVos.stream().filter(a -> StrUtil.equals(a.getTaskSend(), "1")).findAny(); map.put("taskSendFlag", sendAny.isPresent()); map.put("resourceSendTime", resourceSendTime); List list = processService.list(Wrappers.lambdaQuery() .eq(IncidentProcess::getIncidentId, id) // .in(IncidentProcess::getIncidentStatus, 3, 4, 5) .orderByAsc(IncidentProcess::getCreateTime)); String distributeTime = ""; String dealTime = ""; String dealEndTime = ""; if (!"dev".equals(env)) { for (IncidentProcess incidentProcess : list) { // 处理首次派发和首页处理的时间 if (StrUtil.isBlank(distributeTime) && incidentProcess.getIncidentStatus() == 2 && StrUtil.contains(incidentProcess.getDes(), "事件派发")) { distributeTime = DateUtil.formatDateTime(incidentProcess.getCreateTime()); } if (StrUtil.isBlank(dealTime) && incidentProcess.getIncidentStatus() == 3) { dealTime = DateUtil.formatDateTime(incidentProcess.getCreateTime()); } if (StrUtil.isBlank(dealEndTime) && incidentProcess.getIncidentStatus() == 6 && StrUtil.contains(incidentProcess.getDes(), "事件办结")) { dealEndTime = DateUtil.formatDateTime(incidentProcess.getCreateTime()); } if (incidentProcess.getStatus() == 1) { // 查询阅读情况 JSONObject o = feignNoticeInfoService.messagePushInfoList("1", "2", incidentProcess.getId()); log.info("查询消息阅读情况:{}", o); // 解析 if (ObjectUtil.isNotEmpty(o)) { Integer total = o.getInt("total"); if (total != null && total > 0) { JSONArray jsonArray = JSONUtil.parseObj(o.getJSONArray("rows").get(0)).getJSONArray("messageReadInfoList"); StringBuilder unMessage = new StringBuilder(); StringBuilder message = new StringBuilder(); for (Object o1 : jsonArray) { JSONObject jsonObject = JSONUtil.parseObj(o1); if ("0".equals(jsonObject.getStr("readState"))) { // 未读 unMessage.append(jsonObject.getStr("nickName")).append("、"); } else if ("1".equals(jsonObject.getStr("readState"))) { // 已读 message.append(jsonObject.getStr("nickName")).append("、"); } } // 循环完之后,去除最后一个顿号 incidentProcess.setUserRead(message.toString()); incidentProcess.setUserUnRead(unMessage.toString()); } } } } } map.put("process", list); // 物资使用情况 map.put("resource", resourceDetailService.queryResourceAvailable(id)); incidentVo.setDistributeTime(distributeTime); incidentVo.setDealTime(dealTime); incidentVo.setDealEndTime(dealEndTime); map.put("baseInfo", incidentVo); return AjaxResult.success(map); } @ApiOperation("获取事件执行日志详细信息") @GetMapping("/process/{id}") public AjaxResult> getProcessInfo(@NotNull(message = "主键不能为空") @PathVariable("id") String id) { Map map = new HashMap<>(); List list = processService.list(Wrappers.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()); // 解析 if (ObjectUtil.isNotEmpty(o)) { Integer total = o.getInt("total"); if (total != null && total > 0) { JSONArray jsonArray = JSONUtil.parseObj(o.getJSONArray("rows").get(0)).getJSONArray("messageReadInfoList"); StringBuilder unMessage = new StringBuilder(); StringBuilder message = new StringBuilder(); for (Object o1 : jsonArray) { JSONObject jsonObject = JSONUtil.parseObj(o1); if ("0".equals(jsonObject.getStr("status"))) { // 未读 unMessage.append(jsonObject.getStr("nickName")).append("、"); } else if ("1".equals(jsonObject.getStr("status"))) { // 已读 message.append(jsonObject.getStr("nickName")).append("、"); } } // 循环完之后,去除最后一个顿号 incidentProcess.setUserRead(message.toString()); incidentProcess.setUserUnRead(unMessage.toString()); } } } } } map.put("process", list); return AjaxResult.success(map); } /** * 新增事件基础 */ @ApiOperation("新增事件基础") // @Log(title = "事件基础", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() @Security public AjaxResult add(@Validated(AddGroup.class) @RequestBody IncidentBo bo) { // 新增初始化为待派发状态 bo.setStatus(2); LoginUser cacheLoginUser = UserUtil.getCacheLoginUser(); bo.setCreateBy(cacheLoginUser.getUsername()); bo.setCreateDept(cacheLoginUser.getUser().getDeptId()); bo.setExpr1(cacheLoginUser.getUser().getPhonenumber()); String id = iIncidentService.insertByBo(bo); // 待新增事件用户关系的array JSONArray saveJsonArray = new JSONArray(); IncidentUser save = new IncidentUser(); save.setIncidentId(id); save.setUserId(cacheLoginUser.getUserId()); save.setSource("1"); saveJsonArray.add(save); RedisUtils.publish(Constants.INCIDENT_USER_BATCH, saveJsonArray); return toAjax(true); } /** * 修改事件基础 */ @ApiOperation("修改事件基础") @RepeatSubmit() @PutMapping() @Security public AjaxResult edit(@Validated(EditGroup.class) @RequestBody IncidentBo bo) { return toAjax(iIncidentService.updateByBo(bo) ? 1 : 0); } /** * 删除事件基础 */ @ApiOperation("删除事件基础") @Log(title = "事件基础", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) { return toAjax(iIncidentService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); } @ApiOperation("新增事件方案") // @Log(title = "事件方案", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping("/task") public AjaxResult addTask(@Validated(AddGroup.class) @RequestBody IncidentTasksBo bo) { return toAjax(incidentTaskService.insertByBo(bo) ? 1 : 0); } @ApiOperation("删除事件方案") // @Log(title = "事件方案", businessType = BusinessType.DELETE) @DeleteMapping("/task/{ids}") public AjaxResult removeTask(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) { return toAjax(incidentTaskService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); } @ApiOperation("事件方案发送") @RepeatSubmit() @PostMapping("/taskSend") public AjaxResult taskSend(@RequestBody IncidentTasksBo bo) { return toAjax(incidentTaskService.taskSend(bo) ? 1 : 0); } @ApiOperation("查询事件-用于首页地图展示") @GetMapping("/location") public AjaxResult>> queryIncidentLocation() { List list = iIncidentService.listVo(Wrappers.lambdaQuery().in(Incident::getStatus, 1, 2, 3)); Map> collect = list.stream().collect(Collectors.groupingBy(IncidentVo::getStatus, Collectors.mapping(a -> a, Collectors.toList()))); Map> result = new HashMap<>(); result.put("预警事件", CollUtil.defaultIfEmpty(collect.get(2), new ArrayList<>())); // result.put("待派发", CollUtil.defaultIfEmpty(collect.get(2), new ArrayList<>())); result.put("处置", CollUtil.defaultIfEmpty(collect.get(3), new ArrayList<>())); return AjaxResult.success(result); } @ApiOperation("事件报告导出") @GetMapping("/download") public void download(@RequestParam String id, HttpServletRequest request, HttpServletResponse response) { // id为事件id Map map = new HashMap<>(); IncidentVo incidentVo = iIncidentService.queryById(id); if (incidentVo != null) { map.put("name", incidentVo.getName()); map.put("nowDate", DateUtil.today()); if (ObjectUtil.isNotEmpty(incidentVo.getType())) { map.put("type", sysDictDataService.selectDictLabel("zhdd_incident_type", Convert.toStr(incidentVo.getType()))); } else { map.put("type", "-"); } map.put("createTime", DateUtil.formatDateTime(incidentVo.getCreateTime())); map.put("addr", incidentVo.getAddr()); map.put("commanderText", StrUtil.blankToDefault(incidentVo.getCommanderText(), "无")); map.put("madinDeptText", StrUtil.blankToDefault(incidentVo.getMadinDeptText(), "部门无")); map.put("assistDeptText", StrUtil.blankToDefault(incidentVo.getAssistDeptText(), "部门无")); // 解析主办部门和协办部门人员 String madinTaskUser = incidentVo.getMadinTaskUser(); if (StrUtil.isNotBlank(madinTaskUser)) { List messagePushUsers = JSONUtil.toList(madinTaskUser, MessagePushUser.class); map.put("madinDeptUser", messagePushUsers.stream().map(MessagePushUser::getNickName).collect(Collectors.joining(","))); } else { map.put("madinDeptUser", "人员无"); } String assistTaskUser = incidentVo.getAssistTaskUser(); if (StrUtil.isNotBlank(assistTaskUser)) { List messagePushUsers = JSONUtil.toList(assistTaskUser, MessagePushUser.class); map.put("assistDeptUser", messagePushUsers.stream().map(MessagePushUser::getNickName).collect(Collectors.joining(","))); } else { map.put("assistDeptUser", "人员无"); } map.put("conclusionDeal", StrUtil.blankToDefault(incidentVo.getConclusionDeal(), "无")); map.put("conclusion", StrUtil.blankToDefault(incidentVo.getConclusion(), "无")); /*if (StrUtil.isNotBlank(incidentVo.getSource())) { map.put("source", sysDictDataService.selectDictLabel("zhdd_incident_source", incidentVo.getSource())); } else { map.put("source", "-"); }*/ if (ObjectUtil.isNotEmpty(incidentVo.getLevel())) { map.put("level", sysDictDataService.selectDictLabel("zhdd_incident_level", Convert.toStr(incidentVo.getLevel())) + "级"); } else { map.put("level", "-"); } // 组装事件图片 List picList = StrUtil.split(incidentVo.getPic(), ","); List pics = new ArrayList<>(); for (String s : picList) { ImageEntity imageEntity = new ImageEntity(); imageEntity.setType(ImageEntity.Data); imageEntity.setHeight(300); imageEntity.setWidth(550); log.info("图片相对地址:{}", s); // 本地资源路径 String localPath = RuoYiConfig.getProfile(); // 数据库资源地址 String downloadPath = localPath + StringUtils.substringAfter(s, Constants.RESOURCE_PREFIX); try { imageEntity.setData(FileUtil.readBytes(downloadPath)); } catch (Exception e) { log.info("读取图片失败:{}", e.getMessage()); continue; } pics.add(imageEntity); } // 查询处置过程 List incidentProcess = processService.list(Wrappers.lambdaQuery() .eq(IncidentProcess::getIncidentId, id).orderByAsc(IncidentProcess::getCreateTime)); Map> processCollect = incidentProcess.stream().filter(a -> StrUtil.isNotBlank(a.getTaskId())).collect(Collectors.groupingBy(IncidentProcess::getTaskId)); // 查询处置方案 List incidentTasks = incidentTaskService.listTaskInfo(id); if (incidentTasks != null && incidentTasks.size() > 0) { StringBuilder tasks = new StringBuilder(); for (int i = 0; i < incidentTasks.size(); i++) { tasks.append(i + 1).append("、"); // .append(incidentTasks.get(i).getTaskName()).append(NEW_LINE) // 查询指令对应的处置过程 List processList = processCollect.get(incidentTasks.get(i).getId()); if (processList != null && processList.size() > 0) { String collect = processList.stream().map(IncidentProcess::getDes).collect(Collectors.joining(NEW_LINE + "\t")); tasks.append(collect).append(NEW_LINE).append("\t"); String picCollect = processList.stream().map(IncidentProcess::getPic).collect(Collectors.joining(",")); for (String s : StrUtil.split(picCollect, ",")) { ImageEntity imageEntity = new ImageEntity(); imageEntity.setType(ImageEntity.Data); imageEntity.setHeight(300); imageEntity.setWidth(550); log.info("图片相对地址:{}", s); // 本地资源路径 String localPath = RuoYiConfig.getProfile(); // 数据库资源地址 String downloadPath = localPath + StringUtils.substringAfter(s, Constants.RESOURCE_PREFIX); try { imageEntity.setData(FileUtil.readBytes(downloadPath)); } catch (Exception e) { log.info("读取图片失败:{}", e.getMessage()); continue; } pics.add(imageEntity); } } } map.put("tasks", tasks.toString()); } else { map.put("tasks", "无"); } map.put("pics", pics); } String fileName = "incident_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".docx"; try { XWPFDocument doc = WordExportUtil.exportWord07( "word/incidentDetail.docx", map); FileOutputStream fos = new FileOutputStream(ExcelUtil.getAbsoluteFile(fileName)); doc.write(fos); // 设置强制下载不打开 response.setContentType("application/force-download"); // 设置文件名 response.addHeader("Content-Disposition", "attachment;fileName=" + fileName); OutputStream out = response.getOutputStream(); doc.write(out); out.close(); } catch (Exception e) { e.printStackTrace(); } finally { delFileWord(ExcelUtil.getAbsoluteFile(fileName)); } } @ApiOperation("事件执行日志导出") @GetMapping("/processDownload") public void processDownload(@RequestParam String id, HttpServletRequest request, HttpServletResponse response) { // id为事件id Map map = new HashMap<>(); IncidentVo incidentVo = iIncidentService.queryById(id); if (incidentVo != null) { map.put("name", incidentVo.getName()); // 查询处置过程 List incidentProcess = processService.list(Wrappers.lambdaQuery() .eq(IncidentProcess::getIncidentId, id).orderByAsc(IncidentProcess::getCreateTime)); for (IncidentProcess process : incidentProcess) { process.setCreateTimeText(DateUtil.formatDateTime(process.getCreateTime())); } map.put("process", incidentProcess); } String fileName = "incident_log_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".docx"; try { XWPFDocument doc = WordExportUtil.exportWord07( "word/incidentProcess.docx", map); FileOutputStream fos = new FileOutputStream(ExcelUtil.getAbsoluteFile(fileName)); doc.write(fos); // 设置强制下载不打开 response.setContentType("application/force-download"); // 设置文件名 response.addHeader("Content-Disposition", "attachment;fileName=" + fileName); OutputStream out = response.getOutputStream(); doc.write(out); out.close(); } catch (Exception e) { e.printStackTrace(); } finally { delFileWord(ExcelUtil.getAbsoluteFile(fileName)); } } @ApiOperation("查询历史事件以及对应的方案") @RepeatSubmit() @GetMapping("/history") public TableDataInfo history(IncidentBo bo) { return iIncidentService.queryHistory(bo); } @ApiOperation("复制事件应急方案") @RepeatSubmit() @PostMapping("/copyTask") public AjaxResult copyTask(@RequestBody JSONObject jsonObject) { String oldId = jsonObject.getStr("oldIncidentId"); String newId = jsonObject.getStr("newIncidentId"); if (StrUtil.hasBlank(oldId, newId)) { return AjaxResult.error("参数存在空值!"); } return toAjax(incidentTaskService.copyTask(oldId, newId) ? 1 : 0); } @ApiOperation("查询事件处置方案是否办结") @RepeatSubmit() @GetMapping("/queryTaskFinish") public AjaxResult queryTaskFinish(@RequestParam String taskId) { IncidentTaskVo voOne = incidentTaskService.getVoOne(Wrappers.lambdaQuery() .eq(IncidentTask::getId, taskId) .in(IncidentTask::getSendFlag, "2", "3") .eq(IncidentTask::getTaskSend, "1") .eq(IncidentTask::getBackLogFlag, "0")); if (voOne != null) { return AjaxResult.success(true); } else { return AjaxResult.success(false); } } @ApiOperation("待办消息办结") @RepeatSubmit() @PostMapping("/backLogFinish") public AjaxResult backLogFinish(@RequestBody JSONObject jsonObject) { String id = jsonObject.getStr("taskId"); if (StrUtil.isBlank(id)) { return AjaxResult.error("参数存在空值!"); } return toAjax(processService.backLogFinish(id) ? 1 : 0); } /** * 删除零时生成的文件 */ public static void delFileWord(String filePath) { File file = new File(filePath); file.delete(); } public static void main(String[] args) { Set set = new HashSet<>(); set.add("common"); set.add("read"); System.out.println(CollUtil.containsAny(set, CollUtil.newHashSet("admin", "update"))); } }