Compare commits

...

3 Commits

Author SHA1 Message Date
f589908884 Merge branch 'master' into zjw 2024-09-18 10:10:57 +08:00
24cdb9204e 报警忽略租户 2024-09-14 16:59:22 +08:00
de69f63a22 报警提交维修报告 2024-09-14 16:54:26 +08:00
9 changed files with 352 additions and 3 deletions

View File

@ -97,4 +97,17 @@ public class EquipAlarmDataController {
BeanUtils.toBean(list, EquipAlarmDataRespVO.class));
}
@Operation(summary = "获取报警提交维修工单详情")
@GetMapping("/getSubmitOrderDetails/{alarmId}")
@PreAuthorize("@ss.hasPermission('imt:equip-alarm-data:query')")
public CommonResult<AlarmSubmitOrderDetailsVO> getSubmitOrderDetails(@PathVariable("alarmId") String alarmId) {
return success(equipAlarmDataService.getSubmitOrderDetails(alarmId));
}
@GetMapping("/isSubmitOrder/{alarmId}")
@Operation(summary = "判断报警是否已经提交工单")
public CommonResult<Boolean> isSubmitOrder(@PathVariable("alarmId") String alarmId){
return success(equipAlarmDataService.isSubmitOrder(alarmId));
}
}

View File

@ -0,0 +1,81 @@
package com.inspur.module.system.controller.admin.alarm.vo;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 报警提交维修工单详情
*
* @Author xusd
* @Date 2024/9/14 14:39
**/
@Data
public class AlarmSubmitOrderDetailsVO {
/**
* 设备预警信息主键
*/
private String equipAlarmId;
/**
* 机床设备id
*/
private String equipId;
/**
* 机床设备编号
*/
private String equipNo;
/**
* 设备型号
*/
private String modelName;
/**
* 机床分析状态0正常1磨损中2磨损严重
*/
private Integer equipAnalyseStatus;
/**
* 机床组件id
*/
private String componentId;
/**
* 机床组件名称
*/
private String componentName;
/**
* 机床客户信息id
*/
private String customerId;
/**
* 机床客户名称
*/
private String customerName;
/**
* 报警等级
*/
private Integer alarmLevel;
/**
* 报警类型
*/
private Integer alarmType;
/**
* 首次报警时间
*/
private LocalDateTime firstAlarmTime;
/**
* 最新报警时间
*/
private LocalDateTime latestAlarmTime;
}

View File

@ -48,4 +48,14 @@ public interface EquipAlarmDataMapper extends BaseMapperX<EquipAlarmDataDO> {
*/
List<EquipAlarmDataDO> getEquipAlarmDataByEquipIdAndAlarmType(@Param("equipId") String equipId,
@Param("alarmType") Integer alarmType);
/**
* 获取报警提交维修工单详情
*
* @Author xusd
* @Date 14:42 2024/9/14
* @param alarmId 报警id
* @return com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO
*/
AlarmSubmitOrderDetailsVO getSubmitOrderDetails(@Param("alarmId") String alarmId);
}

View File

@ -57,4 +57,24 @@ public interface EquipAlarmDataService {
* 通过设备id查询设备报警数据
*/
List<EquipAlarmDataDO> getEquipAlarmDataByEquipId(String equipId,Integer alarmType);
/**
* 获取报警提交维修工单详情
*
* @Author xusd
* @Date 14:42 2024/9/14
* @param alarmId 报警id
* @return com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO
*/
AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId);
/**
* 判断报警是否已经提交工单
*
* @Author xusd
* @Date 16:44 2024/9/14
* @param alarmId 报警id
* @return java.lang.Boolean
*/
Boolean isSubmitOrder(String alarmId);
}

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO;
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -36,6 +38,9 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService {
@Resource
private EquipAlarmDataMapper equipAlarmDataMapper;
@Resource
private MaintenanceOrderMapper maintenanceOrderMapper;
@Override
@TenantIgnore
public String createEquipAlarmData(EquipAlarmDataSaveReqVO createReqVO) {
@ -91,4 +96,18 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService {
public List<EquipAlarmDataDO> getEquipAlarmDataByEquipId(String equipId,Integer alarmType) {
return equipAlarmDataMapper.getEquipAlarmDataByEquipIdAndAlarmType(equipId,alarmType);
}
@Override
@TenantIgnore
public AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId) {
return equipAlarmDataMapper.getSubmitOrderDetails(alarmId);
}
@Override
@TenantIgnore
public Boolean isSubmitOrder(String alarmId) {
MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectOne(MaintenanceOrderDO::getAlarmId, alarmId);
return Objects.nonNull(maintenanceOrderDO);
}
}

View File

@ -17,8 +17,24 @@
<result property="componentName" column="component_name" />
</resultMap>
<resultMap id="SubmitOrderDetails" type="com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO">
<result property="equipAlarmId" column="equip_alarm_id" />
<result property="equipId" column="equip_id" />
<result property="componentId" column="component_id" />
<result property="alarmLevel" column="alarm_level" />
<result property="alarmType" column="alarm_type" />
<result property="firstAlarmTime" column="first_alarm_time" />
<result property="latestAlarmTime" column="latest_alarm_time" />
<result property="equipAnalyseStatus" column="equip_analyse_status" />
<result property="customerName" column="customer_name" />
<result property="equipNo" column="equip_no" />
<result property="modelName" column="model_name" />
<result property="componentName" column="component_name" />
<result property="customerId" column="customer_id" />
</resultMap>
<sql id="selectEquipAlarmVo">
select iead.equip_alarm_id, iead.equip_id, iead.component_id, iead.alarm_level, iead.alarm_type, iead.first_alarm_time, iead.latest_alarm_time, iead.status, iead.equip_analyse_status, cui.customer_name, ei.equip_no, imi.model_name, ci.component_name from imt_equip_alarm_data iead
select iead.equip_alarm_id, iead.equip_id, iead.component_id, iead.alarm_level, iead.alarm_type, iead.first_alarm_time, iead.latest_alarm_time, iead.status, iead.equip_analyse_status, cui.customer_name, ei.equip_no, imi.model_name, ci.component_name, cui.customer_id from imt_equip_alarm_data iead
left join imt_equip_info ei on iead.equip_id = ei.equip_id
left join imt_model_info imi on ei.model_id = imi.model_id
left join imt_component_info ci on iead.component_id = ci.component_id
@ -49,4 +65,9 @@
and iead.deleted = '0'
<if test="alarmType != null and alarmType != ''">and iead.alarm_type = #{alarmType}</if>
</select>
<select id="getSubmitOrderDetails" resultMap="SubmitOrderDetails">
<include refid="selectEquipAlarmVo"/>
where iead.equip_alarm_id = #{alarmId}
and iead.deleted = '0'
</select>
</mapper>

View File

@ -51,3 +51,19 @@ export function exportEquipAlarmDataExcel(params) {
responseType: "blob",
});
}
// 获取报警提交维修工单详情
export function getSubmitOrderDetails(alarmId) {
return request({
url: "/imt/equip-alarm-data/getSubmitOrderDetails/" + alarmId,
method: "get",
});
}
// 判断报警是否已经提交工单
export function isSubmitOrder(alarmId) {
return request({
url: "/imt/equip-alarm-data/isSubmitOrder/" + alarmId,
method: "get",
});
}

View File

@ -364,6 +364,7 @@
>
<div class="repair-info">
<el-button
v-if="!showOrderSubmit"
type="success"
@click="handelMaintanence"
>
@ -504,9 +505,10 @@
style="height:500px"
></div>
</el-dialog>
<alarm-submit-maintenance-order-form ref="submitOrderForm"/>
</div>
</template>
<script>
import * as echarts from "echarts";
import * as AlarmDataApi from "@/api/system/alarm/alarmdata";
@ -514,10 +516,13 @@ import * as EquipAlarmDataApi from "@/api/system/alarm/equipalarmdata";
import AlarmDataForm from "./AlarmDataForm.vue";
import { getFieldList } from "@/api/data/query.js";
import { getAlarmRules } from "@/api/system/alarm/alarmrules";
import AlarmSubmitMaintenanceOrderForm
from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue";
var _ = require("lodash");
export default {
name: "AlarmData",
components: {
AlarmSubmitMaintenanceOrderForm,
AlarmDataForm,
},
data() {
@ -593,17 +598,24 @@ export default {
loading: false,
selectedRow: {},
datetimeRange: [],
showOrderSubmit: false,
};
},
created() {
this.getThrList();
this.getTreList();
this.getIsSubmitOrder();
this.customerName = this.$route.query.customerName;
this.modelName = this.$route.query.modelName;
this.equipNo = this.$route.query.equipNo;
this.alarmLevel = this.$route.query.alarmLevel;
},
methods: {
getIsSubmitOrder(){
EquipAlarmDataApi.isSubmitOrder(this.$route.query.equipAlarmId).then(res=>{
this.showOrderSubmit = res.data
})
},
async handleAlarmDataQuery(row) {
//row
this.loading = true;
@ -698,7 +710,9 @@ export default {
/**
* 维修工单
*/
handelMaintanence() {},
handelMaintanence() {
this.$refs.submitOrderForm.open(this.$route.query.equipAlarmId)
},
/**echart表初始化 */
initchart(xData, yData, name, unit) {
let p = new Promise((resolve) => {

View File

@ -0,0 +1,155 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-card class="box-card">
<div slot="header"><span>报警信息</span></div>
<el-form ref="alarmForm" :model="alarmFormData" v-loading="alarmFormLoading" label-width="160px">
<el-row>
<el-col :span="12">
<el-form-item label="机床设备编号:" prop="equipNo">
{{alarmFormData.equipNo}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备型号:" prop="modelName">
{{alarmFormData.modelName}}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="机床组件名称:" prop="componentName">
{{alarmFormData.componentName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="机床客户名称:" prop="customerName">
{{alarmFormData.customerName}}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="机床分析状态:" prop="equipAnalyseStatus">
<dict-tag :type="DICT_TYPE.TREND_ANALY_STATUS" :value="alarmFormData.equipAnalyseStatus"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报警等级:" prop="alarmLevel">
<dict-tag :type="DICT_TYPE.ALARM_LEVEL" :value="alarmFormData.alarmLevel"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="首次报警时间:" prop="firstAlarmTime">
{{ parseTime(alarmFormData.firstAlarmTime) }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最新报警时间:" prop="latestAlarmTime">
{{ parseTime(alarmFormData.latestAlarmTime) }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报警类型:" prop="alarmType">
<dict-tag :type="DICT_TYPE.ALARM_TYPE" :value="alarmFormData.alarmType"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" style="margin-top: 20px">
<div slot="header"><span>维修工单信息</span></div>
<el-form ref="submitForm" :model="submitFormData" v-loading="submitFormLoading" :rules="submitFormRules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="故障类型" prop="faultType">
<el-select v-model="submitFormData.faultType" placeholder="请选择故障类型" style="width: 100%">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.FAULT_TYPE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="优先级" prop="priority">
<el-select v-model="submitFormData.priority" placeholder="请选择优先级" style="width: 100%">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_PRIORITY)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="故障描述" prop="description">
<el-input v-model="submitFormData.description" :rows="4" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<div style="text-align: right">
<el-button type="primary" @click="submitOrder" > </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-form>
</el-card>
</el-dialog>
</div>
</template>
<script>
import {getSubmitOrderDetails} from '@/api/system/alarm/equipalarmdata'
import {parseTime} from "../../../../utils/ruoyi";
import * as MaintenanceOrderApi from "@/api/system/maintenance/maintenance";
export default {
name: "alarmSubmitMaintenanceOrderForm",
data() {
return {
dialogTitle: "维修工单提交",
dialogVisible: false,
alarmFormData:{},
alarmFormLoading:false,
submitFormData:{},
submitFormLoading:false,
submitFormRules:{
faultType: [{ required: true, message: '故障类型不能为空', trigger: 'blur' }],
priority: [{ required: true, message: '优先级不能为空', trigger: 'blur' }],
}
}
},
methods: {
parseTime,
open(id) {
this.alarmFormData = {};
this.submitFormData = {};
console.log(id);
//
getSubmitOrderDetails(id).then(res=>{
console.log(res);
if (res.data == null){
this.$modal.msgError("未获取到设备报警信息");
return;
}
this.dialogVisible = true;
this.alarmFormLoading = true
this.alarmFormData = res.data;
this.alarmFormLoading = false
})
},
async submitOrder(){
this.submitFormLoading = true;
await this.$refs.submitForm.validate();
console.log(this.alarmFormData);
this.submitFormData.equipId = this.alarmFormData.equipId;
this.submitFormData.componentId = this.alarmFormData.componentId;
this.submitFormData.customerId = this.alarmFormData.customerId;
this.submitFormData.alarmId = this.alarmFormData.equipAlarmId;
this.submitFormData.status = 0;
await MaintenanceOrderApi.createRemoteMaintenanceOrder(this.submitFormData)
this.$modal.msgSuccess("提交成功");
this.dialogVisible = false;
this.submitFormLoading = false;
},
},
}
</script>