develop
Angel 10 months ago
parent 466bbdbec9
commit 34b1bf63a8

@ -1,11 +1,13 @@
package com.ruoyi.database.controller; package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.MetaAlarmInfo; import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.domain.vo.alarmInfoVO;
import com.ruoyi.database.service.MetaAlarmInfoService; import com.ruoyi.database.service.MetaAlarmInfoService;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
@ -16,6 +18,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -66,6 +70,38 @@ public class MetaAlarmInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/search")
@ApiOperation("根据条件查询接警信息")
public AjaxResult searchAlarmInfo(alarmInfoVO alarmInfoVO) throws Exception {
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>();
// 判断条件是否为空,不为空则加入查询条件
if (StringUtils.isNotBlank(alarmInfoVO.getPoliceReceiverName())) {
queryWrapper.eq("police_receiver_name", alarmInfoVO.getPoliceReceiverName());
}
if (StringUtils.isNotBlank(alarmInfoVO.getInformantName())) {
queryWrapper.eq("informant_name", alarmInfoVO.getInformantName());
}
if (StringUtils.isNotBlank(alarmInfoVO.getAlarmResponseUnit())) {
queryWrapper.like("alarm_response_unit", alarmInfoVO.getAlarmResponseUnit());
}
if (StringUtils.isNotBlank(alarmInfoVO.getInformantPhone())) {
queryWrapper.eq("informant_phone", alarmInfoVO.getInformantPhone());
}
// 添加日期范
// 围查询
if (alarmInfoVO.getStartDate() != null && alarmInfoVO.getEndDate() != null) {
queryWrapper.between("informant_time", alarmInfoVO.getStartDate(), alarmInfoVO.getEndDate());
}
List<MetaAlarmInfo> resultList = metaAlarmInfoService.list(queryWrapper);
return AjaxResult.success(resultList);
}
@GetMapping("/time") @GetMapping("/time")
@ApiOperation("根据时间查询接警信息") @ApiOperation("根据时间查询接警信息")
public TableDataInfo<MetaAlarmInfo> timeList(MetaAlarmInfo metaAlarmInfo) throws Exception { public TableDataInfo<MetaAlarmInfo> timeList(MetaAlarmInfo metaAlarmInfo) throws Exception {
@ -76,17 +112,19 @@ public class MetaAlarmInfoController extends BaseController {
calendar.setTime(parse); calendar.setTime(parse);
calendar.add(Calendar.DAY_OF_MONTH, 1); calendar.add(Calendar.DAY_OF_MONTH, 1);
SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String resultDateString = outputSdf.format(calendar.getTime()); String resultDateString = outputSdf.format(calendar.getTime());
String format = outputSdf.format(parse); String format = outputSdf.format(parse);
QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<MetaAlarmInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.between("alarm_response_time", format, resultDateString); queryWrapper.between("alarm_response_time", format, resultDateString);
int count = metaAlarmInfoService.count(queryWrapper); int count = metaAlarmInfoService.count(queryWrapper);
PageUtils.startPage(); PageUtils.startPage();
List<MetaAlarmInfo> list = metaAlarmInfoService.list(queryWrapper); List<MetaAlarmInfo> list = metaAlarmInfoService.list(queryWrapper);
List<MetaAlarmInfo> alarmInfos = new ArrayList<>(); List<MetaAlarmInfo> alarmInfos = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (MetaAlarmInfo metaAlarmInfo1 : list) { for (MetaAlarmInfo metaAlarmInfo1 : list) {
String informantTime = metaAlarmInfo1.getInformantTime(); String informantTime = metaAlarmInfo1.getInformantTime();
Date parse1 = outputSdf.parse(informantTime); Date parse1 = outputSdf.parse(informantTime);

@ -1,12 +1,10 @@
package com.ruoyi.database.controller; package com.ruoyi.database.controller;
import cn.hutool.db.handler.StringHandler;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.DisposalInfo;
import com.ruoyi.database.domain.MetaImpUserModelInfo; import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.ruoyi.database.domain.TransitHuntersUserModelRecord; import com.ruoyi.database.domain.TransitHuntersUserModelRecord;
import com.ruoyi.database.domain.vo.ImpUserModelVO; import com.ruoyi.database.domain.vo.ImpUserModelVO;
@ -16,8 +14,6 @@ import com.ruoyi.database.service.TransitHuntersUserModelRecordService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -115,7 +111,7 @@ public class MetaImpUserModelInfoController extends BaseController {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1); LocalDateTime minusDay = now.minusDays(1);
QueryWrapper<MetaImpUserModelInfo> metaImpUserModelInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper<MetaImpUserModelInfo> metaImpUserModelInfoQueryWrapper = new QueryWrapper<>();
// metaImpUserModelInfoQueryWrapper.groupBy("data_type"); //metaImpUserModelInfoQueryWrapper.groupBy("data_type");
metaImpUserModelInfoQueryWrapper.in("sign_police_code", strings); metaImpUserModelInfoQueryWrapper.in("sign_police_code", strings);
metaImpUserModelInfoQueryWrapper.between("warning_time", formatter.format(minusDay), formatter.format(now)); metaImpUserModelInfoQueryWrapper.between("warning_time", formatter.format(minusDay), formatter.format(now));
List<MetaImpUserModelInfo> list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper); List<MetaImpUserModelInfo> list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper);
@ -163,6 +159,13 @@ public class MetaImpUserModelInfoController extends BaseController {
if (metaImpUserModelInfo.getKey5()!=null && metaImpUserModelInfo.getValue5()!=null){ if (metaImpUserModelInfo.getKey5()!=null && metaImpUserModelInfo.getValue5()!=null){
map.put(metaImpUserModelInfo.getKey5(), metaImpUserModelInfo.getValue5()); map.put(metaImpUserModelInfo.getKey5(), metaImpUserModelInfo.getValue5());
} }
if (metaImpUserModelInfo.getKey1()!=null && metaImpUserModelInfo.getValue1()!=null){
map.put(metaImpUserModelInfo.getKey1(), metaImpUserModelInfo.getValue1());
}
if (metaImpUserModelInfo.getActivityMessage()!=null){
metaImpUserModelInfo.setKey17("活动信息");
map.put(metaImpUserModelInfo.getKey17(), metaImpUserModelInfo.getActivityMessage());
}
metaImpUserModelInfoVO.setKV(map); metaImpUserModelInfoVO.setKV(map);
} }
if (Objects.equals(metaImpUserModelInfo.getDataType(), "100086")) { if (Objects.equals(metaImpUserModelInfo.getDataType(), "100086")) {
@ -215,7 +218,6 @@ public class MetaImpUserModelInfoController extends BaseController {
metaImpUserModelInfoVO.setKV(map); metaImpUserModelInfoVO.setKV(map);
} }
metaImpUserModelInfoVOS.add(metaImpUserModelInfoVO); metaImpUserModelInfoVOS.add(metaImpUserModelInfoVO);
} }
for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1) { for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list1) {

@ -136,5 +136,7 @@ public class MetaImpUserModelInfo extends BaseEntity {
private String key16; private String key16;
private String value16; private String value16;
@TableField(exist = false)
private String key17;
} }

@ -0,0 +1,17 @@
package com.ruoyi.database.domain.dto;
import com.ruoyi.database.domain.DevopsDeviceInfo;
public class DeviceDTO extends DevopsDeviceInfo {
private String concatenatedAddress;
// getters and setters for the new field
public String getConcatenatedAddress() {
return concatenatedAddress;
}
public void setConcatenatedAddress(String concatenatedAddress) {
this.concatenatedAddress = concatenatedAddress;
}
}

@ -0,0 +1,98 @@
package com.ruoyi.database.domain.vo;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class alarmInfoVO{
/**
*
*/
@ApiModelProperty("警情编码")
@Excel(name = "警情编码")
private String alarmCode;
/**
*
*/
@ApiModelProperty("接警人姓名")
@Excel(name = "接警人姓名")
private String policeReceiverName;
/**
*
*/
@ApiModelProperty("接警单位")
@Excel(name = "接警单位")
private String alarmResponseUnit;
/**
*
*/
@ApiModelProperty("接警时间")
@Excel(name = "接警时间")
private String alarmResponseTime;
/**
*
*/
@ApiModelProperty("报警内容")
@Excel(name = "报警内容")
private String alarmResponseContent;
/**
*
*/
@ApiModelProperty("报警类型名称")
@Excel(name = "报警类型名称")
private String alarmResponseTypeName;
/**
*
*/
@ApiModelProperty("报警人姓名")
@Excel(name = "报警人姓名")
private String informantName;
/**
*
*/
@ApiModelProperty("报警人联系方式")
@Excel(name = "报警人联系方式")
private String informantPhone;
/**
*
*/
@ApiModelProperty("报警时间")
@Excel(name = "报警时间")
private String informantTime;
/**
*
*/
@ApiModelProperty("接警事发地址")
@Excel(name = "接警事发地址")
private String alarmAddress;
/**
*
*/
@ApiModelProperty("经度")
@Excel(name = "经度")
private Double longitude;
/**
*
*/
@ApiModelProperty("纬度")
@Excel(name = "纬度")
private Double latitude;
private String startDate;
private String endDate;
}

@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.business.domain.vo.MetaAlarmInfoAndHandleAlarmVo; import com.ruoyi.business.domain.vo.MetaAlarmInfoAndHandleAlarmVo;
import com.ruoyi.business.domain.vo.MetaAlarmInfoVo; import com.ruoyi.business.domain.vo.MetaAlarmInfoVo;
import com.ruoyi.database.domain.MetaAlarmInfo; import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.domain.vo.alarmInfoVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
@ -91,4 +93,10 @@ public interface MetaAlarmInfoMapper extends BaseMapper<MetaAlarmInfo> {
" ORDER BY informant_time DESC LIMIT 100) a") " ORDER BY informant_time DESC LIMIT 100) a")
public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm(); public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm();
@Select("SELECT * FROM meta_alarm_info " +
"WHERE police_receiver_name LIKE #{policeReceiverName} " +
"AND informant_name LIKE #{informantName} " +
"AND alarm_response_unit LIKE #{alarmResponseUnit} " +
"AND informant_phone LIKE #{informantPhone}")
List<alarmInfoVO> searchAlarmIxnfo(@Param("policeReceiverName") String policeReceiverName, @Param("informantName") String informantName, @Param("alarmResponseUnit") String alarmResponseUnit, @Param("informantPhone") String informantPhone);
} }

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.business.domain.vo.MetaAlarmInfoAndHandleAlarmVo; import com.ruoyi.business.domain.vo.MetaAlarmInfoAndHandleAlarmVo;
import com.ruoyi.business.domain.vo.MetaAlarmInfoVo; import com.ruoyi.business.domain.vo.MetaAlarmInfoVo;
import com.ruoyi.database.domain.MetaAlarmInfo; import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.domain.vo.alarmInfoVO;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -36,4 +38,6 @@ public interface MetaAlarmInfoService extends IService<MetaAlarmInfo> {
public List<MetaAlarmInfoVo> selectTop3AlarmInfo(); public List<MetaAlarmInfoVo> selectTop3AlarmInfo();
public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm(); public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm();
List<alarmInfoVO> searchAlarmIxnfo(@Param("policeReceiverName") String policeReceiverName, @Param("informantName") String informantName, @Param("alarmResponseUnit") String alarmResponseUnit, @Param("informantPhone") String informantPhone);
} }

@ -7,6 +7,7 @@ import com.ruoyi.business.domain.vo.MetaAlarmInfoAndHandleAlarmVo;
import com.ruoyi.business.domain.vo.MetaAlarmInfoVo; import com.ruoyi.business.domain.vo.MetaAlarmInfoVo;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.database.domain.MetaAlarmInfo; import com.ruoyi.database.domain.MetaAlarmInfo;
import com.ruoyi.database.domain.vo.alarmInfoVO;
import com.ruoyi.database.mapper.MetaAlarmInfoMapper; import com.ruoyi.database.mapper.MetaAlarmInfoMapper;
import com.ruoyi.database.service.MetaAlarmInfoService; import com.ruoyi.database.service.MetaAlarmInfoService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -69,4 +70,9 @@ public class MetaAlarmInfoServiceImpl extends ServiceImpl<MetaAlarmInfoMapper, M
public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm() { public List<MetaAlarmInfoAndHandleAlarmVo> listAlarmAndHandleAlarm() {
return alarmInfoMapper.listAlarmAndHandleAlarm(); return alarmInfoMapper.listAlarmAndHandleAlarm();
} }
@Override
public List<alarmInfoVO> searchAlarmIxnfo(String policeReceiverName, String informantName, String alarmResponseUnit, String informantPhone) {
return alarmInfoMapper.searchAlarmIxnfo(policeReceiverName, informantName, alarmResponseUnit, informantPhone);
}
} }

Loading…
Cancel
Save