Commit b09a9b91 authored by tangwei's avatar tangwei

修改bug

parents 054699ea 20038932
......@@ -76,4 +76,7 @@ public class RequestData {
@ApiModelProperty(value = "筛选条件-是否120警情")
private String isAid ;
@ApiModelProperty(value = "筛选条件-关联视频装备id")
private String equipmentSpecificId;
}
......@@ -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 {
@ApiModelProperty(value = "筛选条件-所属单位")
private String bizOrgCode;
@ApiModelProperty(value = "筛选条件-关联视频装备id")
private String equipmentSpecificId;
}
\ No newline at end of file
......@@ -184,7 +184,7 @@ public class CommandController extends BaseController {
@Autowired
AirportStandMapper airportStandMapper;
private static final String JW = "mechinePosition";
private static final String JW = "mechinePosition,seat";
private static final String KEYSITE = "keySiteExcle";
public static final Logger log = LoggerFactory.getLogger(CommandController.class);
......@@ -420,7 +420,7 @@ public class CommandController extends BaseController {
case "237":
case "238":
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.eq("stand_code",alertFormValue.getFieldValue());
......@@ -438,9 +438,10 @@ public class CommandController extends BaseController {
par.setLatitude(alertCalled.getCoordinateY());
par.setLongitude(alertCalled.getCoordinateX());
if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null);
par.setLatitudeTwo(alertCalled.getCoordinateY());
par.setLongitudeTwo(alertCalled.getCoordinateX());
String id = equipFeignClient.getSpecificId(alertCalled.getRelationId());
JSONObject jsonObject = JSONObject.parseObject(id);
String toString = jsonObject.get("result").toString();
par.setEquipmentSpecificId(toString);
}else {
for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldCode().equals(KEYSITE) && !StringUtils.isEmpty(alertFormValue.getFieldValueCode())) {
......@@ -458,21 +459,11 @@ public class CommandController extends BaseController {
}
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());
}else {
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());
Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
......
......@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.EquipmentBaseAppVO;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivceAlarm;
import io.swagger.annotations.Api;
......@@ -39,6 +40,8 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController {
@Autowired
IEquipmentSpecificAlarmService iEquipmentSpecificAlarmService;
@Autowired
IEquipmentSpecificAlarmLogService iEquipmentSpecificAlarmLogService;
@Autowired
IEquipmentService iEquipmentService;
@Autowired
EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
......@@ -59,6 +62,13 @@ public class EquipmentSpecificAlarmController extends AbstractBaseController {
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)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取告警日志信息", notes = "获取告警日志信息")
......
......@@ -550,8 +550,26 @@
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id
</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 '>
UNION ALL
UNION
</if>
<if test='par.longitude!=null and par.equipmentSpecificId !=null '>
UNION
</if>
<if test='par.longitude!=null and par.latitude!=null '>
(SELECT
......@@ -580,7 +598,7 @@
wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
distance ASC)
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
......@@ -605,7 +623,7 @@
wle.longitude IS NOT NULL
AND wle.latitude IS NOT 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}
</if>
<if test='par.type!=null and par.type!="" '>
......@@ -618,7 +636,7 @@
AND wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
distance ASC)
</if>
union
SELECT
......@@ -637,15 +655,37 @@
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id
) AS a limit #{pageNum},#{pageSize}
) AS a GROUP BY a.id limit #{pageNum},#{pageSize}
</select>
<select id="VideoListByAlertCount" resultType="int">
SELECT
count(a.id)
count(1)
from
(
SELECT
a.*
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 '>
SELECT
wle.id ,
......@@ -727,7 +767,7 @@
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id
) AS a
) AS a group by a.id ) b
</select>
<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