|
@@ -1,6 +1,8 @@
|
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
@@ -16,28 +18,31 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 火灾报警系统报警信息表 服务实现类
|
|
|
+ * 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
* @author JCB
|
|
|
- * @since 2022-07-29
|
|
|
+ * @since 2022-08-18
|
|
|
*/
|
|
|
@Service
|
|
|
public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, AlarmFire> implements AlarmFireService {
|
|
|
|
|
|
@Override
|
|
|
- public CommonPage<AlarmFireVo> alarmFireLowerList(Integer handlingStatus, String startDate, String endDate,
|
|
|
+ public CommonPage<AlarmFireVo> alarmFireLowerList(String companyName, Integer handlingStatus, String startDate, String endDate,
|
|
|
Integer pageNum, Integer pageSize, String alarmType) {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- List<Integer> alarmTypeList = new ArrayList<>();
|
|
|
- if (alarmType != null && !"".equals(alarmType)) {
|
|
|
+ List<String> alarmTypeList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(alarmType)) {
|
|
|
String[] alarmTypeArray = alarmType.split(",");
|
|
|
for (int i = 0; i < alarmTypeArray.length; i++) {
|
|
|
- alarmTypeList.add(Integer.parseInt(alarmTypeArray[i]));
|
|
|
+ alarmTypeList.add(alarmTypeArray[i]);
|
|
|
}
|
|
|
}
|
|
|
String userType = null;
|
|
@@ -45,39 +50,38 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
if (loginUser != null && !"".equals(loginUser)) {
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
- //缺少维保单位部分代码
|
|
|
- List<String> devcieCodeList = new ArrayList<>();
|
|
|
- CommonPage<AlarmFire> alarmFireList = this.alarmFireList(devcieCodeList, handlingStatus, startDate, endDate, pageNum, pageSize, alarmTypeList);
|
|
|
+ //缺少单位ID部分代码
|
|
|
+ List<Integer> companyIdList = new ArrayList<>();
|
|
|
+ CommonPage<AlarmFire> alarmFireList = this.alarmFireList(companyIdList, companyName, handlingStatus, startDate, endDate, pageNum, pageSize, alarmTypeList);
|
|
|
List<AlarmFireVo> list = new ArrayList<>();
|
|
|
for (int i = 0; i < alarmFireList.getRecords().size(); i++) {
|
|
|
AlarmFireVo alarmFireVo = new AlarmFireVo();
|
|
|
alarmFireVo.setId(alarmFireList.getRecords().get(i).getId());
|
|
|
alarmFireVo.setDeviceCode(alarmFireList.getRecords().get(i).getDeviceCode());
|
|
|
- alarmFireVo.setAlarmType(alarmFireList.getRecords().get(i).getAlarmType());
|
|
|
+ alarmFireVo.setCompanyName(alarmFireList.getRecords().get(i).getCompanyName());
|
|
|
+ alarmFireVo.setCompanyId(alarmFireList.getRecords().get(i).getCompanyId());
|
|
|
alarmFireVo.setAlarmTime(df.format(alarmFireList.getRecords().get(i).getAlarmTime()));
|
|
|
- alarmFireVo.setAddress(alarmFireList.getRecords().get(i).getAddress());
|
|
|
- alarmFireVo.setAlarmStatus(alarmFireList.getRecords().get(i).getAlarmStatus());
|
|
|
- alarmFireVo.setOriginalType(alarmFireList.getRecords().get(i).getOriginalType());
|
|
|
- alarmFireVo.setAlarmName(alarmFireList.getRecords().get(i).getAlarmName());
|
|
|
- alarmFireVo.setOriginalPoint(alarmFireList.getRecords().get(i).getOriginalPoint());
|
|
|
- alarmFireVo.setPointType(alarmFireList.getRecords().get(i).getPointType());
|
|
|
- alarmFireVo.setPointDescribe(alarmFireList.getRecords().get(i).getPointDescribe());
|
|
|
- alarmFireVo.setPortNum(alarmFireList.getRecords().get(i).getPortNum());
|
|
|
- alarmFireVo.setHostNum(alarmFireList.getRecords().get(i).getHostNum());
|
|
|
- alarmFireVo.setLoopNum(alarmFireList.getRecords().get(i).getLoopNum());
|
|
|
- alarmFireVo.setPtNum(alarmFireList.getRecords().get(i).getPtNum());
|
|
|
+ alarmFireVo.setAlarmType(alarmFireList.getRecords().get(i).getAlarmType());
|
|
|
+ alarmFireVo.setConten(alarmFireList.getRecords().get(i).getDeviceName() + "," + alarmFireList.getRecords().get(i).getAttributeValue4());
|
|
|
+ alarmFireVo.setHandlingStatus(alarmFireList.getRecords().get(i).getHandlingStatus());
|
|
|
alarmFireVo.setHandler(alarmFireList.getRecords().get(i).getHandler());
|
|
|
- if (alarmFireList.getRecords().get(i).getHandlingTime()!=null){
|
|
|
+ if (alarmFireList.getRecords().get(i).getHandlingTime() != null) {
|
|
|
alarmFireVo.setHandlingTime(df.format(alarmFireList.getRecords().get(i).getHandlingTime()));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
alarmFireVo.setHandlingTime(null);
|
|
|
}
|
|
|
- alarmFireVo.setHandlingContent(alarmFireList.getRecords().get(i).getHandlingContent());
|
|
|
- alarmFireVo.setHandlerPhone(alarmFireList.getRecords().get(i).getHandlerPhone());
|
|
|
- alarmFireVo.setHandlingStatus(alarmFireList.getRecords().get(i).getHandlingStatus());
|
|
|
alarmFireVo.setFalseAlarm(alarmFireList.getRecords().get(i).getFalseAlarm());
|
|
|
+ alarmFireVo.setHandlingContent(alarmFireList.getRecords().get(i).getHandlingContent());
|
|
|
alarmFireVo.setSitePhoto(alarmFireList.getRecords().get(i).getSitePhoto());
|
|
|
- alarmFireVo.setCompanyName("未定义单位表");
|
|
|
+ alarmFireVo.setPortNum(alarmFireList.getRecords().get(i).getPortNum());
|
|
|
+ alarmFireVo.setHostNum(alarmFireList.getRecords().get(i).getHostNum());
|
|
|
+ alarmFireVo.setLoopNum(alarmFireList.getRecords().get(i).getLoopNum());
|
|
|
+ alarmFireVo.setPtNum(alarmFireList.getRecords().get(i).getPtNum());
|
|
|
+// alarmFireVo.setSystemType(alarmFireList.getRecords().get(i).getSystemType());
|
|
|
+// alarmFireVo.setAddress(alarmFireList.getRecords().get(i).getAddress());
|
|
|
+// alarmFireVo.setAlarmStatus(alarmFireList.getRecords().get(i).getAlarmStatus());
|
|
|
+// alarmFireVo.setPointType(alarmFireList.getRecords().get(i).getPointType());
|
|
|
+// alarmFireVo.setHandlerPhone(alarmFireList.getRecords().get(i).getHandlerPhone());
|
|
|
list.add(alarmFireVo);
|
|
|
}
|
|
|
return new CommonPage<>(list, alarmFireList.getTotal(), pageSize, pageNum);
|
|
@@ -86,12 +90,11 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> fireStatistics(String alarmType) {
|
|
|
-
|
|
|
- List<Integer> alarmTypeList = new ArrayList<>();
|
|
|
- if (alarmType != null && !"".equals(alarmType)) {
|
|
|
+ List<String> alarmTypeList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(alarmType)) {
|
|
|
String[] alarmTypeArray = alarmType.split(",");
|
|
|
for (int i = 0; i < alarmTypeArray.length; i++) {
|
|
|
- alarmTypeList.add(Integer.parseInt(alarmTypeArray[i]));
|
|
|
+ alarmTypeList.add(alarmTypeArray[i]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -101,10 +104,10 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
//缺少维保单位部分代码
|
|
|
- List<String> devcieCodeList = new ArrayList<>();
|
|
|
+ List<Integer> companyIdList = new ArrayList<>();
|
|
|
|
|
|
- int untreated = this.fireCount(devcieCodeList, 0, alarmTypeList);
|
|
|
- int processed = this.fireCount(devcieCodeList, 1, alarmTypeList);
|
|
|
+ int untreated = this.fireCount(companyIdList, 0, alarmTypeList);
|
|
|
+ int processed = this.fireCount(companyIdList, 1, alarmTypeList);
|
|
|
// String disposalRate = processed / (untreated + processed) + "%";
|
|
|
Integer count = untreated + processed;
|
|
|
String disposalRate = OnlineMethod.myPercent(processed, count);
|
|
@@ -125,11 +128,11 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> fireStatisticalChart(String alarmType, String startDate, String endDate) {
|
|
|
- List<Integer> alarmTypeList = new ArrayList<>();
|
|
|
- if (alarmType != null && !"".equals(alarmType)) {
|
|
|
+ List<String> alarmTypeList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(alarmType)) {
|
|
|
String[] alarmTypeArray = alarmType.split(",");
|
|
|
for (int i = 0; i < alarmTypeArray.length; i++) {
|
|
|
- alarmTypeList.add(Integer.parseInt(alarmTypeArray[i]));
|
|
|
+ alarmTypeList.add(alarmTypeArray[i]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -139,17 +142,17 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
//缺少维保单位部分代码
|
|
|
- List<String> devcieCodeList = new ArrayList<>();
|
|
|
- List<Integer> alarmTypeListOne = new ArrayList<>();
|
|
|
+ List<Integer> companyIdList = new ArrayList<>();
|
|
|
+ List<String> alarmTypeListOne = new ArrayList<>();
|
|
|
Integer selectStatus = 0;
|
|
|
- if (alarmTypeList.contains(100)){
|
|
|
+ if (alarmTypeList.contains("100")) {
|
|
|
selectStatus = 1;
|
|
|
- alarmTypeListOne.add(2);
|
|
|
- alarmTypeListOne.add(4);
|
|
|
- }else {
|
|
|
+ alarmTypeListOne.add("2");
|
|
|
+ alarmTypeListOne.add("4");
|
|
|
+ } else {
|
|
|
alarmTypeListOne = alarmTypeList;
|
|
|
}
|
|
|
- List<AlarmFireStatisticalVo> list = baseMapper.selectAlarmFireStatistical(devcieCodeList, alarmTypeListOne, startDate, endDate,selectStatus);
|
|
|
+ List<AlarmFireStatisticalVo> list = baseMapper.selectAlarmFireStatistical(companyIdList, alarmTypeListOne, startDate, endDate, selectStatus);
|
|
|
List<Integer> alarmCountList = new ArrayList<>();
|
|
|
List<Integer> handleCountList = new ArrayList<>();
|
|
|
List<String> alarmTimeList = new ArrayList<>();
|
|
@@ -171,22 +174,44 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
|
|
|
@Override
|
|
|
public void updateAlarmFire(AlarmFire alarmFire) {
|
|
|
- alarmFire.setHandler(SecurityUtils.getUsername());
|
|
|
- alarmFire.setHandlingTime(LocalDateTime.now());
|
|
|
- alarmFire.setHandlingStatus(1);
|
|
|
- this.updateById(alarmFire);
|
|
|
+ if (alarmFire.getId() == 0) {
|
|
|
+ LambdaQueryWrapper<AlarmFire> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.select(AlarmFire::getId)
|
|
|
+ .eq(AlarmFire::getDeviceCode, alarmFire.getDeviceCode())
|
|
|
+ .eq(AlarmFire::getAlarmType, alarmFire.getAlarmType())
|
|
|
+ .eq(AlarmFire::getHostNum, alarmFire.getHostNum())
|
|
|
+ .eq(AlarmFire::getLoopNum, alarmFire.getLoopNum())
|
|
|
+ .eq(AlarmFire::getPtNum, alarmFire.getPtNum())
|
|
|
+ .eq(AlarmFire::getPortNum, alarmFire.getPortNum());
|
|
|
+ List<AlarmFire> list = this.list(queryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ list.get(i).setHandler(SecurityUtils.getUsername());
|
|
|
+ list.get(i).setHandlingTime(LocalDateTime.now());
|
|
|
+ list.get(i).setHandlingStatus(1);
|
|
|
+ list.get(i).setHandlingContent(alarmFire.getHandlingContent());
|
|
|
+ list.get(i).setHandlerPhone("未定义");
|
|
|
+ list.get(i).setFalseAlarm(alarmFire.getFalseAlarm());
|
|
|
+ this.updateById(list.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ alarmFire.setHandler(SecurityUtils.getUsername());
|
|
|
+ alarmFire.setHandlingTime(LocalDateTime.now());
|
|
|
+ alarmFire.setHandlingStatus(1);
|
|
|
+ this.updateById(alarmFire);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
- public List<AlarmFireVo> alarmFireLowerListExport(Integer handlingStatus, String startDate, String endDate, String alarmType) {
|
|
|
+ public List<AlarmFireVo> alarmFireLowerListExport(String companyName, Integer handlingStatus, String startDate, String endDate, String alarmType) {
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- List<Integer> alarmTypeList = new ArrayList<>();
|
|
|
- if (alarmType != null && !"".equals(alarmType)) {
|
|
|
+ List<String> alarmTypeList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(alarmType)) {
|
|
|
String[] alarmTypeArray = alarmType.split(",");
|
|
|
for (int i = 0; i < alarmTypeArray.length; i++) {
|
|
|
- alarmTypeList.add(Integer.parseInt(alarmTypeArray[i]));
|
|
|
+ alarmTypeList.add(alarmTypeArray[i]);
|
|
|
}
|
|
|
}
|
|
|
String userType = null;
|
|
@@ -194,70 +219,59 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
if (loginUser != null && !"".equals(loginUser)) {
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
- //缺少维保单位部分代码
|
|
|
- List<String> devcieCodeList = new ArrayList<>();
|
|
|
- CommonPage<AlarmFire> alarmFireList = this.alarmFireList(devcieCodeList, handlingStatus, startDate, endDate, 0, 0, alarmTypeList);
|
|
|
+ //缺少单位ID部分代码
|
|
|
+ List<Integer> companyIdList = new ArrayList<>();
|
|
|
+ CommonPage<AlarmFire> alarmFireList = this.alarmFireList(companyIdList, companyName, handlingStatus, startDate, endDate, 0, 0, alarmTypeList);
|
|
|
List<AlarmFireVo> list = new ArrayList<>();
|
|
|
for (int i = 0; i < alarmFireList.getRecords().size(); i++) {
|
|
|
AlarmFireVo alarmFireVo = new AlarmFireVo();
|
|
|
- alarmFireVo.setXh(i + 1);
|
|
|
alarmFireVo.setId(alarmFireList.getRecords().get(i).getId());
|
|
|
alarmFireVo.setDeviceCode(alarmFireList.getRecords().get(i).getDeviceCode());
|
|
|
- alarmFireVo.setAlarmType(alarmFireList.getRecords().get(i).getAlarmType());
|
|
|
+ alarmFireVo.setCompanyName(alarmFireList.getRecords().get(i).getCompanyName());
|
|
|
+ alarmFireVo.setCompanyId(alarmFireList.getRecords().get(i).getCompanyId());
|
|
|
alarmFireVo.setAlarmTime(df.format(alarmFireList.getRecords().get(i).getAlarmTime()));
|
|
|
- alarmFireVo.setAddress(alarmFireList.getRecords().get(i).getAddress());
|
|
|
- alarmFireVo.setAlarmStatus(alarmFireList.getRecords().get(i).getAlarmStatus());
|
|
|
- alarmFireVo.setOriginalType(alarmFireList.getRecords().get(i).getOriginalType());
|
|
|
- alarmFireVo.setAlarmName(alarmFireList.getRecords().get(i).getAlarmName());
|
|
|
- alarmFireVo.setOriginalPoint(alarmFireList.getRecords().get(i).getOriginalPoint());
|
|
|
- alarmFireVo.setPointType(alarmFireList.getRecords().get(i).getPointType());
|
|
|
- alarmFireVo.setPointDescribe(alarmFireList.getRecords().get(i).getPointDescribe());
|
|
|
- alarmFireVo.setPortNum(alarmFireList.getRecords().get(i).getPortNum());
|
|
|
- alarmFireVo.setHostNum(alarmFireList.getRecords().get(i).getHostNum());
|
|
|
- alarmFireVo.setLoopNum(alarmFireList.getRecords().get(i).getLoopNum());
|
|
|
- alarmFireVo.setPtNum(alarmFireList.getRecords().get(i).getPtNum());
|
|
|
+ alarmFireVo.setAlarmType(alarmFireList.getRecords().get(i).getAlarmType());
|
|
|
+ alarmFireVo.setConten(alarmFireList.getRecords().get(i).getDeviceName() + "," + alarmFireList.getRecords().get(i).getAttributeValue4());
|
|
|
+ alarmFireVo.setHandlingStatus(alarmFireList.getRecords().get(i).getHandlingStatus());
|
|
|
alarmFireVo.setHandler(alarmFireList.getRecords().get(i).getHandler());
|
|
|
- if (alarmFireList.getRecords().get(i).getHandlingTime()!=null){
|
|
|
+ if (alarmFireList.getRecords().get(i).getHandlingTime() != null) {
|
|
|
alarmFireVo.setHandlingTime(df.format(alarmFireList.getRecords().get(i).getHandlingTime()));
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
alarmFireVo.setHandlingTime(null);
|
|
|
}
|
|
|
- alarmFireVo.setHandlingContent(alarmFireList.getRecords().get(i).getHandlingContent());
|
|
|
- alarmFireVo.setHandlerPhone(alarmFireList.getRecords().get(i).getHandlerPhone());
|
|
|
- alarmFireVo.setHandlingStatus(alarmFireList.getRecords().get(i).getHandlingStatus());
|
|
|
alarmFireVo.setFalseAlarm(alarmFireList.getRecords().get(i).getFalseAlarm());
|
|
|
- alarmFireVo.setSitePhoto(alarmFireList.getRecords().get(i).getSitePhoto());
|
|
|
- alarmFireVo.setCompanyName("未定义单位表");
|
|
|
+ alarmFireVo.setHandlingContent(alarmFireList.getRecords().get(i).getHandlingContent());
|
|
|
+// alarmFireVo.setSystemType(alarmFireList.getRecords().get(i).getSystemType());
|
|
|
+// alarmFireVo.setAddress(alarmFireList.getRecords().get(i).getAddress());
|
|
|
+// alarmFireVo.setAlarmStatus(alarmFireList.getRecords().get(i).getAlarmStatus());
|
|
|
+// alarmFireVo.setPointType(alarmFireList.getRecords().get(i).getPointType());
|
|
|
+// alarmFireVo.setPortNum(alarmFireList.getRecords().get(i).getPortNum());
|
|
|
+// alarmFireVo.setHostNum(alarmFireList.getRecords().get(i).getHostNum());
|
|
|
+// alarmFireVo.setLoopNum(alarmFireList.getRecords().get(i).getLoopNum());
|
|
|
+// alarmFireVo.setPtNum(alarmFireList.getRecords().get(i).getPtNum());
|
|
|
+// alarmFireVo.setHandlerPhone(alarmFireList.getRecords().get(i).getHandlerPhone());
|
|
|
+// alarmFireVo.setSitePhoto(alarmFireList.getRecords().get(i).getSitePhoto());
|
|
|
list.add(alarmFireVo);
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 火警告警处置/故障告警处置-数量统计
|
|
|
- *
|
|
|
- * @param deviceCodeList 设备编号
|
|
|
- * @param handlingStatus 处理状态(0、未处理 1、已处理)
|
|
|
- * @param alarmTypeList 告警类型(2 火警、4 故障、16 监管等)
|
|
|
- * @return
|
|
|
- */
|
|
|
@Override
|
|
|
- public Integer fireCount(List<String> deviceCodeList, Integer handlingStatus, List<Integer> alarmTypeList) {
|
|
|
+ public Integer fireCount(List<Integer> companyIdList, Integer handlingStatus, List<String> alarmTypeList) {
|
|
|
LambdaQueryWrapper<AlarmFire> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- if (deviceCodeList.size() > 0) {
|
|
|
- queryWrapper.in(AlarmFire::getDeviceCode, deviceCodeList);
|
|
|
+ if (companyIdList.size() > 0) {
|
|
|
+ queryWrapper.in(AlarmFire::getCompanyId, companyIdList);
|
|
|
}
|
|
|
if (handlingStatus != null) {
|
|
|
queryWrapper.eq(AlarmFire::getHandlingStatus, handlingStatus);
|
|
|
}
|
|
|
if (alarmTypeList.size() > 0) {
|
|
|
- if (alarmTypeList.contains(100)){
|
|
|
- List<Integer> alarmTypeList1 = new ArrayList<>();
|
|
|
- alarmTypeList1.add(2);
|
|
|
- alarmTypeList1.add(4);
|
|
|
+ if (alarmTypeList.contains("100")) {
|
|
|
+ List<String> alarmTypeList1 = new ArrayList<>();
|
|
|
+ alarmTypeList1.add("2");
|
|
|
+ alarmTypeList1.add("4");
|
|
|
queryWrapper.notIn(AlarmFire::getAlarmType, alarmTypeList1);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
queryWrapper.in(AlarmFire::getAlarmType, alarmTypeList);
|
|
|
}
|
|
|
}
|
|
@@ -265,41 +279,33 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
|
|
|
return total;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 火警告警处置/故障告警处置-列表数据查询
|
|
|
- *
|
|
|
- * @param deviceCodeList 设备编号
|
|
|
- * @param handlingStatus 处理状态(0、未处理 1、已处理)
|
|
|
- * @param startDate 开始时间 格式:yyyy-MM-dd HH:mm:ss
|
|
|
- * @param endDate 结束时间 格式:yyyy-MM-dd HH:mm:ss
|
|
|
- * @param pageNum 当前页
|
|
|
- * @param pageSize 每页条数
|
|
|
- * @param alarmTypeList 告警类型(2 火警、4 故障、16 监管等、100隐患)
|
|
|
- * @return
|
|
|
- */
|
|
|
+
|
|
|
@Override
|
|
|
- public CommonPage<AlarmFire> alarmFireList(List<String> deviceCodeList, Integer handlingStatus, String startDate,
|
|
|
- String endDate, Integer pageNum, Integer pageSize, List<Integer> alarmTypeList) {
|
|
|
+ public CommonPage<AlarmFire> alarmFireList(List<Integer> companyIdList, String companyName, Integer handlingStatus, String startDate,
|
|
|
+ String endDate, Integer pageNum, Integer pageSize, List<String> alarmTypeList) {
|
|
|
LambdaQueryWrapper<AlarmFire> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- if (deviceCodeList.size() > 0) {
|
|
|
- queryWrapper.in(AlarmFire::getDeviceCode, deviceCodeList);
|
|
|
+ if (companyIdList.size() > 0) {
|
|
|
+ queryWrapper.in(AlarmFire::getCompanyId, companyIdList);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(companyName)) {
|
|
|
+ queryWrapper.like(AlarmFire::getCompanyName, companyName);
|
|
|
}
|
|
|
if (handlingStatus != null) {
|
|
|
queryWrapper.eq(AlarmFire::getHandlingStatus, handlingStatus);
|
|
|
}
|
|
|
|
|
|
if (alarmTypeList.size() > 0) {
|
|
|
- if (alarmTypeList.contains(100)){
|
|
|
- List<Integer> alarmTypeList1 = new ArrayList<>();
|
|
|
- alarmTypeList1.add(2);
|
|
|
- alarmTypeList1.add(4);
|
|
|
+ if (alarmTypeList.contains("100")) {
|
|
|
+ List<String> alarmTypeList1 = new ArrayList<>();
|
|
|
+ alarmTypeList1.add("2");
|
|
|
+ alarmTypeList1.add("4");
|
|
|
queryWrapper.notIn(AlarmFire::getAlarmType, alarmTypeList1);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
queryWrapper.in(AlarmFire::getAlarmType, alarmTypeList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (startDate != null && !"".equals(startDate) && endDate != null && !"".equals(endDate)) {
|
|
|
+ if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
|
|
|
queryWrapper.between(AlarmFire::getAlarmTime, startDate, endDate);
|
|
|
}
|
|
|
int total = this.count(queryWrapper);
|