预警查看详情接口

develop
hanrenchun 10 months ago
parent ee23b55345
commit 08b88c21e0

@ -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;
@ -34,11 +35,26 @@ public class MetaImpUserModelInfoController extends BaseController {
private final MetaImpUserModelInfoService metaImpUserModelInfoService;
private final TransitHuntersUserModelRecordService transitHuntersUserModelRecordService;
// @GetMapping
// @ApiOperation("查询重点人员预警信息详情")
// public TableDataInfo<MetaImpUserModelInfoVO> 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<MetaImpUserModelInfo> 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<MetaImpUserModelInfo> list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper);
QueryWrapper<TransitHuntersUserModelRecord> wrapper = new QueryWrapper<>();
wrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
List<TransitHuntersUserModelRecord> list1 = transitHuntersUserModelRecordService.list(wrapper);
ArrayList<MetaImpUserModelInfoVO> 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);
}

@ -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;

@ -31,4 +31,6 @@ public class MetaImpUserModelInfoVO extends BaseEntity {
private String type;
private Long dataId;
}
Loading…
Cancel
Save