Commit d1bb31a8 authored by zhangsen's avatar zhangsen

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6_temp

parents c804413a 96cb9c8b
...@@ -6,24 +6,32 @@ import java.util.Date; ...@@ -6,24 +6,32 @@ import java.util.Date;
import java.util.List; import java.util.List;
public enum PressurePumpEnum { public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC","", new Date().getSeconds()+" " + new Date().getMinutes() +"/5 * * * ?", "5", ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", new Date().getSeconds() + " " + new Date().getMinutes() + "/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode()), PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5", ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode()), PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "", ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode()), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30", ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode()), PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode()), PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240", ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode()), PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"),
ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30", ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode()), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode()), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240", ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode()); PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时");
private String code; private String code;
private String operator; private String operator;
...@@ -31,14 +39,16 @@ public enum PressurePumpEnum { ...@@ -31,14 +39,16 @@ public enum PressurePumpEnum {
private String rightValue; private String rightValue;
private String compareValue; private String compareValue;
private String level; private String level;
private String tips;
private PressurePumpEnum(String code, String operator, String leftValue, String rightValue, String compareValue, String level) { PressurePumpEnum(String code, String operator, String leftValue, String rightValue, String compareValue, String level, String tips) {
this.code = code; this.code = code;
this.operator = operator; this.operator = operator;
this.leftValue = leftValue; this.leftValue = leftValue;
this.rightValue = rightValue; this.rightValue = rightValue;
this.compareValue = compareValue; this.compareValue = compareValue;
this.level = level; this.level = level;
this.tips = tips;
} }
public static List<PressurePumpEnum> getEnumListByCode(String code) { public static List<PressurePumpEnum> getEnumListByCode(String code) {
...@@ -65,4 +75,5 @@ public enum PressurePumpEnum { ...@@ -65,4 +75,5 @@ public enum PressurePumpEnum {
} }
public String getCompareValue() { return compareValue; } public String getCompareValue() { return compareValue; }
public String getLevel() { return level; } public String getLevel() { return level; }
public String getTips() { return tips; }
} }
...@@ -2,10 +2,10 @@ package com.yeejoin.equipmanage.common.enums; ...@@ -2,10 +2,10 @@ package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpMessageEnum { public enum PressurePumpMessageEnum {
MESSAGE_LEVEL_YB("YB", "【%s】分钟内,启停间隔较小", "","【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"), MESSAGE_LEVEL_YB("YB", "%s内,启停间隔较小", "","【%s】- 【%s】 - %s内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_YZ("YZ", "【%s】分钟内,启停间隔较小", "", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"), MESSAGE_LEVEL_YZ("YZ", "%s内,启停间隔较小", "", "【%s】- 【%s】 - %s内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ("QT_WJ", "【%s】分钟内,设备启停频繁", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"), MESSAGE_LEVEL_QT_WJ("QT_WJ", "%s内,设备启停频繁", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - %s内,设备启停频繁,可能存在漏水,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理"); MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过%s,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 运行时长超过%s,存在漏水可能,请及时查看处理");
private String code; private String code;
private String allMessage; private String allMessage;
private String marqueeMessage; private String marqueeMessage;
......
...@@ -589,8 +589,19 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -589,8 +589,19 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Map<Date, Long> dutyPersonShiftMap = dutyPersonShiftsDb.stream() Map<Date, Long> dutyPersonShiftMap = dutyPersonShiftsDb.stream()
.collect(Collectors.toMap(DutyPersonShift::getDutyDate, DutyPersonShift::getSequenceNbr)); .collect(Collectors.toMap(DutyPersonShift::getDutyDate, DutyPersonShift::getSequenceNbr));
// todo: 只更新当天及值班之后数据 // todo: 只更新当天及值班之后数据
// 修复导入当天值班数据bug
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(new Date());
Date date = null;
try {
date = simpleDateFormat.parse(format);
} catch (ParseException e) {
e.printStackTrace();
}
Date finalDate = date;
Set<DutyPersonShift> needToDb = shiftDtos.stream() Set<DutyPersonShift> needToDb = shiftDtos.stream()
.filter(s -> DateUtils.dateCompare(s.getDutyDate(), new Date()) >= 0).map(shiftDto -> { .filter(s -> DateUtils.dateCompare(s.getDutyDate(), finalDate) >= 0).map(shiftDto -> {
DutyPersonShift dutyPersonShift = new DutyPersonShift(); DutyPersonShift dutyPersonShift = new DutyPersonShift();
Bean.copyExistPropertis(shiftDto, dutyPersonShift); Bean.copyExistPropertis(shiftDto, dutyPersonShift);
dutyPersonShift.setInstanceId(finalInstanceId); dutyPersonShift.setInstanceId(finalInstanceId);
......
...@@ -132,8 +132,14 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -132,8 +132,14 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
if (linkageUnitDto.getAddress() != null) { if (linkageUnitDto.getAddress() != null) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress());
linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS)); linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS));
linkageUnitDto.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); String[] addressArr = linkageUnitDto.getAddress().split("@address@");
linkageUnitDto.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); JSONObject jsonObject = JSONObject.parseObject(addressArr[1]);
if (StringUtils.isNotEmpty(jsonObject.getString(BizConstant.LONGITUDE))) {
linkageUnitDto.setLongitude(Double.valueOf(jsonObject.getString(BizConstant.LONGITUDE)));
}
if (StringUtils.isNotEmpty(jsonObject.getString(BizConstant.LATITUDE))) {
linkageUnitDto.setLatitude(Double.valueOf(jsonObject.getString(BizConstant.LATITUDE)));
}
} }
// 1.保存行数据 // 1.保存行数据
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
......
...@@ -17,6 +17,7 @@ import io.swagger.annotations.Api; ...@@ -17,6 +17,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -48,6 +49,11 @@ public class BigScreenController extends AbstractBaseController { ...@@ -48,6 +49,11 @@ public class BigScreenController extends AbstractBaseController {
@Autowired @Autowired
private IotFeign iotFeign; private IotFeign iotFeign;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
@Value("${equipment.pressurepump.stop}")
private String pressurePumpStop;
@GetMapping(value = "/list") @GetMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "系统、消防水池、工业水池、水源总容积、消防车辆(接口弃用)", notes = "系统、消防水池、工业水池、水源总容积、消防车辆") @ApiOperation(httpMethod = "GET", value = "系统、消防水池、工业水池、水源总容积、消防车辆(接口弃用)", notes = "系统、消防水池、工业水池、水源总容积、消防车辆")
...@@ -110,8 +116,8 @@ public class BigScreenController extends AbstractBaseController { ...@@ -110,8 +116,8 @@ public class BigScreenController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Stop"); entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStop);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -121,7 +127,7 @@ public class BigScreenController extends AbstractBaseController { ...@@ -121,7 +127,7 @@ public class BigScreenController extends AbstractBaseController {
String json2 = JSON.toJSONString(entity2.getResult()); String json2 = JSON.toJSONString(entity2.getResult());
List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2); List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2);
listObject1.addAll(listObject2); listObject1.addAll(listObject2);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FHS_PressurePump_Start") && t.get("FHS_PressurePump_Start").equals("true")) || (t.containsKey("FHS_PressurePump_Stop") && t.get("FHS_PressurePump_Stop").equals("true"))).collect(Collectors.toList()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true")) || (t.containsKey(pressurePumpStop) && t.get(pressurePumpStop).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("startAndStopNum", num); item.put("startAndStopNum", num);
} }
......
...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -47,6 +48,12 @@ public class ConfigureController extends AbstractBaseController { ...@@ -47,6 +48,12 @@ public class ConfigureController extends AbstractBaseController {
@Autowired @Autowired
private IotFeign iotFeign; private IotFeign iotFeign;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
@Value("${equipment.pressurepump.stop}")
private String pressurePumpStop;
@PersonIdentify @PersonIdentify
@RequestMapping(value = "/alarmLogPage", method = RequestMethod.GET) @RequestMapping(value = "/alarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -283,8 +290,8 @@ public class ConfigureController extends AbstractBaseController { ...@@ -283,8 +290,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Stop"); entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStop);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -294,7 +301,7 @@ public class ConfigureController extends AbstractBaseController { ...@@ -294,7 +301,7 @@ public class ConfigureController extends AbstractBaseController {
String json2 = JSON.toJSONString(entity2.getResult()); String json2 = JSON.toJSONString(entity2.getResult());
List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2); List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2);
listObject1.addAll(listObject2); listObject1.addAll(listObject2);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FHS_PressurePump_Start") && t.get("FHS_PressurePump_Start").equals("true")) || (t.containsKey("FHS_PressurePump_Stop") && t.get("FHS_PressurePump_Stop").equals("true"))).collect(Collectors.toList()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true")) || (t.containsKey(pressurePumpStop) && t.get(pressurePumpStop).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("startAndStopNum", num); item.put("startAndStopNum", num);
} }
...@@ -343,8 +350,8 @@ public class ConfigureController extends AbstractBaseController { ...@@ -343,8 +350,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Stop"); entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStop);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -354,7 +361,7 @@ public class ConfigureController extends AbstractBaseController { ...@@ -354,7 +361,7 @@ public class ConfigureController extends AbstractBaseController {
String json2 = JSON.toJSONString(entity2.getResult()); String json2 = JSON.toJSONString(entity2.getResult());
List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2); List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2);
listObject1.addAll(listObject2); listObject1.addAll(listObject2);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FHS_PressurePump_Start") && t.get("FHS_PressurePump_Start").equals("true")) || (t.containsKey("FHS_PressurePump_Stop") && t.get("FHS_PressurePump_Stop").equals("true"))).collect(Collectors.toList()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true")) || (t.containsKey(pressurePumpStop) && t.get(pressurePumpStop).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("startAndStopNum", num); item.put("startAndStopNum", num);
} }
......
...@@ -16,6 +16,7 @@ import io.swagger.annotations.Api; ...@@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -50,6 +51,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -50,6 +51,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired @Autowired
private ISupervisionVideoService supervisionVideoService; private ISupervisionVideoService supervisionVideoService;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览水源信息") @ApiOperation(value = "监盘概览水源信息")
...@@ -286,38 +290,38 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -286,38 +290,38 @@ public class SupervisionConfigureController extends AbstractBaseController {
ResponseModel twoHourEntity = null; ResponseModel twoHourEntity = null;
ResponseModel fourHourEntity = null; ResponseModel fourHourEntity = null;
try { try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
halfHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), half, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); halfHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), half, nowStrLong, prefix, suffix, pressurePumpStart);
twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, pressurePumpStart);
fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, "FHS_PressurePump_Start"); fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if (200 == mounthEntity.getStatus()) { if (200 == mounthEntity.getStatus()) {
String json1 = JSON.toJSONString(mounthEntity.getResult()); String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); 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()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("monthStartNum", num); item.put("monthStartNum", num);
} }
if (200 == halfHourEntity.getStatus()) { if (200 == halfHourEntity.getStatus()) {
String json1 = JSON.toJSONString(halfHourEntity.getResult()); String json1 = JSON.toJSONString(halfHourEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); 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()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("halfHourStartNum", num); item.put("halfHourStartNum", num);
} }
if (200 == twoHourEntity.getStatus()) { if (200 == twoHourEntity.getStatus()) {
String json1 = JSON.toJSONString(twoHourEntity.getResult()); String json1 = JSON.toJSONString(twoHourEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); 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()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("twoHourStartNum", num); item.put("twoHourStartNum", num);
} }
if (200 == fourHourEntity.getStatus()) { if (200 == fourHourEntity.getStatus()) {
String json1 = JSON.toJSONString(fourHourEntity.getResult()); String json1 = JSON.toJSONString(fourHourEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); 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()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true"))).collect(Collectors.toList());
int num = collect.size(); int num = collect.size();
item.put("fourHourStartNum", num); item.put("fourHourStartNum", num);
} }
......
...@@ -43,7 +43,7 @@ public class PumpSendMessage implements Job { ...@@ -43,7 +43,7 @@ public class PumpSendMessage implements Job {
Map<String, String> map = new HashMap<>(4); Map<String, String> map = new HashMap<>(4);
String allMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getAllMessage(); String allMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getAllMessage();
if (StringUtil.isNotEmpty(allMessage)) { if (StringUtil.isNotEmpty(allMessage)) {
String content = String.format(allMessage, pressurePumpEnum.getRightValue()); String content = String.format(allMessage, pressurePumpEnum.getTips());
map.put("content", content); map.put("content", content);
map.put("type", "漏水提醒"); map.put("type", "漏水提醒");
map.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date())); map.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
...@@ -51,7 +51,7 @@ public class PumpSendMessage implements Job { ...@@ -51,7 +51,7 @@ public class PumpSendMessage implements Job {
} }
String recordMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getRecordMessage(); String recordMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) { if (StringUtil.isNotEmpty(recordMessage)) {
body = String.format(recordMessage, equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getRightValue()); body = String.format(recordMessage, equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getTips());
} }
String marqueeMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getMarqueeMessage(); String marqueeMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) { if (StringUtil.isNotEmpty(marqueeMessage)) {
......
...@@ -495,6 +495,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -495,6 +495,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
Map<String, Object> map = fireFightingSystemMapper.getWaterPoolLevel(equipmentSpecificIndex.getEquipmentSpecificId()); Map<String, Object> map = fireFightingSystemMapper.getWaterPoolLevel(equipmentSpecificIndex.getEquipmentSpecificId());
if (!ObjectUtils.isEmpty(map)) { if (!ObjectUtils.isEmpty(map)) {
BigDecimal minValues = new BigDecimal(map.get("minValues").toString());
BigDecimal minValue = getBigDecimal(map.get("minValues")); BigDecimal minValue = getBigDecimal(map.get("minValues"));
BigDecimal maxValue = getBigDecimal(map.get("maxValues")); BigDecimal maxValue = getBigDecimal(map.get("maxValues"));
BigDecimal nowValue = getBigDecimal(iotDataVO.getValue()); BigDecimal nowValue = getBigDecimal(iotDataVO.getValue());
...@@ -557,7 +558,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -557,7 +558,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else if( value instanceof BigInteger) { } else if( value instanceof BigInteger) {
val = new BigDecimal( (BigInteger) value ); val = new BigDecimal( (BigInteger) value );
} else if( value instanceof Number ) { } else if( value instanceof Number ) {
val = new BigDecimal( ((Number)value).doubleValue() ); val = new BigDecimal(String.valueOf(value));
} else { } else {
throw new ClassCastException("Not possible to coerce ["+value+"] from class "+value.getClass()+" into a BigDecimal."); throw new ClassCastException("Not possible to coerce ["+value+"] from class "+value.getClass()+" into a BigDecimal.");
} }
...@@ -1456,7 +1457,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1456,7 +1457,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String body = ""; String body = "";
Map<String, String> map = new HashMap<>(4); Map<String, String> map = new HashMap<>(4);
if (StringUtil.isNotEmpty(allMessage)) { if (StringUtil.isNotEmpty(allMessage)) {
String value = StringUtil.isNotEmpty(pressurePumpEnum.getLeftValue()) ? pressurePumpEnum.getLeftValue() : pressurePumpEnum.getRightValue(); String value = StringUtil.isNotEmpty(pressurePumpEnum.getTips()) ? pressurePumpEnum.getTips() : "";
String content = String.format(allMessage, value); String content = String.format(allMessage, value);
map.put("content", content); map.put("content", content);
map.put("name", data.getEquipmentSpecificName()); map.put("name", data.getEquipmentSpecificName());
...@@ -1464,7 +1465,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1464,7 +1465,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
String recordMessage = pumpMessageEnum.getRecordMessage(); String recordMessage = pumpMessageEnum.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) { if (StringUtil.isNotEmpty(recordMessage)) {
String value = StringUtil.isNotEmpty(pressurePumpEnum.getLeftValue()) ? pressurePumpEnum.getLeftValue() : pressurePumpEnum.getRightValue(); String value = StringUtil.isNotEmpty(pressurePumpEnum.getTips()) ? pressurePumpEnum.getTips() : "";
body = String.format(recordMessage, data.getEquipmentSpecificName(), data.getLocation(), value); body = String.format(recordMessage, data.getEquipmentSpecificName(), data.getLocation(), value);
} }
String marqueeMessage = pumpMessageEnum.getMarqueeMessage(); String marqueeMessage = pumpMessageEnum.getMarqueeMessage();
......
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