diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java index 24df594..eeb28fa 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaImpUserModelInfoController.java @@ -3,6 +3,7 @@ package com.ruoyi.database.controller; import cn.hutool.db.handler.StringHandler; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.database.domain.DisposalInfo; import com.ruoyi.database.domain.MetaImpUserModelInfo; @@ -29,16 +30,31 @@ import java.util.stream.Collectors; @RestController @RequiredArgsConstructor @RequestMapping("/base/metaImpUserModelInfo") -public class MetaImpUserModelInfoController extends BaseController { +public class MetaImpUserModelInfoController extends BaseController { private final MetaImpUserModelInfoService metaImpUserModelInfoService; private final TransitHuntersUserModelRecordService transitHuntersUserModelRecordService; -// @GetMapping -// @ApiOperation("查询重点人员预警信息详情") -// public TableDataInfo list(MetaImpUserModelInfoVO metaImpUserModelInfoVO) { -// return getDataTable(list); -// } + @GetMapping + @ApiOperation("查询重点人员预警信息详情") + public AjaxResult list(MetaImpUserModelInfoVO metaImpUserModelInfoVO) { + if ("重点人员".equals(metaImpUserModelInfoVO.getType())) { + MetaImpUserModelInfo one = metaImpUserModelInfoService.lambdaQuery().eq(MetaImpUserModelInfo::getId, metaImpUserModelInfoVO.getDataId()).one(); + + return AjaxResult.success(one); + } + if ("狩猎人员".equals(metaImpUserModelInfoVO.getType())) { + TransitHuntersUserModelRecord one = transitHuntersUserModelRecordService.lambdaQuery().eq(TransitHuntersUserModelRecord::getId, metaImpUserModelInfoVO.getDataId()).one(); + if (one.getWarningLevel() == 3){ + one.setWarningLevelCn("二级"); + } + if (one.getCaptureFrequency() == 1){ + one.setEndGlobalPic(null); + } + return AjaxResult.success(one); + } + return AjaxResult.error(); + } @GetMapping("/time") @ApiOperation("查询24小时重点人员预警信息表") @@ -55,32 +71,33 @@ public class MetaImpUserModelInfoController extends BaseController { LocalDateTime now = LocalDateTime.now(); LocalDateTime minusDay = now.minusDays(1); QueryWrapper metaImpUserModelInfoQueryWrapper = new QueryWrapper<>(); - metaImpUserModelInfoQueryWrapper.in("sign_police_code",strings); - metaImpUserModelInfoQueryWrapper.between("warning_time",formatter.format(minusDay), formatter.format(now)); + metaImpUserModelInfoQueryWrapper.in("sign_police_code", strings); + metaImpUserModelInfoQueryWrapper.between("warning_time", formatter.format(minusDay), formatter.format(now)); List list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.between("partition_field", formatter.format(minusDay), formatter.format(now)); List list1 = transitHuntersUserModelRecordService.list(wrapper); ArrayList metaImpUserModelInfoVOS = new ArrayList<>(); - for (MetaImpUserModelInfo metaImpUserModelInfo : list){ + for (MetaImpUserModelInfo metaImpUserModelInfo : list) { MetaImpUserModelInfoVO metaImpUserModelInfoVO = new MetaImpUserModelInfoVO(); metaImpUserModelInfoVO.setImpUserSubTypeCn(metaImpUserModelInfo.getImpUserSubTypeCn()); metaImpUserModelInfoVO.setImpUserName(metaImpUserModelInfo.getImpUserName()); metaImpUserModelInfoVO.setImpUserIdCard(metaImpUserModelInfo.getImpUserIdCard()); metaImpUserModelInfoVO.setWarningTime(metaImpUserModelInfo.getWarningTime()); + metaImpUserModelInfoVO.setDataId(metaImpUserModelInfo.getId()); metaImpUserModelInfoVO.setType("重点人员"); - if (metaImpUserModelInfo.getDataType() == 101003){ + if (metaImpUserModelInfo.getDataType() == 101003) { metaImpUserModelInfoVO.setValue(metaImpUserModelInfo.getValue3()); } - if (metaImpUserModelInfo.getDataType() == 060001){ + if (metaImpUserModelInfo.getDataType() == 060001) { metaImpUserModelInfoVO.setValue(metaImpUserModelInfo.getValue4()); } metaImpUserModelInfoVOS.add(metaImpUserModelInfoVO); } - for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1){ + for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1) { MetaImpUserModelInfoVO metaImpUserModelInfoVO = new MetaImpUserModelInfoVO(); metaImpUserModelInfoVO.setImpUserSubTypeCn(transitHuntersUserModelRecord.getHuntersUserTypeCn()); metaImpUserModelInfoVO.setImpUserName(transitHuntersUserModelRecord.getHuntersUserName()); @@ -89,6 +106,7 @@ public class MetaImpUserModelInfoController extends BaseController { String warningTime = transitHuntersUserModelRecord.getWarningTime(); LocalDateTime localDateTime = LocalDateTime.parse(warningTime, inputFormatter); metaImpUserModelInfoVO.setWarningTime(localDateTime.format(formatter)); + metaImpUserModelInfoVO.setDataId(transitHuntersUserModelRecord.getId()); metaImpUserModelInfoVO.setType("狩猎人员"); metaImpUserModelInfoVOS.add(metaImpUserModelInfoVO); } diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java b/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java index a90cb50..114d56e 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; @@ -231,6 +232,7 @@ public class TransitHuntersUserModelRecord extends BaseEntity { */ @ApiModelProperty("预警时间(分区)") @Excel(name = "预警时间(分区)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date partitionField; diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaImpUserModelInfoVO.java b/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaImpUserModelInfoVO.java index d8c0ac2..00488ae 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaImpUserModelInfoVO.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/vo/MetaImpUserModelInfoVO.java @@ -31,4 +31,6 @@ public class MetaImpUserModelInfoVO extends BaseEntity { private String type; + private Long dataId; + } \ No newline at end of file