预警信息接口更新

develop
hanrenchun 10 months ago
parent 9e0dace244
commit 22f01e5336

@ -9,12 +9,15 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.domain.DisposalInfo;
import com.ruoyi.database.domain.TransitHuntersUserModelRecord;
import com.ruoyi.database.service.DisposalInfoService;
import com.ruoyi.database.service.TransitHuntersUserModelRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@Api(tags = "预警信息处置表")
@ -24,20 +27,48 @@ import java.util.List;
public class DisposalInfoController extends BaseController {
private final DisposalInfoService disposalInfoService;
private final TransitHuntersUserModelRecordService transitHuntersUserModelRecordService;
@GetMapping
@ApiOperation("查询预警信息处置表")
public TableDataInfo<DisposalInfo> list(DisposalInfo disposalInfo) {
public TableDataInfo<DisposalInfo> list() {
startPage();
List<DisposalInfo> list = disposalInfoService.list(new QueryWrapper<>(disposalInfo));
return getDataTable(list);
List<TransitHuntersUserModelRecord> list1 = transitHuntersUserModelRecordService.list();
ArrayList<TransitHuntersUserModelRecord> transitHuntersUserModelRecords = new ArrayList<>();
for (TransitHuntersUserModelRecord transitHuntersUserModelRecord :list1){
Long id = transitHuntersUserModelRecord.getId();
DisposalInfo one = disposalInfoService.lambdaQuery().eq(DisposalInfo::getHuntersModelRecordId, id).one();
if (one != null){
transitHuntersUserModelRecord.setDisposalResult(one.getDisposalResult());
transitHuntersUserModelRecord.setSignStatus(one.getSignStatus());
if (one.getRiskDesc()!=null){
transitHuntersUserModelRecord.setRisk("有风险");
}else {
transitHuntersUserModelRecord.setRisk("无风险");
}
} else {
transitHuntersUserModelRecord.setDisposalResultCn("未处置");
transitHuntersUserModelRecord.setDisposalResult(1);
}
transitHuntersUserModelRecords.add(transitHuntersUserModelRecord);
}
return getDataTable(transitHuntersUserModelRecords);
}
@PostMapping
@ApiOperation("新增预警信息处置表")
@Log(title = "预警信息处置表", businessType = BusinessType.INSERT)
public AjaxResult insert(@RequestBody DisposalInfo disposalInfo) {
if (disposalInfo.getDisposalResultCn()!=null){
boolean equals = "未处置".equals(disposalInfo.getDisposalResultCn());
if (equals){
disposalInfo.setDisposalResult(1);
}else {
disposalInfo.setDisposalResult(2);
}
}
// if (disposalInfo.getDisposalResultCn())
return toAjax(disposalInfoService.save(disposalInfo));
}

@ -0,0 +1,67 @@
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.page.TableDataInfo;
import com.ruoyi.database.domain.DisposalInfo;
import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.ruoyi.database.service.MetaImpUserModelInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@Api(tags = "重点人员预警信息表")
@RestController
@RequiredArgsConstructor
@RequestMapping("/base/metaImpUserModelInfo")
public class MetaImpUserModelInfoController extends BaseController {
private final MetaImpUserModelInfoService metaImpUserModelInfoService;
@GetMapping
@ApiOperation("查询重点人员预警信息表")
public TableDataInfo<MetaImpUserModelInfo> list() {
startPage();
ArrayList<String> strings = new ArrayList<>();
strings.add("320924510000");
strings.add("320924510102");
strings.add("320924510101");
strings.add("320924830100");
strings.add("320924830000");
strings.add("320924680000");
QueryWrapper<MetaImpUserModelInfo> metaImpUserModelInfoQueryWrapper = new QueryWrapper<>();
metaImpUserModelInfoQueryWrapper.in("sign_police_code",strings);
List<MetaImpUserModelInfo> list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper);
return getDataTable(list);
}
@GetMapping("/time")
@ApiOperation("查询24小时重点人员预警信息表")
public TableDataInfo<MetaImpUserModelInfo> timeList() {
startPage();
ArrayList<String> strings = new ArrayList<>();
strings.add("320924510000");
strings.add("320924510102");
strings.add("320924510101");
strings.add("320924830100");
strings.add("320924830000");
strings.add("320924680000");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
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));
List<MetaImpUserModelInfo> list = metaImpUserModelInfoService.list(metaImpUserModelInfoQueryWrapper);
return getDataTable(list);
}
}

@ -49,12 +49,8 @@ public class TransitHuntersUserModelRecordController extends BaseController {
public TableDataInfo<TransitHuntersUserModelRecord> list(TransitHuntersUserModelRecord transitHuntersUserModelRecord) {
startPage();
QueryWrapper<TransitHuntersUserModelRecord> queryWrapper = new QueryWrapper<>(transitHuntersUserModelRecord);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
LocalDateTime minusDay = now.minusDays(1);
SimpleDateFormat outputSdf = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
queryWrapper.between("partition_field", formatter.format(minusDay), formatter.format(now));
List<TransitHuntersUserModelRecord> list = transitHuntersUserModelRecordService.list(queryWrapper);
List<TransitHuntersUserModelRecordVo> listVo = list.stream()
.map(record -> {

@ -0,0 +1,134 @@
package com.ruoyi.database.domain;
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 java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @TableName meta_imp_user_model_info
*/
@TableName(value ="meta_imp_user_model_info")
@Data
public class MetaImpUserModelInfo extends BaseEntity {
@ApiModelProperty("主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Integer dataType;
private String impUserSubType;
private String impUserName;
private String impUserIdCard;
private BigDecimal longitude;
private BigDecimal latitude;
private String activityTime;
private String activityDeviceAddress;
private String activityDeviceCode;
private String activityPoliceStationCode;
private String activityPoliceStationName;
private String activityMessage;
private String signPoliceman;
private String signPolicemanIdCard;
private Integer signStatus;
@TableField(exist = false)
private String signStatusCn;
private Integer disposalStatus;
@TableField(exist = false)
private String disposalStatusCn;
private String signPoliceStation;
private String signPoliceCode;
private String warningTime;
private String isImpAddress;
private String key1;
private String value1;
private String key2;
private String value2;
private String key3;
private String value3;
private String key4;
private String value4;
private String key5;
private String value5;
private String key6;
private String value6;
private String key7;
private String value7;
private String key8;
private String value8;
private String key9;
private String value9;
private String key10;
private String value10;
private String key11;
private String value11;
private String key12;
private String value12;
private String key13;
private String value13;
private String key14;
private String value14;
private String key15;
private String value15;
private String key16;
private String value16;
}

@ -233,4 +233,21 @@ public class TransitHuntersUserModelRecord extends BaseEntity {
@Excel(name = "预警时间(分区)")
private Date partitionField;
@TableField(exist = false)
@ApiModelProperty("签收状态")
@Excel(name = "签收状态")
private Integer signStatus;
@TableField(exist = false)
private String signStatusCn;
@TableField(exist = false)
@ApiModelProperty("处置结果")
@Excel(name = "处置结果")
private Integer disposalResult;
@TableField(exist = false)
private String disposalResultCn;
@TableField(exist = false)
private String risk;
}

@ -0,0 +1,20 @@
package com.ruoyi.database.mapper;
import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author 28758
* @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Mapper
* @createDate 2024-01-28 15:49:30
* @Entity com.ruoyi.database.domain.MetaImpUserModelInfo
*/
@Mapper
public interface MetaImpUserModelInfoMapper extends BaseMapper<MetaImpUserModelInfo> {
}

@ -0,0 +1,13 @@
package com.ruoyi.database.service;
import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 28758
* @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service
* @createDate 2024-01-28 15:49:30
*/
public interface MetaImpUserModelInfoService extends IService<MetaImpUserModelInfo> {
}

@ -0,0 +1,22 @@
package com.ruoyi.database.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.ruoyi.database.service.MetaImpUserModelInfoService;
import com.ruoyi.database.mapper.MetaImpUserModelInfoMapper;
import org.springframework.stereotype.Service;
/**
* @author 28758
* @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service
* @createDate 2024-01-28 15:49:30
*/
@Service
public class MetaImpUserModelInfoServiceImpl extends ServiceImpl<MetaImpUserModelInfoMapper, MetaImpUserModelInfo>
implements MetaImpUserModelInfoService{
}
Loading…
Cancel
Save