Commit 30a496a4 authored by KeYong's avatar KeYong

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents 04d93143 c7b8c2ee
......@@ -382,7 +382,7 @@ public class WaterResourceDto extends BaseDto {
@ExcelIgnore
@ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId;
private String levelDeviceId;
@ApiModelProperty("水池液位显示装置名称")
@ExcelProperty(value = "水池液位显示装置", index = 45)
......
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@TableName("wl_supervision_video")
@ApiModel(value = "Video对象", description = "")
public class SupervisionVideo extends BaseEntity {
private String bizOrgCode;
private String cameraId;
}
......@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.ISupervisionVideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......@@ -46,6 +47,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
private IotFeign iotFeign;
@Autowired
private ISupervisionVideoService supervisionVideoService;
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览水源信息")
......@@ -123,7 +127,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
if (ObjectUtils.isEmpty(bizOrgCode)){
if (ObjectUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(fireFightingSystemMapper.statisticsByStation(bizOrgCode));
......@@ -184,11 +188,10 @@ public class SupervisionConfigureController extends AbstractBaseController {
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String system, @RequestParam(required = false) String specificIndexKey, CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
......@@ -295,7 +298,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FHS_PressurePump_Start") && t.get("FHS_PressurePump_Start").equals("true"))).collect(Collectors.toList());
int num = collect.size();
item.put("halfHourStartNum", num);
}else if (200 == twoHourEntity.getStatus()) {
} else if (200 == twoHourEntity.getStatus()) {
String json1 = JSON.toJSONString(twoHourEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FHS_PressurePump_Start") && t.get("FHS_PressurePump_Start").equals("true"))).collect(Collectors.toList());
......@@ -337,13 +340,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
}).collect(Collectors.toList());
List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids);
long diffMinute = 0L;
if(!ObjectUtils.isEmpty(stateMap)){
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();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start =0L;
long end =0L;
long start = 0L;
long end = 0L;
try {
start = sdf.parse(startTime.replaceAll("T", " ")).getTime();
end = sdf.parse(endTime.replaceAll("T", " ")).getTime();
......@@ -351,7 +354,7 @@ public class SupervisionConfigureController extends AbstractBaseController {
throw new RuntimeException(e);
}
long res = start - end;
diffMinute= res / 1000 / 60;
diffMinute = res / 1000 / 60;
}
long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream(
......@@ -361,4 +364,58 @@ public class SupervisionConfigureController extends AbstractBaseController {
}).collect(Collectors.toList());
return CommonResponseUtil.success(pressurePumpInfo);
}
@PersonIdentify
@RequestMapping(value = "/addVideo", method = RequestMethod.GET)
@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) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
if (StringUtils.isBlank(bizOrgCode)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(supervisionVideoService.addVide(ids, bizOrgCode));
}
@PersonIdentify
@RequestMapping(value = "/queryVideoList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询视频列表", produces = "application/json;charset=UTF-8", notes = "查询视频列表")
public ResponseModel queryVideoList(@RequestParam(required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
if (StringUtils.isBlank(bizOrgCode)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(supervisionVideoService.queryVideoList(bizOrgCode));
}
@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查询视频")
public ResponseModel queryVideoAllId(@RequestParam(required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
if (StringUtils.isBlank(bizOrgCode)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode));
}
}
......@@ -466,12 +466,12 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/
List<Map<String, Object>> getWaterPoolInfoNum(@Param("bizOrgCode") String bizOrgCode);
/**
* 消防水源总量统计
* @param companyCode
* @return
*/
Map<String, Object> getWaterPoolVolumeInfo(@Param("companyCode") String companyCode);
// /**
// * 消防水源总量统计
// * @param companyCode
// * @return
// */
// Map<String, Object> getWaterPoolVolumeInfo(@Param("companyCode") String companyCode);
/**
* 获取车辆总数
......
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface SupervisionVideoMapper extends BaseMapper<SupervisionVideo> {
List<Map<String, Object>> getVideoByCompany(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> queryVideoAllId(@Param("bizOrgCode")String bizOrgCode);
}
package com.yeejoin.equipmanage.service;
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
* @date 2020/11/23 15:28
* @since v2.0
*/
public interface ISupervisionVideoService extends IService<SupervisionVideo> {
List queryVideoList(String bizOrgCode);
int deleteVideo(String id);
boolean addVide(String ids,String bizOrgCode);
List<Map<String,Object>> queryVideoAllId(String bizOrgCode);
}
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import com.yeejoin.equipmanage.mapper.SupervisionVideoMapper;
import com.yeejoin.equipmanage.service.ISupervisionVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Slf4j
@Service
//@EnableAsync
public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMapper, SupervisionVideo> implements ISupervisionVideoService {
@Autowired
SupervisionVideoMapper supervisionVideoMapper;
@Override
public List<List<Map<String, Object>>> queryVideoList(String bizOrgCode) {
List<List<Map<String, Object>>> resList = new ArrayList<>();
List<Map<String, Object>> list = supervisionVideoMapper.getVideoByCompany(bizOrgCode);
List<Map<String, Object>> mapList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
if (list.size() > 1 && (i / 2) - 1 != 0 && i != 0) {
mapList.add(list.get(i));
resList.add(mapList);
mapList = new ArrayList<>();
} else {
mapList.add(list.get(i));
if (i == list.size() - 1) {
resList.add(mapList);
}
}
}
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) {
List<SupervisionVideo> list = new ArrayList<>();
for (String s : ids.split(",")) {
SupervisionVideo supervisionVideo = new SupervisionVideo();
supervisionVideo.setCameraId(s);
supervisionVideo.setBizOrgCode(bizOrgCode);
supervisionVideo.setId(Long.valueOf(String.valueOf(UUID.randomUUID().getLeastSignificantBits()).replace("-", "")));
list.add(supervisionVideo);
}
return saveBatch(list);
}
@Override
public List<Map<String, Object>> queryVideoAllId(String bizOrgCode) {
return supervisionVideoMapper.queryVideoAllId(bizOrgCode);
}
}
......@@ -1340,7 +1340,7 @@ public class ExcelServiceImpl {
if (item.getLevelDeviceName() != null) {
String[] type = item.getLevelDeviceName().split("@");
item.setLevelDeviceName(type[0]);
item.setLevelDeviceId(Long.valueOf(type[1]));
item.setLevelDeviceId(type[1]);
}
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
if (item.getEquipCategoryName() != null) {
......
......@@ -2970,7 +2970,7 @@
SELECT
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' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel
IFNULL(avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ),0) AS nowLevel
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
......@@ -3006,7 +3006,7 @@
SELECT
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' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel
ifnull(MAX( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ), 0) AS nowLevel
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
......@@ -3023,52 +3023,52 @@
</select>
<select id="getWaterPoolVolumeInfo" resultType="java.util.Map">
SELECT
IFNULL( sum( a.margin ), 0 ) AS margin,
IFNULL( sum( volume ), 0 ) AS volume
FROM
(
SELECT
`ou`.`code` AS `code`,
ifnull((
abs((
ifnull(
max((
CASE
WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN
`ei`.`perf_value`
END
)),
ifnull( `rp`.`min_water_level`, 0 )) /
IF
((
ifnull( `rp`.`max_water_level`, 0 ) = 0
),
1,
ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),
0
) AS `margin`,
ifnull( `rp`.`volume`, 0 ) AS `volume`
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE
`r`.`resource_type` IN ( 'pool', 'industryPool' )
AND `r`.`is_delete` = 1
AND `ou`.`code` IS NOT NULL
<if test="companyCode != null and companyCode != ''">
AND ou.`code` = #{companyCode}
</if>
GROUP BY
`r`.`sequence_nbr`
) a
</select>
<!-- <select id="getWaterPoolVolumeInfo" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- IFNULL( sum( a.margin ), 0 ) AS margin,-->
<!-- IFNULL( sum( volume ), 0 ) AS volume-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- `ou`.`code` AS `code`,-->
<!-- ifnull((-->
<!-- abs((-->
<!-- ifnull(-->
<!-- max((-->
<!-- CASE-->
<!-- WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN-->
<!-- `ei`.`perf_value`-->
<!-- END-->
<!-- )),-->
<!-- ifnull( `rp`.`min_water_level`, 0 )) /-->
<!-- IF-->
<!-- ((-->
<!-- ifnull( `rp`.`max_water_level`, 0 ) = 0-->
<!-- ),-->
<!-- 1,-->
<!-- ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),-->
<!-- 0-->
<!-- ) AS `margin`,-->
<!-- ifnull( `rp`.`volume`, 0 ) AS `volume`-->
<!-- FROM-->
<!-- `cb_water_resource` `r`-->
<!-- LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`-->
<!-- LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`-->
<!-- LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`-->
<!-- LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`-->
<!-- LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`-->
<!-- WHERE-->
<!-- `r`.`resource_type` IN ( 'pool', 'industryPool' )-->
<!-- AND `r`.`is_delete` = 1-->
<!-- AND `ou`.`code` IS NOT NULL-->
<!-- <if test="companyCode != null and companyCode != ''">-->
<!-- AND ou.`code` = #{companyCode}-->
<!-- </if>-->
<!-- GROUP BY-->
<!-- `r`.`sequence_nbr`-->
<!-- ) a-->
<!-- </select>-->
<select id="getCarNum" resultType="java.lang.Integer">
SELECT
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.SupervisionVideoMapper">
<select id="getVideoByCompany" resultType="java.util.Map">
select wv.*
from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id
where wsv.biz_org_code = #{bizOrgCode}
</select>
<select id="queryVideoAllId" resultType="java.util.Map">
select wsv.camera_id
from wl_supervision_video wsv
where wsv.biz_org_code = #{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