Commit 2dc5d1c6 authored by limei's avatar limei

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents 29f1c37f 1edc3d07
...@@ -382,7 +382,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -382,7 +382,7 @@ public class WaterResourceDto extends BaseDto {
@ExcelIgnore @ExcelIgnore
@ApiModelProperty("水池液位显示装置id") @ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId; private String levelDeviceId;
@ApiModelProperty("水池液位显示装置名称") @ApiModelProperty("水池液位显示装置名称")
@ExcelProperty(value = "水池液位显示装置", index = 45) @ExcelProperty(value = "水池液位显示装置", index = 45)
......
...@@ -69,7 +69,7 @@ public class WaterResourcePoolDto extends BaseDto { ...@@ -69,7 +69,7 @@ public class WaterResourcePoolDto extends BaseDto {
private float maxWaterLevel; private float maxWaterLevel;
@ApiModelProperty("水池液位显示装置id") @ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId; private String levelDeviceId;
@ApiModelProperty("水池液位显示装置名称") @ApiModelProperty("水池液位显示装置名称")
private String levelDeviceName; private String levelDeviceName;
......
...@@ -104,7 +104,7 @@ public class WaterResourcePool extends BaseEntity { ...@@ -104,7 +104,7 @@ public class WaterResourcePool extends BaseEntity {
* 水池液位显示装置id * 水池液位显示装置id
*/ */
@TableField("level_device_id") @TableField("level_device_id")
private Long levelDeviceId; private String levelDeviceId;
/** /**
* 水池液位显示装置名称 * 水池液位显示装置名称
......
...@@ -10,6 +10,7 @@ public enum WaterResourceTypeEnum { ...@@ -10,6 +10,7 @@ public enum WaterResourceTypeEnum {
消防水鹤("crane", "消防水鹤"), 消防水鹤("crane", "消防水鹤"),
消防水池("pool", "消防水池"), 消防水池("pool", "消防水池"),
天然水源("natural", "天然水源"), 天然水源("natural", "天然水源"),
消防水箱("waterTank", "消防水箱"),
工业水池("industryPool", "工业水池"); 工业水池("industryPool", "工业水池");
private String code; private String code;
......
...@@ -38,12 +38,15 @@ public class Equipment extends BaseEntity { ...@@ -38,12 +38,15 @@ public class Equipment extends BaseEntity {
@ApiModelProperty(value = "国别") @ApiModelProperty(value = "国别")
private String country; private String country;
@ApiModelProperty(value = "保养周期") @ApiModelProperty(value = "维保周期")
private Short maintenanceCycle; private Short maintenanceCycle;
@ApiModelProperty(value = "检查周期(天)") @ApiModelProperty(value = "检查周期(天)")
private Short checkCycle; private Short checkCycle;
@ApiModelProperty(value = "报废期限")
private Short expiryDate;
private String remark; private String remark;
@ApiModelProperty(value = "管理方式 单件还是批量管理模式,单件S,批量:P") @ApiModelProperty(value = "管理方式 单件还是批量管理模式,单件S,批量:P")
......
...@@ -179,4 +179,10 @@ public class EquipmentDetail extends BaseEntity { ...@@ -179,4 +179,10 @@ public class EquipmentDetail extends BaseEntity {
@TableField(value = "latitude") @TableField(value = "latitude")
private Double latitude; private Double latitude;
@TableField(exist = false)
private List<UploadFile> quality;
@TableField(exist = false)
private List<UploadFile> operation;
} }
...@@ -4,6 +4,7 @@ import java.util.Date; ...@@ -4,6 +4,7 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity; import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -159,4 +160,13 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -159,4 +160,13 @@ public class EquipmentSpecific extends BaseEntity {
@ApiModelProperty(value = "设备值说明") @ApiModelProperty(value = "设备值说明")
@TableField("value_label") @TableField("value_label")
private String valueLabel; private String valueLabel;
@ApiModelProperty(value = "质保信息")
@TableField("warranty_info")
private String warrantyInfo;
@ApiModelProperty(value = "质保周期")
@TableField("warranty_period")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date warrantyPeriod;
} }
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@TableName("wl_marquee_data")
@ApiModel(value = "marquee_data对象", description = "")
public class MarqueeData extends BaseEntity {
/**
* 类型
*/
private String type;
/**
* 设备名称
*/
private String name;
/**
* 位置
*/
private String position;
/**
* 消息类型
*/
private String messageType;
/**
* 是否已读【0:未读;1:已读】
*/
private int isRead;
/**
* 设备id
*/
private Long equipmentSpecificId;
}
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@TableName("wl_supervision_video")
@ApiModel(value = "Video对象", description = "")
public class SupervisionVideo extends BaseEntity {
private String bizOrgCode;
private String cameraId;
}
package com.yeejoin.equipmanage.common.entity.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author DELL
*/
@Data
@ApiModel(value = "FormGroupColumnDto对象", description = "分组Dto对象")
public class FormGroupColumnDto {
@ApiModelProperty(value = "字段名")
private String fieldName;
@ApiModelProperty(value = "中文名")
private String fieldLabel;
@ApiModelProperty(value = "值")
private String fieldValue;
@ApiModelProperty(value = "数据类型:文本,数字,枚举,日期")
private String dataType;
@ApiModelProperty(value = "查询策略;全等,模糊,区间")
private String queryStrategy;
@ApiModelProperty(value = "分组编号")
private String groupCode;
}
...@@ -2,7 +2,8 @@ package com.yeejoin.equipmanage.common.enums; ...@@ -2,7 +2,8 @@ package com.yeejoin.equipmanage.common.enums;
public enum FileTypeEnum { public enum FileTypeEnum {
image("图片"),video("视频"),instruction("说明"),certificate("资质"),face("平面图"); image("图片"),video("视频"),instruction("说明"),certificate("资质"),
face("平面图"),quality("合格证"),operation("操作说明");
String describe; String describe;
......
...@@ -24,7 +24,10 @@ public enum GroupCodeEnum { ...@@ -24,7 +24,10 @@ public enum GroupCodeEnum {
R_RAIN_ROOM("雨淋阀间","r_rainRoom","YLFJ"), R_RAIN_ROOM("雨淋阀间","r_rainRoom","YLFJ"),
R_FIRE_FOAM_ROOM("消防泡沫间","r_fireFoamRoom","PMJ"), R_FIRE_FOAM_ROOM("消防泡沫间","r_fireFoamRoom","PMJ"),
R_FIRE_CONTROL_ROOM("消防控制室","r_fireControlRoom","XKS"), R_FIRE_CONTROL_ROOM("消防控制室","r_fireControlRoom","XKS"),
FLOOR("楼层","floor","LC"); FLOOR("楼层","floor","LC"),
PMYG("泡沫液罐","92031900","PMYG"),
GWYLTCQ("管网压力探测器","92011000","GWYLTCQ"),
XFSCZZ("消防水池装置","92010700","XFSCZZ");
private String groupName; private String groupName;
private String groupCode; private String groupCode;
......
...@@ -5,5 +5,5 @@ package com.yeejoin.equipmanage.common.enums; ...@@ -5,5 +5,5 @@ package com.yeejoin.equipmanage.common.enums;
* @author DELL * @author DELL
*/ */
public enum GroupColumnDataType { public enum GroupColumnDataType {
String, Integer,datetime, Enum,Double,Date,Boolean,Array,File,InstanceId String, Integer,datetime, Enum,Double,Date,Boolean,Array,File,InstanceId,inputNumber
} }
package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpCheckEnum {
LE("le", "小于等于"),
GE("ge", "大于等于"),
BE("be", "在两者之间");
private String code;
private String describe;
private PressurePumpCheckEnum(String code, String describe) {
this.code = code;
this.describe = describe;
}
public String getCode() {
return code;
}
public String getDescribe() {
return describe;
}
public static PressurePumpCheckEnum getByCode(String code) {
for (PressurePumpCheckEnum l : PressurePumpCheckEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.equipmanage.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC","", "0 0/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode()),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode()),
ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode()),
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()),
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()),
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()),
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()),
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()),
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());
private String code;
private String operator;
private String leftValue;
private String rightValue;
private String compareValue;
private String level;
private PressurePumpEnum(String code, String operator, String leftValue, String rightValue, String compareValue, String level) {
this.code = code;
this.operator = operator;
this.leftValue = leftValue;
this.rightValue = rightValue;
this.compareValue = compareValue;
this.level = level;
}
public static List<PressurePumpEnum> getEnumListByCode(String code) {
List<PressurePumpEnum> list = new ArrayList<>();
for(PressurePumpEnum e : PressurePumpEnum.values()) {
if (e.getCode().startsWith(code)) {
list.add(e);
}
}
return list;
}
public String getCode() {
return code;
}
public String getOperator() {
return operator;
}
public String getLeftValue() {
return leftValue;
}
public String getRightValue() {
return rightValue;
}
public String getCompareValue() { return compareValue; }
public String getLevel() { return level; }
}
package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpMessageEnum {
MESSAGE_LEVEL_YB("YB", "【%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_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理");
private String code;
private String allMessage;
private String marqueeMessage;
private String recordMessage;
private PressurePumpMessageEnum(String code, String allMessage, String marqueeMessage,String recordMessage) {
this.code = code;
this.allMessage = allMessage;
this.marqueeMessage = marqueeMessage;
this.recordMessage = recordMessage;
}
public String getCode() {
return code;
}
public String getAllMessage() {
return allMessage;
}
public String getMarqueeMessage() {
return marqueeMessage;
}
public String getRecordMessage() {
return recordMessage;
}
public static PressurePumpMessageEnum getByCode(String code) {
for (PressurePumpMessageEnum l : PressurePumpMessageEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpValueEnum {
LAST_STOP("lastStop", "上次停泵时间"),
LAST_START("lastStart", "上次启泵时间"),
LATELY_STOP("latelyStop", "所有泵最近一次停泵时间"),
PUMP_START_TIME("pumpStartTime", "计算启动时常"),
LATELY_START("latelyStart", "所有泵最近一次启泵时间");
private String code;
private String describe;
private PressurePumpValueEnum(String code, String describe) {
this.code = code;
this.describe = describe;
}
public String getCode() {
return code;
}
public String getDescribe() {
return describe;
}
public static PressurePumpValueEnum getByCode(String code) {
for (PressurePumpValueEnum l : PressurePumpValueEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
...@@ -221,7 +221,7 @@ public class OrgUsrController extends BaseController { ...@@ -221,7 +221,7 @@ public class OrgUsrController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUnit/{code}", method = RequestMethod.GET) @RequestMapping(value = "/getUnitByCode/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取单位详情", notes = "获取单位详情") @ApiOperation(httpMethod = "GET", value = "获取单位详情", notes = "获取单位详情")
public ResponseModel<OrgUsrFormDto> selectByCode(HttpServletRequest request, @PathVariable String code) throws Exception { public ResponseModel<OrgUsrFormDto> selectByCode(HttpServletRequest request, @PathVariable String code) throws Exception {
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
......
...@@ -137,12 +137,14 @@ public class WaterResourceController extends BaseController { ...@@ -137,12 +137,14 @@ public class WaterResourceController extends BaseController {
waterResourceNaturalService.createWithModel(waterResourceNaturalDto); waterResourceNaturalService.createWithModel(waterResourceNaturalDto);
break; break;
case "pool": case "pool":
case "waterTank":
case "industryPool": case "industryPool":
// 新增基础信息 // 新增基础信息
model.setIsIot(true); model.setIsIot(true);
waterResourceServiceImpl.createWithModel(model); waterResourceServiceImpl.createWithModel(model);
WaterResourcePoolDto waterResourcePoolDto = new WaterResourcePoolDto(); WaterResourcePoolDto waterResourcePoolDto = new WaterResourcePoolDto();
BeanUtils.copyProperties(model, waterResourcePoolDto); BeanUtils.copyProperties(model, waterResourcePoolDto);
// waterResourcePoolDto.setLevelDeviceId(String.join(",", model.getLevelDeviceId()));
waterResourcePoolDto.setSequenceNbr(null); waterResourcePoolDto.setSequenceNbr(null);
waterResourcePoolDto.setResourceId(model.getSequenceNbr()); waterResourcePoolDto.setResourceId(model.getSequenceNbr());
waterResourcePoolService.createWithModel(waterResourcePoolDto); waterResourcePoolService.createWithModel(waterResourcePoolDto);
...@@ -278,6 +280,7 @@ public class WaterResourceController extends BaseController { ...@@ -278,6 +280,7 @@ public class WaterResourceController extends BaseController {
waterResourceNaturalService.updateWithModel(waterResourceNaturalDto); waterResourceNaturalService.updateWithModel(waterResourceNaturalDto);
break; break;
case "industryPool": case "industryPool":
case "waterTank":
case "pool": case "pool":
WaterResourcePoolDto waterResourcePoolDto = new WaterResourcePoolDto(); WaterResourcePoolDto waterResourcePoolDto = new WaterResourcePoolDto();
WaterResourcePool waterResourcePool = WaterResourcePool waterResourcePool =
...@@ -285,6 +288,7 @@ public class WaterResourceController extends BaseController { ...@@ -285,6 +288,7 @@ public class WaterResourceController extends BaseController {
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(model, waterResourcePoolDto); BeanUtils.copyProperties(model, waterResourcePoolDto);
waterResourcePoolDto.setSequenceNbr(waterResourcePool.getSequenceNbr()); waterResourcePoolDto.setSequenceNbr(waterResourcePool.getSequenceNbr());
waterResourcePoolDto.setResourceId(waterResourcePool.getResourceId());
waterResourcePoolService.updateWithModel(waterResourcePoolDto); waterResourcePoolService.updateWithModel(waterResourcePoolDto);
break; break;
default: default:
...@@ -403,11 +407,13 @@ public class WaterResourceController extends BaseController { ...@@ -403,11 +407,13 @@ public class WaterResourceController extends BaseController {
BeanUtils.copyProperties(waterResourceNatural, waterResourceDto); BeanUtils.copyProperties(waterResourceNatural, waterResourceDto);
break; break;
case "industryPool": case "industryPool":
case "waterTank":
case "pool": case "pool":
WaterResourcePool waterResourcePool = WaterResourcePool waterResourcePool =
waterResourcePoolService.getOne(new QueryWrapper<WaterResourcePool>().eq("resource_id", waterResourcePoolService.getOne(new QueryWrapper<WaterResourcePool>().eq("resource_id",
sequenceNbr)); sequenceNbr));
BeanUtils.copyProperties(waterResourcePool, waterResourceDto); BeanUtils.copyProperties(waterResourcePool, waterResourceDto);
// waterResourceDto.setLevelDeviceId(Arrays.asList(waterResourcePool.getLevelDeviceId().split(",")));
break; break;
default: default:
break; break;
......
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DataDictionaryTypeEnum {
PERSON_TYPE("人员类型", "DLRYLX");
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
DataDictionaryTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
}
package com.yeejoin.amos.boot.module.common.biz.enums; package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DynamicGroupCode { public enum DynamicGroupCodeEnum {
JCS_PERSON("机场人员", "246"); JCS_PERSON("机场人员", "246");
...@@ -23,7 +23,7 @@ public enum DynamicGroupCode { ...@@ -23,7 +23,7 @@ public enum DynamicGroupCode {
this.code = code; this.code = code;
} }
DynamicGroupCode(String name, String code) { DynamicGroupCodeEnum(String name, String code) {
this.name = name; this.name = name;
this.code = code; this.code = code;
} }
......
...@@ -19,7 +19,10 @@ import java.util.stream.Stream; ...@@ -19,7 +19,10 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
...@@ -82,6 +85,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -82,6 +85,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired @Autowired
DutyPersonShiftMapper dutyPersonShiftMapper; DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
IDataDictionaryService dataDictionaryService;
/** /**
* 每天单个班次执勤人数全部小于等于3人 * 每天单个班次执勤人数全部小于等于3人
*/ */
...@@ -122,7 +129,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -122,7 +129,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}); });
} }
// 获取人员详细信息 // 获取人员详细信息
List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCode.JCS_PERSON.getCode(), userIdSet); List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCodeEnum.JCS_PERSON.getCode(), userIdSet);
if (!CollectionUtils.isEmpty(personInfoList)) { if (!CollectionUtils.isEmpty(personInfoList)) {
Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId")))); Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId"))));
records.forEach(x -> { records.forEach(x -> {
...@@ -559,9 +566,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -559,9 +566,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<DynamicFormInstance> instances = dynamicFormInstanceService List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType") .list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId) .eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCode.JCS_PERSON.getCode())); .eq(DynamicFormInstance::getGroupCode, DynamicGroupCodeEnum.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) { if (!CollectionUtils.isEmpty(instances)) {
d.put("personType", instances.get(0).getFieldValue()); String fieldValue = instances.get(0).getFieldValue();
List<DataDictionary> dictionaryList = dataDictionaryService.getByType(DataDictionaryTypeEnum.PERSON_TYPE.getCode());
if (StringUtils.isNotBlank(fieldValue) && !CollectionUtils.isEmpty(dictionaryList)) {
Map<String, List<DataDictionary>> map = dictionaryList.stream().collect(Collectors.groupingBy(DataDictionary::getCode));
List<DataDictionary> list = map.get(fieldValue);
if (!CollectionUtils.isEmpty(list)) {
d.put("personType", list.get(0).getName());
}
}
} }
} }
return d; return d;
......
...@@ -167,9 +167,10 @@ public class BuildingController extends AbstractBaseController { ...@@ -167,9 +167,10 @@ public class BuildingController extends AbstractBaseController {
@ApiOperation(value = "通用保存") @ApiOperation(value = "通用保存")
public Object save( public Object save(
@RequestParam(value = "groupCode") String groupCode, @RequestParam(value = "groupCode") String groupCode,
@RequestParam(value = "instanceId", required = false) String instanceId,
@RequestBody Map<String, Object> map) { @RequestBody Map<String, Object> map) {
String orgCode = getOrgCode(); String orgCode = getOrgCode();
return buildService.saveForm(groupCode, orgCode, map); return buildService.saveForm(groupCode, orgCode, map, instanceId);
} }
@GetMapping(value = "/pointTree") @GetMapping(value = "/pointTree")
...@@ -217,9 +218,10 @@ public class BuildingController extends AbstractBaseController { ...@@ -217,9 +218,10 @@ public class BuildingController extends AbstractBaseController {
@PutMapping(value = "/commonUpdate") @PutMapping(value = "/commonUpdate")
public Object update( public Object update(
@RequestParam Long instanceId, @RequestParam Long instanceId,
@RequestParam(value = "groupCode", required = false) String groupCode,
@RequestBody Map<String, Object> map) { @RequestBody Map<String, Object> map) {
String orgCode = getOrgCode(); String orgCode = getOrgCode();
return buildService.updateForm(instanceId, orgCode, map); return buildService.updateForm(instanceId, orgCode, map, groupCode);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -188,6 +188,10 @@ public class ConfigureController extends AbstractBaseController { ...@@ -188,6 +188,10 @@ public class ConfigureController extends AbstractBaseController {
if (!CollectionUtils.isEmpty(fireCarInfoByWL.getRecords())) { if (!CollectionUtils.isEmpty(fireCarInfoByWL.getRecords())) {
List<Map<String, Object>> records = fireCarInfoByWL.getRecords(); List<Map<String, Object>> records = fireCarInfoByWL.getRecords();
records.forEach(item -> { records.forEach(item -> {
String carId = item.get("id").toString();
Map<String, Object> fireCaStartBySeven = fireFightingSystemMapper.getFireCaStartBySeven(carId);
Object count = fireCaStartBySeven.get("count");
item.put("count",count.toString());
if (item.containsKey("carStateDate") && !ObjectUtils.isEmpty(item.get("carStateDate"))) { if (item.containsKey("carStateDate") && !ObjectUtils.isEmpty(item.get("carStateDate"))) {
try { try {
Date carStateDate = DateUtils.dateParse(item.get("carStateDate").toString(), "yyyy-MM-dd'T'HH:mm:ss"); Date carStateDate = DateUtils.dateParse(item.get("carStateDate").toString(), "yyyy-MM-dd'T'HH:mm:ss");
...@@ -632,7 +636,7 @@ public class ConfigureController extends AbstractBaseController { ...@@ -632,7 +636,7 @@ public class ConfigureController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/iotMonthReport") @GetMapping(value = "/iotMonthReport")
@ApiOperation(httpMethod = "GET", value = "物联报表-月", notes = "物联报表-月") @ApiOperation(httpMethod = "GET", value = "物联报表-月", notes = "物联报表-月")
public ResponseModel equipList(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, public ResponseModel iotMonthReport(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "startDate") String startDate, @RequestParam(value = "startDate") String startDate,
@RequestParam(value = "endDate") String endDate) { @RequestParam(value = "endDate") String endDate) {
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.util.ArrayList; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import io.swagger.annotations.Api;
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.beans.factory.annotation.Value;
...@@ -23,20 +24,11 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -23,20 +24,11 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam; import java.util.ArrayList;
import com.yeejoin.equipmanage.common.utils.CommonPageParamUtil; import java.util.HashMap;
import com.yeejoin.equipmanage.common.utils.CommonPageable; import java.util.List;
import com.yeejoin.equipmanage.common.utils.CommonRequest; import java.util.Map;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* @author keyong * @author keyong
...@@ -181,6 +173,108 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -181,6 +173,108 @@ public class EquipmentAlarmController extends AbstractBaseController {
} }
/** /**
* 稳压泵跑马灯消息已读列表分页查询
*
* @return
*/
@RequestMapping(value = "/listPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
public ResponseModel list(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "warehouseStructureName", required = false) String warehouseStructureName,
@RequestParam(value = "equipCode", required = false) String equipCode,
@RequestParam(value = "handleStatus", required = false) String handleStatus,
@RequestParam(value = "system", required = false) String system,
@RequestParam(value = "alarmType", required = false) String alarmType,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "buildIds", required = false) List<String> buildIds,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
@RequestParam(value = "isRemoveShield", required = false) String isRemoveShield,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest();
request.setName("beginDate");
request.setValue(StringUtil.isNotEmpty(beginDate) ? StringUtils.trimToNull(beginDate).substring(0, 10) + " 00:00:00" : null);
queryRequests.add(request);
CommonRequest request1 = new CommonRequest();
request1.setName("endDate");
request1.setValue(StringUtil.isNotEmpty(endDate) ? StringUtils.trimToNull(endDate).substring(0, 10) + " 23:59:59" : null);
queryRequests.add(request1);
CommonRequest request2 = new CommonRequest();
request2.setName("warehouseStructureName");
request2.setValue(StringUtil.isNotEmpty(warehouseStructureName) ? StringUtils.trimToNull(warehouseStructureName) : null);
queryRequests.add(request2);
CommonRequest request3 = new CommonRequest();
request3.setName("equipCode");
request3.setValue(StringUtil.isNotEmpty(equipCode) ? StringUtils.trimToNull(equipCode) : null);
queryRequests.add(request3);
CommonRequest request4 = new CommonRequest();
request4.setName("alarmType");
request4.setValue(StringUtil.isNotEmpty(alarmType) ? StringUtils.trimToNull(alarmType) : null);
queryRequests.add(request4);
CommonRequest request5 = new CommonRequest();
request5.setName("orgCode");
request5.setValue(null);
queryRequests.add(request5);
CommonRequest request6 = new CommonRequest();
request6.setName("handleStatus");
request6.setValue(StringUtil.isNotEmpty(handleStatus) ? StringUtils.trimToNull(handleStatus) : null);
queryRequests.add(request6);
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(system) ? StringUtils.trimToNull(system) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("type");
request8.setValue(StringUtil.isNotEmpty(type) ? StringUtils.trimToNull(type) : null);
queryRequests.add(request8);
CommonRequest request9 = new CommonRequest();
request9.setName("buildIds");
request9.setValue(ObjectUtils.isEmpty(buildIds) ? null : buildIds);
queryRequests.add(request9);
CommonRequest request10 = new CommonRequest();
request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonRequest request12 = new CommonRequest();
request12.setName("isRemoveShield");
request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null);
queryRequests.add(request12);
if (equioEnabled) {
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null);
queryRequests.add(request13);
}
}else {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue("");
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.pageList(param);
return CommonResponseUtil.success(list);
}
@RequestMapping(value = "/updateReadStatus", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "修改消息已读状态", produces = "application/json;charset=UTF-8", notes = "修改消息已读状态")
public ResponseModel updateReadStatus(@RequestParam(value = "messageId") String messageId) {
return CommonResponseUtil.success(iEquipmentSpecificAlarmService.updateReadStatus(messageId));
}
/**
* 通过id获取告警详情 * 通过id获取告警详情
* *
* @return * @return
......
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.entity.FormGroupColumn;
import com.yeejoin.equipmanage.service.IFormGroupColumnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
/**
* 动态表单控制器
*
* @author gaojianqiang
* @date 2022-10-09
*/
@RestController
@Api(tags = "动态表单分组列Api")
@RequestMapping(value = "/form-group-column", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class FormGroupColumnController extends AbstractBaseController {
@Autowired
IFormGroupColumnService formGroupColumnService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "通过分组code查询列信息", notes = "通过分组code查询列信息")
@RequestMapping(value = "/queryByGroup", method = RequestMethod.GET)
public List<FormGroupColumn> queryByGroup(@RequestParam String groupCode) {
return formGroupColumnService.queryByGroup(groupCode);
}
}
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.entity.FormGroupColumn;
import com.yeejoin.equipmanage.common.entity.dto.FormGroupColumnDto;
import com.yeejoin.equipmanage.service.IFormGroupColumnService;
import com.yeejoin.equipmanage.service.IFormInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
/**
* 动态表单控制器
*
* @author gaojianqiang
* @date 2022-10-09
*/
@RestController
@Api(tags = "动态表单实例Api")
@RequestMapping(value = "/form-instance", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class FormInstanceController extends AbstractBaseController {
@Autowired
private IFormInstanceService formInstanceService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "通过分组code查询列及值信息", notes = "通过分组code查询列及值信息")
@RequestMapping(value = "/queryColumnAndValueByGroup", method = RequestMethod.GET)
public List<FormGroupColumnDto> queryColumnAndValueByGroup(@RequestParam String groupCode, @RequestParam(required = false) Long instanceId) {
return formInstanceService.queryColumnAndValueByGroup(groupCode, instanceId);
}
}
package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.ISupervisionVideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@Api(tags = "监盘总览组态需求 -- API")
@RequestMapping(value = "/supervisionConfigure", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
private FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
private IFireFightingSystemService iFireFightingSystemService;
@Autowired
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
@Autowired
private IotFeign iotFeign;
@Autowired
private ISupervisionVideoService supervisionVideoService;
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览水源信息")
@GetMapping("/getWaterInfo")
public ResponseModel getWaterInfo(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getWaterInfoBySuper(page, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览泡沫罐和水箱信息(监盘概览)")
@GetMapping("/getFoamTankBySuper")
public ResponseModel getFoamTankBySuper(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getFoamTankBySuper(page, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览管网压力信息(监盘概览)")
@GetMapping("/getPipeNetworkBySuper")
public ResponseModel getPipeNetworkBySuper(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getPipeNetworkBySuper(page, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览水池装置进水流量信息(监盘概览)")
@GetMapping("/getInfluentFlowBySuper")
public ResponseModel getInfluentFlowBySuper(CommonPageable commonPageable, @RequestParam(required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getInfluentFlowBySuper(page, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取某站下装备数量、摄像头数量(监盘概览)")
@GetMapping("/statisticsBySuper")
public ResponseModel statisticsByStation(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
if (ObjectUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.success(null);
}
return CommonResponseUtil.success(fireFightingSystemMapper.statisticsByStation(bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "【监盘总览-排油系统信息】获取系统设备状态(根据系统编码查询)")
@GetMapping("/getEquipmentStateBySuper")
public ResponseModel getEquipmentStateBySuper(@RequestParam(required = false) String systemCode, CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
Page result = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
} else {
throw new BadRequest("系统编码不能为空");
}
return CommonResponseUtil.success(iFireFightingSystemService.equipmentStateBySuper(result, hashMap));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "【监盘总览-排油系统信息】获取系统工作状态(根据系统编码查询)")
@GetMapping("/getSystemStatusBySuper")
public ResponseModel getSystemStatusBySuper(@RequestParam(required = false) String systemCode) {
HashMap<String, Object> hashMap = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
String bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
hashMap.put("bizOrgCode", bizOrgCode);
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
if (StringUtils.isNotBlank(systemCode)) {
hashMap.put("systemCode", systemCode);
} else {
throw new BadRequest("系统编码不能为空");
}
return CommonResponseUtil.success(iFireFightingSystemService.getSystemStatusBySuper(hashMap));
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String system, @RequestParam(required = false) String specificIndexKey, CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(system) ? StringUtils.trimToNull(system) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(specificIndexKey) ? StringUtils.trimToNull(specificIndexKey) : null);
queryRequests.add(request8);
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null);
queryRequests.add(request13);
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.fireAlarmLogPage(param));
}
@PersonIdentify
@RequestMapping(value = "/alarmTrend", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "报警类型趋势", produces = "application/json;charset=UTF-8", notes = "报警类型趋势")
public ResponseModel alarmTrend() {
String bizOrgCode = null;
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
return CommonResponseUtil.success(equipmentSpecificAlarmService.alarmTrend(bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "概览稳压泵信息")
@GetMapping("/getPressurePumpInfo")
public ResponseModel getPressurePumpInfo(CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
if (StringUtils.isEmpty(bizOrgCode)) {
return CommonResponseUtil.success(null);
}
Page<Map<String, Object>> pressurePumpInfo = fireFightingSystemMapper.getPressurePumpInfo(page, bizOrgCode, null);
List<Long> ids = new ArrayList();
pressurePumpInfo.getRecords().stream().map(item -> {
item.put("monthStartNum", 0);
item.put("halfHourStartNum", 0);
item.put("twoHourStartNum", 0);
item.put("fourHourStartNum", 0);
item.put("update_time", "--");
item.put("equipment_index_name", "--");
String prefix = null;
String suffix = null;
String iotCode = item.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
String nowStrLong = DateUtils.getNowStrLong();
Date mounthDate = DateUtils.dateAddMonths(null, -1);
Date halfHour = DateUtils.dateAddMinutes(null, -30);
Date twoHour = DateUtils.dateAddHours(null, -2);
Date fourHour = DateUtils.dateAddHours(null, -3);
String startDateStr = DateUtils.convertDateToString(mounthDate, DateUtils.DATE_TIME_PATTERN);
String half = DateUtils.convertDateToString(halfHour, DateUtils.DATE_TIME_PATTERN);
String two = DateUtils.convertDateToString(twoHour, DateUtils.DATE_TIME_PATTERN);
String four = DateUtils.convertDateToString(fourHour, DateUtils.DATE_TIME_PATTERN);
ResponseModel mounthEntity = null;
ResponseModel halfHourEntity = null;
ResponseModel twoHourEntity = null;
ResponseModel fourHourEntity = null;
try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, "FHS_PressurePump_Start");
halfHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), half, nowStrLong, prefix, suffix, "FHS_PressurePump_Start");
twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, "FHS_PressurePump_Start");
fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, "FHS_PressurePump_Start");
} catch (Exception e) {
e.printStackTrace();
}
if (200 == mounthEntity.getStatus()) {
String json1 = JSON.toJSONString(mounthEntity.getResult());
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());
int num = collect.size();
item.put("monthStartNum", num);
} else if (200 == halfHourEntity.getStatus()) {
String json1 = JSON.toJSONString(halfHourEntity.getResult());
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());
int num = collect.size();
item.put("halfHourStartNum", num);
} else if (200 == twoHourEntity.getStatus()) {
String json1 = JSON.toJSONString(twoHourEntity.getResult());
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());
int num = collect.size();
item.put("twoHourStartNum", num);
} else if (200 == fourHourEntity.getStatus()) {
String json1 = JSON.toJSONString(fourHourEntity.getResult());
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());
int num = collect.size();
item.put("fourHourStartNum", num);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long nowDateTime = new Date().getTime();//当前时间戳
Map<String, String> stateMap = fireFightingSystemMapper.queryPressureNowStateBySpecificId((Long) item.get("id"));
ids.add((Long) item.get("id"));
boolean time = false;
if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) {
item.put("update_time", String.valueOf(stateMap.get("update_date")).replaceAll("T", " "));
item.put("equipment_index_name", stateMap.get("equipment_index_name"));
if ("启动".equals(stateMap.get("equipment_index_name"))) {
long update_time = 0L;
try {
update_time = sdf.parse(String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")).getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
long res = nowDateTime - update_time;
long diffMinute = res / 1000 / 60;
if (diffMinute <= 5) {
time = true;
}
item.put("upTime", diffMinute);
}
}
item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常");
return item;
}).collect(Collectors.toList());
List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids);
long diffMinute = 0L;
if (!ObjectUtils.isEmpty(stateMap)) {
String startTime = stateMap.get(0).get("update_date").toString();
String endTime = stateMap.get(1).get("update_date").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start = 0L;
long end = 0L;
try {
start = sdf.parse(startTime.replaceAll("T", " ")).getTime();
end = sdf.parse(endTime.replaceAll("T", " ")).getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
long res = start - end;
diffMinute = res / 1000 / 60;
}
long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream(
).map(item -> {
item.put("startAndStopInterval", finalDiffMinute);
return item;
}).collect(Collectors.toList());
return CommonResponseUtil.success(pressurePumpInfo);
}
@PersonIdentify
@RequestMapping(value = "/replaceVideo", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "替换视频", produces = "application/json;charset=UTF-8", notes = "替换视频")
public ResponseModel replaceVideo(@RequestBody Map<String, String> ids) {
String bizOrgCode = null;
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
return CommonResponseUtil.success(supervisionVideoService.replaceVideo(ids, bizOrgCode));
}
@PersonIdentify
@RequestMapping(value = "/queryVideoList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询视频列表", produces = "application/json;charset=UTF-8", notes = "查询视频列表")
public ResponseModel queryVideoList() {
String bizOrgCode = null;
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
if (personIdentity.getCompanyBizOrgCode() == null) {
bizOrgCode = personIdentity.getBizOrgCode();
} else {
bizOrgCode = personIdentity.getCompanyBizOrgCode();
}
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
return CommonResponseUtil.success(supervisionVideoService.queryVideoList(bizOrgCode));
}
@PersonIdentify
@RequestMapping(value = "/queryVideoAllId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询对应站下所有视频id", produces = "application/json;charset=UTF-8", notes = "根据id查询视频")
public ResponseModel queryVideoAllId() {
String bizOrgCode = null;
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
}
return CommonResponseUtil.success(supervisionVideoService.queryVideoAllId(bizOrgCode));
}
}
...@@ -219,4 +219,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -219,4 +219,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Map<String, Object> inspectionMessage(@Param("orgCode") String orgCode Map<String, Object> inspectionMessage(@Param("orgCode") String orgCode
, @Param("startTime") String startTime , @Param("startTime") String startTime
, @Param("endTime") String endTime); , @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode);
} }
...@@ -110,4 +110,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -110,4 +110,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey); List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey);
List<Map<String, Object>> getEquipSpecificScrap();
List<EquipmentSpecificIndex> getEquipIndexInIndex(@Param("list") List<String> listIndex);
} }
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -300,12 +301,54 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -300,12 +301,54 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page<Map<String, Object>> getFireCarInfoByWL(Page page, @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> getFireCarInfoByWL(Page page, @Param("bizOrgCode") String bizOrgCode);
/** /**
* 物联监控页面消防车辆信息
*
* @param carId
* @return
*/
Map<String, Object> getFireCaStartBySeven(@Param("carId") String carId);
/**
* 获取水源信息 * 获取水源信息
* *
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
Page<Map<String, Object>> getWaterInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode); Page<Map<String, Object>> getWaterInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode);
/**
* 获取水源信息(监盘概览)
*
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getWaterInfoBySuper(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 监盘概览泡沫罐和水箱信息(监盘概览)
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getFoamTankBySuper(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 监盘概览管网压力信息(监盘概览)
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getPipeNetworkBySuper(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 监盘概览水池装置进水流量信息(监盘概览)
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getInfluentFlowBySuper(Page page, @Param("bizOrgCode") String bizOrgCode);
/** /**
* 获取系统今日告警信息 * 获取系统今日告警信息
* *
...@@ -322,6 +365,13 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -322,6 +365,13 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getFireSystemInfo(HashMap<String, Object> hashMap); List<Map<String, Object>> getFireSystemInfo(HashMap<String, Object> hashMap);
/** /**
* 获取系统状态 大于0异常 小于0正常
* @param hashMap
* @return
*/
Integer getSystemStatus(HashMap<String, Object> hashMap);
/**
* 获取系统近一月告警设备top5 * 获取系统近一月告警设备top5
* *
* @param hashMap * @param hashMap
...@@ -338,6 +388,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -338,6 +388,14 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
String equipmentId(HashMap<String, Object> hashMap); String equipmentId(HashMap<String, Object> hashMap);
/** /**
* 获取设备id
*
* @param hashMap
* @return
*/
String equipmentIdBySuper(HashMap<String, Object> hashMap);
/**
* 获取系统设备状态 * 获取系统设备状态
* *
* @param page * @param page
...@@ -347,6 +405,15 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -347,6 +405,15 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page<Map<String, Object>> equipmentState(Page page, String id); Page<Map<String, Object>> equipmentState(Page page, String id);
/** /**
* 获取系统设备状态
*
* @param page
* @param id
* @return
*/
Page<Map<String, Object>> equipmentStateBySuper(Page page, String id);
/**
* 稳压泵信息 * 稳压泵信息
* *
* @param page * @param page
...@@ -387,18 +454,25 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -387,18 +454,25 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getSystemAlarmInfoNum(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getSystemAlarmInfoNum(@Param("bizOrgCode") String bizOrgCode);
/** /**
* 消防水池或者工业水池信息 * 工业水池信息
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
List<Map<String, Object>> getWaterPoolInfoNum(@Param("bizOrgCode") String bizOrgCode, @Param("poolType") String poolType); List<Map<String, Object>> getWaterIndustryPoolInfoNum(@Param("bizOrgCode") String bizOrgCode);
/** /**
* 消防水源总量统计 * 消防水池信息
* @param companyCode * @param bizOrgCode
* @return * @return
*/ */
Map<String, Object> getWaterPoolVolumeInfo(@Param("companyCode") String companyCode); List<Map<String, Object>> getWaterPoolInfoNum(@Param("bizOrgCode") String bizOrgCode);
// /**
// * 消防水源总量统计
// * @param companyCode
// * @return
// */
// Map<String, Object> getWaterPoolVolumeInfo(@Param("companyCode") String companyCode);
/** /**
* 获取车辆总数 * 获取车辆总数
...@@ -526,4 +600,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -526,4 +600,18 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectDayEchart(@Param("systemId") String systemId, List<Map<String, Object>> selectDayEchart(@Param("systemId") String systemId,
@Param("date") String date, @Param("date") String date,
@Param("indicator") List<String> indicator); @Param("indicator") List<String> indicator);
List<Map<String, Object>> queryStartAndStopBySpecificId(@Param("ids")List<Long> ids);
List<Map<String, Object>> queryStateBySpecificId(@Param("id")long id);
Map<String, Object> getFoamTankLevel(@Param("equipSpeId") Long equipSpeId);
Map<String, Object> getPipeNetwork(@Param("equipSpeId") Long equipSpeId);
Map<String, Object> getWaterPoolLevel(@Param("equipSpeId") Long equipSpeId);
BigDecimal getWaterPoolLevelByEquipSpeId(@Param("equipSpeId") String equipSpeId);
} }
...@@ -212,4 +212,6 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> { ...@@ -212,4 +212,6 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @return * @return
*/ */
List<String> selectChildListdate(@Param("id")Long id); List<String> selectChildListdate(@Param("id")Long id);
int updateFormFieldValue(@Param("id") Long id, @Param("name") String name, @Param("value") String value);
} }
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.MarqueeData;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface MarqueeDataMapper extends BaseMapper<MarqueeData> {
List<Map<String, Object>> selectAll();
}
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SupervisionVideoMapper extends BaseMapper<SupervisionVideo> {
List<AlamVideoVO> getVideoByCompany(@Param("bizOrgCode") String bizOrgCode);
List<String> queryVideoAllId(@Param("bizOrgCode")String bizOrgCode);
}
...@@ -53,7 +53,7 @@ public enum SyncRiskOperator { ...@@ -53,7 +53,7 @@ public enum SyncRiskOperator {
newMap.put("parentId", item.get("parentId")); newMap.put("parentId", item.get("parentId"));
RiskSource riskSource1 = new RiskSource(); RiskSource riskSource1 = new RiskSource();
Map<String, Object> createMap = formInstanceService.createByMap(String.valueOf(item.get("groupCode")), Map<String, Object> createMap = formInstanceService.createByMap(String.valueOf(item.get("groupCode")),
String.valueOf(map.get("companyCode")), newMap); String.valueOf(map.get("companyCode")), newMap, null);
riskSource1.setParentId(Long.parseLong(String.valueOf(map.get("riskPointId")))); riskSource1.setParentId(Long.parseLong(String.valueOf(map.get("riskPointId"))));
riskSource1.setName(String.valueOf(item.get("buildName"))); riskSource1.setName(String.valueOf(item.get("buildName")));
riskSource1.setId(Long.parseLong(String.valueOf(createMap.get("instanceId")))); riskSource1.setId(Long.parseLong(String.valueOf(createMap.get("instanceId"))));
......
package com.yeejoin.equipmanage.quartz;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.MarqueeData;
import com.yeejoin.equipmanage.common.enums.PressurePumpEnum;
import com.yeejoin.equipmanage.common.enums.PressurePumpMessageEnum;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.Token;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.MarqueeDataMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
public class PumpSendMessage implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
Map jobDataMap = (Map) jobExecutionContext.getJobDetail().getJobDataMap().get("parameterList");
String jobName = String.valueOf(jobDataMap.get("jobName"));
String triggerName = String.valueOf(jobDataMap.get("triggerName"));
String triggerGroupName = String.valueOf(jobDataMap.get("triggerGroupName"));
String jobGroupName = String.valueOf(jobDataMap.get("jobGroupName"));
EquipmentSpecific equipmentSpecific = (EquipmentSpecific)jobDataMap.get("equipmentSpecific");
PressurePumpEnum pressurePumpEnum = (PressurePumpEnum)jobDataMap.get("pressurePumpEnum");
SystemctlFeign systemctlFeign = (SystemctlFeign)jobDataMap.get("systemctlFeign");
RemoteSecurityService remoteSecurityService = (RemoteSecurityService)jobDataMap.get("remoteSecurityService");
MarqueeDataMapper marqueeDataMapper = (MarqueeDataMapper)jobDataMap.get("marqueeDataMapper");
MessageModel model = new MessageModel();
model.setSendTime(new Date());
String body = "";
Map<String, String> map = new HashMap<>(4);
String allMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getAllMessage();
if (StringUtil.isNotEmpty(allMessage)) {
String content = String.format(allMessage, pressurePumpEnum.getRightValue());
map.put("content", content);
map.put("type", "漏水提醒");
map.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
map.put("name", equipmentSpecific.getName());
}
String recordMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) {
body = String.format(recordMessage, equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getRightValue());
}
String marqueeMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) {
MarqueeData marqueeData = new MarqueeData();
marqueeData.setIsRead(0);
marqueeData.setEquipmentSpecificId(equipmentSpecific.getId());
marqueeData.setMessageType("pressurePump");
marqueeData.setName(equipmentSpecific.getName());
marqueeData.setPosition(equipmentSpecific.getPosition());
marqueeData.setType("漏水提醒");
marqueeData.setCreateDate(new Date());
marqueeDataMapper.insert(marqueeData);
}
model.setBody(body);
model.setTitle("漏水提醒");
model.setExtras(map);
model.setRelationId(String.valueOf(equipmentSpecific.getId()));
model.setMsgType("pressurePump");
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setIsSendWeb(true);
model.setCategory(1);
List<String> receive = new ArrayList<>();
receive.add("system");
model.setRecivers(receive);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
QuartzManager.removeJob(jobName,jobGroupName,triggerName,triggerGroupName);
} catch (Exception e) {
log.error("稳压泵运行时常消息发送失败"+ e.getMessage());
}
}
}
package com.yeejoin.equipmanage.quartz;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import java.util.Map;
public class QuartzManager {
private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory();
private static String JOB_GROUP_NAME = "EQUIP_JOBGROUP_NAME";
private static String TRIGGER_GROUP_NAME = "EQUIP_TRIGGERGROUP_NAME";
/**
* @Description: 添加一个定时任务,使用默认的任务组名,触发器名,触发器组名
* @param jobName 任务名
* @param cls 任务
* @param time 时间设置,参考quartz说明文档
*/
public static void addJob(String jobName, Class cls, String time,Object scheduleJob) {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
JobDetail job = JobBuilder.newJob(cls)
.withIdentity(jobName, JOB_GROUP_NAME)
.build();
// 添加具体任务方法
job.getJobDataMap().put("scheduleJob", scheduleJob);
// 表达式调度构建器
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(time);
// 按新的cronExpression表达式构建一个新的trigger
Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity(jobName, TRIGGER_GROUP_NAME)
.withSchedule(scheduleBuilder).build();
//交给scheduler去调度
sched.scheduleJob(job, trigger);
// 启动
if (!sched.isShutdown()) {
sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 添加一个定时任务
* @param jobName 任务名
* @param jobGroupName 任务组名
* @param triggerName 触发器名
* @param triggerGroupName 触发器组名
* @param jobClass 任务
* @param time 时间设置,参考quartz说明文档
*/
public static void addJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName, Class jobClass,
String time, Map<String,Object> parameter) {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
JobDetail job = JobBuilder.newJob(jobClass)
.withIdentity(jobName, jobGroupName)
.build();
job.getJobDataMap().put("parameterList", parameter);
// 表达式调度构建器
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(time);
// 按新的cronExpression表达式构建一个新的trigger
Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity(triggerName, triggerGroupName)
.withSchedule(scheduleBuilder).build();
sched.scheduleJob(job, trigger);
// 启动
if (!sched.isShutdown()) {
sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间(使用默认的任务组名,触发器名,触发器组名)
* @param jobName
* @param time
*/
public static void modifyJobTime(String jobName, String time) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, TRIGGER_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
CronTrigger trigger =(CronTrigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
CronScheduleBuilder scheduleBuilder =CronScheduleBuilder.cronSchedule(time);
//按新的cronExpression表达式重新构建trigger
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey)
.withSchedule(scheduleBuilder).build();
//按新的trigger重新设置job执行
sched.rescheduleJob(triggerKey, trigger);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间
* @param triggerName
* @param triggerGroupName
* @param time
* @author qgw
* @date 2016年1月27日 下午4:45:15 ^_^
*/
public static void modifyJobTime(String triggerName,String triggerGroupName, String time) {
TriggerKey triggerKey = TriggerKey.triggerKey(
triggerName, triggerGroupName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
// trigger已存在,则更新相应的定时设置
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder
.cronSchedule(time);
// 按新的cronExpression表达式重新构建trigger
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey)
.withSchedule(scheduleBuilder).build();
// 按新的trigger重新设置job执行
sched.resumeTrigger(triggerKey);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description 移除一个任务(使用默认的任务组名,触发器名,触发器组名)
* @param jobName
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void removeJob(String jobName) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, TRIGGER_GROUP_NAME);
JobKey jobKey = JobKey.jobKey(jobName, JOB_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
Trigger trigger = (Trigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
sched.pauseTrigger(triggerKey);;// 停止触发器
sched.unscheduleJob(triggerKey);// 移除触发器
sched.deleteJob(jobKey);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务
* @param jobName
* @param jobGroupName
* @param triggerName
* @param triggerGroupName
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void removeJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, triggerGroupName);
JobKey jobKey = JobKey.jobKey(jobName, jobGroupName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseTrigger(triggerKey);// 停止触发器
sched.unscheduleJob(triggerKey);// 移除触发器
sched.deleteJob(jobKey);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:暂停一个任务
* @param jobName
* @param jobGroupName
*/
public static void pauseJob(String jobName, String jobGroupName) {
JobKey jobKey =JobKey.jobKey(jobName, jobName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseJob(jobKey);
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* @Description:暂停一个任务(使用默认组名)
* @param jobName
*/
public static void pauseJob(String jobName) {
JobKey jobKey =JobKey.jobKey(jobName, JOB_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseJob(jobKey);
} catch (SchedulerException e) {
e.printStackTrace();
}
}
/**
* @Description:启动所有定时任务
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void startJobs() {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description 关闭所有定时任务
* @author qgw
* @date 2016年1月25日 下午2:26:54 ^_^
*/
public static void shutdownJobs() {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
if (!sched.isShutdown()) {
sched.shutdown();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 任务是否存在
* @param jobName 任务名
* @param jobGroupName 任务组名
* @return 是否存在
*/
public static boolean checkExists(String jobName, String jobGroupName){
try {
Scheduler sched = gSchedulerFactory.getScheduler();
return sched.checkExists( new JobKey(jobName,
jobGroupName));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
...@@ -98,7 +98,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -98,7 +98,7 @@ public interface IBuilldService extends IService<Building> {
* @param map form * @param map form
* @return Object * @return Object
*/ */
Object saveForm(String groupCode, String companyCode, Map<String, Object> map); Object saveForm(String groupCode, String companyCode, Map<String, Object> map, String caseId);
/** /**
* 通用表单更新 * 通用表单更新
...@@ -108,7 +108,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -108,7 +108,7 @@ public interface IBuilldService extends IService<Building> {
* @param map form * @param map form
* @return Object * @return Object
*/ */
Object updateForm(Long instanceId, String companyCode, Map<String, Object> map); Object updateForm(Long instanceId, String companyCode, Map<String, Object> map, String groupCode);
/** /**
* 获取 建筑装备树 * 获取 建筑装备树
......
...@@ -91,4 +91,12 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -91,4 +91,12 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
List<Map<String, Object>> fireFacilitiesList(String bizOrgCode, String startTime, String endTime); List<Map<String, Object>> fireFacilitiesList(String bizOrgCode, String startTime, String endTime);
Map<String, Object> dailyMaintenance(String bizOrgCode,String orgCode, String startTime, String endTime); Map<String, Object> dailyMaintenance(String bizOrgCode,String orgCode, String startTime, String endTime);
Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime); Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime);
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode);
Page<Map<String, Object>> pageList(CommonPageInfoParam param);
int updateReadStatus(String messageId);
} }
...@@ -27,4 +27,11 @@ public interface IEquipmentSpecificIndexService extends IService<EquipmentSpecif ...@@ -27,4 +27,11 @@ public interface IEquipmentSpecificIndexService extends IService<EquipmentSpecif
* @Date 2020/11/3 17:58 * @Date 2020/11/3 17:58
*/ */
List<EquipmentSpecificIndex> getEquipmentSpeIndexBySpeIotCode(String iotCode); List<EquipmentSpecificIndex> getEquipmentSpeIndexBySpeIotCode(String iotCode);
/**
* 根据指标key查询列表
* @param listIndex keys
* @return 列表
*/
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIndex(List<String> listIndex);
} }
...@@ -242,12 +242,16 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -242,12 +242,16 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap); Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap);
Integer getSystemStatusBySuper(HashMap<String, Object> hashMap);
Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap); Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap);
Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap); Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap);
Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap); Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap);
Page<Map<String, Object>> equipmentStateBySuper(Page result, HashMap<String, Object> hashMap);
Map<String, Object> statisticsByStation(String bizOrgCode); Map<String, Object> statisticsByStation(String bizOrgCode);
Map<String, Object> todayAlarmEquipment(String bizOrgCode); Map<String, Object> todayAlarmEquipment(String bizOrgCode);
......
...@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.FormInstance; import com.yeejoin.equipmanage.common.entity.FormInstance;
import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO; import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO;
import com.yeejoin.equipmanage.common.entity.dto.FormGroupColumnDto;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO; import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.vo.AreaTreeVo;
import com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo; import com.yeejoin.equipmanage.common.vo.UnitAreaTreeVo;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -35,7 +35,7 @@ public interface IFormInstanceService extends IService<FormInstance> { ...@@ -35,7 +35,7 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @param map 字段值对象 * @param map 字段值对象
* @return Map<String, Object> * @return Map<String, Object>
*/ */
Map<String, Object> createByMap(String groupCode, String companyCode, Map<String, Object> map); Map<String, Object> createByMap(String groupCode, String companyCode, Map<String, Object> map, String caseId);
/** /**
* 更新 * 更新
...@@ -172,4 +172,6 @@ public interface IFormInstanceService extends IService<FormInstance> { ...@@ -172,4 +172,6 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @return List<Map < String, Object>> * @return List<Map < String, Object>>
*/ */
List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name); List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name);
List<FormGroupColumnDto> queryColumnAndValueByGroup(String groupCode, Long instanceId);
} }
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import java.util.List;
import java.util.Map;
/**
* @author ZeHua Li
* @date 2020/11/23 15:28
* @since v2.0
*/
public interface ISupervisionVideoService extends IService<SupervisionVideo> {
List queryVideoList(String bizOrgCode);
boolean replaceVideo(Map<String,String> ids, String bizOrgCode);
List<String> queryVideoAllId(String bizOrgCode);
}
...@@ -19,6 +19,7 @@ import com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO; ...@@ -19,6 +19,7 @@ import com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO;
import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO; import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.*; import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.EnumsUtils; import com.yeejoin.equipmanage.common.utils.EnumsUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO; import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
...@@ -45,6 +46,7 @@ import org.springframework.util.CollectionUtils; ...@@ -45,6 +46,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.exception.BaseException; import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.CommonUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -164,6 +166,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -164,6 +166,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
final String ALL_BUILDING = "allBuilding"; final String ALL_BUILDING = "allBuilding";
final static String[] list = {"92031900", "92011000", "92010700"};
/** /**
* @param groupCode * @param groupCode
* @Description 根据groupCode查询allowOperation对应的操作菜单 * @Description 根据groupCode查询allowOperation对应的操作菜单
...@@ -298,7 +302,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -298,7 +302,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
@Override @Override
public Object saveForm(String groupCode, String companyCode, Map<String, Object> map) { public Object saveForm(String groupCode, String companyCode, Map<String, Object> map, String caseId) {
final String instanceId = "instanceId"; final String instanceId = "instanceId";
//1.保存表单数据 //1.保存表单数据
//前端的address中携带了经纬度,后台切割保存 //前端的address中携带了经纬度,后台切割保存
...@@ -324,7 +328,10 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -324,7 +328,10 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
// } // }
} }
Map<String, Object> formKeyMap = iFormInstanceService.createByMap(groupCode, companyCode, map); Map<String, Object> formKeyMap = iFormInstanceService.createByMap(groupCode, companyCode, map, caseId);
if (StringUtil.isNotEmpty(caseId)) {
return CommonResponseUtil.success(formKeyMap);
}
if (formKeyMap.get(instanceId) != null) { if (formKeyMap.get(instanceId) != null) {
//2.保存图片 //2.保存图片
this.saveFiles(Long.parseLong(formKeyMap.get("instanceId").toString()), map); this.saveFiles(Long.parseLong(formKeyMap.get("instanceId").toString()), map);
...@@ -356,7 +363,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -356,7 +363,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
@Transactional(rollbackFor = {Exception.class, BaseException.class}) @Transactional(rollbackFor = {Exception.class, BaseException.class})
public Object updateForm(Long instanceId, String orgCode, Map<String, Object> map) { public Object updateForm(Long instanceId, String orgCode, Map<String, Object> map, String groupCode) {
if (StringUtil.isNotEmpty(groupCode)) {
map.keySet().forEach(x -> {
formInstanceMapper.updateFormFieldValue(instanceId, x, String.valueOf(map.get(x)));
});
return CommonResponseUtil.success();
}
Long id = formInstanceMapper.getStructureParentId(String.valueOf(instanceId)); Long id = formInstanceMapper.getStructureParentId(String.valueOf(instanceId));
//1.保存图片 //1.保存图片
this.saveFiles(instanceId, map); this.saveFiles(instanceId, map);
...@@ -680,6 +693,15 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -680,6 +693,15 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
@Transactional @Transactional
public Boolean deleteBuilding(Long instanceId) { public Boolean deleteBuilding(Long instanceId) {
List<FormInstance> lists = formInstanceMapper.selectList(new QueryWrapper<FormInstance>().eq("instance_id", instanceId));
if (0 < lists.size()) {
String groupCode = lists.get(0).getGroupCode();
if (!ValidationUtil.isEmpty(Arrays.stream(list).filter(x -> x.equals(groupCode)).collect(Collectors.toList()))) {
formInstanceMapper.delete(new QueryWrapper<FormInstance>().eq("group_code", groupCode).eq("instance_id", instanceId));
return true;
}
}
List<StockDetail> list = stockDetailMapper.selectList(new QueryWrapper<StockDetail>().eq("warehouse_structure_id", instanceId)); List<StockDetail> list = stockDetailMapper.selectList(new QueryWrapper<StockDetail>().eq("warehouse_structure_id", instanceId));
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
throw new BadRequest("该建筑存在入库装备,无法直接删除"); throw new BadRequest("该建筑存在入库装备,无法直接删除");
......
...@@ -143,6 +143,8 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -143,6 +143,8 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
equipmentDetail.setVideo(getEquipFileList(id, FileTypeEnum.video.toString())); equipmentDetail.setVideo(getEquipFileList(id, FileTypeEnum.video.toString()));
equipmentDetail.setCertification(getEquipFileList(id, FileTypeEnum.certificate.toString())); equipmentDetail.setCertification(getEquipFileList(id, FileTypeEnum.certificate.toString()));
equipmentDetail.setInstruction(getEquipFileList(id, FileTypeEnum.instruction.toString())); equipmentDetail.setInstruction(getEquipFileList(id, FileTypeEnum.instruction.toString()));
equipmentDetail.setQuality(getEquipFileList(id, FileTypeEnum.quality.toString()));
equipmentDetail.setOperation(getEquipFileList(id, FileTypeEnum.operation.toString()));
if (equipmentDetail.getCountry() != null) { if (equipmentDetail.getCountry() != null) {
equipmentDetail.setCountryName( equipmentDetail.setCountryName(
iSystemDicService.getOne(new QueryWrapper<SystemDic>().eq("id", equipmentDetail.getCountry())).getName()); iSystemDicService.getOne(new QueryWrapper<SystemDic>().eq("id", equipmentDetail.getCountry())).getName());
...@@ -225,6 +227,8 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -225,6 +227,8 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
fileList.addAll(fillFileList(equipmentDetail.getVideo(), equipmentDetail.getId(), FileTypeEnum.video.toString())); fileList.addAll(fillFileList(equipmentDetail.getVideo(), equipmentDetail.getId(), FileTypeEnum.video.toString()));
fileList.addAll(fillFileList(equipmentDetail.getCertification(), equipmentDetail.getId(), FileTypeEnum.certificate.toString())); fileList.addAll(fillFileList(equipmentDetail.getCertification(), equipmentDetail.getId(), FileTypeEnum.certificate.toString()));
fileList.addAll(fillFileList(equipmentDetail.getInstruction(), equipmentDetail.getId(), FileTypeEnum.instruction.toString())); fileList.addAll(fillFileList(equipmentDetail.getInstruction(), equipmentDetail.getId(), FileTypeEnum.instruction.toString()));
fileList.addAll(fillFileList(equipmentDetail.getQuality(), equipmentDetail.getId(), FileTypeEnum.quality.toString()));
fileList.addAll(fillFileList(equipmentDetail.getOperation(), equipmentDetail.getId(), FileTypeEnum.operation.toString()));
iUploadFileService.saveBatch(fileList); iUploadFileService.saveBatch(fileList);
} }
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil; import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto; import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
...@@ -21,7 +22,9 @@ import com.yeejoin.equipmanage.common.utils.DateUtils; ...@@ -21,7 +22,9 @@ import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.JcsFeign; import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
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;
...@@ -38,8 +41,6 @@ import java.net.NetworkInterface; ...@@ -38,8 +41,6 @@ import java.net.NetworkInterface;
import java.net.SocketException; import java.net.SocketException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
import java.util.*; import java.util.*;
...@@ -81,6 +82,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -81,6 +82,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
@Autowired @Autowired
private ISignalClassifyService signalClassifyService; private ISignalClassifyService signalClassifyService;
@Autowired
MarqueeDataMapper marqueeDataMapper;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private SystemctlFeign systemctlFeign;
@Value("${window.vedioFormat}") @Value("${window.vedioFormat}")
String vedioFormat; String vedioFormat;
...@@ -182,8 +190,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -182,8 +190,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param); Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) { if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) { for (Map<String, Object> x : resultPage.getRecords()) {
LocalDateTime createDate = (LocalDateTime) x.get("createDate"); // LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant())); // x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
if (ObjectUtils.isEmpty(x.get("handleType"))) { if (ObjectUtils.isEmpty(x.get("handleType"))) {
x.put("handleType", null); x.put("handleType", null);
} else { } else {
...@@ -728,4 +736,66 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -728,4 +736,66 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
public Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime) { public Map<String, Object> inspectionMessage(String orgCode, String startTime, String endTime) {
return equipmentSpecificAlarmMapper.inspectionMessage(orgCode, startTime, endTime); return equipmentSpecificAlarmMapper.inspectionMessage(orgCode, startTime, endTime);
} }
@Override
public Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.fireAlarmLogPage(result, param);
}
@Override
public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode);
}
@Override
public Page<Map<String, Object>> pageList(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
if (AlarmTypeEnum.GZGJ.getCode().equals(param.getAlarmType())) {
param.setAlarmType("");
param.setIsFireAlarm("false");
}
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) {
// LocalDateTime createDate = (LocalDateTime) x.get("createDate");
// x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
if (ObjectUtils.isEmpty(x.get("handleType"))) {
x.put("handleType", null);
} else {
String handleType = ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")));
x.put("handleType", StringUtil.isNotEmpty(handleType) ? handleType : signalClassifyService.getTypeNameByCode(String.valueOf(x.get("handleType"))).getTypeName());
}
// 冗余统一跑马灯显示字段取值
x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName"));
}
}
List<Map<String, Object>> list = marqueeDataMapper.selectAll();
List<Map<String, Object>> records = resultPage.getRecords();
for (Map<String, Object> stringObjectMap : list) {
records.add(stringObjectMap);
}
records.sort((t1, t2) -> t2.get("createDate").toString().compareTo(t1.get("createDate").toString()));
return resultPage;
}
@Override
public int updateReadStatus(String messageId) {
MarqueeData marqueeData = marqueeDataMapper.selectById(messageId);
marqueeData.setIsRead(1);
int i = marqueeDataMapper.updateById(marqueeData);
MessageModel model = new MessageModel();
model.setMsgType("pressurePump");
model.setSendTime(new Date());
model.setIsSendWeb(true);
model.setCategory(1);
model.setIsSendApp(false);
model.setTerminal("WEB");
Map<String, String> ext = new HashMap<>();
ext.put("isRead", "1");
model.setExtras(ext);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
return i;
}
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper;
...@@ -23,4 +24,9 @@ public class EquipmentSpecificIndexServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -23,4 +24,9 @@ public class EquipmentSpecificIndexServiceImpl extends ServiceImpl<EquipmentSpec
public List<EquipmentSpecificIndex> getEquipmentSpeIndexBySpeIotCode(String iotCode) { public List<EquipmentSpecificIndex> getEquipmentSpeIndexBySpeIotCode(String iotCode) {
return this.baseMapper.getEquipmentSpeIndexBySpeIotCode(iotCode); return this.baseMapper.getEquipmentSpeIndexBySpeIotCode(iotCode);
} }
@Override
public List<EquipmentSpecificIndex> getEquipmentSpeIndexByIndex(List<String> listIndex) {
return this.baseMapper.getEquipIndexInIndex(listIndex);
}
} }
...@@ -6,11 +6,14 @@ import java.util.*; ...@@ -6,11 +6,14 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.IotFeign; import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import org.apache.catalina.util.IOTools; import org.apache.catalina.util.IOTools;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -18,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -73,28 +77,6 @@ import com.yeejoin.equipmanage.common.exception.BaseException; ...@@ -73,28 +77,6 @@ import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.QRCodeUtil; import com.yeejoin.equipmanage.common.utils.QRCodeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.service.ICarService;
import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSystemSourceStatisticsService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IStockBillDetailService;
import com.yeejoin.equipmanage.service.IStockBillService;
import com.yeejoin.equipmanage.service.IStockDetailService;
import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.IUploadFileService;
import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil; import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -118,6 +100,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -118,6 +100,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
IEquPropertyService equPropertyService; IEquPropertyService equPropertyService;
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private SystemctlFeign systemctlFeign;
@Autowired
@Lazy @Lazy
IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce; IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce;
@Autowired @Autowired
...@@ -173,6 +159,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -173,6 +159,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private IVideoEquipmentSpecificService videoEquipmentSpecificService; private IVideoEquipmentSpecificService videoEquipmentSpecificService;
@Autowired
private IFormInstanceService formInstanceService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -182,6 +171,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -182,6 +171,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Value("${equipment.type}") @Value("${equipment.type}")
String equipmentCategoryLeftTypeCode; String equipmentCategoryLeftTypeCode;
@Value("${equipment.scrap.day}")
String equipmentScrapDay;
@Autowired @Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
...@@ -447,6 +439,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -447,6 +439,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
fileList.addAll(fillFileList(equipmentDetail.getVideo(), equipmentDetail.getId(), FileTypeEnum.video.toString())); fileList.addAll(fillFileList(equipmentDetail.getVideo(), equipmentDetail.getId(), FileTypeEnum.video.toString()));
fileList.addAll(fillFileList(equipmentDetail.getCertification(), equipmentDetail.getId(), FileTypeEnum.certificate.toString())); fileList.addAll(fillFileList(equipmentDetail.getCertification(), equipmentDetail.getId(), FileTypeEnum.certificate.toString()));
fileList.addAll(fillFileList(equipmentDetail.getInstruction(), equipmentDetail.getId(), FileTypeEnum.instruction.toString())); fileList.addAll(fillFileList(equipmentDetail.getInstruction(), equipmentDetail.getId(), FileTypeEnum.instruction.toString()));
fileList.addAll(fillFileList(equipmentDetail.getQuality(), equipmentDetail.getId(), FileTypeEnum.quality.toString()));
fileList.addAll(fillFileList(equipmentDetail.getOperation(), equipmentDetail.getId(), FileTypeEnum.operation.toString()));
iUploadFileService.saveBatch(fileList); iUploadFileService.saveBatch(fileList);
} }
equipmentDetailService.saveOrUpdateBatch(equipmentDetails); equipmentDetailService.saveOrUpdateBatch(equipmentDetails);
...@@ -1023,7 +1017,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1023,7 +1017,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentDetailService.removeById(equipmentSpecific.getEquipmentDetailId()); equipmentDetailService.removeById(equipmentSpecific.getEquipmentDetailId());
} }
if (res > 0) { if (res > 0) {
return true; // 删除设备动态表单扩展属性
return formInstanceService.deleteInstanceById(id);
} else { } else {
return false; return false;
} }
...@@ -1822,4 +1817,75 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1822,4 +1817,75 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return infoVoList; return infoVoList;
} }
/**
* 在设备报废前30日 每日9点执行 系统推送提醒。设备报废后停止消息推送提醒。。
*
* @throws Exception
*/
@Scheduled(cron = "${equipment.scrap.cron}")
@Transactional(rollbackFor = Exception.class)
public void equipmentScrap() throws Exception {
List<Map<String, Object>> equipSpecificScrap = equipmentSpecificIndexMapper.getEquipSpecificScrap();
equipSpecificScrap.forEach(e->{
try {
int year = e.get("weExpiry") != null ? Integer.parseInt(e.get("weExpiry").toString()) : Integer.parseInt(e.get("wesExpiry").toString());
Date productDate = DateUtils.dateParse(e.get("product").toString(),"yyyy-MM-dd'T'HH:mm");
Calendar calendar = Calendar.getInstance();
calendar.setTime(productDate);
calendar.add(Calendar.YEAR, year);
Date now = new Date();
String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime());
int i = -1;
while (now.after(calendar.getTime())) {
calendar.add(Calendar.DAY_OF_MONTH,1);
i++;
}
if(i < Integer.parseInt(equipmentScrapDay) && i > -1) {
syncSystemctlMsg(e, scrapTime,i);
}
} catch (ParseException parseException) {
parseException.printStackTrace();
}
});
}
void syncSystemctlMsg(Map<String, Object> map,String scrapTime, int i) {
try {
MessageModel model = new MessageModel();
model.setTitle("报废到期提醒");
String equipName = map.get("name").toString();
String location = map.get("sname").toString() + map.get("position").toString() ;
String body = String.format("%s-%s于%s报废,请提前更换处理", equipName, location, scrapTime);
String join = String.format("设备还剩%s天报废,请提前更换", i);
model.setBody(body);
model.setMsgType("scrapWarning");
model.setSendTime(new Date());
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setIsSendWeb(true);
model.setRelationId(map.get("id").toString());
model.setCategory(1);
List<String> receive = new ArrayList<>();
receive.add("system");
Map<String, String> ext = new HashMap<>();
ext.put("content", join);
ext.put("type", "报废到期");
ext.put("name", map.get("name").toString());
ext.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
model.setExtras(ext);
model.setRecivers(receive);
// Systemctl.messageClient.create(model);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
} catch (Exception e) {
e.printStackTrace();
}
}
} }
...@@ -1290,6 +1290,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1290,6 +1290,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public Integer getSystemStatusBySuper(HashMap<String, Object> hashMap) {
Integer systemStatus = fireFightingSystemMapper.getSystemStatus(hashMap);
return systemStatus;
}
@Override
public Map<String, Object> getSystemName(HashMap<String, Object> hashMap) { public Map<String, Object> getSystemName(HashMap<String, Object> hashMap) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> map = fireFightingSystemMapper.getFireSystemInfo(hashMap); List<Map<String, Object>> map = fireFightingSystemMapper.getFireSystemInfo(hashMap);
...@@ -1332,6 +1338,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1332,6 +1338,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public Page<Map<String, Object>> equipmentStateBySuper(Page res, HashMap<String, Object> hashMap) {
Page result = new Page<>(res.getCurrent(), res.getSize());
String id = fireFightingSystemMapper.equipmentIdBySuper(hashMap);
if (!StringUtil.isNotEmpty(id)) {
return null;
}
Page<Map<String, Object>> mapPage = fireFightingSystemMapper.equipmentStateBySuper(result, id);
return mapPage;
}
@Override
public Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap) { public Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap) {
String bizOrgCode = null; String bizOrgCode = null;
String systemCode = null; String systemCode = null;
...@@ -1442,8 +1459,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1442,8 +1459,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map<String, Object>> carInfo = fireFightingSystemMapper.getCarInfo(bizOrgCode); List<Map<String, Object>> carInfo = fireFightingSystemMapper.getCarInfo(bizOrgCode);
bigScreenVo.setCarNumInfo(carInfo); bigScreenVo.setCarNumInfo(carInfo);
List<Map<String, Object>> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(bizOrgCode); List<Map<String, Object>> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(bizOrgCode);
List<Map<String, Object>> pool = fireFightingSystemMapper.getWaterPoolInfoNum(bizOrgCode, "pool"); List<Map<String, Object>> pool = fireFightingSystemMapper.getWaterPoolInfoNum(bizOrgCode);
List<Map<String, Object>> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(bizOrgCode, "industryPool"); List<Map<String, Object>> industryPool = fireFightingSystemMapper.getWaterIndustryPoolInfoNum(bizOrgCode);
bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum); bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum);
bigScreenVo.setIndustryPool(industryPool); bigScreenVo.setIndustryPool(industryPool);
bigScreenVo.setPool(pool); bigScreenVo.setPool(pool);
......
...@@ -13,6 +13,7 @@ import com.yeejoin.equipmanage.common.entity.FormGroupColumn; ...@@ -13,6 +13,7 @@ import com.yeejoin.equipmanage.common.entity.FormGroupColumn;
import com.yeejoin.equipmanage.common.entity.FormInstance; import com.yeejoin.equipmanage.common.entity.FormInstance;
import com.yeejoin.equipmanage.common.entity.SourceFile; import com.yeejoin.equipmanage.common.entity.SourceFile;
import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO; import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO;
import com.yeejoin.equipmanage.common.entity.dto.FormGroupColumnDto;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO; import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.enums.GroupCodeEnum; import com.yeejoin.equipmanage.common.enums.GroupCodeEnum;
import com.yeejoin.equipmanage.common.enums.GroupColumnDataType; import com.yeejoin.equipmanage.common.enums.GroupColumnDataType;
...@@ -23,6 +24,7 @@ import com.yeejoin.equipmanage.mapper.FormInstanceMapper; ...@@ -23,6 +24,7 @@ import com.yeejoin.equipmanage.mapper.FormInstanceMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -81,12 +83,14 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -81,12 +83,14 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
private final String ORGCODE = "orgCode"; private final String ORGCODE = "orgCode";
final static String[] list = {"92031900", "92011000", "92010700"};
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
@Override @Override
@Transactional(rollbackFor = {BaseException.class, Exception.class}) @Transactional(rollbackFor = {BaseException.class, Exception.class})
public Map<String, Object> createByMap(String groupCode, String companyCode, Map<String, Object> map) { public Map<String, Object> createByMap(String groupCode, String companyCode, Map<String, Object> map, String caseId) {
//1.查询分组表数据,数据准备用 //1.查询分组表数据,数据准备用
Map<String, Object> returnMap = new HashMap<>(); Map<String, Object> returnMap = new HashMap<>();
FormGroup formGroup = iFormGroupService.getByUniqueKey(groupCode); FormGroup formGroup = iFormGroupService.getByUniqueKey(groupCode);
...@@ -96,6 +100,10 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -96,6 +100,10 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
return returnMap; return returnMap;
} }
Long instanceId = sequence.nextId(); Long instanceId = sequence.nextId();
if (!ValidationUtil.isEmpty(Arrays.stream(list).filter(x -> x.equals(groupCode)).collect(Collectors.toList()))) {
instanceId = Long.valueOf(caseId);
returnMap.put("code", sequence.nextId());
}
String groupType = formGroup.getGroupType(); String groupType = formGroup.getGroupType();
List<FormInstance> entities = new ArrayList<>(); List<FormInstance> entities = new ArrayList<>();
//3.以数据库现在配置的动态表单字段为准,进行数据插入的准备 //3.以数据库现在配置的动态表单字段为准,进行数据插入的准备
...@@ -564,4 +572,22 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -564,4 +572,22 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
public List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name) { public List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name) {
return this.baseMapper.querySpecialChildrenListByName(parentId, bizOrgCode, name); return this.baseMapper.querySpecialChildrenListByName(parentId, bizOrgCode, name);
} }
@Override
public List<FormGroupColumnDto> queryColumnAndValueByGroup(String groupCode, Long instanceId) {
List<FormGroupColumnDto> list = new ArrayList<>();
List<FormGroupColumn> columnList = iFormGroupColumnService.queryByGroup(groupCode);
if (!CollectionUtils.isEmpty(columnList)) {
Map<String, Object> map = queryForMap(instanceId);
columnList.forEach(x -> {
FormGroupColumnDto dto = new FormGroupColumnDto();
BeanUtils.copyProperties(x, dto);
if (!map.isEmpty()) {
dto.setFieldValue(map.get(dto.getFieldName()).toString());
}
list.add(dto);
});
}
return list;
}
} }
...@@ -19,6 +19,8 @@ import com.yeejoin.equipmanage.common.utils.StringUtil; ...@@ -19,6 +19,8 @@ import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.SystemctlFeign; import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.quartz.PumpSendMessage;
import com.yeejoin.equipmanage.quartz.QuartzManager;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.BeanUtil; import com.yeejoin.equipmanage.utils.BeanUtil;
...@@ -27,6 +29,7 @@ import org.springframework.beans.BeanUtils; ...@@ -27,6 +29,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization; import org.springframework.transaction.support.TransactionSynchronization;
...@@ -35,8 +38,14 @@ import org.springframework.util.CollectionUtils; ...@@ -35,8 +38,14 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -54,6 +63,9 @@ import java.util.stream.Collectors; ...@@ -54,6 +63,9 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
public class MqttReceiveServiceImpl implements MqttReceiveService { public class MqttReceiveServiceImpl implements MqttReceiveService {
private static String PUMP_JOB_GROUP_NAME = "EQUIP_PUMP_JOB_GROUP_NAME";
private static String PUMP_TRIGGER_NAME = "EQUIP_PUMP_TRIGGER_NAME";
private static String PUMP_TRIGGER_GROUP_NAME = "EQUIP_PUMP_TRIGGER_GROUP_NAME";
private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>(); private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>();
...@@ -85,6 +97,28 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -85,6 +97,28 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper; EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
MarqueeDataMapper marqueeDataMapper;
/**
* 泡沫罐KEY
*/
private final static String CAFS_FoamTank_FoamTankLevel = "CAFS_FoamTank_FoamTankLevel";
/**
* 泡沫罐KEY
*/
private final static String FHS_PipePressureDetector_PipePressure = "FHS_PipePressureDetector_PipePressure";
/**
* 水池信息
*/
private final static String FHS_FirePoolDevice_WaterLevel = "FHS_FirePoolDevice_WaterLevel";
/**
* 水池信息
*/
private final static String FHS_WirelessliquidDetector_WaterLevel = "FHS_WirelessliquidDetector_WaterLevel";
static EquipmentSpecificMapper equipmentSpecificMapper; static EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired @Autowired
public void setEquipmentSpecificMapper(EquipmentSpecificMapper equipmentSpecificMapper){ public void setEquipmentSpecificMapper(EquipmentSpecificMapper equipmentSpecificMapper){
...@@ -179,6 +213,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -179,6 +213,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
MqttReceiveServiceImpl.jcsSwitch = jcsSwitch; MqttReceiveServiceImpl.jcsSwitch = jcsSwitch;
} }
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
@Value("${equipment.pressurepump.stop}")
private String pressurePumpStop;
private static Boolean bool = Boolean.FALSE; private static Boolean bool = Boolean.FALSE;
@Override @Override
...@@ -281,6 +322,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -281,6 +322,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 存储温度数据至内存中(火眼) // 存储温度数据至内存中(火眼)
iotDataListToCacheMap(iotDatalist); iotDataListToCacheMap(iotDatalist);
iotDatalist.forEach(iotDataVO -> { iotDatalist.forEach(iotDataVO -> {
String indexKey = iotDataVO.getKey();
// 稳压泵启停信号处理
if (indexKey.equals(pressurePumpStart) || indexKey.equals(pressurePumpStop)) {
pressurePump(indexKey, iotDatalist, topicEntity);
}
for (EquipmentSpecificIndex equipmentSpecificIndex : indexList) { for (EquipmentSpecificIndex equipmentSpecificIndex : indexList) {
if (!ObjectUtils.isEmpty(equipmentSpecificIndex.getNameKey()) if (!ObjectUtils.isEmpty(equipmentSpecificIndex.getNameKey())
&& equipmentSpecificIndex.getNameKey().toLowerCase().equals(iotDataVO.getKey().toLowerCase())) { && equipmentSpecificIndex.getNameKey().toLowerCase().equals(iotDataVO.getKey().toLowerCase())) {
...@@ -311,6 +357,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -311,6 +357,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (equipmentSpecificIndex.getIsAlarm() != null && 1 == equipmentSpecificIndex.getIsAlarm()) { if (equipmentSpecificIndex.getIsAlarm() != null && 1 == equipmentSpecificIndex.getIsAlarm()) {
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex));
} }
//管网压力和泡沫罐信息处理
if (iotDataVO.getKey().toLowerCase().equals(CAFS_FoamTank_FoamTankLevel.toLowerCase()) ||
FHS_PipePressureDetector_PipePressure.toLowerCase().equals(iotDataVO.getKey().toLowerCase())) {
doFoamTankLevel(iotDataVO, equipmentSpecificIndex);
}
//消防水池液位处理
if (iotDataVO.getKey().toLowerCase().equals(FHS_FirePoolDevice_WaterLevel.toLowerCase()) ||
iotDataVO.getKey().toLowerCase().equals(FHS_WirelessliquidDetector_WaterLevel.toLowerCase())) {
doWaterPoolLevel(iotDataVO, equipmentSpecificIndex);
}
} }
} }
}); });
...@@ -363,6 +419,138 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -363,6 +419,138 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}); });
} }
/**
* 泡沫罐 或 者管网压力 消息发送
* @param iotDataVO iotDataVO
* @param equipmentSpecificIndex equipmentSpecificIndex
*/
private void doFoamTankLevel(IotDataVO iotDataVO, EquipmentSpecificIndex equipmentSpecificIndex) {
MessageModel model = new MessageModel();
Map<String, Object> map = new HashMap<>();
if (iotDataVO.getKey().toLowerCase().equals(CAFS_FoamTank_FoamTankLevel.toLowerCase())) {
map = fireFightingSystemMapper.getFoamTankLevel(equipmentSpecificIndex.getEquipmentSpecificId());
} else {
map = fireFightingSystemMapper.getPipeNetwork(equipmentSpecificIndex.getEquipmentSpecificId());
}
BigDecimal minValue = getBigDecimal(map.get("minValues"));
BigDecimal maxValue = getBigDecimal(map.get("maxValues"));
BigDecimal nowValue = getBigDecimal(iotDataVO.getValue());
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
String body = "";
if (nowValue.compareTo(minValue) < 0) {
body = "当前数值 " + nowValue + " 低于最低报警阈值 " + minValue;
} else if (nowValue.compareTo(maxValue) > 0) {
body = "当前数值 " + nowValue + " 超过最高报警阈值 " + maxValue;
}
String bodyMain = String.format("%s,- 当前数值%s,%s ,请及时查看处理。",
equipmentSpecificIndex.getEquipmentSpecificName() + "-" + equipmentSpecificIndex.getLocation(),
nowValue,
nowValue.compareTo(minValue) < 0 ? "低于最低报警阈值" + minValue : "超过最高报警阈值" + maxValue
);
model.setTitle(equipmentSpecificIndex.getEquipmentSpecificName());
model.setBody(bodyMain);
model.setMsgType("FoamTankOrPipeNetwork");
model.setSendTime(new Date());
model.setIsSendWeb(true);
model.setCategory(1);
model.setRelationId(equipmentSpecificIndex.getEquipmentSpecificId().toString());
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setRecivers(Arrays.asList("system"));
Map<String, String> ext = new HashMap<>();
ext.put("content", body);
ext.put("type", "模拟量超阈值提醒");
ext.put("name", equipmentSpecificIndex.getEquipmentSpecificName());
ext.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
model.setExtras(ext);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
log.info(String.format("调用平台消息服务成功:%s", JSON.toJSONString(model)));
}
}
/**
* 消防水池、工业水池和消防水箱 消息发送
*
* @param iotDataVO iotDataVO
* @param equipmentSpecificIndex equipmentSpecificIndex
*/
private void doWaterPoolLevel(IotDataVO iotDataVO, EquipmentSpecificIndex equipmentSpecificIndex) {
MessageModel model = new MessageModel();
Map<String, Object> map = fireFightingSystemMapper.getWaterPoolLevel(equipmentSpecificIndex.getEquipmentSpecificId());
if (!ObjectUtils.isEmpty(map)) {
BigDecimal minValue = getBigDecimal(map.get("minValues"));
BigDecimal maxValue = getBigDecimal(map.get("maxValues"));
BigDecimal nowValue = getBigDecimal(iotDataVO.getValue());
String levelDeviceId = (String) map.get("levelDeviceId");
BigDecimal add = nowValue;
if (levelDeviceId.contains(",")) {
List<String> split = Arrays.asList(levelDeviceId.split(","));
int i = 1;
for (String s : split) {
if (!s.trim().equals(Long.toString(equipmentSpecificIndex.getEquipmentSpecificId()))) {
BigDecimal waterPoolLevelByEquipSpeId = fireFightingSystemMapper.getWaterPoolLevelByEquipSpeId(s);
add = add.add(waterPoolLevelByEquipSpeId);
i++;
}
}
nowValue = add.divide(new BigDecimal(i), 2, RoundingMode.HALF_UP);
}
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
String body = "";
if (nowValue.compareTo(minValue) < 0) {
body = "当前数值 " + nowValue + " 低于最低报警阈值 " + minValue;
} else if (nowValue.compareTo(maxValue) > 0) {
body = "当前数值 " + nowValue + " 超过最高报警阈值 " + maxValue;
}
String bodyMain = String.format("%s,- 当前数值%s,%s ,请及时查看处理。",
map.get("name"),
nowValue,
nowValue.compareTo(minValue) < 0 ? "低于最低报警阈值" + minValue : "超过最高报警阈值" + maxValue
);
model.setTitle("模拟量提醒");
model.setBody(bodyMain);
model.setMsgType("WaterPoolKey");
model.setSendTime(new Date());
model.setIsSendWeb(true);
model.setCategory(1);
model.setRelationId(map.get("id").toString());
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setRecivers(Arrays.asList("system"));
Map<String, String> ext = new HashMap<>();
ext.put("content", body);
ext.put("type", "模拟量超阈值提醒");
ext.put("name", (String) map.get("name"));
ext.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
model.setExtras(ext);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
log.info(String.format("调用平台消息服务成功:%s", JSON.toJSONString(model)));
}
}
}
private BigDecimal getBigDecimal( Object value ) {
BigDecimal val = null;
if( value != null ) {
if( value instanceof BigDecimal ) {
val = (BigDecimal) value;
} else if( value instanceof String ) {
val = new BigDecimal( (String) value );
} else if( value instanceof BigInteger) {
val = new BigDecimal( (BigInteger) value );
} else if( value instanceof Number ) {
val = new BigDecimal( ((Number)value).doubleValue() );
} else {
throw new ClassCastException("Not possible to coerce ["+value+"] from class "+value.getClass()+" into a BigDecimal.");
}
}
return val;
}
public void carRealTimeDate(List<IotDataVO> iotDatalist, List<CarProperty> carProperties) { public void carRealTimeDate(List<IotDataVO> iotDatalist, List<CarProperty> carProperties) {
List<CarProperty> carIndexsList = new ArrayList<>(); List<CarProperty> carIndexsList = new ArrayList<>();
iotDatalist.forEach(iotDataVO -> { iotDatalist.forEach(iotDataVO -> {
...@@ -1143,4 +1331,231 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1143,4 +1331,231 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
} }
private void pressurePump(String indexKey, List<IotDataVO> iotDatalist, TopicEntityVo topicEntity) {
List<String> listIndex = new ArrayList<>();
listIndex.add(pressurePumpStart);
listIndex.add(pressurePumpStop);
// 获取全部启停泵信号
List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex);
List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexKey);
if (!CollectionUtils.isEmpty(enumListByCode)) {
enumListByCode.forEach(pressurePumpEnum -> {
// 1. 获取需要校验的值
PressurePumpValueEnum valueEnum = PressurePumpValueEnum.getByCode(pressurePumpEnum.getCompareValue());
assert valueEnum != null;
EquipmentSpecificIndex data = getPressurePumpDateByType(indexKey,valueEnum, topicEntity, equipmentSpeIndexList, pressurePumpEnum);
Date newDate = new Date();
// 2. 校验
if (!ObjectUtils.isEmpty(data)) {
checkValueByDate(data, newDate, pressurePumpEnum);
}
});
}
}
private EquipmentSpecificIndex getPressurePumpDateByType(String indexKey, PressurePumpValueEnum valueEnum, TopicEntityVo topicEntity, List<EquipmentSpecificIndex> equipmentSpeIndexList, PressurePumpEnum pressurePumpEnum) {
String iotCode = topicEntity.getIotCode();
EquipmentSpecificIndex equipmentSpecificIndex = null;
String jobName = topicEntity.getIotCode()+"_"+indexKey;
String triggerName = PUMP_TRIGGER_NAME+"-"+topicEntity.getIotCode();
switch (valueEnum) {
case LAST_STOP:
List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStop.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(lastStop)) {
equipmentSpecificIndex = lastStop.get(0);
}
break;
case LAST_START:
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
// 删除这个稳压泵的监听任务
if(b) {
QuartzManager.removeJob(jobName,PUMP_JOB_GROUP_NAME,triggerName,PUMP_TRIGGER_GROUP_NAME);
}
List<EquipmentSpecificIndex> lastStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(lastStart)) {
equipmentSpecificIndex = lastStart.get(0);
}
break;
case LATELY_STOP:
List<EquipmentSpecificIndex> latelyStop = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && pressurePumpStop.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(latelyStop)) {
equipmentSpecificIndex = latelyStop.get(0);
}
break;
case LATELY_START:
List<EquipmentSpecificIndex> latelyStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(latelyStart)) {
equipmentSpecificIndex = latelyStart.get(0);
}
break;
case PUMP_START_TIME:
startTimeCompute(indexKey, topicEntity, pressurePumpEnum);
break;
default:
break;
}
return equipmentSpecificIndex;
}
private void checkValueByDate(EquipmentSpecificIndex data, Date newDate, PressurePumpEnum pressurePumpEnum) {
String operator = pressurePumpEnum.getOperator();
PressurePumpCheckEnum pumpCheckEnum = PressurePumpCheckEnum.getByCode(operator);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long diff = 0;
try {
long d1 = df.parse(df.format(data.getUpdateDate())).getTime();
long d2 = df.parse(df.format(newDate)).getTime();
diff = (d2-d1)/1000/60;
} catch (Exception e) {
log.error("时间转换失败" + e.getMessage());
return;
}
assert pumpCheckEnum != null;
String leftValue = pressurePumpEnum.getLeftValue();
String rightValue = pressurePumpEnum.getRightValue();
switch (pumpCheckEnum) {
case LE:
if (StringUtil.isNotEmpty(rightValue)) {
long value = Long.parseLong(rightValue);
if (diff <= value) {
sendMessagePressure(pressurePumpEnum, data);
}
}
break;
case GE:
if (StringUtil.isNotEmpty(leftValue)) {
long value = Long.parseLong(leftValue);
if (diff >= value) {
sendMessagePressure(pressurePumpEnum, data);
}
}
break;
case BE:
if (StringUtil.isNotEmpty(leftValue) && StringUtil.isNotEmpty(rightValue)) {
long lvalue = Long.parseLong(leftValue);
long rvalue = Long.parseLong(rightValue);
if (diff >= lvalue && diff <= rvalue) {
sendMessagePressure(pressurePumpEnum, data);
}
}
break;
default:
break;
}
}
private void sendMessagePressure(PressurePumpEnum pressurePumpEnum, EquipmentSpecificIndex data) {
String level = pressurePumpEnum.getLevel();
PressurePumpMessageEnum pumpMessageEnum = PressurePumpMessageEnum.getByCode(level);
assert pumpMessageEnum != null;
String time = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date());
MessageModel model = new MessageModel();
String allMessage = pumpMessageEnum.getAllMessage();
String body = "";
Map<String, String> map = new HashMap<>(4);
if (StringUtil.isNotEmpty(allMessage)) {
String value = StringUtil.isNotEmpty(pressurePumpEnum.getLeftValue()) ? pressurePumpEnum.getLeftValue() : pressurePumpEnum.getRightValue();
String content = String.format(allMessage, value);
map.put("content", content);
map.put("name", data.getEquipmentSpecificName());
map.put("time", time);
}
String recordMessage = pumpMessageEnum.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) {
String value = StringUtil.isNotEmpty(pressurePumpEnum.getLeftValue()) ? pressurePumpEnum.getLeftValue() : pressurePumpEnum.getRightValue();
body = String.format(recordMessage, data.getEquipmentSpecificName(), data.getLocation(), value);
}
String marqueeMessage = pumpMessageEnum.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) {
MarqueeData marqueeData = new MarqueeData();
marqueeData.setIsRead(0);
marqueeData.setEquipmentSpecificId(data.getEquipmentId());
marqueeData.setMessageType("pressurePump");
marqueeData.setName(data.getEquipmentSpecificName());
marqueeData.setPosition(data.getLocation());
marqueeData.setType("漏水提醒");
marqueeData.setCreateDate(new Date());
marqueeDataMapper.insert(marqueeData);
}
switch (pumpMessageEnum) {
case MESSAGE_LEVEL_YB:
case MESSAGE_LEVEL_YZ:
map.put("type", "稳压泵启停异常提醒");
model.setTitle("稳压泵启停异常提醒");
break;
case MESSAGE_LEVEL_QT_WJ:
case MESSAGE_LEVEL_QT_WJ_YXSC:
map.put("type", "漏水提醒");
model.setTitle("漏水提醒");
break;
default:
break;
}
model.setSendTime(new Date());
model.setBody(body);
model.setExtras(map);
model.setMsgType("pressurePump");
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setIsSendWeb(true);
model.setCategory(1);
List<String> receive = new ArrayList<>();
receive.add("system");
model.setRelationId(String.valueOf(data.getEquipmentId()));
model.setRecivers(receive);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
}
private void startTimeCompute(String indexKey, TopicEntityVo topicEntity, PressurePumpEnum pressurePumpEnum) {
String jobName = topicEntity.getIotCode()+"_"+indexKey;
String triggerName = PUMP_TRIGGER_NAME+"-"+topicEntity.getIotCode();
String cron = pressurePumpEnum.getLeftValue();
EquipmentSpecific equipmentSpecific = null;
try {
LambdaQueryWrapper<EquipmentSpecific> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentSpecific::getIotCode, topicEntity.getIotCode());
equipmentSpecific = equipmentSpecificMapper.selectOne(wrapper);
}catch (Exception e) {
log.error("根据iotCod查询失败" + topicEntity.getIotCode());
}
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
if (indexKey.equals(pressurePumpStart)) {
if (b) {
// 任务存在 更新时间
QuartzManager.modifyJobTime(triggerName,PUMP_TRIGGER_GROUP_NAME,cron);
} else {
QuartzManager.removeJob(jobName,PUMP_JOB_GROUP_NAME,triggerName,PUMP_TRIGGER_GROUP_NAME);
// 任务不存在,新增
// 传参
if (ObjectUtils.isEmpty(equipmentSpecific)) {
return;
}
Map<String,Object> parameter = new HashMap<>(6);
parameter.put("jobName", jobName);
parameter.put("triggerName", triggerName);
parameter.put("triggerGroupName", PUMP_TRIGGER_GROUP_NAME);
parameter.put("jobGroupName", PUMP_JOB_GROUP_NAME);
parameter.put("equipmentSpecific", equipmentSpecific);
parameter.put("pressurePumpEnum", pressurePumpEnum);
parameter.put("remoteSecurityService", remoteSecurityService);
parameter.put("systemctlFeign", systemctlFeign);
parameter.put("marqueeDataMapper", marqueeDataMapper);
QuartzManager.addJob(jobName,PUMP_JOB_GROUP_NAME,triggerName,PUMP_TRIGGER_GROUP_NAME, PumpSendMessage.class,cron,parameter);
}
}
}
} }
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.SupervisionVideo;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.mapper.SupervisionVideoMapper;
import com.yeejoin.equipmanage.service.ISupervisionVideoService;
import com.yeejoin.equipmanage.service.IVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Slf4j
@Service
//@EnableAsync
public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMapper, SupervisionVideo> implements ISupervisionVideoService {
@Autowired
SupervisionVideoMapper supervisionVideoMapper;
@Value("${window.vedioFormat}")
String vedioFormat;
@Autowired
private IVideoService videoService;
@Override
public List<List<AlamVideoVO>> queryVideoList(String bizOrgCode) {
List<List<AlamVideoVO>> resList = new ArrayList<>();
List<AlamVideoVO> list = supervisionVideoMapper.getVideoByCompany(bizOrgCode);
list.forEach(action -> {
action.setVedioFormat(vedioFormat);
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
});
List<AlamVideoVO> mapList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
if (list.size() > 1 && ((i+1) % 2) - 1 != 0 && i != 0) {
mapList.add(list.get(i));
resList.add(mapList);
mapList = new ArrayList<>();
} else {
mapList.add(list.get(i));
if (i == list.size() - 1) {
resList.add(mapList);
}
}
}
return resList;
}
@Override
public boolean replaceVideo(Map<String,String> map, String bizOrgCode) {
supervisionVideoMapper.delete(new QueryWrapper<SupervisionVideo>().eq("biz_org_code",bizOrgCode));
List<SupervisionVideo> list = new ArrayList<>();
String ids = map.get("ids");
for (String s : ids.split(",")) {
SupervisionVideo supervisionVideo = new SupervisionVideo();
supervisionVideo.setCameraId(s);
supervisionVideo.setBizOrgCode(bizOrgCode);
supervisionVideo.setId(Long.valueOf(String.valueOf(UUID.randomUUID().getLeastSignificantBits()).replace("-", "")));
list.add(supervisionVideo);
}
return saveBatch(list);
}
@Override
public List<String> queryVideoAllId(String bizOrgCode) {
return supervisionVideoMapper.queryVideoAllId(bizOrgCode);
}
}
...@@ -1340,7 +1340,7 @@ public class ExcelServiceImpl { ...@@ -1340,7 +1340,7 @@ public class ExcelServiceImpl {
if (item.getLevelDeviceName() != null) { if (item.getLevelDeviceName() != null) {
String[] type = item.getLevelDeviceName().split("@"); String[] type = item.getLevelDeviceName().split("@");
item.setLevelDeviceName(type[0]); item.setLevelDeviceName(type[0]);
item.setLevelDeviceId(Long.valueOf(type[1])); item.setLevelDeviceId(type[1]);
} }
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17 // BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
if (item.getEquipCategoryName() != null) { if (item.getEquipCategoryName() != null) {
......
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
...@@ -101,3 +101,12 @@ iot.code.prefix.have.used= ...@@ -101,3 +101,12 @@ iot.code.prefix.have.used=
#是否向iot推送消息 #是否向iot推送消息
isSendIot=false isSendIot=false
#报废前30日 发起提醒
equipment.scrap.day=30
#提醒时间
equipment.scrap.cron=0 0 9 * * ?
# 稳压泵启动信号
equipment.pressurepump.start=FHS_PressurePump_Start
# 稳压泵停止信号
equipment.pressurepump.stop=FHS_PressurePump_Stop
...@@ -118,4 +118,9 @@ redis_equip_type_count = equipTypeAndCount ...@@ -118,4 +118,9 @@ redis_equip_type_count = equipTypeAndCount
auth-key-fire-iot-equip=fire_iot-equip_info auth-key-fire-iot-equip=fire_iot-equip_info
# app离线同步装备数据开关 # app离线同步装备数据开关
auth-open-fire-equip=false auth-open-fire-equip=false
\ No newline at end of file
management.security.enabled=true
management.endpoint.health.show-details=always
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
...@@ -3013,4 +3013,42 @@ ...@@ -3013,4 +3013,42 @@
ALTER TABLE `wl_equipment_specific_alarm` DROP COLUMN `confirm_date`; ALTER TABLE `wl_equipment_specific_alarm` DROP COLUMN `confirm_date`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tianyiming" id="20221011tianyiming" runAlways="true">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="wl_supervision_video"/>
</not>
</preConditions>
<comment>add wl_supervision_video</comment>
<sql>
CREATE TABLE `wl_supervision_video` (
`id` bigint(20) NOT NULL,
`biz_org_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '所属公司',
`camera_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '摄像头id',
`create_date` datetime DEFAULT NULL COMMENT '添加时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
</sql>
</changeSet>
<changeSet author="xxz" id="20221013xxz" runAlways="true">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="wl_marquee_data"/>
</not>
</preConditions>
<comment>add wl_marquee_data</comment>
<sql>
CREATE TABLE `wl_marquee_data` (
`id` bigint(20) NOT NULL,
`type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型',
`position` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '位置',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称',
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`message_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息类型',
`is_read` int(10) NULL DEFAULT NULL COMMENT '是否已读【0:未读;1:已读】',
`equipment_specific_id` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -193,4 +193,62 @@ ...@@ -193,4 +193,62 @@
INSERT INTO `wl_form_group_column` (`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES ('133000000319', 'address', '地址', 'String', '132828674817', 'eq', b'0', 'r_fireControlRoom', '2581805', '2022-03-01 12:01:04'); INSERT INTO `wl_form_group_column` (`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES ('133000000319', 'address', '地址', 'String', '132828674817', 'eq', b'0', 'r_fireControlRoom', '2581805', '2022-03-01 12:01:04');
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zs" id="202210101651">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_water_resource_pool"/>
</preConditions>
<comment>修改液位显示装置字段类型->需求2022 一个水池可选多个 装置</comment>
<sql>
ALTER TABLE `cb_water_resource_pool` MODIFY COLUMN `level_device_id` varchar(255) NULL DEFAULT NULL COMMENT '水池液位显示装置id';
</sql>
</changeSet>
<changeSet author="ltw" id="202210111354-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="warranty_info"/>
</not>
</preConditions>
<comment>新增字段 warranty_info,warranty_period</comment>
<sql>
alter table `wl_equipment_specific` add column `warranty_info` varchar(500) DEFAULT NULL COMMENT '质保信息';
alter table `wl_equipment_specific` add column `warranty_period` datetime DEFAULT NULL COMMENT '质保周期';
</sql>
</changeSet>
<changeSet author="ltw" id="202210111354-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment" columnName="expiry_date"/>
</not>
</preConditions>
<comment>新增字段 expiry_date 报废期限</comment>
<sql>
alter table `wl_equipment` add column `expiry_date` decimal(12,0) DEFAULT NULL COMMENT '报废期限';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="20221011-1729-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_category"/>
</preConditions>
<comment>消防水箱分类扩展 wl_equipment_category</comment>
<sql>
REPLACE INTO `wl_equipment_category`(`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`, `image`) VALUES (1547790305762250754, '1438771726480601090', '93060600', '消防水箱', 0, NULL, NULL, '2022-07-15 11:49:00', '2', 'upload/equipment_category_icon/industryPool.png');
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="20221011-1729-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_form_group_column"/>
</preConditions>
<comment>物联设备增加模拟量阈值 wl_form_group_column</comment>
<sql>
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000350, 'minLevel', '最低报警液位(m)', 'inputNumber', 132828674825, 'eq', b'0', '92031900', 2581805, '2022-10-09 09:24:35');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000351, 'maxLevel', '最高报警液位(m)', 'inputNumber', 132828674825, 'eq', b'0', '92031900', 2581805, '2022-10-09 09:24:36');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000352, 'volume', '泡沫液罐容积(m³)', 'inputNumber', 132828674825, 'eq', b'0', '92031900', 2581805, '2022-10-09 09:24:37');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000353, 'minPressure', '最低报警压力(Mpa)', 'inputNumber', 132828674826, 'eq', b'0', '92011000', 2581805, '2022-10-09 09:24:38');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000354, 'maxPressure', '最高报警压力(Mpa)', 'inputNumber', 132828674826, 'eq', b'0', '92011000', 2581805, '2022-10-09 09:24:39');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000355, 'minFlow', '最低报警流量(L/S)', 'inputNumber', 132828674827, 'eq', b'0', '92010700', 2581805, '2022-10-09 09:24:39');
REPLACE INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000356, 'maxFlow', '最高报警流量(L/S)', 'inputNumber', 132828674827, 'eq', b'0', '92010700', 2581805, '2022-10-09 09:24:40');
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -195,7 +195,10 @@ ...@@ -195,7 +195,10 @@
AS fireEquipmentPointValue, AS fireEquipmentPointValue,
wlesal.type AS typeCode, wlesal.type AS typeCode,
(select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as type, (select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as type,
wlesal.create_date AS createDate, date_format(
wlesal.create_date,
'%Y-%m-%d %H:%i:%s'
) createDate,
CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/ CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/
(select (select
group_concat(fet.`name`) group_concat(fet.`name`)
...@@ -1326,4 +1329,161 @@ ...@@ -1326,4 +1329,161 @@
LEFT JOIN p_point_classify ppc on pci.point_classify_id = ppc.id LEFT JOIN p_point_classify ppc on pci.point_classify_id = ppc.id
)AS missedCheck )AS missedCheck
</select> </select>
<select id="fireAlarmLogPage" resultType="java.util.HashMap">
SELECT
equipment_specific_index_name,
equipment_specific_name,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') alarm_time,
location,
emergency_level_color,
IF
( `wlesal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) AS `cleanStatus`
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
<if test="param.system != null and param.system != ''">
find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wles.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wles.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="alarmTrend" resultType="java.util.Map">
SELECT
`result`.`click_date` AS `click_date`,
`a`.`fireAlarmNum` AS `fireAlarmNum`,
`b`.`breakdownNum` AS `breakdownNum`,
`c`.`shieldNum` AS `shieldNum`,
`d`.`otherNum` AS `otherNum`
FROM
((((
`v_monitor_event_utils_week` `result`
LEFT JOIN (
SELECT
`weekUtil`.`click_date` AS `click_date`,
ifnull( count( `fireAlarm`.`id` ), 0 ) AS `fireAlarmNum`
FROM
(
`v_monitor_event_utils_week` `weekUtil`
LEFT JOIN (
SELECT
log.*
FROM
`wl_equipment_specific_alarm_log` `log`
LEFT JOIN wl_equipment_specific wes ON `log`.equipment_specific_id = wes.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
) fireAlarm ON (((
date_format( `fireAlarm`.`create_date`, '%Y-%m-%d' ) = `weekUtil`.`click_date`
)
AND ( `fireAlarm`.`equipment_specific_index_name` = '火警' )
)))
GROUP BY
`weekUtil`.`click_date`
ORDER BY
`weekUtil`.`click_date`
) `a` ON ((
`a`.`click_date` = `result`.`click_date`
)))
LEFT JOIN (
SELECT
`weekUtil`.`click_date` AS `click_date`,
ifnull( count( `breakdown`.`id` ), 0 ) AS `breakdownNum`
FROM
(
`v_monitor_event_utils_week` `weekUtil`
LEFT JOIN (
SELECT
log.*
FROM
`wl_equipment_specific_alarm_log` `log`
LEFT JOIN wl_equipment_specific wes ON `log`.equipment_specific_id = wes.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
) `breakdown` ON (((
`weekUtil`.`click_date` = date_format( `breakdown`.`create_date`, '%Y-%m-%d' ))
AND ( `breakdown`.`equipment_specific_index_name` = '故障' ))))
GROUP BY
`weekUtil`.`click_date`
ORDER BY
`weekUtil`.`click_date`
) `b` ON ((
`b`.`click_date` = `result`.`click_date`
)))
LEFT JOIN (
SELECT
`weekUtil`.`click_date` AS `click_date`,
ifnull( count( `shield`.`id` ), 0 ) AS `shieldNum`
FROM
(
`v_monitor_event_utils_week` `weekUtil`
LEFT JOIN (
SELECT
log.*
FROM
`wl_equipment_specific_alarm_log` `log`
LEFT JOIN wl_equipment_specific wes ON `log`.equipment_specific_id = wes.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
) `shield` ON (((
date_format( `shield`.`create_date`, '%Y-%m-%d' ) = `weekUtil`.`click_date`
)
AND ( `shield`.`equipment_specific_index_name` = '屏蔽' ))))
GROUP BY
`weekUtil`.`click_date`
ORDER BY
`weekUtil`.`click_date`
) `c` ON ((
`c`.`click_date` = `result`.`click_date`
)))
LEFT JOIN (
SELECT
`weekUtil`.`click_date` AS `click_date`,
ifnull( count( `other`.`id` ), 0 ) AS `otherNum`
FROM
(
`v_monitor_event_utils_week` `weekUtil`
LEFT JOIN (
SELECT
log.*
FROM
`wl_equipment_specific_alarm_log` `log`
LEFT JOIN wl_equipment_specific wes ON `log`.equipment_specific_id = wes.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
) `other` ON (((
date_format( `other`.`create_date`, '%Y-%m-%d' ) = `weekUtil`.`click_date`
)
AND (
`other`.`equipment_specific_index_name` NOT IN ( '火警', '故障', '屏蔽' )))))
GROUP BY
`weekUtil`.`click_date`
ORDER BY
`weekUtil`.`click_date`
) `d` ON ((
`d`.`click_date` = `result`.`click_date`
)))
ORDER BY
`result`.`click_date` DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -25,19 +25,18 @@ ...@@ -25,19 +25,18 @@
<result property="equipDetailId" column="equip_detail_id"></result> <result property="equipDetailId" column="equip_detail_id"></result>
</resultMap> </resultMap>
<update id="updateIndexValueBatch"> <update id="updateIndexValueBatch">
<foreach collection="list" item="item" index="index" separator=";"> <foreach collection="list" item="item" index="index" separator=";">
update wl_equipment_specific_index set update wl_equipment_specific_index set
value = #{item.value} value = #{item.value}
where equipment_specific_id = #{item.equipmentSpecificId} where equipment_specific_id = #{item.equipmentSpecificId}
and equipment_index_id = #{item.equipmentIndexId} and equipment_index_id = #{item.equipmentIndexId}
</foreach> </foreach>
</update> </update>
<select id="getEquipmentSpeIndexBySpeIotCode" <select id="getEquipmentSpeIndexBySpeIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT wesi.id AS id,
wesi.id AS id, wei.name_key AS nameKey,
wei.name_key AS nameKey, wesi.value AS value,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId, wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId, wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_name AS equipmentIndexName, wesi.equipment_index_name AS equipmentIndexName,
...@@ -65,21 +64,22 @@ ...@@ -65,21 +64,22 @@
TRIM(CONCAT_WS(' ',wes.position,sd.description)) AS location, TRIM(CONCAT_WS(' ',wes.position,sd.description)) AS location,
sd.warehouse_structure_id AS buildId sd.warehouse_structure_id AS buildId
FROM FROM
wl_equipment_specific_index AS wesi wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id LEFT JOIN wl_equipment_specific AS wes
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
WHERE WHERE
wes.iot_code = #{iotCode} and wei.is_iot = true wes.iot_code = #{iotCode}
and wei.is_iot = true
</select> </select>
<select id="getEquipmentSpeIndexByIotCode" <select id="getEquipmentSpeIndexByIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT wesi.id AS id,
wesi.id AS id, wei.name_key AS nameKey,
wei.name_key AS nameKey, wesi.value AS value,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId, wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId, wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code, wes.org_code AS code,
...@@ -90,18 +90,19 @@ ...@@ -90,18 +90,19 @@
wei.unit AS indexUnitName, wei.unit AS indexUnitName,
wesi.update_date AS updateDate wesi.update_date AS updateDate
FROM FROM
wl_equipment_specific_index AS wesi wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id LEFT JOIN wl_equipment_specific AS wes
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE WHERE
wes.iot_code = #{iotCode} wes.iot_code = #{iotCode}
</select> </select>
<select id="getEquipmentSpeIndexByIotCodeAndTrend" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> <select id="getEquipmentSpeIndexByIotCodeAndTrend"
SELECT resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
wei.id AS id, SELECT wei.id AS id,
wei.name_key AS nameKey, wei.name_key AS nameKey,
wesi.value AS value, wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId, wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId, wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code, wes.org_code AS code,
...@@ -112,159 +113,142 @@ ...@@ -112,159 +113,142 @@
wei.unit AS indexUnitName, wei.unit AS indexUnitName,
wesi.update_date AS updateDate wesi.update_date AS updateDate
FROM FROM
wl_equipment_specific_index AS wesi wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id LEFT JOIN wl_equipment_specific AS wes
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE WHERE
wes.iot_code = #{iotCode} wes.iot_code = #{iotCode}
AND AND
wei.is_trend = 1 wei.is_trend = 1
</select> </select>
<select id="getEquipmentSpeIndexDataByIotCode" <select id="getEquipmentSpeIndexDataByIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT wesi.id AS id,
wesi.id AS id, wei.name_key AS nameKey,
wei.name_key AS nameKey, IFNULL(si.value_label, si.`value`) AS 'value',
IFNULL(si.value_label, si.`value`) AS 'value', wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_specific_id AS equipmentSpecificId, wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_id AS equipmentIndexId, wes.org_code AS code,
wes.org_code AS code, wes.iot_code AS iotCode,
wes.iot_code AS iotCode, wes.org_code AS orgCode,
wes.org_code AS orgCode, wei.type_code AS typeCode,
wei.type_code AS typeCode, wei.name AS indexName,
wei.name AS indexName, wei.unit AS indexUnitName,
wei.unit AS indexUnitName, wei.value_enum AS valueEnum
wei.value_enum AS valueEnum FROM wl_equipment_specific_index AS wesi
FROM LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
wl_equipment_specific_index AS wesi LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id WHERE wes.iot_code = #{iotCode}
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
</select> </select>
<select id="getEquipmentSpeIndexByEquipmentSecificId" <select id="getEquipmentSpeIndexByEquipmentSecificId"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT wesi.id,
wesi.id, wesi.equipment_specific_id,
wesi.equipment_specific_id, wesi.VALUE,
wesi.VALUE, wesi.create_date,
wesi.create_date, wesi.equipment_index_id,
wesi.equipment_index_id, wli.`name` nameKey
wli.`name` nameKey FROM wl_equipment_specific_index wesi
FROM LEFT JOIN wl_equipment_index wli ON wesi.equipment_index_id = wli.id
wl_equipment_specific_index wesi where wesi.equipment_specific_id = #{id}
LEFT JOIN wl_equipment_index wli ON wesi.equipment_index_id = wli.id
where wesi.equipment_specific_id=#{id}
</select> </select>
<select id="getVideoByEquipmentSecificId" resultType="com.yeejoin.equipmanage.common.entity.Video"> <select id="getVideoByEquipmentSecificId" resultType="com.yeejoin.equipmanage.common.entity.Video">
SELECT SELECT ip,
ip, `port`,
`port`, url,
url, `name`,
`name`, token,
token, `code`,
`code`, preset_position
preset_position FROM wl_video wlv
FROM LEFT JOIN wl_video_equipment_specific wlves ON wlv.id = wlves.video_id
wl_video wlv WHERE wlves.equipment_specific_id = #{id}
LEFT JOIN wl_video_equipment_specific wlves ON wlv.id = wlves.video_id
WHERE
wlves.equipment_specific_id = #{id}
</select> </select>
<select id="getEquipmentDetailBySecificId" resultMap="EquipmentDetail"> <select id="getEquipmentDetailBySecificId" resultMap="EquipmentDetail">
SELECT SELECT wled.NAME equipment_name,
wled.NAME equipment_name, wle.id equip_id,
wle.id equip_id, wled.id equip_detail_id,
wled.id equip_detail_id, wles.qr_code,
wles.qr_code, wles.CODE,
wles. CODE, (
( select GROUP_CONCAT(fs.name)
select from f_fire_fighting_system fs
GROUP_CONCAT(fs.name) where FIND_IN_SET(fs.id, wles.system_id)
from ) as System_name,
f_fire_fighting_system fs wlec.NAME category_name,
where wlws.full_name warehouse_name,
FIND_IN_SET(fs.id,wles.system_id) wled.standard,
) as System_name, sd.`name` country,
wlec. NAME category_name, wled.remark,
wlws.full_name warehouse_name, wled.maintenance_cycle,
wled.standard, wled.is_import,
sd.`name` country, wled.brand,
wled.remark, wlun.`name` unit_name,
wled.maintenance_cycle, wlmi.`name` manufacturer_name,
wled.is_import, wlmi.service_tel,
wled.brand, wlmi.sales_tel,
wlun.`name` unit_name, wlmi.address,
wlmi.`name` manufacturer_name, wlmi.img,
wlmi.service_tel, wleias.`value` STATUS
wlmi.sales_tel, FROM wl_equipment_specific wles
wlmi.address, LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
wlmi.img, LEFT JOIN wl_system_dic sd ON sd.id = wled.country
wleias.`value` STATUS LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
FROM LEFT JOIN wl_equipment_category wlec ON wle.category_id = wlec.id
wl_equipment_specific wles LEFT JOIN wl_stock_detail wlsd ON wlsd.qr_code = wles.qr_code
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id LEFT JOIN wl_warehouse_structure wlws ON wlsd.warehouse_structure_id = wlws.id
LEFT JOIN wl_system_dic sd ON sd.id = wled.country LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id
LEFT JOIN wl_equipment_category wlec ON wle.category_id = wlec.id LEFT JOIN (
LEFT JOIN wl_stock_detail wlsd ON wlsd.qr_code = wles.qr_code SELECT wlei.equipment_id,
LEFT JOIN wl_warehouse_structure wlws ON wlsd.warehouse_structure_id = wlws.id wlesi.`value`
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id FROM wl_equipment_index wlei
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id LEFT JOIN wl_equipment_specific_index wlesi ON wlei.id = wlesi.equipment_index_id
LEFT JOIN ( WHERE wlei.name_key = 'runState'
SELECT ) wleias ON wle.id = wleias.equipment_id
wlei.equipment_id, WHERE wles.id = #{id}
wlesi.`value`
FROM
wl_equipment_index wlei
LEFT JOIN wl_equipment_specific_index wlesi ON wlei.id = wlesi.equipment_index_id
WHERE
wlei.name_key = 'runState'
) wleias ON wle.id = wleias.equipment_id
WHERE wles.id=#{id}
</select> </select>
<select id="selectEquProperty" resultType="java.util.HashMap"> <select id="selectEquProperty" resultType="java.util.HashMap">
SELECT SELECT wlei.NAME,
wlei. NAME, wlesi.`value`
wlesi.`value` FROM wl_equipment_specific_index wlesi
FROM LEFT JOIN wl_equipment_specific wleqs ON wleqs.id = wlesi.equipment_specific_id
wl_equipment_specific_index wlesi LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
LEFT JOIN wl_equipment_specific wleqs ON wleqs.id = wlesi.equipment_specific_id where wleqs.id = #{id}
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
where wleqs.id=#{id}
</select> </select>
<select id="selectEquList" resultType="java.util.HashMap"> <select id="selectEquList" resultType="java.util.HashMap">
SELECT SELECT
de.id, de.id,
de.name, de.name,
a.image, a.image,
de.standard, de.standard,
(case wsd.`status` (case wsd.`status`
when '1' then '在位' when '1' then '在位'
when '2' then '执勤' when '2' then '执勤'
when '3' then '维修' when '3' then '维修'
when '6' then '退役' when '6' then '退役'
when '7' then '报废' when '7' then '报废'
when '10' then '车载' when '10' then '车载'
when '11' then '损耗' when '11' then '损耗'
else '未入库' END) statusName, else '未入库' END) statusName,
(case LEFT(ca.`code`,1) (case LEFT(ca.`code`,1)
when '4' then '04#' when '4' then '04#'
else '01#' END) typen, else '01#' END) typen,
IFNULL(wsd.amount,0)amount, IFNULL(wsd.amount,0)amount,
info.name manufacturerName, info.name manufacturerName,
dic.name country, dic.name country,
wesp.qr_code qrcode wesp.qr_code qrcode
FROM FROM
wl_equipment_specific wesp wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id
LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id
LEFT JOIN wl_system_dic dic on dic.id=de.country LEFT JOIN wl_system_dic dic on dic.id=de.country
LEFT JOIN wl_equipment ca on ca.id=de.equipment_id LEFT JOIN wl_equipment ca on ca.id=de.equipment_id
LEFT JOIN (SELECT object_id, LEFT JOIN (SELECT object_id,
(CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image', (CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image',
(CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video', (CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video',
(CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction', (CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction',
(CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate', (CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate',
...@@ -272,29 +256,29 @@ WHERE wles.id=#{id} ...@@ -272,29 +256,29 @@ WHERE wles.id=#{id}
FROM wl_upload_file FROM wl_upload_file
GROUP BY object_id) a on a.object_id=de.id GROUP BY object_id) a on a.object_id=de.id
LEFT JOIN wl_stock_detail wsd ON wsd.qr_code = wesp.qr_code LEFT JOIN wl_stock_detail wsd ON wsd.qr_code = wesp.qr_code
<if test="name!= null and name!=''"> <if test="name!= null and name!=''">
AND de.name like CONCAT('%',#{name},'%') AND de.name like CONCAT('%',#{name},'%')
</if> </if>
<if test="standard!= null and standard!='' "> <if test="standard!= null and standard!='' ">
AND de.standard like CONCAT('%',#{standard},'%') AND de.standard like CONCAT('%',#{standard},'%')
</if> </if>
<if test="manufacturerName != null and manufacturerName!='' "> <if test="manufacturerName != null and manufacturerName!='' ">
AND info.name like CONCAT('%',#{manufacturerName},'%') AND info.name like CONCAT('%',#{manufacturerName},'%')
</if> </if>
LIMIT #{pageNum},#{pageSize} LIMIT #{pageNum},#{pageSize}
</select> </select>
<select id="selectEquListcount" resultType="java.util.HashMap"> <select id="selectEquListcount" resultType="java.util.HashMap">
SELECT SELECT
de.name de.name
FROM FROM
wl_equipment_specific wesp wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id
LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id
LEFT JOIN wl_system_dic dic on dic.id=de.country LEFT JOIN wl_system_dic dic on dic.id=de.country
LEFT JOIN wl_equipment ca on ca.id=de.equipment_id LEFT JOIN wl_equipment ca on ca.id=de.equipment_id
LEFT JOIN (SELECT object_id, LEFT JOIN (SELECT object_id,
(CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image', (CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image',
(CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video', (CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video',
(CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction', (CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction',
(CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate', (CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate',
...@@ -306,32 +290,29 @@ WHERE wles.id=#{id} ...@@ -306,32 +290,29 @@ WHERE wles.id=#{id}
LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id
LEFT JOIN wl_warehouse_structure wws1 ON wws.parent_id = wws1.id LEFT JOIN wl_warehouse_structure wws1 ON wws.parent_id = wws1.id
<if test="name!= null and name!='' "> <if test="name!= null and name!='' ">
AND de.name like CONCAT('%',#{name},'%') AND de.name like CONCAT('%',#{name},'%')
</if> </if>
<if test="standard!= null and standard!='' "> <if test="standard!= null and standard!='' ">
AND de.standard like CONCAT('%',#{standard},'%') AND de.standard like CONCAT('%',#{standard},'%')
</if> </if>
<if test="manufacturerName != null and manufacturerName!='' "> <if test="manufacturerName != null and manufacturerName!='' ">
AND info.name like CONCAT('%',#{manufacturerName},'%') AND info.name like CONCAT('%',#{manufacturerName},'%')
</if> </if>
</select> </select>
<select id="getEquipmentSpeIndexList" resultType="hashmap"> <select id="getEquipmentSpeIndexList" resultType="hashmap">
SELECT SELECT wles.equipment_specific_id AS speId,
wles.equipment_specific_id AS speId, wles.`value` AS speIndexValue,
wles.`value` AS speIndexValue, wlei.type_name AS typeName,
wlei.type_name AS typeName, wlei.type_code AS typeCode,
wlei.type_code AS typeCode, wlei.name_key AS nameKey,
wlei.name_key AS nameKey, wlei.`name` as indexName
wlei.`name` as indexName FROM wl_equipment_specific_index wles
FROM JOIN wl_equipment_index wlei ON wlei.id = wles.equipment_index_id
wl_equipment_specific_index wles WHERE wlei.is_iot = 1
JOIN wl_equipment_index wlei ON wlei.id = wles.equipment_index_id AND (
WHERE wlei.type_code IN ('BREAKDOWN', 'SHIELD'))
wlei.is_iot = 1 AND (wles.`value` IS NOT NULL AND LENGTH(TRIM(wles.`value`)) > 1)
AND (
wlei.type_code IN ( 'BREAKDOWN', 'SHIELD' ))
AND (wles.`value` IS NOT NULL AND LENGTH(TRIM(wles.`value`)) > 1 )
</select> </select>
<select id="getEquipSpecificIndexList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO"> <select id="getEquipSpecificIndexList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT SELECT
...@@ -379,7 +360,7 @@ WHERE wles.id=#{id} ...@@ -379,7 +360,7 @@ WHERE wles.id=#{id}
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
<where> <where>
<if test="list != null and list.size > 0 and type = 'id'"> <if test="list != null and list.size > 0 and type = 'id'">
si.equipment_specific_id IN si.equipment_specific_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -390,17 +371,18 @@ WHERE wles.id=#{id} ...@@ -390,17 +371,18 @@ WHERE wles.id=#{id}
SELECT SELECT
si.id, si.id,
si.equipment_specific_id AS equipmentId, si.equipment_specific_id AS equipmentId,
(case when si.value_label is null or trim(si.value_label) ='' then si.`value` else si.value_label end )AS 'value', (case when si.value_label is null or trim(si.value_label) ='' then si.`value` else si.value_label end )AS
'value',
si.create_date, si.create_date,
si.update_date si.update_date
FROM FROM
wl_equipment_specific_index si wl_equipment_specific_index si
<where> <where>
<if test="id != null"> <if test="id != null">
si.equipment_index_id = #{id} si.equipment_index_id = #{id}
</if> </if>
<if test="equipmentSpecificId!= null"> <if test="equipmentSpecificId!= null">
AND si.equipment_specific_id = #{equipmentSpecificId} AND si.equipment_specific_id = #{equipmentSpecificId}
</if> </if>
</where> </where>
</select> </select>
...@@ -426,38 +408,34 @@ WHERE wles.id=#{id} ...@@ -426,38 +408,34 @@ WHERE wles.id=#{id}
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
<where> <where>
<if test="list != null and list.size > 0 and type = 'id'"> <if test="list != null and list.size > 0 and type = 'id'">
si.id IN si.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> </where>
</select> </select>
<select id="getEquipSpecificIndexByUpdateDateDesc" resultType="java.util.HashMap"> <select id="getEquipSpecificIndexByUpdateDateDesc" resultType="java.util.HashMap">
SELECT SELECT esi.id,
esi.id, es.`name` AS equipmentSpecificName,
es.`name` AS equipmentSpecificName, esi.equipment_index_name AS equipmentSpecificIndexName,
esi.equipment_index_name AS equipmentSpecificIndexName,
IF (
esi.value_label = ''
OR esi.value_label IS NULL,
esi.`value`,
esi.value_label
) AS valueLabel,
es.position AS location,
esi.update_date AS createDate
FROM
`wl_equipment_specific_index` esi
LEFT JOIN wl_equipment_specific es ON es.id = esi.equipment_specific_id
WHERE
esi.`value` IS NOT NULL
ORDER BY
esi.update_date DESC
LIMIT 50
</select>
<select id="getEquipmentSpeIndexByIotCodeTrend" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> IF(
esi.value_label = ''
OR esi.value_label IS NULL,
esi.`value`,
esi.value_label
) AS valueLabel,
es.position AS location,
esi.update_date AS createDate
FROM `wl_equipment_specific_index` esi
LEFT JOIN wl_equipment_specific es ON es.id = esi.equipment_specific_id
WHERE esi.`value` IS NOT NULL
ORDER BY esi.update_date DESC LIMIT 50
</select>
<select id="getEquipmentSpeIndexByIotCodeTrend"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT
wei.id AS id, wei.id AS id,
wei.name_key AS nameKey, wei.name_key AS nameKey,
...@@ -487,4 +465,44 @@ WHERE wles.id=#{id} ...@@ -487,4 +465,44 @@ WHERE wles.id=#{id}
AND wei.name_key = #{fieldKey} AND wei.name_key = #{fieldKey}
</if> </if>
</select> </select>
<select id="getEquipSpecificScrap" resultType="java.util.Map">
select wes.id,
str.name as sname,
wlsd.status,
wes.position,
wes.name,
we.expiry_date as weExpiry,
wed.expiry_date as wesExpiry,
wed.production_date as product
from wl_equipment_specific wes
left join wl_equipment_detail wed on wes.equipment_detail_id = wed.id
left join wl_equipment we on wed.equipment_id = we.id
left join wl_warehouse_structure str on str.id = wes.warehouse_structure_id
left join wl_stock_detail wlsd on wes.id = wlsd.equipment_specific_id
where wed.production_date is not null
and wlsd.status != 7
</select>
<select id="getEquipIndexInIndex" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
si.equipment_specific_id AS equipmentId,
si.id,
si.`value`,
si.create_date,
si.update_date,
si.equipment_index_key,
si.equipment_specific_name,
es.position location,
es.`iot_code` AS iotCode
FROM
wl_equipment_specific_index si
LEFT JOIN wl_equipment_specific es ON si.equipment_specific_id = es.id
<where>
<if test="list != null and list.size > 0 and type = 'id'">
si.equipment_index_key IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2362,7 +2362,8 @@ ...@@ -2362,7 +2362,8 @@
</select> </select>
<select id="getWaterInfo" resultType="java.util.Map"> <select id="getWaterInfo" resultType="java.util.Map">
SELECT select * from (
(SELECT
r.`name`, r.`name`,
ou.`code`, ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel, IFNULL( rp.min_water_level, 0 ) AS minLevel,
...@@ -2370,18 +2371,18 @@ ...@@ -2370,18 +2371,18 @@
( (
CASE CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL THEN WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL THEN
'--' '--'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 ) WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN AND rp.max_water_level IS NULL THEN
'100' '100'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 ) WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL(( '--' ELSE IFNULL((
FORMAT( FORMAT(
abs( abs(
IFNULL( IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ), max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) / IFNULL( rp.min_water_level, 0 )) /
IF IF
( (
...@@ -2395,15 +2396,15 @@ ...@@ -2395,15 +2396,15 @@
) )
END END
) AS levelAbs, ) AS levelAbs,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel, IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
( (
CASE CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL
OR rp.min_water_level IS NULL THEN OR rp.min_water_level IS NULL THEN
'--' '--'
WHEN IFNULL( WHEN IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ), max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常' '缺水' ELSE '正常'
END END
...@@ -2418,13 +2419,102 @@ ...@@ -2418,13 +2419,102 @@
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0 AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific es ON es.id = rp.level_device_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE WHERE
r.resource_type IN ( 'pool', 'industryPool' ) r.resource_type = 'industryPool'
AND r.is_delete = 1
AND ou.`code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="systemCode!=null and systemCode!=''">
AND fs.code = #{systemCode,jdbcType=VARCHAR}
</if>
GROUP BY
r.sequence_nbr) union all
(
SELECT
a.`name`,
a.`code`,
a.minLevel,
a.maxLevel,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
a.nowLevel,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
a.volume,
a.image,
a.resource_type,
a.sequence_nbr,
a.`code` AS systemCode
FROM
(
SELECT
r.`name`,
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
r.sequence_nbr,
rp.level_device_id,
fs.`code` AS systemCode
FROM
cb_water_resource r
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE
r.resource_type = 'pool'
AND r.is_delete = 1 AND r.is_delete = 1
AND ou.`code` IS NOT NULL AND ou.`code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
...@@ -2435,8 +2525,10 @@ ...@@ -2435,8 +2525,10 @@
</if> </if>
GROUP BY GROUP BY
r.sequence_nbr r.sequence_nbr
) a
)) b
ORDER BY ORDER BY
levelStatus DESC levelStatus DESC,sequence_nbr DESC
</select> </select>
<select id="getFireSystemInfo" resultType="java.util.Map"> <select id="getFireSystemInfo" resultType="java.util.Map">
...@@ -2574,6 +2666,17 @@ ...@@ -2574,6 +2666,17 @@
code = #{systemCode} code = #{systemCode}
</select> </select>
<select id="equipmentIdBySuper" resultType="String">
select
id
from
f_fire_fighting_system
where
code = #{systemCode}
and
biz_org_code like concat(#{bizOrgCode}, '%')
</select>
<select id="equipmentState" resultType="java.util.Map"> <select id="equipmentState" resultType="java.util.Map">
<!-- SELECT--> <!-- SELECT-->
<!-- b.equipName,--> <!-- b.equipName,-->
...@@ -2640,6 +2743,43 @@ ...@@ -2640,6 +2743,43 @@
b.totalNum DESC b.totalNum DESC
</select> </select>
<select id="equipmentStateBySuper" resultType="java.util.Map">
SELECT
b.equipName,
( CASE WHEN b.totalAlarmNum > 0 THEN '异常' ELSE '正常' END ) `status`,
b.totalAlarmNum AS alarmNum,
b.`code` AS equipDetailCode,
b.totalNum
FROM
(
SELECT
a.equipName,
count( DISTINCT wesi.equipment_specific_id ) AS totalAlarmNum,
a.`code`,
count( DISTINCT a.id ) AS totalNum
FROM
(
SELECT
eq.`name` AS equipName,
eq.id AS equipmentId,
eq.`code` AS `code`,
wes.id
FROM
wl_equipment eq
LEFT JOIN wl_equipment_detail wed ON eq.id = wed.equipment_id
LEFT JOIN wl_equipment_specific wes ON wed.id = wes.equipment_detail_id
WHERE
FIND_IN_SET( #{id}, wes.system_id ) > 0
) a
LEFT JOIN wl_equipment_specific_index wesi ON wesi.equipment_specific_id = a.id
AND ((wesi.`is_alarm` = 1 and wesi.`value` = 'true') or (wesi.`is_alarm` = 0 and wesi.`value` = 'false'))
GROUP BY
a.equipmentId
) b
ORDER BY
b.totalNum DESC
</select>
<select id="getPressurePumpInfo" resultType="java.util.Map"> <select id="getPressurePumpInfo" resultType="java.util.Map">
SELECT SELECT
ed.`name`, ed.`name`,
...@@ -2819,93 +2959,127 @@ ...@@ -2819,93 +2959,127 @@
<select id="getWaterPoolInfoNum" resultType="java.util.Map"> <select id="getWaterPoolInfoNum" resultType="java.util.Map">
SELECT SELECT
count( 1 ) AS totalNum, count( 1 ) AS totalNum,
count( a.nowLevel &lt; a.minLevel OR NULL ) AS abnomalNum, count( a.minLevel > a.nowLevel OR NULL ) AS abnomalNum,
count( a.nowLevel &gt;= a.minLevel OR NULL ) AS nomalNum, count( a.nowLevel >= a.minLevel OR NULL ) AS nomalNum,
( (
FORMAT ( FORMAT (
abs((( abs(((
count( a.nowLevel &gt;= a.minLevel OR NULL )) / count( a.nowLevel >= a.minLevel OR NULL )) /
IF IF
(( count( 1 ) = 0 ), 1, count( 1 ) ))) * 100, 2) (( count( 1 ) = 0 ), 1, count( 1 ) ))) * 100,
2
)
) AS normalAbs ) AS normalAbs
FROM FROM
( (
SELECT SELECT
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`, ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`, ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
ifnull( (select
max(( avg(IFNULL(ei.`value`,0))
CASE from
wl_equipment_specific_index ei
WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN where
`ei`.`perf_value` (ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
END and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel
)),
ifnull( `rp`.`min_water_level`, 0 )) AS `nowLevel`
FROM FROM
`cb_water_resource` `r` `cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr` LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE WHERE
`r`.`is_delete` = 1 `r`.`is_delete` = 1
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND r.`biz_org_code` like concat(#{bizOrgCode}, '%') AND r.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
AND `r`.`resource_type` = #{poolType} AND `r`.`resource_type` = 'pool'
GROUP BY GROUP BY
`r`.`sequence_nbr` `r`.`sequence_nbr`
) a ) a
</select> </select>
<select id="getWaterPoolVolumeInfo" resultType="java.util.Map">
<select id="getWaterIndustryPoolInfoNum" resultType="java.util.Map">
SELECT SELECT
IFNULL( sum( a.margin ), 0 ) AS margin, count( 1 ) AS totalNum,
IFNULL( sum( volume ), 0 ) AS volume count( a.minLevel > a.nowLevel OR NULL ) AS abnomalNum,
count( a.nowLevel >= a.minLevel OR NULL ) AS nomalNum,
(
FORMAT (
abs(((
count( a.nowLevel >= a.minLevel OR NULL )) /
IF
(( count( 1 ) = 0 ), 1, count( 1 ) ))) * 100,
2
)
) AS normalAbs
FROM FROM
( (
SELECT SELECT
`ou`.`code` AS `code`, ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull(( ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
abs(( ifnull(MAX( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ), 0) AS nowLevel
ifnull( FROM
max(( `cb_water_resource` `r`
CASE LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific_index` `ei` ON `ei`.`equipment_specific_id` = `rp`.`level_device_id`
WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN WHERE
`ei`.`perf_value` `r`.`is_delete` = 1
END <if test="bizOrgCode != null and bizOrgCode != ''">
)), AND r.`biz_org_code` like concat(#{bizOrgCode}, '%')
ifnull( `rp`.`min_water_level`, 0 )) / </if>
IF AND `r`.`resource_type` = 'industryPool'
(( GROUP BY
ifnull( `rp`.`max_water_level`, 0 ) = 0 `r`.`sequence_nbr`
), ) a
1,
ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),
0
) AS `margin`,
ifnull( `rp`.`volume`, 0 ) AS `volume`
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE
`r`.`resource_type` IN ( 'pool', 'industryPool' )
AND `r`.`is_delete` = 1
AND `ou`.`code` IS NOT NULL
<if test="companyCode != null and companyCode != ''">
AND ou.`code` = #{companyCode}
</if>
GROUP BY
`r`.`sequence_nbr`
) a
</select> </select>
<!-- <select id="getWaterPoolVolumeInfo" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- IFNULL( sum( a.margin ), 0 ) AS margin,-->
<!-- IFNULL( sum( volume ), 0 ) AS volume-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- `ou`.`code` AS `code`,-->
<!-- ifnull((-->
<!-- abs((-->
<!-- ifnull(-->
<!-- max((-->
<!-- CASE-->
<!-- WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN-->
<!-- `ei`.`perf_value`-->
<!-- END-->
<!-- )),-->
<!-- ifnull( `rp`.`min_water_level`, 0 )) /-->
<!-- IF-->
<!-- ((-->
<!-- ifnull( `rp`.`max_water_level`, 0 ) = 0-->
<!-- ),-->
<!-- 1,-->
<!-- ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),-->
<!-- 0-->
<!-- ) AS `margin`,-->
<!-- ifnull( `rp`.`volume`, 0 ) AS `volume`-->
<!-- FROM-->
<!-- `cb_water_resource` `r`-->
<!-- LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`-->
<!-- LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`-->
<!-- LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`-->
<!-- LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`-->
<!-- LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`-->
<!-- WHERE-->
<!-- `r`.`resource_type` IN ( 'pool', 'industryPool' )-->
<!-- AND `r`.`is_delete` = 1-->
<!-- AND `ou`.`code` IS NOT NULL-->
<!-- <if test="companyCode != null and companyCode != ''">-->
<!-- AND ou.`code` = #{companyCode}-->
<!-- </if>-->
<!-- GROUP BY-->
<!-- `r`.`sequence_nbr`-->
<!-- ) a-->
<!-- </select>-->
<select id="getCarNum" resultType="java.lang.Integer"> <select id="getCarNum" resultType="java.lang.Integer">
SELECT SELECT
count( wc.id ) as carNum count( wc.id ) as carNum
...@@ -3621,7 +3795,7 @@ ...@@ -3621,7 +3795,7 @@
wesp.`code` AS num, wesp.`code` AS num,
ifNull(ed.standard,"") AS type, ifNull(ed.standard,"") AS type,
ifNull(mi.`name`,"") as manufacturer, ifNull(mi.`name`,"") as manufacturer,
ifNull( wws.full_name,"") as address, ifNull(concat(wws.full_name,'--',ed.area) ,"") as address,
ifNull(eq.`name`,"") AS equType, ifNull(eq.`name`,"") AS equType,
wesp.biz_org_name AS bizOrgName, wesp.biz_org_name AS bizOrgName,
wesp.id, wesp.id,
...@@ -4356,4 +4530,510 @@ ...@@ -4356,4 +4530,510 @@
temp.notReturnd DESC temp.notReturnd DESC
</select> </select>
<select id="getFireCaStartBySeven" resultType="java.util.Map">
select count(1) as count from wl_car_property wcp where
wcp.create_date BETWEEN DATE_SUB(NOW(),INTERVAL 7 DAY) and now()
and equipment_index_key = 'FireCar_Start' and value = 'true' and car_id = #{carId}
</select>
<select id="getWaterInfoBySuper" resultType="java.util.Map">
select * from (
(SELECT
r.`name`,
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL THEN
'--'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'100'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
IFNULL( rp.max_water_level, 0 ) = 0,
1,
IFNULL( rp.max_water_level, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL
OR rp.min_water_level IS NULL THEN
'--'
WHEN IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
r.sequence_nbr,
fs.`code` AS systemCode
FROM
cb_water_resource r
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE
r.resource_type = 'industryPool'
AND r.is_delete = 1
AND ou.`code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
r.sequence_nbr) union all
(
SELECT
a.`name`,
a.`code`,
a.minLevel,
a.maxLevel,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
a.nowLevel,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
a.volume,
a.image,
a.resource_type,
a.sequence_nbr,
a.`code` AS systemCode
FROM
(
SELECT
r.`name`,
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
r.sequence_nbr,
rp.level_device_id,
fs.`code` AS systemCode
FROM
cb_water_resource r
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = r.biz_org_code
AND ou.is_delete = 0
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = r.belong_fighting_system_id
WHERE
r.resource_type = 'pool'
AND r.is_delete = 1
AND ou.`code` IS NOT NULL
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
r.sequence_nbr
) a
)) b
ORDER BY
levelStatus DESC,sequence_nbr DESC
</select>
<select id="getFoamTankBySuper" resultType="java.util.Map">
SELECT
a.`name`,
IFNULL(a.nowLevel, '--') AS nowLevel,
a.id,
IFNULL(a.image, '') AS image,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
'foamTank' AS type
FROM
(
SELECT
ed.`name`,
es.iot_code,
es.id,
ec.image,
max( CASE WHEN ei.equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' THEN ei.`value` END ) AS nowLevel,
max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) AS minLevel,
max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) AS maxLevel
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_index ei ON es.id = ei.equipment_specific_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON e.category_id = ec.id
LEFT JOIN wl_form_instance fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92031900%'
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND es.iot_code IS NOT NULL
GROUP BY
es.id
) a UNION ALL
SELECT
a.`name`,
IFNULL(a.nowLevel, '--') as nowLevel,
a.id,
IFNULL(a.image, '') AS image,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
(
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
a.type AS type
FROM
(
SELECT
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select
avg(IFNULL(ei.`value`,0))
from
wl_equipment_specific_index ei
where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
ec.image,
r.resource_type AS type,
r.sequence_nbr AS id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_category ec ON ec.id = r.equip_category_id
WHERE
r.resource_type = 'waterTank'
AND r.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND r.is_delete = 1
GROUP BY
r.sequence_nbr
) a
</select>
<select id="getPipeNetworkBySuper" resultType="java.util.Map">
SELECT
a.`name`,
IFNULL(a.area, '') AS area,
a.id,
IFNULL(a.nowPressure, '--') AS nowPressure,
a.nowPressureDate,
(
CASE
WHEN nowPressure IS NOT NULL
AND minLevel IS NOT NULL
AND nowPressure >= minLevel THEN
'正常'
WHEN nowPressure IS NOT NULL
AND minLevel IS NOT NULL
AND minLevel > nowPressure THEN
'压力低' ELSE '--'
END
) AS `status`
FROM
(
SELECT
ed.`name`,
concat_ws( '-', ws.full_name, ed.area ) area,
es.id,
max( CASE WHEN ei.equipment_index_key = 'FHS_PipePressureDetector_PipePressure' THEN ei.`value` END ) AS nowPressure,
IF
((
max( CASE WHEN ei.equipment_index_key = 'FHS_PipePressureDetector_PipePressure' THEN ei.`value` END ) IS NOT NULL
),
max( CASE WHEN ei.equipment_index_key = 'FHS_PipePressureDetector_PipePressure' THEN DATE_FORMAT( ei.`update_date`, '%m-%d %H:%i:%S' ) END ),
'--'
) AS nowPressureDate,
max( CASE WHEN fi.field_name = 'lowLevel' THEN fi.field_value END ) AS minLevel,
max( CASE WHEN fi.field_name = 'highLevel' THEN fi.field_value END ) AS maxLevel
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_index ei ON es.id = ei.equipment_specific_id
LEFT JOIN wl_form_instance fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92011000%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY
es.id
) a
</select>
<select id="getInfluentFlowBySuper" resultType="java.util.Map">
SELECT
ed.`name`,
IFNULL(concat_ws( '-', ws.full_name, ed.area ), '') AS area,
es.id,
IFNULL( max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' THEN ei.`value` END ), '--' ) AS nowInfluentFlow,
IF
((
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' THEN ei.`value` END ) IS NOT NULL
),
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_InfluentFlow' THEN DATE_FORMAT( ei.`update_date`, '%m-%d %H:%i:%S' ) END ),
'--'
) AS nowInfluentFlowDate
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment_specific_index ei ON es.id = ei.equipment_specific_id
LEFT JOIN wl_form_instance fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92010700%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
GROUP BY
es.id
</select>
<select id="getSystemStatus" resultType="java.lang.Integer">
SELECT
count( DISTINCT equipment_specific_id ) AS isAlarm
FROM
wl_equipment_specific_index
WHERE
equipment_specific_id IN ( SELECT id FROM wl_equipment_specific WHERE FIND_IN_SET( #{id}, system_id ) > 0 AND biz_org_code LIKE concat(#{bizOrgCode}, '%') )
AND ((
`is_alarm` = 1
AND `value` = 'true'
)
OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select>
<select id="queryStartAndStopBySpecificId" resultType="java.util.Map">
SELECT
i.equipment_specific_id,
i.update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
<if test="ids != null and ids.size > 0">
i.equipment_specific_id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
ORDER BY
i.update_date DESC
limit 2
</select>
<select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT
i.update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
i.equipment_specific_id = #{id,jdbcType=VARCHAR}
AND i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
ORDER BY
i.update_date DESC
</select>
<select id="getFoamTankLevel" resultType="java.util.Map">
SELECT
IF
(
max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) = ''
OR max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END ) IS NULL,
0,
max( CASE WHEN fi.field_name = 'minLevel' THEN fi.field_value END )) AS minValues,
IF
(
max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) = ''
OR max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END ) IS NULL,
0,
max( CASE WHEN fi.field_name = 'maxLevel' THEN fi.field_value END )) AS maxValues
FROM
wl_form_instance fi
WHERE
fi.instance_id = #{equipSpeId}
</select>
<select id="getPipeNetwork" resultType="java.util.Map">
SELECT
IF
(
max( CASE WHEN fi.field_name = 'minPressure' THEN fi.field_value END ) = ''
OR max( CASE WHEN fi.field_name = 'minPressure' THEN fi.field_value END ) IS NULL,
0,
max( CASE WHEN fi.field_name = 'minPressure' THEN fi.field_value END )) AS minValues,
IF
(
max( CASE WHEN fi.field_name = 'maxPressure' THEN fi.field_value END ) = ''
OR max( CASE WHEN fi.field_name = 'maxPressure' THEN fi.field_value END ) IS NULL,
0,
max( CASE WHEN fi.field_name = 'maxPressure' THEN fi.field_value END )) AS maxValues
FROM
wl_form_instance fi
WHERE
fi.instance_id = #{equipSpeId}
</select>
<select id="getWaterPoolLevel" resultType="java.util.Map">
SELECT
ifnull(r.`name`, '') as name,
r.sequence_nbr AS id,
ifnull(r.resource_type, '') as resourceType,
ifnull(rp.min_water_level, 0) AS minValues,
ifnull(rp.max_water_level, 0) AS maxValues,
ifnull(rp.level_device_id, '') as levelDeviceId
FROM
cb_water_resource_pool rp
LEFT JOIN cb_water_resource r ON r.sequence_nbr = rp.resource_id
WHERE
FIND_IN_SET( #{equipSpeId}, rp.level_device_id )
ORDER BY
rp.rec_date DESC
LIMIT 1
</select>
<select id="getWaterPoolLevelByEquipSpeId" resultType="java.math.BigDecimal">
SELECT
IFNULL( max( CASE WHEN equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN `value` END ), 0 )
FROM
wl_equipment_specific_index
WHERE
equipment_specific_id = #{equipSpeId}
</select>
</mapper> </mapper>
...@@ -456,6 +456,12 @@ ...@@ -456,6 +456,12 @@
biz_org_name= #{bizOrgName} biz_org_name= #{bizOrgName}
where id = #{id} where id = #{id}
</update> </update>
<update id="updateFormFieldValue">
update wl_form_instance
set
field_value = #{value}
where instance_id = #{id} AND field_name = #{name}
</update>
<update id="updateStrFullName"> <update id="updateStrFullName">
update wl_warehouse_structure update wl_warehouse_structure
set full_name=replace(full_name,#{name},#{fullName}) set full_name=replace(full_name,#{name},#{fullName})
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.MarqueeDataMapper">
<select id="selectAll" resultType="java.util.Map">
select
id messageId,
type equipmentSpecificIndexName,
position,
name equipmentSpecificName,
date_format(
create_date,
'%Y-%m-%d %H:%i:%s'
) createDate,
message_type messageType,
is_read isRead,
equipment_specific_id id
from
wl_marquee_data
where
is_read = '0'
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.SupervisionVideoMapper">
<select id="getVideoByCompany" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select
wv.id,
wv.token,
wv.name as name,
wv.url,
wv.code,
wv.preset_position as presetPosition,
wv.name
from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id
where wsv.biz_org_code like concat(#{bizOrgCode},'%');
</select>
<select id="queryVideoAllId" resultType="java.lang.String">
select wsv.camera_id
from wl_supervision_video wsv
where wsv.biz_org_code like concat(#{bizOrgCode},'%');
</select>
</mapper>
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
...@@ -127,4 +127,8 @@ management.endpoints.enabled-by-default=false ...@@ -127,4 +127,8 @@ management.endpoints.enabled-by-default=false
#阿里云实时语音识别参数 #阿里云实时语音识别参数
speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n
speech-config.app-key=FC84bGUpbNFrexoL speech-config.app-key=FC84bGUpbNFrexoL
\ No newline at end of file
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
...@@ -3448,5 +3448,15 @@ ...@@ -3448,5 +3448,15 @@
CHANGE COLUMN `user_name` `usr_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名' AFTER `sequence_nbr` CHANGE COLUMN `user_name` `usr_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名' AFTER `sequence_nbr`
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="zs" id="202210101353">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_water_resource_pool"/>
</preConditions>
<comment>修改液位显示装置字段类型->需求2022 一个水池可选多个 装置</comment>
<sql>
ALTER TABLE `cb_water_resource_pool` MODIFY COLUMN `level_device_id` varchar(255) NULL DEFAULT NULL COMMENT '水池液位显示装置id';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -2257,7 +2257,7 @@ ...@@ -2257,7 +2257,7 @@
<w:sz-cs w:val="28"/> <w:sz-cs w:val="28"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr> </w:rPr>
<w:t>是否合格</w:t> <w:t>检验结果</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
...@@ -2291,7 +2291,7 @@ ...@@ -2291,7 +2291,7 @@
<w:sz-cs w:val="28"/> <w:sz-cs w:val="28"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/> <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr> </w:rPr>
<w:t>标准原文</w:t> <w:t>规范标准值</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
......
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