Commit b09a9b91 authored by tangwei's avatar tangwei

修改bug

parents 054699ea 20038932
...@@ -76,4 +76,7 @@ public class RequestData { ...@@ -76,4 +76,7 @@ public class RequestData {
@ApiModelProperty(value = "筛选条件-是否120警情") @ApiModelProperty(value = "筛选条件-是否120警情")
private String isAid ; private String isAid ;
@ApiModelProperty(value = "筛选条件-关联视频装备id")
private String equipmentSpecificId;
} }
...@@ -280,6 +280,11 @@ public interface EquipFeignClient { ...@@ -280,6 +280,11 @@ public interface EquipFeignClient {
); );
@RequestMapping(value = "/equipSpecificAlarm/getSpecificId", method = RequestMethod.GET)
String getSpecificId(@RequestParam("id") String id) ;
/** /**
* *
*获取视频列表 *获取视频列表
......
...@@ -66,4 +66,7 @@ public class RequestData { ...@@ -66,4 +66,7 @@ public class RequestData {
@ApiModelProperty(value = "筛选条件-所属单位") @ApiModelProperty(value = "筛选条件-所属单位")
private String bizOrgCode; private String bizOrgCode;
@ApiModelProperty(value = "筛选条件-关联视频装备id")
private String equipmentSpecificId;
} }
\ No newline at end of file
...@@ -184,7 +184,7 @@ public class CommandController extends BaseController { ...@@ -184,7 +184,7 @@ public class CommandController extends BaseController {
@Autowired @Autowired
AirportStandMapper airportStandMapper; AirportStandMapper airportStandMapper;
private static final String JW = "mechinePosition"; private static final String JW = "mechinePosition,seat";
private static final String KEYSITE = "keySiteExcle"; private static final String KEYSITE = "keySiteExcle";
public static final Logger log = LoggerFactory.getLogger(CommandController.class); public static final Logger log = LoggerFactory.getLogger(CommandController.class);
...@@ -420,7 +420,7 @@ public class CommandController extends BaseController { ...@@ -420,7 +420,7 @@ public class CommandController extends BaseController {
case "237": case "237":
case "238": case "238":
for (AlertFormValue alertFormValue : list) { for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldCode().equals(JW) && !StringUtils.isEmpty(alertFormValue.getFieldValue())){ if (JW.contains(alertFormValue.getFieldCode()) && !StringUtils.isEmpty(alertFormValue.getFieldValue())){
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>(); QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",alertFormValue.getFieldValue()); queryWrapper.eq("stand_code",alertFormValue.getFieldValue());
...@@ -438,9 +438,10 @@ public class CommandController extends BaseController { ...@@ -438,9 +438,10 @@ public class CommandController extends BaseController {
par.setLatitude(alertCalled.getCoordinateY()); par.setLatitude(alertCalled.getCoordinateY());
par.setLongitude(alertCalled.getCoordinateX()); par.setLongitude(alertCalled.getCoordinateX());
if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的 if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null); String id = equipFeignClient.getSpecificId(alertCalled.getRelationId());
par.setLatitudeTwo(alertCalled.getCoordinateY()); JSONObject jsonObject = JSONObject.parseObject(id);
par.setLongitudeTwo(alertCalled.getCoordinateX()); String toString = jsonObject.get("result").toString();
par.setEquipmentSpecificId(toString);
}else { }else {
for (AlertFormValue alertFormValue : list) { for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldCode().equals(KEYSITE) && !StringUtils.isEmpty(alertFormValue.getFieldValueCode())) { if (alertFormValue.getFieldCode().equals(KEYSITE) && !StringUtils.isEmpty(alertFormValue.getFieldValueCode())) {
...@@ -458,21 +459,11 @@ public class CommandController extends BaseController { ...@@ -458,21 +459,11 @@ public class CommandController extends BaseController {
} }
ResponseModel<Page<Map<String, Object>>> data = null; ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitude()) ){ if (ValidationUtil.isEmpty(par.getLatitude() ) ){
data = equipFeignClient.getVideopagList( String.valueOf((pageNum - 1) * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),par.getEquipmentName(),par.getBizOrgCode(),par.getType()); data = equipFeignClient.getVideopagList( String.valueOf((pageNum - 1) * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),par.getEquipmentName(),par.getBizOrgCode(),par.getType());
}else { }else {
data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par); data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par);
} }
if (!ObjectUtils.isEmpty(result)&&!ObjectUtils.isEmpty(result.getResult().get("video"))){
List<Map<String, Object>> records = result != null ? (List<Map<String, Object>>) result.getResult().get("video") : null;
Page<Map<String, Object>> page = data.getResult();
records.addAll(data.getResult().getRecords());
page.setRecords(records);
data.setResult(page);
}
// ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.pageVideo(pageNum == 0 ? 1 : pageNum, pageSize, par.getLongitude(), par.getLatitude(), par.getDistance()); // ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.pageVideo(pageNum == 0 ? 1 : pageNum, pageSize, par.getLongitude(), par.getLatitude(), par.getDistance());
Page<Map<String, Object>> pag = data != null ? data.getResult() : null; Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null; List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
......
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipmentBaseAppVO; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipmentBaseAppVO;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.service.IEquipmentService; import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivceAlarm; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivceAlarm;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -39,6 +40,8 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController { ...@@ -39,6 +40,8 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController {
@Autowired @Autowired
IEquipmentSpecificAlarmService iEquipmentSpecificAlarmService; IEquipmentSpecificAlarmService iEquipmentSpecificAlarmService;
@Autowired @Autowired
IEquipmentSpecificAlarmLogService iEquipmentSpecificAlarmLogService;
@Autowired
IEquipmentService iEquipmentService; IEquipmentService iEquipmentService;
@Autowired @Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper; EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
...@@ -59,6 +62,13 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController { ...@@ -59,6 +62,13 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController {
return equipmentSpecificSerivceAlarm.findByTypeAndDate(dto); return equipmentSpecificSerivceAlarm.findByTypeAndDate(dto);
} }
@RequestMapping(value = "/getSpecificId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
public String getSpecificId(String id) {
EquipmentSpecificAlarmLog dto = iEquipmentSpecificAlarmLogService.getById(id);
return dto.getEquipmentSpecificId().toString();
}
@RequestMapping(value = "/getEquipSpecificAlarmNotes", method = RequestMethod.GET) @RequestMapping(value = "/getEquipSpecificAlarmNotes", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取告警日志信息", notes = "获取告警日志信息") @ApiOperation(httpMethod = "GET", value = "获取告警日志信息", notes = "获取告警日志信息")
......
...@@ -550,8 +550,26 @@ ...@@ -550,8 +550,26 @@
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids) FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id GROUP BY id
</if> </if>
<if test="par.equipmentSpecificId!=null and par.equipmentSpecificId!=''">
select
v.id AS id,
v.CODE AS CODE,
v.url AS url,
v.token AS token,
v.NAME AS NAME,
v.address,
v.longitude,
'' AS distance,
v.latitude
from wl_video_equipment_specific as ves
left join wl_video as v on ves.video_id = v.id
where equipment_specific_id = #{par.equipmentSpecificId}
</if>
<if test='par.longitude!=null and par.buildingId!=null '> <if test='par.longitude!=null and par.buildingId!=null '>
UNION ALL UNION
</if>
<if test='par.longitude!=null and par.equipmentSpecificId !=null '>
UNION
</if> </if>
<if test='par.longitude!=null and par.latitude!=null '> <if test='par.longitude!=null and par.latitude!=null '>
(SELECT (SELECT
...@@ -580,7 +598,7 @@ ...@@ -580,7 +598,7 @@
wle.code like concat ('%',#{par.code},'%') wle.code like concat ('%',#{par.code},'%')
</if> </if>
ORDER BY ORDER BY
distance DESC) distance ASC)
</if> </if>
<if test="par.longitudeTwo != null and par.longitude != null"> <if test="par.longitudeTwo != null and par.longitude != null">
UNION UNION
...@@ -605,7 +623,7 @@ ...@@ -605,7 +623,7 @@
wle.longitude IS NOT NULL wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL AND wle.latitude IS NOT NULL
<if test='par.longitudeTwo!=null and par.latitude!=null '> <if test='par.longitudeTwo!=null and par.latitude!=null '>
AND Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AND Round(st_distance(point(wle.longitude,wle.latitude),point(#{par.longitudeTwo},#{par.latitudeTwo} ))*111195,1)
&lt;= #{par.distance} &lt;= #{par.distance}
</if> </if>
<if test='par.type!=null and par.type!="" '> <if test='par.type!=null and par.type!="" '>
...@@ -618,7 +636,7 @@ ...@@ -618,7 +636,7 @@
AND wle.code like concat ('%',#{par.code},'%') AND wle.code like concat ('%',#{par.code},'%')
</if> </if>
ORDER BY ORDER BY
distance DESC) distance ASC)
</if> </if>
union union
SELECT SELECT
...@@ -637,15 +655,37 @@ ...@@ -637,15 +655,37 @@
WHERE WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids) FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id GROUP BY id
) AS a limit #{pageNum},#{pageSize} ) AS a GROUP BY a.id limit #{pageNum},#{pageSize}
</select> </select>
<select id="VideoListByAlertCount" resultType="int"> <select id="VideoListByAlertCount" resultType="int">
SELECT SELECT
count(a.id) count(1)
from
(
SELECT
a.*
FROM FROM
( (
<if test="par.equipmentSpecificId!=null and par.equipmentSpecificId!=''">
select
v.id AS id,
v.CODE AS CODE,
v.url AS url,
v.token AS token,
v.NAME AS NAME,
v.address,
v.longitude,
'' AS distance,
v.latitude
from wl_video_equipment_specific as ves
left join wl_video as v on ves.video_id = v.id
where equipment_specific_id = #{par.equipmentSpecificId}
</if>
<if test='par.longitude!=null and par.equipmentSpecificId !=null '>
UNION
</if>
<if test='par.longitude!=null and par.latitude!=null '> <if test='par.longitude!=null and par.latitude!=null '>
SELECT SELECT
wle.id , wle.id ,
...@@ -727,7 +767,7 @@ ...@@ -727,7 +767,7 @@
WHERE WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids) FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id GROUP BY id
) AS a ) AS a group by a.id ) b
</select> </select>
<select id="pageVideoCount" resultType="int"> <select id="pageVideoCount" resultType="int">
......
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