Commit de190d1b authored by 王晓倩's avatar 王晓倩

地图查询报警器用户的历史报警数量逻辑修改

parent 6b5d3c51
......@@ -38,11 +38,11 @@ public class SysJobServiceImpl implements ISysJobService
public void init() throws SchedulerException, TaskException
{
scheduler.clear();
List<SysJob> jobList = jobMapper.selectJobAll();
for (SysJob job : jobList)
{
ScheduleUtils.createScheduleJob(scheduler, job);
}
// List<SysJob> jobList = jobMapper.selectJobAll();
// for (SysJob job : jobList)
// {
// ScheduleUtils.createScheduleJob(scheduler, job);
// }
}
/**
......
......@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
......@@ -24,7 +25,7 @@ public interface TDetectorReportDataMapper
public List<TDetectorReportData> selectTDetectorReportDataByCode(String detectorCode);
public List<TDetectorReportData> countDetector(List<String> list);
public List<TDetectorReportData> countDetectorByUserId(TDetectorInfo tDetectorInfo);
public List<TDetectorAlarmInfoVO> selectTDetectorAlarm();
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorReportData;
import com.github.pagehelper.PageInfo;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
......@@ -28,7 +30,7 @@ public interface ITDetectorReportDataService
public List<TDetectorAlarmInfoVO> selectTDetectorAlarm();
public List<TDetectorReportData> countDetector(List<String> list);
public List<TDetectorReportData> countDetectorByUserId(TDetectorInfo tDetectorInfo);
/**
* 查询设备上报的数据列表
......
......@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import com.github.pagehelper.PageInfo;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.vo.TDetectorAlarmInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -53,8 +54,8 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
}
@Override
public List<TDetectorReportData> countDetector(List<String> list){
return tDetectorReportDataMapper.countDetector(list);
public List<TDetectorReportData> countDetectorByUserId(TDetectorInfo tDetectorInfo){
return tDetectorReportDataMapper.countDetectorByUserId(tDetectorInfo);
}
/**
......
......@@ -71,26 +71,18 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
int cancelAlarmNum = 0;
int historyAlarmNum = 0;
List<String> strList = new ArrayList<>();
for(TDetectorInfo info : tDetectorInfoList){
if(!StringUtils.isEmpty(info.getDetectorStatus()) && info.getDetectorStatus().equals("0")){
++onLineNum;
}else{
++offLineNum;
if(tDetectorInfoList.size() > 0){
for(TDetectorInfo info : tDetectorInfoList){
if(!StringUtils.isEmpty(info.getDetectorStatus()) && info.getDetectorStatus().equals("0")){
++onLineNum;
}else{
++offLineNum;
}
}
strList.add(info.getDetectorCode());
}
if(strList.size() > 0){
// ZHDeviceReportDatasExample zhDeviceReportDatasExample = new ZHDeviceReportDatasExample();
// zhDeviceReportDatasExample.createCriteria().andDeviceNoIn(strList);
List<TDetectorReportData> dataList = tDetectorReportDataMapper.countDetector(strList);
List<TDetectorReportData> dataList = tDetectorReportDataMapper.countDetectorByUserId(detector);
historyAlarmNum = dataList.size();
// zhDeviceReportDatasExample.clear();
// zhDeviceReportDatasExample.createCriteria().andDeviceNoIn(strList).andIsCancelAlarmEqualTo("1");
for(TDetectorReportData data : dataList){
if(!StringUtils.isEmpty(data.getIsCancelAlarm()) && data.getIsCancelAlarm().equals("1")){
++cancelAlarmNum;
......
......@@ -103,12 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY data.detector_id LIMIT 50
</select>
<select id="countDetector" parameterType="List" resultMap="TDetectorReportDataResult" >
<include refid="selectTDetectorReportDataVo"/>
where detector_status_id != '1' and detector_code in
<foreach collection="list" item="detectorCode" index="index" open="(" close=")" separator=",">
#{detectorCode}
</foreach>
<select id="countDetectorByUserId" parameterType="TDetectorInfo" resultMap="TDetectorReportDataResult" >
select r.id, r.source_id, r.detector_code, r.detector_status_id, r.is_cancel_alarm, r.cancel_time
from t_detector_report_data r
left join t_detector_info d on r.detector_code = d.detector_code
where r.detector_status_id != '1' and d.user_id = #{userId} and d.is_del = #{isDel}
</select>
<insert id="insertTDetectorReportData" parameterType="TDetectorReportData" useGeneratedKeys="true" keyProperty="id">
......
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