Commit 3e651828 authored by tangwei's avatar tangwei

修改接口

parent a2c54fcc
......@@ -86,10 +86,10 @@ public class AlertCalledDto extends BaseDto{
private String rescueGrid;
@ApiModelProperty(value = "坐标x")
private String coordinateX;
private Double coordinateX;
@ApiModelProperty(value = "坐标y")
private String coordinateY;
private Double coordinateY;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
......
......@@ -93,10 +93,10 @@ public class AlertCalled extends BaseEntity {
private String rescueGrid;
@ApiModelProperty(value = "经度")
private String coordinateX;
private Double coordinateX;
@ApiModelProperty(value = "纬度")
private String coordinateY;
private Double coordinateY;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
......
......@@ -90,10 +90,10 @@ public class ESAlertCalled {
/**
* 坐标x
*/
private String coordinateX;
private Double coordinateX;
/**
* 坐标y
*/
private String coordinateY;
private Double coordinateY;
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -135,8 +136,27 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) {
try {
// 警情基本信息
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCallTime(new Date());
if(alertCalled.getAddress()!=null){
String[] data= alertCalled.getAddress().split("@address@");
alertCalled.setAddress(data[0]);
if(data[1]!=null&&!"".equals(data[1])){
JSONObject jSONObject = JSON.parseObject(data[1]);
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
alertCalled.setCoordinateX(Double.valueOf(jSONObject.getString("longitude")));
}
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
alertCalled.setCoordinateY(Double.valueOf(jSONObject.getString("latitude")));
}
}
}
alertCalled.setCallTime(new Date());
if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){
alertCalled.setType("0");
......@@ -197,6 +217,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledObjsDto;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("报送失败,系统异常!");
}
}
......@@ -405,4 +426,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public AlertCalled getAlertCalledById(Long id) {
return this.getById(id);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment