消防控制室和消防水源不展示
左侧搜索栏换成消防器材类型 数量 统计 例如 器材类型:干粉灭火器 数量:1000 第一个图 风向 大气 删除 报警信息改为实时报警的数量 左侧所有接口都定时更新0927cmt
parent
1881570348
commit
edcafb7348
|
@ -3,15 +3,24 @@ package com.zcloud.controller.anemometer;
|
|||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.alarm.AlarmInfoService;
|
||||
import com.zcloud.service.announcement.AnemometerLocalService;
|
||||
import com.zcloud.service.announcement.AnemometerMachineService;
|
||||
import com.zcloud.service.announcement.AnemometerService;
|
||||
import com.zcloud.service.gatemachine.GateAreaService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.ReturnMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -29,6 +38,8 @@ public class AnemometerController extends BaseController {
|
|||
private AnemometerLocalService anemometerLocalService;
|
||||
@Resource
|
||||
private AnemometerService anemometerService;
|
||||
@Resource
|
||||
private AlarmInfoService alarmInfoService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/page")
|
||||
|
@ -81,6 +92,57 @@ public class AnemometerController extends BaseController {
|
|||
ReturnMap returnMap = new ReturnMap();
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> dataList = anemometerLocalService.detailListAll(pd);
|
||||
List<PageData> alarmCount = alarmInfoService.alarmCountForMap(pd);
|
||||
if (alarmCount.size()>0) {
|
||||
PageData pageData = alarmCount.get(0);
|
||||
String timeString = pageData.getString("ALARM_TIME");
|
||||
//当前时间 时间戳
|
||||
Date currentDate = new Date();
|
||||
// 使用Calendar清空分钟、秒和毫秒
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(currentDate);
|
||||
calendar.set(Calendar.MILLISECOND,0);
|
||||
currentDate = calendar.getTime();
|
||||
//数据时间 时间戳
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date alarmDate = simpleDateFormat.parse(timeString);
|
||||
//判断当前时间范围
|
||||
Date second0 = new Date(currentDate.getTime());
|
||||
Date second15 = new Date(currentDate.getTime());
|
||||
Date second30 = new Date(currentDate.getTime());
|
||||
Date second45 = new Date(currentDate.getTime());
|
||||
Date second60 = new Date(currentDate.getTime());
|
||||
second0.setSeconds(0);
|
||||
second15.setSeconds(15);
|
||||
second30.setSeconds(30);
|
||||
second45.setSeconds(45);
|
||||
second60.setSeconds(60);
|
||||
if (currentDate.compareTo(second0) >= 0 && currentDate.compareTo(second15) < 0) {
|
||||
if (alarmDate.compareTo(second0) >= 0 && alarmDate.compareTo(second15) < 0) {
|
||||
returnMap.put("alarmCount",pageData.getString("ALARMCOUNT"));
|
||||
} else {
|
||||
returnMap.put("alarmCount","0");
|
||||
}
|
||||
} else if (currentDate.compareTo(second15) >= 0 && currentDate.compareTo(second30) <0) {
|
||||
if (alarmDate.compareTo(second15) >= 0 && alarmDate.compareTo(second30) < 0) {
|
||||
returnMap.put("alarmCount",pageData.getString("ALARMCOUNT"));
|
||||
} else {
|
||||
returnMap.put("alarmCount","0");
|
||||
}
|
||||
} else if (currentDate.compareTo(second30) >= 0 && currentDate.compareTo(second45) <0) {
|
||||
if (alarmDate.compareTo(second30) >= 0 && alarmDate.compareTo(second45) < 0) {
|
||||
returnMap.put("alarmCount",pageData.getString("ALARMCOUNT"));
|
||||
} else {
|
||||
returnMap.put("alarmCount","0");
|
||||
}
|
||||
} else if (currentDate.compareTo(second45) >= 0 && currentDate.compareTo(second60) <0) {
|
||||
if (alarmDate.compareTo(second45) >= 0 && alarmDate.compareTo(second60) < 0) {
|
||||
returnMap.put("alarmCount",pageData.getString("ALARMCOUNT"));
|
||||
} else {
|
||||
returnMap.put("alarmCount","0");
|
||||
}
|
||||
}
|
||||
}
|
||||
returnMap.put("anemometerCount",dataList.size());
|
||||
returnMap.put("varList",dataList);
|
||||
return returnMap;
|
||||
|
|
|
@ -518,6 +518,17 @@ public class AppFireRecordController extends BaseController {
|
|||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
if (pd.getString("FIRE_CHECK_ID").equals("undefined") || pd.getString("FIRE_RECORD_ID").equals("undefined") ) {
|
||||
pd.put("pointId",pd.getString("FIRE_POINT_ID"));
|
||||
Page page = new Page();
|
||||
page.setPd(pd);
|
||||
List<PageData> dataList = fireCheckListService.getFireCheckListByAppV2(page);
|
||||
if (dataList.size()>0) {
|
||||
PageData pageData = dataList.get(0);
|
||||
pd.put("FIRE_CHECK_ID",pageData.getString("FIRE_CHECK_ID"));
|
||||
pd.put("FIRE_RECORD_ID",pageData.getString("FIRE_RECORD_ID"));
|
||||
}
|
||||
}
|
||||
List<PageData> varList = fireCheckStandardService.getAppRiskByDevice(pd);
|
||||
map.put("result", errInfo);
|
||||
map.put("varData", varList);
|
||||
|
|
|
@ -297,6 +297,23 @@ public class CmtMapController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/fireDevice/listAllDeviceForMap")
|
||||
@ResponseBody
|
||||
public Object listAllDeviceForMap(Page page) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
String corpinfoId = Jurisdiction.getCORPINFO_ID();
|
||||
pd.put("CORPINFO_ID", corpinfoId);
|
||||
//获取当前人的公司id
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = fireResourcesService.deviceAlllistPage(page);
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员、车辆进出记录
|
||||
*
|
||||
|
|
|
@ -49,6 +49,8 @@ public interface AlarmInfoMapper {
|
|||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
List<PageData> alarmCountForMap(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
|
|
|
@ -64,5 +64,7 @@ public interface CmtFireResourcesMapper {
|
|||
|
||||
List<PageData> devicelistPage(Page page);
|
||||
|
||||
List<PageData> deviceAlllistPage(Page page);
|
||||
|
||||
List<PageData> getPointCheckPhotoById(PageData pageData);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public interface AlarmInfoService {
|
|||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
public List<PageData> alarmCountForMap(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
|
|
|
@ -90,6 +90,14 @@ public class AlarmInfoServiceImpl implements AlarmInfoService {
|
|||
return alarmInfoMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> alarmCountForMap(PageData pd)throws Exception{
|
||||
return alarmInfoMapper.alarmCountForMap(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
|
|
|
@ -59,4 +59,6 @@ public interface CmtFireResourcesService {
|
|||
List<PageData> goRecordDeviceByPid(PageData pd);
|
||||
|
||||
List<PageData> devicelistPage(Page page);
|
||||
|
||||
List<PageData> deviceAlllistPage(Page page);
|
||||
}
|
||||
|
|
|
@ -133,4 +133,9 @@ public class CmtFireResourcesServiceImpl implements CmtFireResourcesService {
|
|||
public List<PageData> devicelistPage(Page page) {
|
||||
return czksfireResourcesMapper.devicelistPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> deviceAlllistPage(Page page) {
|
||||
return czksfireResourcesMapper.deviceAlllistPage(page);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ public class SaveAnemometerInfoScheduled {
|
|||
PageData tPd = new PageData();
|
||||
tPd.put("DICT_NAME","风速仪");
|
||||
List<PageData> levelList = alarmInfoService.findThreshold(tPd);
|
||||
String date = DateUtil.date2Str(new Date());
|
||||
for (PageData codeData : anemometerList) {
|
||||
//若风速大于阈值则存储报警信息
|
||||
for (PageData data : levelList) {
|
||||
|
@ -73,7 +74,7 @@ public class SaveAnemometerInfoScheduled {
|
|||
PageData alarmPd = new PageData();
|
||||
alarmPd.put("ALARM_INFO_ID",UuidUtil.get32UUID());
|
||||
alarmPd.put("ALARM_VALUE",codeData.getString("FVALUE"));
|
||||
alarmPd.put("ALARM_TIME",DateUtil.date2Str(new Date()));
|
||||
alarmPd.put("ALARM_TIME",date);
|
||||
alarmPd.put("LEVEL",data.getString("LEVELNAME"));
|
||||
alarmPd.put("CREATOR","c5187fb9565649a89267f9adf6b0fab6");
|
||||
alarmPd.put("CREATTIME",DateUtil.date2Str(new Date()));
|
||||
|
|
|
@ -114,6 +114,17 @@
|
|||
f.ALARM_INFO_ID=#{ALARM_INFO_ID}
|
||||
</select>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="alarmCountForMap" parameterType="pd" resultType="pd">
|
||||
SELECT
|
||||
f.ALARM_TIME ALARM_TIME,
|
||||
COUNT(f.ALARM_INFO_ID) ALARMCOUNT
|
||||
FROM
|
||||
bus_alarm_info f
|
||||
GROUP BY f.ALARM_TIME
|
||||
ORDER BY f.ALARM_TIME DESC
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
|
|
|
@ -188,13 +188,13 @@
|
|||
AND rd.FIRE_DEVICE_ID = fpc.FIRE_DEVICE_ID
|
||||
WHERE
|
||||
reg.ISDELETE = 0
|
||||
<if test="FIRE_CHECK_ID != null and FIRE_CHECK_ID != ''">
|
||||
<if test='FIRE_CHECK_ID != null and FIRE_CHECK_ID != "" and FIRE_CHECK_ID != "undefined"'>
|
||||
and fr.FIRE_CHECK_ID = #{FIRE_CHECK_ID}
|
||||
</if>
|
||||
<if test="FIRE_RECORD_ID != null and FIRE_RECORD_ID != ''">
|
||||
<if test='FIRE_RECORD_ID != null and FIRE_RECORD_ID != "" and FIRE_RECORD_ID != "undefined"'>
|
||||
AND fr.FIRE_RECORD_ID = #{FIRE_RECORD_ID}
|
||||
</if>
|
||||
<if test="FIRE_POINT_ID != null and FIRE_POINT_ID != ''">
|
||||
<if test='FIRE_POINT_ID != null and FIRE_POINT_ID != "" and FIRE_POINT_ID != "undefined"'>
|
||||
AND fd.FIRE_POINT_ID = #{FIRE_POINT_ID}
|
||||
</if>
|
||||
AND fr.ISDELETE = 0
|
||||
|
|
|
@ -450,6 +450,25 @@
|
|||
ORDER BY
|
||||
d.CREATTIME DESC
|
||||
</select>
|
||||
<select id="deviceAlllistPage" resultType="com.zcloud.entity.PageData">
|
||||
SELECT
|
||||
d.FIRE_POINT_ID,
|
||||
FIRE_DEVICE_TYPE_ID,
|
||||
dic.`NAME` FIRE_DEVICE_TYPE_NAME,
|
||||
COUNT( 1 ) COUNT
|
||||
FROM
|
||||
`qa-cmt-prevention`.bus_fire_device d
|
||||
LEFT JOIN `qa-cmt-prevention`.sys_dictionaries dic ON d.FIRE_DEVICE_TYPE_ID = dic.BIANMA
|
||||
WHERE
|
||||
d.ISDELETE = 0
|
||||
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
|
||||
and d.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
</if>
|
||||
GROUP BY
|
||||
d.FIRE_DEVICE_TYPE_ID
|
||||
ORDER BY
|
||||
d.CREATTIME DESC
|
||||
</select>
|
||||
<select id="getPointCheckPhotoById" resultType="com.zcloud.entity.PageData">
|
||||
SELECT
|
||||
GROUP_CONCAT( img.FILEPATH SEPARATOR '@@' ) FILEPATHLIST,
|
||||
|
|
Loading…
Reference in New Issue