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

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

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