Commit 3e651828 authored by tangwei's avatar tangwei

修改接口

parent a2c54fcc
...@@ -86,10 +86,10 @@ public class AlertCalledDto extends BaseDto{ ...@@ -86,10 +86,10 @@ public class AlertCalledDto extends BaseDto{
private String rescueGrid; private String rescueGrid;
@ApiModelProperty(value = "坐标x") @ApiModelProperty(value = "坐标x")
private String coordinateX; private Double coordinateX;
@ApiModelProperty(value = "坐标y") @ApiModelProperty(value = "坐标y")
private String coordinateY; private Double coordinateY;
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateTime; private Date updateTime;
......
...@@ -93,10 +93,10 @@ public class AlertCalled extends BaseEntity { ...@@ -93,10 +93,10 @@ public class AlertCalled extends BaseEntity {
private String rescueGrid; private String rescueGrid;
@ApiModelProperty(value = "经度") @ApiModelProperty(value = "经度")
private String coordinateX; private Double coordinateX;
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private String coordinateY; private Double coordinateY;
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateTime; private Date updateTime;
......
...@@ -90,10 +90,10 @@ public class ESAlertCalled { ...@@ -90,10 +90,10 @@ public class ESAlertCalled {
/** /**
* 坐标x * 坐标x
*/ */
private String coordinateX; private Double coordinateX;
/** /**
* 坐标y * 坐标y
*/ */
private String coordinateY; private Double coordinateY;
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -135,7 +136,26 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -135,7 +136,26 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) { public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) {
try { try {
// 警情基本信息 // 警情基本信息
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled(); AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
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()); alertCalled.setCallTime(new Date());
if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())|| if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){ AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){
...@@ -197,6 +217,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -197,6 +217,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledObjsDto; return alertCalledObjsDto;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("报送失败,系统异常!"); throw new RuntimeException("报送失败,系统异常!");
} }
} }
...@@ -405,4 +426,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -405,4 +426,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public AlertCalled getAlertCalledById(Long id) { public AlertCalled getAlertCalledById(Long id) {
return this.getById(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