Commit 8c2a9bfb authored by chenzhao's avatar chenzhao

修改bug 120 119 交接班列表 119警情弹框信息补充 相似警情48小时 视频推送规则

parent 2b2156b9
......@@ -63,10 +63,10 @@ public class WaterResourcePoolDto extends BaseDto {
private String recUserName;
@ApiModelProperty(value = "最低报警水位(m)")
private float minWaterLevel;
private Float minWaterLevel;
@ApiModelProperty(value = "最高报警水位(m)")
private float maxWaterLevel;
private Float maxWaterLevel;
@ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId;
......
......@@ -105,8 +105,11 @@
</select>
<select id="pageList" resultType="java.util.Map">
select
d.*
d.*,
jsc.*
from
jc_shift_change jsc
LEFT JOIN
(
select
i.INSTANCE_ID instanceId,
......@@ -130,10 +133,10 @@
</if>
</foreach>
GROUP by
i.INSTANCE_ID) d
i.INSTANCE_ID) d on jsc.instance_id = d.instanceId
<if test="params != null and params.size() > 0">
where
1=1
jsc.is_delete = 0
<foreach collection="params" index="key" item="value" separator="">
<choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''">
......@@ -151,6 +154,9 @@
<if test="params.date != null and params.lift == 'descend'">
order by endDate desc
</if>
<if test="params.systemType != null and params.systemType != '' ">
jsc.system_type is not null
</if>
<if test="params.date != null and params.lift == 'ascend'">
order by endDate ASC
</if>
......
......@@ -422,17 +422,19 @@ public class CommandController extends BaseController {
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",alertFormValue.getFieldValue());
AirportStand airportStand = airportStandMapper.selectOne(queryWrapper);
//机位坐标
par.setLatitude(Double.valueOf(airportStand.getLatitude()));
par.setLongitude(Double.valueOf(airportStand.getLongitude()));
}
}
//集结点坐标
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
break;
case "229":
if (alertCalled.getAlertSourceCode().equals("1326")){
case "229"://一般火灾
par.setLatitude(alertCalled.getCoordinateX());
par.setLongitude(alertCalled.getCoordinateY());
if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null);
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
......@@ -453,7 +455,7 @@ public class CommandController extends BaseController {
}
ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitudeTwo()) ){
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);
......
......@@ -128,14 +128,13 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
return this.baseMapper.selectList(wrapper);
}
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode) {
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode,String systemType) {
Map<String, String> params = this.getRequestParamMap();
//systemType 不是null 则查询的为120系统交接班
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
}
page.setCurrent(current);
page.setSize(size);
if (!params.isEmpty()&&params !=null){
if (!params.get("sort").isEmpty() && params.get("sort") != null){
......@@ -144,6 +143,7 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
params.put("lift",sorts[1]);
}
}
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
......
......@@ -3135,7 +3135,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){
dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString());
}
if ("birthdayTime".equals(dynamicFormInstance.getFieldCode()) && ObjectUtils.isEmpty(peopleInfoDto.getFirefighters().getBirthdayTime())){
dynamicFormInstance.setFieldValue(null);
}
dynamicFormInstancelist.add(dynamicFormInstance);
});
......
......@@ -171,6 +171,7 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceNaturalService.createWithModel(waterResourceNaturalDto);
break;
case "industryPool":
case "waterTank":
case "pool":
// 新增基础信息
model.setIsIot(true);
......
......@@ -104,9 +104,6 @@ public class ShiftChangeController extends BaseController {
public ResponseModel queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
if (current >= 1){
current = (current-1)*size;
}
return ResponseHelper.buildResponse(iShiftChangeService.queryForShiftChangePage(current, size));
}
......
......@@ -261,12 +261,20 @@ public class ESAlertCalledService {
boolMustAll.must(qb0);
}
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000;
long currentTime2 = System.currentTimeMillis();
currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1);
//报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
......@@ -404,12 +412,20 @@ public class ESAlertCalledService {
}
boolMustAll.must(qb0);
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000;
long currentTime2 = System.currentTimeMillis();
currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1);
//报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
......
......@@ -78,6 +78,7 @@ public class RuleAlertCalledService {
// 警情 报送类型
alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setCallTimeStr(alertCalledVo.getAlertCalled().getCallTime().toString());
alertCalledRo.setReplaceContent(replaceContent);
alertCalledRo.setUsIds(usIds);
......
......@@ -4,15 +4,13 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -98,33 +96,14 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override
public IPage<Map<String, Object>> queryForShiftChangePage(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.isNull(ShiftChange::getSystemType);
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"");
return page;
}
@Override
public IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShiftChange::getSystemType,"120");
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"1214");
return page;
}
......
......@@ -359,7 +359,7 @@
<select id="pageBuildingVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
select a.* from (
<if test="dto.buildingId!=null and dto.buildingId!=''">
SELECT
v.id AS id,
v.name AS name,
......@@ -372,7 +372,7 @@
<choose>
<when test="dto.buildingId!=null and dto.buildingId!=''">
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
JOIN wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids)
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
......@@ -387,6 +387,9 @@
<if test="dto.type!=null and dto.type!=''">
and v.type = #{dto.type}
</if>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
</if>
GROUP BY id
</when>
<when test='dto.buildingId == null || dto.buildingId ==""'>
......@@ -410,37 +413,36 @@
GROUP BY id
</when>
</choose>
UNION
</if>
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type}
</if>
GROUP BY id
) AS a limit #{current},#{size}
</select>
<!-- UNION
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type}
</if>
GROUP BY id
) AS a limit #{current},#{size}-->
<select id="pageBuildingVideoCount" resultType="int">
select count(a.id) from (
<if test="dto.buildingId!=null and dto.buildingId!=''">
......@@ -530,8 +532,29 @@
a.*
FROM
(
<if test='par.longitude!=null and par.latitude!=null '>
<if test="par.buildingId!=null and par.buildingId!=''">
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
'' as distance,
v.longitude,
v.latitude
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id
</if>
<if test='par.longitude!=null and par.buildingId!=null '>
UNION ALL
</if>
<if test='par.longitude!=null and par.latitude!=null '>
(SELECT
wle.id ,
wle.`code` ,
wle.url,
......@@ -556,12 +579,14 @@
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
</if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT
(SELECT
wle.id,
wle.`code`,
wle.url,
......@@ -584,14 +609,16 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
AND wle.type = #{par.type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
AND wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
</if>
union
SELECT
......@@ -610,7 +637,7 @@
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id
) AS a ORDER BY a.distance desc limit #{pageNum},#{pageSize}
) AS a limit #{pageNum},#{pageSize}
</select>
......@@ -637,13 +664,13 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{type}
AND wle.type = #{type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remake},'%')
AND wle.remake like concat ('%',#{par.remake},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
......@@ -674,13 +701,13 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
AND wle.type = #{par.type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
AND wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
</if>
union
......
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