Commit c0e29fee authored by zhangsen's avatar zhangsen

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6_temp

parents 7836ca1f 56a0472d
......@@ -321,18 +321,17 @@ public class SupervisionConfigureController extends AbstractBaseController {
item.put("equipment_index_name", stateMap.get("equipment_index_name"));
if ("启动".equals(stateMap.get("equipment_index_name"))) {
long update_time = 0L;
try {
update_time = sdf.parse(String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")).getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
long res = nowDateTime - update_time;
long diffMinute = res / 1000 / 60;
if (diffMinute <= 5) {
time = true;
}
item.put("upTime",diffMinute);
}
}
item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常");
......@@ -341,9 +340,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids);
long diffMinute = 0L;
if (!ObjectUtils.isEmpty(stateMap)) {
List<Map<String, Object>> map = fireFightingSystemMapper.queryStateBySpecificId((long) stateMap.get(0).get("equipment_specific_id"));
String startTime = map.get(0).get("update_date").toString();
String endTime = map.get(1).get("update_date").toString();
String startTime = stateMap.get(0).get("update_date").toString();
String endTime = stateMap.get(1).get("update_date").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start = 0L;
long end = 0L;
......@@ -366,10 +364,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
@PersonIdentify
@RequestMapping(value = "/addVideo", method = RequestMethod.GET)
@RequestMapping(value = "/replaceVideo", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "添加视频", produces = "application/json;charset=UTF-8", notes = "添加视频")
public ResponseModel addVideo(@RequestParam String ids, @RequestParam(required = false) String bizOrgCode) {
@ApiOperation(httpMethod = "POST", value = "添加视频", produces = "application/json;charset=UTF-8", notes = "添加视频")
public ResponseModel replaceVideo(@RequestBody String ids, @RequestParam(required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
......@@ -377,7 +375,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(supervisionVideoService.addVide(ids, bizOrgCode));
return CommonResponseUtil.success(supervisionVideoService.replaceVideo(ids, bizOrgCode));
}
@PersonIdentify
......@@ -396,14 +394,6 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
@PersonIdentify
@RequestMapping(value = "/delVideo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "删除视频", produces = "application/json;charset=UTF-8", notes = "删除视频")
public ResponseModel delVideo(String id) {
return CommonResponseUtil.success(supervisionVideoService.deleteVideo(id));
}
@PersonIdentify
@RequestMapping(value = "/queryVideoAllId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询对应站下所有视频id", produces = "application/json;charset=UTF-8", notes = "根据id查询视频")
......
......@@ -14,5 +14,5 @@ public interface SupervisionVideoMapper extends BaseMapper<SupervisionVideo> {
List<Map<String, Object>> getVideoByCompany(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> queryVideoAllId(@Param("bizOrgCode")String bizOrgCode);
List<String> queryVideoAllId(@Param("bizOrgCode")String bizOrgCode);
}
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
......@@ -15,9 +14,7 @@ public interface ISupervisionVideoService extends IService<SupervisionVideo> {
List queryVideoList(String bizOrgCode);
int deleteVideo(String id);
boolean replaceVideo(String ids,String bizOrgCode);
boolean addVide(String ids,String bizOrgCode);
List<Map<String,Object>> queryVideoAllId(String bizOrgCode);
List<String> queryVideoAllId(String bizOrgCode);
}
......@@ -793,6 +793,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
model.setTerminal("WEB");
Map<String, String> ext = new HashMap<>();
ext.put("isRead", "1");
model.setExtras(ext);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
return i;
......
......@@ -43,13 +43,10 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
return resList;
}
@Override
public int deleteVideo(String id) {
return supervisionVideoMapper.delete(new QueryWrapper<SupervisionVideo>().eq("camera_id", id));
}
@Override
public boolean addVide(String ids, String bizOrgCode) {
public boolean replaceVideo(String ids, String bizOrgCode) {
supervisionVideoMapper.delete(new QueryWrapper<SupervisionVideo>().eq("biz_org_code",bizOrgCode));
List<SupervisionVideo> list = new ArrayList<>();
for (String s : ids.split(",")) {
SupervisionVideo supervisionVideo = new SupervisionVideo();
......@@ -62,7 +59,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
}
@Override
public List<Map<String, Object>> queryVideoAllId(String bizOrgCode) {
public List<String> queryVideoAllId(String bizOrgCode) {
return supervisionVideoMapper.queryVideoAllId(bizOrgCode);
}
}
......@@ -3030,4 +3030,25 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
</sql>
</changeSet>
<changeSet author="xxz" id="20221013xxz" runAlways="true">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="wl_marquee_data"/>
</not>
</preConditions>
<comment>add wl_marquee_data</comment>
<sql>
CREATE TABLE `wl_marquee_data` (
`id` bigint(20) NOT NULL,
`type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',
`position` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '位置',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`message_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息类型',
`is_read` int(10) NULL DEFAULT NULL COMMENT '是否已读【0:未读;1:已读】',
`equipment_specific_id` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -1347,7 +1347,7 @@
find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wles.equipment_specific_index_key like concat (#{param.fireEquipmentSpecificIndexKey},'%')
AND wles.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wles.biz_org_code like concat (#{param.bizOrgCode},'%')
......
......@@ -2493,7 +2493,13 @@
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
......@@ -2505,7 +2511,6 @@
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id ) > 0
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE
......@@ -2970,11 +2975,16 @@
SELECT
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
IFNULL(avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ),0) AS nowLevel
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific_index` `ei` ON FIND_IN_SET(`ei`.`equipment_specific_id`,`rp`.`level_device_id`)
WHERE
`r`.`is_delete` = 1
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -4655,7 +4665,13 @@
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
......@@ -4667,7 +4683,6 @@
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id ) > 0
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE
......@@ -4808,14 +4823,19 @@
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) AS nowLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
ec.image,
r.resource_type AS type,
r.sequence_nbr AS id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
WHERE
r.resource_type = 'waterTank'
......@@ -4930,10 +4950,12 @@
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
AND i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
ORDER BY
i.update_date DESC
limit 2
</select>
<select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT
......
......@@ -8,9 +8,9 @@
where wsv.biz_org_code = #{bizOrgCode}
</select>
<select id="queryVideoAllId" resultType="java.util.Map">
<select id="queryVideoAllId" resultType="java.lang.String">
select wsv.camera_id
from wl_supervision_video wsv
where wsv.biz_org_code = #{bizOrgCode}
where wsv.biz_org_code like concat(#{bizOrgCode},'%');
</select>
</mapper>
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