diff --git a/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcDataReceiveController.java b/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcDataReceiveController.java new file mode 100644 index 0000000..4219e1b --- /dev/null +++ b/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcDataReceiveController.java @@ -0,0 +1,32 @@ +package com.inspur.web.controller.ipc; + +import com.inspur.common.core.domain.AjaxResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/ipc/dataReceive") +public class IpcDataReceiveController { + /** + * 接收PLC数据 + */ + @PostMapping("/plcData") + public AjaxResult plcData(@RequestBody Map> map) { + System.out.println(map.toString()); + return AjaxResult.success(1); + } + + /** + * 接收温振传感器数据 + */ + @PostMapping("/sensorData") + public AjaxResult sensorData(@RequestBody Map> map) { + System.out.println(map.toString()); + return AjaxResult.success(1); + } +} diff --git a/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcFaultTreeConfigController.java b/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcFaultTreeConfigController.java new file mode 100644 index 0000000..3d074b7 --- /dev/null +++ b/tzipc-server/tzipc-admin/src/main/java/com/inspur/web/controller/ipc/IpcFaultTreeConfigController.java @@ -0,0 +1,112 @@ +package com.inspur.web.controller.ipc; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.inspur.common.annotation.Log; +import com.inspur.common.core.controller.BaseController; +import com.inspur.common.core.domain.AjaxResult; +import com.inspur.common.enums.BusinessType; +import com.inspur.ipc.domain.IpcFaultTreeConfig; +import com.inspur.ipc.service.IIpcFaultTreeConfigService; +import com.inspur.common.utils.poi.ExcelUtil; + +/** + * 故障树配置Controller + * + * @author inspur + * @date 2024-04-02 + */ +@RestController +@RequestMapping("/ipc/faultTreeConfig") +public class IpcFaultTreeConfigController extends BaseController +{ + @Autowired + private IIpcFaultTreeConfigService ipcFaultTreeConfigService; + + /** + * 查询故障树配置列表 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:list')") + @GetMapping("/list") + public AjaxResult list(IpcFaultTreeConfig ipcFaultTreeConfig) + { + List list = ipcFaultTreeConfigService.selectIpcFaultTreeConfigList(ipcFaultTreeConfig); + return AjaxResult.success(list); + } + + /** + * 导出故障树配置列表 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:export')") + @Log(title = "故障树配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, IpcFaultTreeConfig ipcFaultTreeConfig) + { + List list = ipcFaultTreeConfigService.selectIpcFaultTreeConfigList(ipcFaultTreeConfig); + ExcelUtil util = new ExcelUtil(IpcFaultTreeConfig.class); + util.exportExcel(response, list, "故障树配置数据"); + } + + /** + * 获取故障树配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:query')") + @GetMapping(value = "/{nodeId}") + public AjaxResult getInfo(@PathVariable("nodeId") Long nodeId) + { + return AjaxResult.success(ipcFaultTreeConfigService.selectIpcFaultTreeConfigByNodeId(nodeId)); + } + + /** + * 校验是否存在子节点 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:query')") + @GetMapping(value = "/hasChild/{nodeId}") + public AjaxResult hasChild(@PathVariable("nodeId") Long nodeId) + { + return AjaxResult.success(ipcFaultTreeConfigService.hasChild(nodeId)); + } + + /** + * 新增故障树配置 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:add')") + @Log(title = "故障树配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody IpcFaultTreeConfig ipcFaultTreeConfig) + { + return toAjax(ipcFaultTreeConfigService.insertIpcFaultTreeConfig(ipcFaultTreeConfig)); + } + + /** + * 修改故障树配置 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:edit')") + @Log(title = "故障树配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody IpcFaultTreeConfig ipcFaultTreeConfig) + { + return toAjax(ipcFaultTreeConfigService.updateIpcFaultTreeConfig(ipcFaultTreeConfig)); + } + + /** + * 删除故障树配置 + */ + @PreAuthorize("@ss.hasPermi('ipc:faultTreeConfig:remove')") + @Log(title = "故障树配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{nodeIds}") + public AjaxResult remove(@PathVariable Long[] nodeIds) + { + return toAjax(ipcFaultTreeConfigService.deleteIpcFaultTreeConfigByNodeIds(nodeIds)); + } +} diff --git a/tzipc-server/tzipc-framework/src/main/java/com/inspur/framework/config/SecurityConfig.java b/tzipc-server/tzipc-framework/src/main/java/com/inspur/framework/config/SecurityConfig.java index d4ccc58..d13b4bb 100644 --- a/tzipc-server/tzipc-framework/src/main/java/com/inspur/framework/config/SecurityConfig.java +++ b/tzipc-server/tzipc-framework/src/main/java/com/inspur/framework/config/SecurityConfig.java @@ -109,7 +109,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage","/data/show/byPart/**").anonymous() + .antMatchers("/login", "/register", "/captchaImage").anonymous() + // 数据接收接口,允许匿名访问 + .antMatchers("/ipc/dataReceive/plcData","/ipc/dataReceive/sensorData").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java index 7467b9b..f5f106f 100644 --- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java @@ -83,6 +83,12 @@ public class IpcAlarmRecord extends BaseEntity { @Excel(name = "报警描述") private String alarmDetail; + /** + * 报警规则id + */ + @Excel(name = "报警规则id") + private Long ruleConfigId; + /** * 状态 0 未处理 1 已处理 */ @@ -199,6 +205,14 @@ public class IpcAlarmRecord extends BaseEntity { return alarmDetail; } + public Long getRuleConfigId() { + return ruleConfigId; + } + + public void setRuleConfigId(Long ruleConfigId) { + this.ruleConfigId = ruleConfigId; + } + public void setAlarmStatus(String alarmStatus) { this.alarmStatus = alarmStatus; } @@ -226,7 +240,7 @@ public class IpcAlarmRecord extends BaseEntity { public IpcAlarmRecord() { } - public IpcAlarmRecord(String id, String partKey, String part, String nameKey, String name, String alarmData, String unit, String alarmLevel, String referenceName, String alarmDetail) { + public IpcAlarmRecord(String id, String partKey, String part, String nameKey, String name, String alarmData, String unit, String alarmLevel, String referenceName, String alarmDetail,Long ruleConfigId) { this.id = id; this.partKey = partKey; this.part = part; @@ -237,6 +251,7 @@ public class IpcAlarmRecord extends BaseEntity { this.alarmLevel = alarmLevel; this.referenceName = referenceName; this.alarmDetail = alarmDetail; + this.ruleConfigId = ruleConfigId; } @Override diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRulesConfig.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRulesConfig.java index df01e4a..9609de3 100644 --- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRulesConfig.java +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRulesConfig.java @@ -51,8 +51,8 @@ public class IpcAlarmRulesConfig extends BaseEntity @Excel(name = "规则值2(参考标准为区间时需要)") private BigDecimal referenceValue2; - /** 规则值显示 */ - @Excel(name = "规则值显示") + /** 规则描述 */ + @Excel(name = "规则描述") private String referenceName; /** 判断规则 */ diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcFaultTreeConfig.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcFaultTreeConfig.java new file mode 100644 index 0000000..71ec42e --- /dev/null +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcFaultTreeConfig.java @@ -0,0 +1,205 @@ +package com.inspur.ipc.domain; + +import com.inspur.common.annotation.Excel; +import com.inspur.common.core.domain.TreeEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 故障树配置对象 ipc_fault_tree_config + * + * @author inspur + * @date 2024-04-02 + */ +public class IpcFaultTreeConfig extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** 节点id */ + private Long nodeId; + + /** 部门名称 */ + @Excel(name = "节点名称") + private String nodeName; + + /** 所属部位 */ + @Excel(name = "所属部位") + private String partKey; + + /** 规则id */ + @Excel(name = "规则id") + private Long alarmRuleConfigId; + + /** 规则描述 */ + @Excel(name = "规则描述") + private String alarmRuleConfigDescription; + + /** 节点图标 */ + @Excel(name = "节点图标") + private String iconCls; + + /** 节点形状 */ + @Excel(name = "节点形状") + private String nodeShapeType; + + /** 节点默认颜色 */ + @Excel(name = "节点默认颜色") + private String nodeDefaultColor; + + /** 节点报警颜色 */ + @Excel(name = "节点报警颜色") + private String nodeAlarmColor; + + /** 是否叶子节点 */ + @Excel(name = "是否叶子节点") + private String isLeaf; + + /** 是否报警 */ + @Excel(name = "是否报警") + private String isAlarm; + + /** 节点状态(0正常 1停用) */ + @Excel(name = "节点状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public void setNodeId(Long nodeId) + { + this.nodeId = nodeId; + } + + public Long getNodeId() + { + return nodeId; + } + public void setNodeName(String nodeName) + { + this.nodeName = nodeName; + } + + public String getNodeName() + { + return nodeName; + } + public void setPartKey(String partKey) + { + this.partKey = partKey; + } + + public String getPartKey() + { + return partKey; + } + public void setIconCls(String iconCls) + { + this.iconCls = iconCls; + } + + public String getIconCls() + { + return iconCls; + } + public void setNodeShapeType(String nodeShapeType) + { + this.nodeShapeType = nodeShapeType; + } + + public String getNodeShapeType() + { + return nodeShapeType; + } + public void setNodeDefaultColor(String nodeDefaultColor) + { + this.nodeDefaultColor = nodeDefaultColor; + } + + public String getNodeDefaultColor() + { + return nodeDefaultColor; + } + public void setNodeAlarmColor(String nodeAlarmColor) + { + this.nodeAlarmColor = nodeAlarmColor; + } + + public String getNodeAlarmColor() + { + return nodeAlarmColor; + } + public void setIsAlarm(String isAlarm) + { + this.isAlarm = isAlarm; + } + + public String getIsAlarm() + { + return isAlarm; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + public Long getAlarmRuleConfigId() { + return alarmRuleConfigId; + } + + public void setAlarmRuleConfigId(Long alarmRuleConfigId) { + this.alarmRuleConfigId = alarmRuleConfigId; + } + + public String getAlarmRuleConfigDescription() { + return alarmRuleConfigDescription; + } + + public void setAlarmRuleConfigDescription(String alarmRuleConfigDescription) { + this.alarmRuleConfigDescription = alarmRuleConfigDescription; + } + + public String getIsLeaf() { + return isLeaf; + } + + public void setIsLeaf(String isLeaf) { + this.isLeaf = isLeaf; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("nodeId", getNodeId()) + .append("parentId", getParentId()) + .append("ancestors", getAncestors()) + .append("nodeName", getNodeName()) + .append("orderNum", getOrderNum()) + .append("partKey", getPartKey()) + .append("iconCls", getIconCls()) + .append("nodeShapeType", getNodeShapeType()) + .append("nodeDefaultColor", getNodeDefaultColor()) + .append("nodeAlarmColor", getNodeAlarmColor()) + .append("isAlarm", getIsAlarm()) + .append("status", getStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/mapper/IpcFaultTreeConfigMapper.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/mapper/IpcFaultTreeConfigMapper.java new file mode 100644 index 0000000..81893a6 --- /dev/null +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/mapper/IpcFaultTreeConfigMapper.java @@ -0,0 +1,69 @@ +package com.inspur.ipc.mapper; + +import java.util.List; +import com.inspur.ipc.domain.IpcFaultTreeConfig; + +/** + * 故障树配置Mapper接口 + * + * @author inspur + * @date 2024-04-02 + */ +public interface IpcFaultTreeConfigMapper +{ + /** + * 查询故障树配置 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + public IpcFaultTreeConfig selectIpcFaultTreeConfigByNodeId(Long nodeId); + + /** + * 校验是否存在子节点 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + public int hasChild(Long nodeId); + + /** + * 查询故障树配置列表 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 故障树配置集合 + */ + public List selectIpcFaultTreeConfigList(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 新增故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + public int insertIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 修改故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + public int updateIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 删除故障树配置 + * + * @param nodeId 故障树配置主键 + * @return 结果 + */ + public int deleteIpcFaultTreeConfigByNodeId(Long nodeId); + + /** + * 批量删除故障树配置 + * + * @param nodeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteIpcFaultTreeConfigByNodeIds(Long[] nodeIds); +} diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/IIpcFaultTreeConfigService.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/IIpcFaultTreeConfigService.java new file mode 100644 index 0000000..8071a6c --- /dev/null +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/IIpcFaultTreeConfigService.java @@ -0,0 +1,70 @@ +package com.inspur.ipc.service; + +import java.util.List; +import com.inspur.ipc.domain.IpcFaultTreeConfig; + +/** + * 故障树配置Service接口 + * + * @author inspur + * @date 2024-04-02 + */ +public interface IIpcFaultTreeConfigService +{ + /** + * 查询故障树配置 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + public IpcFaultTreeConfig selectIpcFaultTreeConfigByNodeId(Long nodeId); + + + /** + * 校验是否存在子节点 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + public boolean hasChild(Long nodeId); + + /** + * 查询故障树配置列表 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 故障树配置集合 + */ + public List selectIpcFaultTreeConfigList(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 新增故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + public int insertIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 修改故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + public int updateIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig); + + /** + * 批量删除故障树配置 + * + * @param nodeIds 需要删除的故障树配置主键集合 + * @return 结果 + */ + public int deleteIpcFaultTreeConfigByNodeIds(Long[] nodeIds); + + /** + * 删除故障树配置信息 + * + * @param nodeId 故障树配置主键 + * @return 结果 + */ + public int deleteIpcFaultTreeConfigByNodeId(Long nodeId); +} diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/impl/IpcFaultTreeConfigServiceImpl.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/impl/IpcFaultTreeConfigServiceImpl.java new file mode 100644 index 0000000..acf50c1 --- /dev/null +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/service/impl/IpcFaultTreeConfigServiceImpl.java @@ -0,0 +1,105 @@ +package com.inspur.ipc.service.impl; + +import java.util.List; +import com.inspur.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.inspur.ipc.mapper.IpcFaultTreeConfigMapper; +import com.inspur.ipc.domain.IpcFaultTreeConfig; +import com.inspur.ipc.service.IIpcFaultTreeConfigService; + +/** + * 故障树配置Service业务层处理 + * + * @author inspur + * @date 2024-04-02 + */ +@Service +public class IpcFaultTreeConfigServiceImpl implements IIpcFaultTreeConfigService +{ + @Autowired + private IpcFaultTreeConfigMapper ipcFaultTreeConfigMapper; + + /** + * 查询故障树配置 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + @Override + public IpcFaultTreeConfig selectIpcFaultTreeConfigByNodeId(Long nodeId) + { + return ipcFaultTreeConfigMapper.selectIpcFaultTreeConfigByNodeId(nodeId); + } + /** + * 校验是否存在子节点 + * + * @param nodeId 故障树配置主键 + * @return 故障树配置 + */ + @Override + public boolean hasChild(Long nodeId){ + return ipcFaultTreeConfigMapper.hasChild(nodeId) > 0; + } + /** + * 查询故障树配置列表 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 故障树配置 + */ + @Override + public List selectIpcFaultTreeConfigList(IpcFaultTreeConfig ipcFaultTreeConfig) + { + return ipcFaultTreeConfigMapper.selectIpcFaultTreeConfigList(ipcFaultTreeConfig); + } + + /** + * 新增故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + @Override + public int insertIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig) + { + ipcFaultTreeConfig.setCreateTime(DateUtils.getNowDate()); + return ipcFaultTreeConfigMapper.insertIpcFaultTreeConfig(ipcFaultTreeConfig); + } + + /** + * 修改故障树配置 + * + * @param ipcFaultTreeConfig 故障树配置 + * @return 结果 + */ + @Override + public int updateIpcFaultTreeConfig(IpcFaultTreeConfig ipcFaultTreeConfig) + { + ipcFaultTreeConfig.setUpdateTime(DateUtils.getNowDate()); + return ipcFaultTreeConfigMapper.updateIpcFaultTreeConfig(ipcFaultTreeConfig); + } + + /** + * 批量删除故障树配置 + * + * @param nodeIds 需要删除的故障树配置主键 + * @return 结果 + */ + @Override + public int deleteIpcFaultTreeConfigByNodeIds(Long[] nodeIds) + { + return ipcFaultTreeConfigMapper.deleteIpcFaultTreeConfigByNodeIds(nodeIds); + } + + /** + * 删除故障树配置信息 + * + * @param nodeId 故障树配置主键 + * @return 结果 + */ + @Override + public int deleteIpcFaultTreeConfigByNodeId(Long nodeId) + { + return ipcFaultTreeConfigMapper.deleteIpcFaultTreeConfigByNodeId(nodeId); + } +} diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java index 816d957..c89d6ea 100644 --- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java +++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java @@ -86,7 +86,7 @@ public class IpcUtil { if (judgeAlarm(map.get(rulesConfig.getNameKey()), rulesConfig.getReferenceValue1(), rulesConfig.getReferenceValue2(), rulesConfig.getReferenceCon())) { // 报警数据 map.put("isAlarm", 1); - IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord(IdUtils.fastSimpleUUID(),rulesConfig.getPartKey(), rulesConfig.getPart(), rulesConfig.getNameKey(), rulesConfig.getName(), String.valueOf(map.get(rulesConfig.getNameKey())), rulesConfig.getUnit(), rulesConfig.getAlarmLevel(), rulesConfig.getReferenceName(), rulesConfig.getAlarmDetail()); + IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord(IdUtils.fastSimpleUUID(),rulesConfig.getPartKey(), rulesConfig.getPart(), rulesConfig.getNameKey(), rulesConfig.getName(), String.valueOf(map.get(rulesConfig.getNameKey())), rulesConfig.getUnit(), rulesConfig.getAlarmLevel(), rulesConfig.getReferenceName(), rulesConfig.getAlarmDetail(),rulesConfig.getId()); returnList.add(ipcAlarmRecord); } else { // 正常数据 diff --git a/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml index 6751384..e53fc86 100644 --- a/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml +++ b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml @@ -107,11 +107,11 @@ insert into ipc_alarm_record - (id,part_key,part,name_key,name,alarm_data,unit,alarm_level,alarm_time,reference_name,alarm_detail,alarm_status) + (id,part_key,part,name_key,name,alarm_data,unit,alarm_level,alarm_time,reference_name,alarm_detail,alarm_status,rule_config_id) values (#{item.id}, #{item.partKey}, #{item.part},#{item.nameKey},#{item.name},#{item.alarmData}, #{item.unit}, - #{item.alarmLevel},sysdate(),#{item.referenceName},#{item.alarmDetail},'0') + #{item.alarmLevel},sysdate(),#{item.referenceName},#{item.alarmDetail},'0',#{item.ruleConfigId}) ; diff --git a/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcFaultTreeConfigMapper.xml b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcFaultTreeConfigMapper.xml new file mode 100644 index 0000000..aae1ce1 --- /dev/null +++ b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcFaultTreeConfigMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select node_id, parent_id, ancestors, node_name, order_num, part_key, icon_cls, node_shape_type, node_default_color, node_alarm_color, is_leaf,is_alarm, status, del_flag, create_by, create_time, update_by, update_time,alarm_rule_config_id,alarm_rule_config_description from ipc_fault_tree_config + + + + + + + + + insert into ipc_fault_tree_config + + parent_id, + ancestors, + node_name, + order_num, + part_key, + icon_cls, + node_shape_type, + node_default_color, + node_alarm_color, + is_leaf, + is_alarm, + status, + del_flag, + create_by, + create_time, + update_by, + update_time, + alarm_rule_config_id, + alarm_rule_config_description, + + + #{parentId}, + #{ancestors}, + #{nodeName}, + #{orderNum}, + #{partKey}, + #{iconCls}, + #{nodeShapeType}, + #{nodeDefaultColor}, + #{nodeAlarmColor}, + #{isLeaf}, + #{isAlarm}, + #{status}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{alarmRuleConfigId}, + #{alarmRuleConfigDescription}, + + + + + update ipc_fault_tree_config + + parent_id = #{parentId}, + ancestors = #{ancestors}, + node_name = #{nodeName}, + order_num = #{orderNum}, + part_key = #{partKey}, + icon_cls = #{iconCls}, + node_shape_type = #{nodeShapeType}, + node_default_color = #{nodeDefaultColor}, + node_alarm_color = #{nodeAlarmColor}, + is_leaf = #{isLeaf}, + is_alarm = #{isAlarm}, + status = #{status}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + alarm_rule_config_id = #{alarmRuleConfigId}, + alarm_rule_config_description = #{alarmRuleConfigDescription}, + + where node_id = #{nodeId} + + + + delete from ipc_fault_tree_config where node_id = #{nodeId} + + + + delete from ipc_fault_tree_config where node_id in + + #{nodeId} + + + diff --git a/tzipc-ui/src/api/ipc/faultTreeConfig.js b/tzipc-ui/src/api/ipc/faultTreeConfig.js new file mode 100644 index 0000000..048ee9c --- /dev/null +++ b/tzipc-ui/src/api/ipc/faultTreeConfig.js @@ -0,0 +1,52 @@ +import request from "@/utils/request"; + +// 查询故障树配置列表 +export function listFaultTreeConfig(query) { + return request({ + url: "/ipc/faultTreeConfig/list", + method: "get", + params: query, + }); +} + +// 查询故障树配置详细 +export function getFaultTreeConfig(nodeId) { + return request({ + url: "/ipc/faultTreeConfig/" + nodeId, + method: "get", + }); +} + +// 查询是否有子节点 +export function selectHasChild(nodeId) { + return request({ + url: "/ipc/faultTreeConfig/hasChild/" + nodeId, + method: "get", + }); +} + +// 新增故障树配置 +export function addFaultTreeConfig(data) { + return request({ + url: "/ipc/faultTreeConfig", + method: "post", + data: data, + }); +} + +// 修改故障树配置 +export function updateFaultTreeConfig(data) { + return request({ + url: "/ipc/faultTreeConfig", + method: "put", + data: data, + }); +} + +// 删除故障树配置 +export function delFaultTreeConfig(nodeId) { + return request({ + url: "/ipc/faultTreeConfig/" + nodeId, + method: "delete", + }); +} diff --git a/tzipc-ui/src/views/ipc/faultTree/faultTreeConfig.vue b/tzipc-ui/src/views/ipc/faultTree/faultTreeConfig.vue new file mode 100644 index 0000000..c865c80 --- /dev/null +++ b/tzipc-ui/src/views/ipc/faultTree/faultTreeConfig.vue @@ -0,0 +1,771 @@ + + + \ No newline at end of file diff --git a/tzipc-ui/src/views/ipc/faultTree/faultTreeShow.vue b/tzipc-ui/src/views/ipc/faultTree/faultTreeShow.vue new file mode 100644 index 0000000..87f711a --- /dev/null +++ b/tzipc-ui/src/views/ipc/faultTree/faultTreeShow.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/tzipc-ui/src/views/ipc/faultTree/ruleConfigDialog.vue b/tzipc-ui/src/views/ipc/faultTree/ruleConfigDialog.vue new file mode 100644 index 0000000..ab1ed4c --- /dev/null +++ b/tzipc-ui/src/views/ipc/faultTree/ruleConfigDialog.vue @@ -0,0 +1,198 @@ + + + + + \ No newline at end of file diff --git a/tzipc-ui/src/views/ipc/rulesConfig/index.vue b/tzipc-ui/src/views/ipc/rulesConfig/index.vue index f4e5fb3..6b49101 100644 --- a/tzipc-ui/src/views/ipc/rulesConfig/index.vue +++ b/tzipc-ui/src/views/ipc/rulesConfig/index.vue @@ -72,63 +72,9 @@ >重置 - - - item.id); - this.single = selection.length !== 1; - this.multiple = !selection.length; - }, /** 新增按钮操作 */ handleAdd() { this.reset(); @@ -637,7 +571,7 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const id = row.id || this.ids; + const id = row.id; getConfig(id).then((response) => { this.form = response.data; this.open = true;