Commit 84e02b55 authored by 赵啸非's avatar 赵啸非

物联网1.0

parent 4f37832b
...@@ -129,9 +129,9 @@ PRIMARY KEY (`id`) ...@@ -129,9 +129,9 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_xhx_device_module`; DROP TABLE IF EXISTS `mortals_xhx_device_module`;
CREATE TABLE mortals_xhx_device_module( CREATE TABLE mortals_xhx_device_module(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`moduleId` bigint(20) NOT NULL COMMENT '模块名称', `moduleName` varchar(256) NOT NULL COMMENT '模块名称',
`deviceId` bigint(20) NOT NULL COMMENT '所属设备', `moduleMsgCode` varchar(256) NOT NULL COMMENT '模块消息编码,与上报消息头编码一致,唯一',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户', `updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
...@@ -143,14 +143,18 @@ PRIMARY KEY (`id`) ...@@ -143,14 +143,18 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_xhx_device_module_use`; DROP TABLE IF EXISTS `mortals_xhx_device_module_use`;
CREATE TABLE mortals_xhx_device_module_use( CREATE TABLE mortals_xhx_device_module_use(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`moduleId` bigint(20) NOT NULL COMMENT '模块ID', `moduleName` varchar(256) NOT NULL COMMENT '模块名称',
`moduleMsgCode` varchar(256) NOT NULL COMMENT '模块消息编码',
`deviceId` bigint(20) NOT NULL COMMENT '所属设备',
`useNum` int COMMENT '调用次数', `useNum` int COMMENT '调用次数',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户', `updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备模块使用频率'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备模块使用频率';
-- ---------------------------- -- ----------------------------
-- 设备告警配置表 -- 设备告警配置表
-- ---------------------------- -- ----------------------------
...@@ -193,9 +197,10 @@ CREATE TABLE mortals_xhx_device_log( ...@@ -193,9 +197,10 @@ CREATE TABLE mortals_xhx_device_log(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`traceID` varchar(64) COMMENT 'traceId,日志追踪id', `traceID` varchar(64) COMMENT 'traceId,日志追踪id',
`deviceId` bigint(20) COMMENT '设备ID', `deviceId` bigint(20) COMMENT '设备ID',
`deviceNum` varchar(32) NOT NULL COMMENT '设备编号', `deviceCode` varchar(32) NOT NULL COMMENT '设备编号',
`deviceName` varchar(32) NOT NULL COMMENT '设备名称,设置设备名称。', `deviceName` varchar(32) NOT NULL COMMENT '设备名称,设置设备名称。',
`logType` tinyint(2) NOT NULL COMMENT '日志类型,(0.上报事件,1.下发服务)', `messageHead` varchar(64) NOT NULL COMMENT '业务消息头标识',
`logType` tinyint(2) NOT NULL COMMENT '消息类型,(0.上行,1.下行)',
`content` varchar(2048) COMMENT '内容', `content` varchar(2048) COMMENT '内容',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户', `createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
...@@ -204,6 +209,8 @@ CREATE TABLE mortals_xhx_device_log( ...@@ -204,6 +209,8 @@ CREATE TABLE mortals_xhx_device_log(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备日志'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备日志';
-- ---------------------------- -- ----------------------------
-- 站点统计表 -- 站点统计表
-- ---------------------------- -- ----------------------------
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
v-if="item.type === 'datetime'" v-if="item.type === 'datetime'"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" :placeholder="item.label"
> >
</el-date-picker> </el-date-picker>
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" notAdd :config="tableConfig"> </LayoutTable> <LayoutTable :data="tableData" notAdd notDel :config="tableConfig"> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
</div> </div>
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
//this.config.addQuery = { deviceId, deviceType }; //this.config.addQuery = { deviceId, deviceType };
if (this.queryIn.alarmDevice) { if (this.queryIn.alarmDevice) {
this.query={}
this.query["alarmDevice"] = this.queryIn.alarmDevice; this.query["alarmDevice"] = this.queryIn.alarmDevice;
} }
...@@ -60,21 +61,29 @@ export default { ...@@ -60,21 +61,29 @@ export default {
return { return {
config: { config: {
search: [ search: [
{
name: "alarmDevice",
type: "text",
label: "告警设备",
fuzzy: true,
},
{ {
name: "alarmStatus", name: "alarmStatus",
type: "select", type: "select",
label: "告警状态,来自工单系统", label: "告警状态",
fuzzy: true, },
{
name: "alarmTimeStart",
type: "datetime",
label: "开始时间",
},
{
name: "alarmTimeEnd",
type: "datetime",
label: "结束时间",
placeholder:"结束时间"
}, },
], ],
columns: [ columns: [
{ type: "selection", width: 60 },
{ {
label: "告警时间", label: "告警时间",
...@@ -87,33 +96,24 @@ export default { ...@@ -87,33 +96,24 @@ export default {
prop: "alarmDevice", prop: "alarmDevice",
formatter: this.formatterString, formatter: this.formatterString,
}, },
{
{ label: "告警类型,", prop: "alarmType", formatter: this.formatter }, label: "告警内容",
prop: "alarmContent",
},
{ label: "告警级别", prop: "alarmLevel", formatter: this.formatter }, { label: "告警级别", prop: "alarmLevel", formatter: this.formatter },
{ label: "接收人员,", prop: "alarmReceivePersonnel" },
{ {
label: "告警状态,来自工单系统", label: "告警状态",
prop: "alarmStatus", prop: "alarmStatus",
formatter: this.formatter, formatter: this.formatter,
}, },
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<table-buttons
noAdd
noEdit
noDel
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
], ],
}, },
}; };
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field label="模块名称" prop="moduleId" v-model="form.moduleId" placeholder="请输入模块名称"/> <Field label="模块名称" prop="moduleName" v-model="form.moduleName" type="textarea" placeholder="请输入模块名称"/>
<Field label="所属设备" prop="deviceId" v-model="form.deviceId" placeholder="请输入所属设备"/> <Field label="模块消息编码,与上报消息头编码一致,唯一" prop="moduleMsgCode" v-model="form.moduleMsgCode" type="textarea" placeholder="请输入模块消息编码,与上报消息头编码一致,唯一"/>
</el-row> </el-row>
...@@ -36,8 +36,13 @@ ...@@ -36,8 +36,13 @@
], ],
// 表单校验 // 表单校验
rules: { rules: {
createTime: [ moduleName: [
{required: true,message: "请选择创建时间" }, {required: true,message: "请输入模块名称", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
],
moduleMsgCode: [
{required: true,message: "请输入模块消息编码,与上报消息头编码一致,唯一", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
], ],
} }
}; };
...@@ -88,8 +93,8 @@ ...@@ -88,8 +93,8 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
moduleId : null, moduleName : "",
deviceId : null, moduleMsgCode : "",
}; };
this.resetForm("form"); this.resetForm("form");
}, },
......
...@@ -13,31 +13,9 @@ ...@@ -13,31 +13,9 @@
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "DeviceModule", name: "DeviceModule",
props: {
queryIn: {
type: Object,
default: null,
},
},
components: {dialogShow }, components: {dialogShow },
mixins: [table], mixins: [table],
created() { created() {
console.log("queryIn module:", this.queryIn);
//this.config.addQuery = { deviceId, deviceType };
if (this.queryIn.deviceId) {
this.query["deviceId"] = this.queryIn.deviceId;
}
this.pageInfo.list = "/device/module/list";
this.pageInfo.del = "/device/module/delete";
this.pageInfo.add = "/device/module/add";
this.pageInfo.edit = "/device/module/edit";
this.pageInfo.view = "/device/module/view";
console.log("pageInfo",this.pageInfo)
}, },
methods: { methods: {
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field label="模块ID" prop="moduleId" v-model="form.moduleId" placeholder="请输入模块ID"/> <Field label="模块名称" prop="moduleName" v-model="form.moduleName" type="textarea" placeholder="请输入模块名称"/>
<Field label="模块消息编码" prop="moduleMsgCode" v-model="form.moduleMsgCode" placeholder="请输入模块消息编码"/>
<Field label="所属设备" prop="deviceId" v-model="form.deviceId" placeholder="请输入所属设备"/>
<Field label="调用次数" prop="useNum" v-model="form.useNum" placeholder="请输入调用次数"/> <Field label="调用次数" prop="useNum" v-model="form.useNum" placeholder="请输入调用次数"/>
</el-row> </el-row>
...@@ -36,8 +38,9 @@ ...@@ -36,8 +38,9 @@
], ],
// 表单校验 // 表单校验
rules: { rules: {
createTime: [ moduleName: [
{required: true,message: "请选择创建时间" }, {required: true,message: "请输入模块名称", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
], ],
} }
}; };
...@@ -88,7 +91,9 @@ ...@@ -88,7 +91,9 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
moduleId : null, moduleName : "",
moduleMsgCode : null,
deviceId : null,
useNum : null, useNum : null,
}; };
this.resetForm("form"); this.resetForm("form");
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</template> </template>
<script> <script>
import form from "@/assets/mixins/form"; import form from "@/assets/mixins/formdialog";
export default { export default {
mixins: [form], mixins: [form],
data() { data() {
...@@ -82,6 +82,7 @@ export default { ...@@ -82,6 +82,7 @@ export default {
paramKey: [{ required: true, message: "请输入参数键", trigger: "blur" }], paramKey: [{ required: true, message: "请输入参数键", trigger: "blur" }],
paramValue: [{ required: true, message: "请输入参数值", trigger: "blur" }], paramValue: [{ required: true, message: "请输入参数值", trigger: "blur" }],
}, },
// urls:{list: "/para/file/list"}
}; };
}, },
......
...@@ -9,8 +9,8 @@ import java.util.Map; ...@@ -9,8 +9,8 @@ import java.util.Map;
* @author zxfei * @author zxfei
*/ */
public enum LogTypeEnum { public enum LogTypeEnum {
上报事件(0, "上报事件"), 上报事件(0, "上"),
下发服务(1, "下发服务"); 下发服务(1, "下");
private Integer value; private Integer value;
private String desc; private String desc;
......
...@@ -181,7 +181,8 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi ...@@ -181,7 +181,8 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
deviceLogEntity.initAttrValue(); deviceLogEntity.initAttrValue();
deviceLogEntity.setDeviceId(deviceEntity.getId()); deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName()); deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceNum(deviceEntity.getDeviceCode()); deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(queueMsg.getHeaders().getData().get(MESSAGETYPE));
deviceLogEntity.setContent(JSONObject.toJSONString(deviceReq)); deviceLogEntity.setContent(JSONObject.toJSONString(deviceReq));
deviceLogEntity.setLogType(LogTypeEnum.上报事件.getValue()); deviceLogEntity.setLogType(LogTypeEnum.上报事件.getValue());
deviceLogEntity.setCreateUserId(1L); deviceLogEntity.setCreateUserId(1L);
......
...@@ -12,9 +12,10 @@ import com.mortals.xhx.common.code.DeviceOnlineStatusEnum; ...@@ -12,9 +12,10 @@ import com.mortals.xhx.common.code.DeviceOnlineStatusEnum;
import com.mortals.xhx.common.code.DeviceMethodEnum; import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum; import com.mortals.xhx.common.code.DeviceStatusEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.module.device.model.DeviceLogEntity; import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.model.DeviceLogQuery;
import com.mortals.xhx.module.device.service.DeviceLogService; import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceModuleService;
import com.mortals.xhx.module.device.service.DeviceModuleUseService;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.model.PlatformEntity; import com.mortals.xhx.module.platform.model.PlatformEntity;
import com.mortals.xhx.module.platform.service.PlatformService; import com.mortals.xhx.module.platform.service.PlatformService;
...@@ -26,6 +27,9 @@ import org.springframework.stereotype.Service; ...@@ -26,6 +27,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 设备状态任务 * 设备状态任务
...@@ -41,22 +45,88 @@ public class DeviceStatTaskImpl implements ITaskExcuteService { ...@@ -41,22 +45,88 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Autowired
private DeviceLogService deviceLogService; private DeviceLogService deviceLogService;
@Autowired
private DeviceModuleUseService deviceModuleUseService;
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired @Autowired
private ProductService productService; private ProductService productService;
@Autowired @Autowired
private PlatformService platformService; private PlatformService platformService;
@Autowired
private DeviceModuleService moduleService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.debug("设备状态统计,开始执行"); log.debug("设备统计,开始执行");
doDeviceModuleUse();
//doDeviceUpOrDown(); //doDeviceUpOrDown();
//doDeviceLogDel(); //doDeviceLogDel();
log.debug("设备状态统计,结束执行"); log.debug("设备统计,结束执行");
}
/**
* 统计设备模块使用率
*/
private void doDeviceModuleUse() {
Map<String, DeviceModuleEntity> moduleMap = moduleService.find(new DeviceModuleQuery()).stream().collect(Collectors.toMap(x -> x.getModuleMsgCode(), y -> y, (o, n) -> n));
try {
// TODO: 2022/7/2 根据每个设备单独查询统计 计算数据量会减少
List<DeviceModuleUseEntity> moduleUseEntityList = deviceService.getCacheList().stream().flatMap(device -> {
//查询当前设备日志
List<DeviceLogEntity> deviceLogList = deviceLogService.find(new DeviceLogQuery().deviceId(device.getId()));
//分组统计每个模块头使用率
Map<String, Long> modelCollect = deviceLogList.parallelStream().collect(Collectors.groupingBy(DeviceLogEntity::getMessageHead, Collectors.counting()));
return modelCollect.entrySet().stream().map(item -> {
if (moduleMap.containsKey(item.getKey())) {
DeviceModuleUseEntity deviceModuleUseEntity = new DeviceModuleUseEntity();
deviceModuleUseEntity.initAttrValue();
DeviceModuleEntity deviceModuleEntity = moduleMap.get(item.getKey());
deviceModuleUseEntity.setDeviceId(device.getId());
deviceModuleUseEntity.setModuleMsgCode(deviceModuleEntity.getModuleMsgCode());
deviceModuleUseEntity.setModuleName(deviceModuleEntity.getModuleName());
deviceModuleUseEntity.setUseNum(item.getValue());
deviceModuleUseEntity.setCreateUserId(1L);
deviceModuleUseEntity.setCreateTime(new Date());
return deviceModuleUseEntity;
}
return null;
}).filter(f -> f != null);
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(moduleUseEntityList)) {
//遍历,更新统计数据表 标识 设备id与消息头
Map<String, DeviceModuleUseEntity> collect = deviceModuleUseService.find(new DeviceModuleUseQuery()).stream().collect(Collectors.toMap(x -> x.getDeviceId() + "#" + x.getModuleMsgCode(), y -> y, (o, n) -> n));
moduleUseEntityList.stream().forEach(mudule -> {
String key = mudule.getDeviceId() + "#" + mudule.getModuleMsgCode();
if (collect.containsKey(key)) {
//更新
DeviceModuleUseEntity deviceModuleUseEntity = collect.get(key);
mudule.setId(deviceModuleUseEntity.getId());
mudule.setUpdateTime(new Date());
mudule.setUpdateUserId(1L);
deviceModuleUseService.update(mudule, null);
} else {
//新增
deviceModuleUseService.save(mudule, null);
}
});
}
} catch (Exception e) {
log.error("更新任务异常,结束执行", e);
}
} }
/** /**
* 统计更新设备状态 * 统计更新设备状态
*/ */
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
* 设备模块信息 DAO接口 * 设备模块信息 DAO接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
public interface DeviceModuleDao extends ICRUDDao<DeviceModuleEntity,Long>{ public interface DeviceModuleDao extends ICRUDDao<DeviceModuleEntity,Long>{
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
* 设备模块使用频率 DAO接口 * 设备模块使用频率 DAO接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
public interface DeviceModuleUseDao extends ICRUDDao<DeviceModuleUseEntity,Long>{ public interface DeviceModuleUseDao extends ICRUDDao<DeviceModuleUseEntity,Long>{
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
* 设备模块信息DaoImpl DAO接口 * 设备模块信息DaoImpl DAO接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@Repository("deviceModuleDao") @Repository("deviceModuleDao")
public class DeviceModuleDaoImpl extends BaseCRUDDaoMybatis<DeviceModuleEntity,Long> implements DeviceModuleDao { public class DeviceModuleDaoImpl extends BaseCRUDDaoMybatis<DeviceModuleEntity,Long> implements DeviceModuleDao {
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
* 设备模块使用频率DaoImpl DAO接口 * 设备模块使用频率DaoImpl DAO接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@Repository("deviceModuleUseDao") @Repository("deviceModuleUseDao")
public class DeviceModuleUseDaoImpl extends BaseCRUDDaoMybatis<DeviceModuleUseEntity,Long> implements DeviceModuleUseDao { public class DeviceModuleUseDaoImpl extends BaseCRUDDaoMybatis<DeviceModuleUseEntity,Long> implements DeviceModuleUseDao {
......
...@@ -7,124 +7,142 @@ import com.mortals.framework.annotation.Excel; ...@@ -7,124 +7,142 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceLogVo; import com.mortals.xhx.module.device.model.vo.DeviceLogVo;
/** /**
* 设备日志实体对象 * 设备日志实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceLogEntity extends DeviceLogVo { public class DeviceLogEntity extends DeviceLogVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* traceId,日志追踪id * traceId,日志追踪id
*/ */
private String traceID; private String traceID;
/** /**
* 设备ID * 设备ID
*/ */
private Long deviceId; private Long deviceId;
/** /**
* 设备编号 * 设备编号
*/ */
private String deviceNum; private String deviceCode;
/** /**
* 设备名称,设置设备名称。 * 设备名称,设置设备名称。
*/ */
private String deviceName; private String deviceName;
/** /**
* 日志类型,(0.上报事件,1.下发服务) * 业务消息头标识
*/ */
private String messageHead;
/**
* 消息类型,(0.上行,1.下行)
*/
private Integer logType; private Integer logType;
/** /**
* 内容 * 内容
*/ */
private String content; private String content;
public DeviceLogEntity(){} public DeviceLogEntity(){}
/** /**
* 获取 traceId,日志追踪id * 获取 traceId,日志追踪id
* @return String * @return String
*/ */
public String getTraceID(){ public String getTraceID(){
return traceID; return traceID;
} }
/** /**
* 设置 traceId,日志追踪id * 设置 traceId,日志追踪id
* @param traceID * @param traceID
*/ */
public void setTraceID(String traceID){ public void setTraceID(String traceID){
this.traceID = traceID; this.traceID = traceID;
} }
/** /**
* 获取 设备ID * 获取 设备ID
* @return Long * @return Long
*/ */
public Long getDeviceId(){ public Long getDeviceId(){
return deviceId; return deviceId;
} }
/** /**
* 设置 设备ID * 设置 设备ID
* @param deviceId * @param deviceId
*/ */
public void setDeviceId(Long deviceId){ public void setDeviceId(Long deviceId){
this.deviceId = deviceId; this.deviceId = deviceId;
} }
/** /**
* 获取 设备编号 * 获取 设备编号
* @return String * @return String
*/ */
public String getDeviceNum(){ public String getDeviceCode(){
return deviceNum; return deviceCode;
} }
/** /**
* 设置 设备编号 * 设置 设备编号
* @param deviceNum * @param deviceCode
*/ */
public void setDeviceNum(String deviceNum){ public void setDeviceCode(String deviceCode){
this.deviceNum = deviceNum; this.deviceCode = deviceCode;
} }
/** /**
* 获取 设备名称,设置设备名称。 * 获取 设备名称,设置设备名称。
* @return String * @return String
*/ */
public String getDeviceName(){ public String getDeviceName(){
return deviceName; return deviceName;
} }
/** /**
* 设置 设备名称,设置设备名称。 * 设置 设备名称,设置设备名称。
* @param deviceName * @param deviceName
*/ */
public void setDeviceName(String deviceName){ public void setDeviceName(String deviceName){
this.deviceName = deviceName; this.deviceName = deviceName;
} }
/** /**
* 获取 日志类型,(0.上报事件,1.下发服务) * 获取 业务消息头标识
* @return Integer * @return String
*/ */
public String getMessageHead(){
return messageHead;
}
/**
* 设置 业务消息头标识
* @param messageHead
*/
public void setMessageHead(String messageHead){
this.messageHead = messageHead;
}
/**
* 获取 消息类型,(0.上行,1.下行)
* @return Integer
*/
public Integer getLogType(){ public Integer getLogType(){
return logType; return logType;
} }
/** /**
* 设置 日志类型,(0.上报事件,1.下发服务) * 设置 消息类型,(0.上行,1.下行)
* @param logType * @param logType
*/ */
public void setLogType(Integer logType){ public void setLogType(Integer logType){
this.logType = logType; this.logType = logType;
} }
/** /**
* 获取 内容 * 获取 内容
* @return String * @return String
*/ */
public String getContent(){ public String getContent(){
return content; return content;
} }
/** /**
* 设置 内容 * 设置 内容
* @param content * @param content
*/ */
public void setContent(String content){ public void setContent(String content){
this.content = content; this.content = content;
} }
...@@ -134,7 +152,7 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -134,7 +152,7 @@ public class DeviceLogEntity extends DeviceLogVo {
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -142,7 +160,7 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -142,7 +160,7 @@ public class DeviceLogEntity extends DeviceLogVo {
if (obj instanceof DeviceLogEntity) { if (obj instanceof DeviceLogEntity) {
DeviceLogEntity tmp = (DeviceLogEntity) obj; DeviceLogEntity tmp = (DeviceLogEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
...@@ -152,8 +170,9 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -152,8 +170,9 @@ public class DeviceLogEntity extends DeviceLogVo {
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",traceID:").append(getTraceID()); sb.append(",traceID:").append(getTraceID());
sb.append(",deviceId:").append(getDeviceId()); sb.append(",deviceId:").append(getDeviceId());
sb.append(",deviceNum:").append(getDeviceNum()); sb.append(",deviceCode:").append(getDeviceCode());
sb.append(",deviceName:").append(getDeviceName()); sb.append(",deviceName:").append(getDeviceName());
sb.append(",messageHead:").append(getMessageHead());
sb.append(",logType:").append(getLogType()); sb.append(",logType:").append(getLogType());
sb.append(",content:").append(getContent()); sb.append(",content:").append(getContent());
return sb.toString(); return sb.toString();
...@@ -161,16 +180,18 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -161,16 +180,18 @@ public class DeviceLogEntity extends DeviceLogVo {
public void initAttrValue(){ public void initAttrValue(){
this.traceID = ""; this.traceID = "";
this.deviceId = null;
this.deviceId = null; this.deviceCode = "";
this.deviceNum = ""; this.deviceName = "";
this.deviceName = ""; this.messageHead = "";
this.logType = null; this.logType = null;
this.content = ""; this.content = "";
} }
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.device.model.vo.DeviceModuleVo; ...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.device.model.vo.DeviceModuleVo;
* 设备模块信息实体对象 * 设备模块信息实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceModuleEntity extends DeviceModuleVo { public class DeviceModuleEntity extends DeviceModuleVo {
...@@ -19,42 +19,42 @@ public class DeviceModuleEntity extends DeviceModuleVo { ...@@ -19,42 +19,42 @@ public class DeviceModuleEntity extends DeviceModuleVo {
/** /**
* 模块名称 * 模块名称
*/ */
private Long moduleId; private String moduleName;
/** /**
* 所属设备 * 模块消息编码,与上报消息头编码一致,唯一
*/ */
private Long deviceId; private String moduleMsgCode;
public DeviceModuleEntity(){} public DeviceModuleEntity(){}
/** /**
* 获取 模块名称 * 获取 模块名称
* @return Long * @return String
*/ */
public Long getModuleId(){ public String getModuleName(){
return moduleId; return moduleName;
} }
/** /**
* 设置 模块名称 * 设置 模块名称
* @param moduleId * @param moduleName
*/ */
public void setModuleId(Long moduleId){ public void setModuleName(String moduleName){
this.moduleId = moduleId; this.moduleName = moduleName;
} }
/** /**
* 获取 所属设备 * 获取 模块消息编码,与上报消息头编码一致,唯一
* @return Long * @return String
*/ */
public Long getDeviceId(){ public String getModuleMsgCode(){
return deviceId; return moduleMsgCode;
} }
/** /**
* 设置 所属设备 * 设置 模块消息编码,与上报消息头编码一致,唯一
* @param deviceId * @param moduleMsgCode
*/ */
public void setDeviceId(Long deviceId){ public void setModuleMsgCode(String moduleMsgCode){
this.deviceId = deviceId; this.moduleMsgCode = moduleMsgCode;
} }
...@@ -78,15 +78,15 @@ public class DeviceModuleEntity extends DeviceModuleVo { ...@@ -78,15 +78,15 @@ public class DeviceModuleEntity extends DeviceModuleVo {
public String toString(){ public String toString(){
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",moduleId:").append(getModuleId()); sb.append(",moduleName:").append(getModuleName());
sb.append(",deviceId:").append(getDeviceId()); sb.append(",moduleMsgCode:").append(getModuleMsgCode());
return sb.toString(); return sb.toString();
} }
public void initAttrValue(){ public void initAttrValue(){
this.moduleId = null; this.moduleName = "";
this.deviceId = null; this.moduleMsgCode = "";
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleEntity; ...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleEntity;
* 设备模块信息查询对象 * 设备模块信息查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceModuleQuery extends DeviceModuleEntity { public class DeviceModuleQuery extends DeviceModuleEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -21,29 +21,11 @@ public class DeviceModuleQuery extends DeviceModuleEntity { ...@@ -21,29 +21,11 @@ public class DeviceModuleQuery extends DeviceModuleEntity {
/** 主键ID,主键,自增长列表 */ /** 主键ID,主键,自增长列表 */
private List <Long> idList; private List <Long> idList;
/** 开始 模块名称 */ /** 模块名称 */
private Long moduleIdStart; private List<String> moduleNameList;
/** 结束 模块名称 */ /** 模块消息编码,与上报消息头编码一致,唯一 */
private Long moduleIdEnd; private List<String> moduleMsgCodeList;
/** 增加 模块名称 */
private Long moduleIdIncrement;
/** 模块名称列表 */
private List <Long> moduleIdList;
/** 开始 所属设备 */
private Long deviceIdStart;
/** 结束 所属设备 */
private Long deviceIdEnd;
/** 增加 所属设备 */
private Long deviceIdIncrement;
/** 所属设备列表 */
private List <Long> deviceIdList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -141,134 +123,36 @@ public class DeviceModuleQuery extends DeviceModuleEntity { ...@@ -141,134 +123,36 @@ public class DeviceModuleQuery extends DeviceModuleEntity {
this.idList = idList; this.idList = idList;
} }
/**
* 获取 开始 模块名称
* @return moduleIdStart
*/
public Long getModuleIdStart(){
return this.moduleIdStart;
}
/**
* 设置 开始 模块名称
* @param moduleIdStart
*/
public void setModuleIdStart(Long moduleIdStart){
this.moduleIdStart = moduleIdStart;
}
/**
* 获取 结束 模块名称
* @return $moduleIdEnd
*/
public Long getModuleIdEnd(){
return this.moduleIdEnd;
}
/**
* 设置 结束 模块名称
* @param moduleIdEnd
*/
public void setModuleIdEnd(Long moduleIdEnd){
this.moduleIdEnd = moduleIdEnd;
}
/**
* 获取 增加 模块名称
* @return moduleIdIncrement
*/
public Long getModuleIdIncrement(){
return this.moduleIdIncrement;
}
/**
* 设置 增加 模块名称
* @param moduleIdIncrement
*/
public void setModuleIdIncrement(Long moduleIdIncrement){
this.moduleIdIncrement = moduleIdIncrement;
}
/** /**
* 获取 模块名称 * 获取 模块名称
* @return moduleIdList * @return moduleNameList
*/ */
public List<Long> getModuleIdList(){ public List<String> getModuleNameList(){
return this.moduleIdList; return this.moduleNameList;
} }
/** /**
* 设置 模块名称 * 设置 模块名称
* @param moduleIdList * @param moduleNameList
*/
public void setModuleIdList(List<Long> moduleIdList){
this.moduleIdList = moduleIdList;
}
/**
* 获取 开始 所属设备
* @return deviceIdStart
*/ */
public Long getDeviceIdStart(){ public void setModuleNameList(List<String> moduleNameList){
return this.deviceIdStart; this.moduleNameList = moduleNameList;
} }
/**
* 设置 开始 所属设备
* @param deviceIdStart
*/
public void setDeviceIdStart(Long deviceIdStart){
this.deviceIdStart = deviceIdStart;
}
/** /**
* 获取 结束 所属设备 * 获取 模块消息编码,与上报消息头编码一致,唯一
* @return $deviceIdEnd * @return moduleMsgCodeList
*/ */
public Long getDeviceIdEnd(){ public List<String> getModuleMsgCodeList(){
return this.deviceIdEnd; return this.moduleMsgCodeList;
} }
/** /**
* 设置 结束 所属设备 * 设置 模块消息编码,与上报消息头编码一致,唯一
* @param deviceIdEnd * @param moduleMsgCodeList
*/ */
public void setDeviceIdEnd(Long deviceIdEnd){ public void setModuleMsgCodeList(List<String> moduleMsgCodeList){
this.deviceIdEnd = deviceIdEnd; this.moduleMsgCodeList = moduleMsgCodeList;
} }
/**
* 获取 增加 所属设备
* @return deviceIdIncrement
*/
public Long getDeviceIdIncrement(){
return this.deviceIdIncrement;
}
/**
* 设置 增加 所属设备
* @param deviceIdIncrement
*/
public void setDeviceIdIncrement(Long deviceIdIncrement){
this.deviceIdIncrement = deviceIdIncrement;
}
/**
* 获取 所属设备
* @return deviceIdList
*/
public List<Long> getDeviceIdList(){
return this.deviceIdList;
}
/**
* 设置 所属设备
* @param deviceIdList
*/
public void setDeviceIdList(List<Long> deviceIdList){
this.deviceIdList = deviceIdList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -442,95 +326,43 @@ public class DeviceModuleQuery extends DeviceModuleEntity { ...@@ -442,95 +326,43 @@ public class DeviceModuleQuery extends DeviceModuleEntity {
return this; return this;
} }
/**
* 设置 模块名称
* @param moduleId
*/
public DeviceModuleQuery moduleId(Long moduleId){
setModuleId(moduleId);
return this;
}
/**
* 设置 开始 模块名称
* @param moduleIdStart
*/
public DeviceModuleQuery moduleIdStart(Long moduleIdStart){
this.moduleIdStart = moduleIdStart;
return this;
}
/**
* 设置 结束 模块名称
* @param moduleIdEnd
*/
public DeviceModuleQuery moduleIdEnd(Long moduleIdEnd){
this.moduleIdEnd = moduleIdEnd;
return this;
}
/** /**
* 设置 增加 模块名称 * 设置 模块名称
* @param moduleIdIncrement * @param moduleName
*/ */
public DeviceModuleQuery moduleIdIncrement(Long moduleIdIncrement){ public DeviceModuleQuery moduleName(String moduleName){
this.moduleIdIncrement = moduleIdIncrement; setModuleName(moduleName);
return this; return this;
} }
/** /**
* 设置 模块名称 * 设置 模块名称
* @param moduleIdList * @param moduleNameList
*/
public DeviceModuleQuery moduleIdList(List<Long> moduleIdList){
this.moduleIdList = moduleIdList;
return this;
}
/**
* 设置 所属设备
* @param deviceId
*/
public DeviceModuleQuery deviceId(Long deviceId){
setDeviceId(deviceId);
return this;
}
/**
* 设置 开始 所属设备
* @param deviceIdStart
*/ */
public DeviceModuleQuery deviceIdStart(Long deviceIdStart){ public DeviceModuleQuery moduleNameList(List<String> moduleNameList){
this.deviceIdStart = deviceIdStart; this.moduleNameList = moduleNameList;
return this; return this;
} }
/**
* 设置 结束 所属设备
* @param deviceIdEnd
*/
public DeviceModuleQuery deviceIdEnd(Long deviceIdEnd){
this.deviceIdEnd = deviceIdEnd;
return this;
}
/** /**
* 设置 增加 所属设备 * 设置 模块消息编码,与上报消息头编码一致,唯一
* @param deviceIdIncrement * @param moduleMsgCode
*/ */
public DeviceModuleQuery deviceIdIncrement(Long deviceIdIncrement){ public DeviceModuleQuery moduleMsgCode(String moduleMsgCode){
this.deviceIdIncrement = deviceIdIncrement; setModuleMsgCode(moduleMsgCode);
return this; return this;
} }
/** /**
* 设置 所属设备 * 设置 模块消息编码,与上报消息头编码一致,唯一
* @param deviceIdList * @param moduleMsgCodeList
*/ */
public DeviceModuleQuery deviceIdList(List<Long> deviceIdList){ public DeviceModuleQuery moduleMsgCodeList(List<String> moduleMsgCodeList){
this.deviceIdList = deviceIdList; this.moduleMsgCodeList = moduleMsgCodeList;
return this; return this;
} }
/** /**
......
...@@ -7,52 +7,88 @@ import com.mortals.framework.annotation.Excel; ...@@ -7,52 +7,88 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceModuleUseVo; import com.mortals.xhx.module.device.model.vo.DeviceModuleUseVo;
/** /**
* 设备模块使用频率实体对象 * 设备模块使用频率实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceModuleUseEntity extends DeviceModuleUseVo { public class DeviceModuleUseEntity extends DeviceModuleUseVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 模块ID * 模块名称
*/ */
private Long moduleId; private String moduleName;
/** /**
* 调用次数 * 模块消息编码
*/ */
private String moduleMsgCode;
/**
* 所属设备
*/
private Long deviceId;
/**
* 调用次数
*/
private Long useNum; private Long useNum;
public DeviceModuleUseEntity(){} public DeviceModuleUseEntity(){}
/** /**
* 获取 模块ID * 获取 模块名称
* @return Long * @return String
*/ */
public Long getModuleId(){ public String getModuleName(){
return moduleId; return moduleName;
}
/**
* 设置 模块名称
* @param moduleName
*/
public void setModuleName(String moduleName){
this.moduleName = moduleName;
}
/**
* 获取 模块消息编码
* @return String
*/
public String getModuleMsgCode(){
return moduleMsgCode;
} }
/** /**
* 设置 模块ID * 设置 模块消息编码
* @param moduleId * @param moduleMsgCode
*/ */
public void setModuleId(Long moduleId){ public void setModuleMsgCode(String moduleMsgCode){
this.moduleId = moduleId; this.moduleMsgCode = moduleMsgCode;
} }
/** /**
* 获取 调用次数 * 获取 所属设备
* @return Long * @return Long
*/ */
public Long getDeviceId(){
return deviceId;
}
/**
* 设置 所属设备
* @param deviceId
*/
public void setDeviceId(Long deviceId){
this.deviceId = deviceId;
}
/**
* 获取 调用次数
* @return Long
*/
public Long getUseNum(){ public Long getUseNum(){
return useNum; return useNum;
} }
/** /**
* 设置 调用次数 * 设置 调用次数
* @param useNum * @param useNum
*/ */
public void setUseNum(Long useNum){ public void setUseNum(Long useNum){
this.useNum = useNum; this.useNum = useNum;
} }
...@@ -62,7 +98,7 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo { ...@@ -62,7 +98,7 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo {
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -70,7 +106,7 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo { ...@@ -70,7 +106,7 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo {
if (obj instanceof DeviceModuleUseEntity) { if (obj instanceof DeviceModuleUseEntity) {
DeviceModuleUseEntity tmp = (DeviceModuleUseEntity) obj; DeviceModuleUseEntity tmp = (DeviceModuleUseEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
...@@ -78,15 +114,21 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo { ...@@ -78,15 +114,21 @@ public class DeviceModuleUseEntity extends DeviceModuleUseVo {
public String toString(){ public String toString(){
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",moduleId:").append(getModuleId()); sb.append(",moduleName:").append(getModuleName());
sb.append(",moduleMsgCode:").append(getModuleMsgCode());
sb.append(",deviceId:").append(getDeviceId());
sb.append(",useNum:").append(getUseNum()); sb.append(",useNum:").append(getUseNum());
return sb.toString(); return sb.toString();
} }
public void initAttrValue(){ public void initAttrValue(){
this.moduleId = null; this.moduleName = "";
this.moduleMsgCode = "";
this.deviceId = null;
this.useNum = null; this.useNum = null;
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.device.model.vo; package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity; import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity;
import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -9,6 +11,12 @@ import java.util.List; ...@@ -9,6 +11,12 @@ import java.util.List;
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-01
*/ */
@Data
public class DeviceAlarmInfoVo extends BaseEntityLong { public class DeviceAlarmInfoVo extends BaseEntityLong {
/** 开始 告警时间 */
private String alarmTimeStart;
/** 结束 告警时间 */
private String alarmTimeEnd;
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import java.util.List; ...@@ -7,7 +7,7 @@ import java.util.List;
* 设备模块使用频率视图对象 * 设备模块使用频率视图对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceModuleUseVo extends BaseEntityLong { public class DeviceModuleUseVo extends BaseEntityLong {
......
...@@ -7,7 +7,7 @@ import java.util.List; ...@@ -7,7 +7,7 @@ import java.util.List;
* 设备模块信息视图对象 * 设备模块信息视图对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-02
*/ */
public class DeviceModuleVo extends BaseEntityLong { public class DeviceModuleVo extends BaseEntityLong {
......
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleEntity;
* 设备模块信息 service接口 * 设备模块信息 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
public interface DeviceModuleService extends ICRUDService<DeviceModuleEntity,Long>{ public interface DeviceModuleService extends ICRUDService<DeviceModuleEntity,Long>{
......
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleUseEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceModuleUseEntity;
* 设备模块使用频率 service接口 * 设备模块使用频率 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
public interface DeviceModuleUseService extends ICRUDService<DeviceModuleUseEntity,Long>{ public interface DeviceModuleUseService extends ICRUDService<DeviceModuleUseEntity,Long>{
......
...@@ -9,7 +9,7 @@ import com.mortals.xhx.module.device.service.DeviceModuleService; ...@@ -9,7 +9,7 @@ import com.mortals.xhx.module.device.service.DeviceModuleService;
* 设备模块信息 service实现 * 设备模块信息 service实现
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@Service("deviceModuleService") @Service("deviceModuleService")
public class DeviceModuleServiceImpl extends AbstractCRUDServiceImpl<DeviceModuleDao, DeviceModuleEntity, Long> implements DeviceModuleService { public class DeviceModuleServiceImpl extends AbstractCRUDServiceImpl<DeviceModuleDao, DeviceModuleEntity, Long> implements DeviceModuleService {
......
...@@ -9,7 +9,7 @@ import com.mortals.xhx.module.device.service.DeviceModuleUseService; ...@@ -9,7 +9,7 @@ import com.mortals.xhx.module.device.service.DeviceModuleUseService;
* 设备模块使用频率 service实现 * 设备模块使用频率 service实现
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@Service("deviceModuleUseService") @Service("deviceModuleUseService")
public class DeviceModuleUseServiceImpl extends AbstractCRUDServiceImpl<DeviceModuleUseDao, DeviceModuleUseEntity, Long> implements DeviceModuleUseService { public class DeviceModuleUseServiceImpl extends AbstractCRUDServiceImpl<DeviceModuleUseDao, DeviceModuleUseEntity, Long> implements DeviceModuleUseService {
......
...@@ -4,35 +4,41 @@ import com.mortals.framework.model.Context; ...@@ -4,35 +4,41 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity; import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceAlarmInfoService; import com.mortals.xhx.module.device.service.DeviceAlarmInfoService;
import com.mortals.xhx.module.device.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* * 设备告警日志
* 设备告警日志 *
* * @author zxfei
* @author zxfei * @date 2022-06-27
* @date 2022-06-27 */
*/
@RestController @RestController
@RequestMapping("device/alarm/info") @RequestMapping("device/alarm/info")
public class DeviceAlarmInfoController extends BaseCRUDJsonBodyMappingController<DeviceAlarmInfoService,DeviceAlarmInfoEntity,Long> { public class DeviceAlarmInfoController extends BaseCRUDJsonBodyMappingController<DeviceAlarmInfoService, DeviceAlarmInfoEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private DeviceService deviceService;
public DeviceAlarmInfoController(){ public DeviceAlarmInfoController() {
super.setModuleDesc( "设备告警日志"); super.setModuleDesc("设备告警日志");
} }
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "alarmType", paramService.getParamBySecondOrganize("DeviceAlarmInfo","alarmType")); this.addDict(model, "alarmType", paramService.getParamBySecondOrganize("DeviceAlarmInfo", "alarmType"));
this.addDict(model, "alarmLevel", paramService.getParamBySecondOrganize("DeviceAlarmInfo","alarmLevel")); this.addDict(model, "alarmLevel", paramService.getParamBySecondOrganize("DeviceAlarmInfo", "alarmLevel"));
this.addDict(model, "alarmStatus", paramService.getParamBySecondOrganize("DeviceAlarmInfo","alarmStatus")); this.addDict(model, "alarmStatus", paramService.getParamBySecondOrganize("DeviceAlarmInfo", "alarmStatus"));
this.addDict(model, "alarmDevice", deviceService.find(new DeviceQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeviceName())));
super.init(model, context); super.init(model, context);
} }
......
package com.mortals.xhx.module.device.web; package com.mortals.xhx.module.device.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.device.model.DeviceModuleEntity;
import com.mortals.xhx.module.device.service.DeviceModuleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.device.model.DeviceModuleEntity;
import com.mortals.xhx.module.device.service.DeviceModuleService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/** /**
* *
* 设备模块信息 * 设备模块信息
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@RestController @RestController
@RequestMapping("device/module") @RequestMapping("device/module")
......
package com.mortals.xhx.module.device.web; package com.mortals.xhx.module.device.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.device.model.DeviceModuleUseEntity;
import com.mortals.xhx.module.device.service.DeviceModuleUseService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.device.model.DeviceModuleUseEntity;
import com.mortals.xhx.module.device.service.DeviceModuleUseService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/** /**
* *
* 设备模块使用频率 * 设备模块使用频率
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-07-02
*/ */
@RestController @RestController
@RequestMapping("device/module/use") @RequestMapping("device/module/use")
......
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