Compare commits

...

8 Commits

11 changed files with 94 additions and 29 deletions

View File

@ -2,6 +2,7 @@ package com.inspur.module.system.api.alarm;
import com.inspur.framework.common.util.json.JsonUtils;
import com.inspur.framework.common.util.object.BeanUtils;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
import com.inspur.module.system.api.alarm.dto.AlarmRulesRespDTO;
import com.inspur.module.system.constant.EquipAyalyzeStatusConstant;
import com.inspur.module.system.constant.JudgeConstant;
@ -50,6 +51,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
private EquipInfoService equipInfoService;
@Override
@TenantIgnore
public List<AlarmRulesRespDTO> selectAlarmRulesListByCatch(String equipId) {
List<AlarmRulesRespDTO> alarmRules = JsonUtils.parseArray(stringRedisTemplate.opsForValue().get(equipId),AlarmRulesRespDTO.class);
if(alarmRules == null || alarmRules.size() == 0){
@ -64,6 +66,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
*/
@Override
@Transactional
@TenantIgnore
public Integer alarmRulesFilter(Map<String, Object> fields, List<AlarmRulesRespDTO> rules){
int count = 0;
for (AlarmRulesRespDTO rule : rules) {
@ -83,6 +86,7 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
*/
@Override
@Transactional
@TenantIgnore
public Integer trendAlarmRulesFilter(Map<String, Object> trendMap,List<AlarmRulesRespDTO> rules){
int count = 0;
for (AlarmRulesRespDTO rule : rules) {

View File

@ -70,4 +70,7 @@ public class MaintenanceOrderSaveReqVO {
@Schema(description = "点检方案")
private String patrolPlan;
@Schema(description = "维修工单提交标识报警提交时为0")
private String submitFlag;
}

View File

@ -1,5 +1,6 @@
package com.inspur.module.system.service.alarm;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.inspur.framework.tenant.core.aop.TenantIgnore;
@ -103,11 +104,14 @@ public class AlarmDataServiceImpl implements AlarmDataService {
@Transactional
public int closeAllAlarmDataByEquipAlarmId(String equipAlarmId){
List<AlarmDataDO> alarmDataList = alarmDataMapper.selectAlarmDatas(new AlarmDataPageReqVO().setEquipAlarmId(equipAlarmId));
List<Long> alarmDataIdList = alarmDataList.stream().map(AlarmDataDO::getAlarmDataId).collect(Collectors.toList());
EquipAlarmDataSaveReqVO equipAlarmDataSaveReqVO = new EquipAlarmDataSaveReqVO();
equipAlarmDataSaveReqVO.setEquipAlarmId(equipAlarmId);
equipAlarmDataSaveReqVO.setStatus(1);//关闭
equipAlarmDataService.updateEquipAlarmData(equipAlarmDataSaveReqVO);
if (CollUtil.isEmpty(alarmDataList)){
return 0;
}
List<Long> alarmDataIdList = alarmDataList.stream().map(AlarmDataDO::getAlarmDataId).collect(Collectors.toList());
return alarmDataMapper.batchUpdateAlarmDataStatus(alarmDataIdList);
}

View File

@ -20,6 +20,7 @@ import com.inspur.module.system.dal.dataobject.user.AdminUserDO;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderRecordMapper;
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceReportMapper;
import com.inspur.module.system.service.alarm.AlarmDataService;
import com.inspur.module.system.service.baseData.CustomerInfoService;
import com.inspur.module.system.service.equip.ComponentInfoService;
import com.inspur.module.system.service.equip.EquipInfoService;
@ -77,6 +78,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
@Resource
private TaskService taskService;
@Resource
private AlarmDataService alarmDataService;
/**
* OA 请假对应的流程定义 KEY
*/
@ -116,11 +120,15 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateRemoteMaintenanceOrder(MaintenanceOrderSaveReqVO updateReqVO) {
// 校验存在
validateRemoteMaintenanceOrderExists(updateReqVO.getMaintenanceOrderId());
// 更新
MaintenanceOrderDO updateObj = BeanUtils.toBean(updateReqVO, MaintenanceOrderDO.class);
if ("0".equals(updateReqVO.getSubmitFlag()) && StrUtil.isNotBlank(updateReqVO.getAlarmId())) {
alarmDataService.closeAllAlarmDataByEquipAlarmId(updateReqVO.getAlarmId());
}
maintenanceOrderMapper.updateById(updateObj);
}

View File

@ -5,15 +5,17 @@
<select id="equipInfoList"
resultType="com.inspur.module.system.controller.largeScreen.vo.LargeScreenEquipInfoListVO">
SELECT
ici.customer_id as customerId,
ici.customer_name as customerName,
COUNT( iei.equip_id ) as equipNum,
0 as equipRun,
0 as alarmNum
ici.customer_id AS customerId,
ici.customer_name AS customerName,
COUNT( DISTINCT iei.equip_id ) AS equipNum,
0 AS equipRun,
COUNT( iad.alarm_data_id ) AS alarmNum
FROM
imt_customer_info AS ici
LEFT JOIN imt_equip_info AS iei ON ici.customer_id = iei.customer_id
AND iei.deleted = '0'
LEFT JOIN imt_alarm_data AS iad ON iei.equip_id = iad.equip_id
AND iad.deleted = '0'
WHERE
ici.deleted = '0'
GROUP BY

View File

@ -216,6 +216,7 @@ import {
import Verify from "@/components/Verifition/Verify";
import { resetUserPwd } from "@/api/system/user";
import { getUserProfile } from "@/api/system/user";
export default {
name: "Login",
@ -361,7 +362,15 @@ export default {
this.loginForm
)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
getUserProfile().then(res=>{
if (res.data.tenantId == "1"){
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}else {
this.$router.push("/equip/equipdashboard").catch(()=>{});
}
})
// this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;

View File

@ -519,8 +519,8 @@
style="height:500px"
></div>
</el-dialog>
<alarm-submit-maintenance-order-form ref="submitOrderForm" />
<alarm-submit-maintenance-patrol-plan-form ref="submitPatrolPlanForm" />
<alarm-submit-maintenance-order-form ref="submitOrderForm" @child-event="showSubmitButton" />
<alarm-submit-maintenance-patrol-plan-form ref="submitPatrolPlanForm" @child-event="showSubmitButton"/>
</div>
</template>
@ -540,6 +540,7 @@ export default {
name: "AlarmData",
components: {
AlarmSubmitMaintenanceOrderForm,
AlarmSubmitMaintenancePatrolPlanForm,
AlarmDataForm,
},
data() {
@ -633,20 +634,28 @@ export default {
},
methods: {
//
showSubmitButton() {
EquipAlarmDataApi.isSubmitPatrolPlan(this.$route.query.equipAlarmId).then(
(res) => {
this.showPatrolPlanSubmit = res.data;
console.log("this.showPatrolPlanSubmit", this.showPatrolPlanSubmit);
if (res.data) {
EquipAlarmDataApi.isSubmitOrder(
this.$route.query.equipAlarmId
).then((res) => {
this.maintenanceOrderId = res.data;
});
showSubmitButton(flag) {
if (flag === "0"){
this.$store.dispatch("tagsView/delView", this.$router.currentRoute);
//
this.$router.push("/alarm/equipalarm");
}else {
EquipAlarmDataApi.isSubmitPatrolPlan(this.$route.query.equipAlarmId).then(
(res) => {
this.showPatrolPlanSubmit = res.data;
console.log("this.showPatrolPlanSubmit", this.showPatrolPlanSubmit);
if (res.data) {
EquipAlarmDataApi.isSubmitOrder(
this.$route.query.equipAlarmId
).then((res) => {
if(res.data !== null){
this.maintenanceOrderId = res.data;
}
});
}
}
}
);
);
}
},
cardChange(e) {
// console.log("", e);
@ -764,7 +773,7 @@ export default {
* 维修工单
*/
handelMaintanence() {
this.$refs.submitOrderForm.open(this.$route.query.equipAlarmId);
this.$refs.submitOrderForm.open(this.$route.query.equipAlarmId,this.maintenanceOrderId);
},
handelPatrolPlan() {
this.$refs.submitPatrolPlanForm.open(this.$route.query.equipAlarmId);

View File

@ -293,6 +293,14 @@ import {
getEquipSelection,
} from "@/api/system/equip/equipInfo";
export default {
beforeRouteEnter(to, from, next) {
// ,
next(vm => {
//
vm.getList();
});
},
name: "EquipAlarmData",
components: {
EquipAlarmDataForm,
@ -333,9 +341,9 @@ export default {
equipSelection: [],
};
},
created() {
this.getList();
},
// created() {
// this.getList();
// },
methods: {
cascaderChange(value) {
if (value.length > 0) {
@ -346,6 +354,7 @@ export default {
},
/** 查询列表 */
async getList() {
console.log("getList")
try {
this.loading = true;
const res = await EquipAlarmDataApi.getEquipAlarmDataPage(

View File

@ -226,11 +226,19 @@
<el-button
size="mini"
type="text"
icon="el-icon-delete"
icon="el-icon-receiving"
@click="handleDetails(scope.row.equipId)"
v-hasPermi="['imt:equip-info:query']"
>设备详情
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-data-line"
@click="handleToDataDash(scope.row.equipId)"
v-hasPermi="['imt:equip-info:query']"
>监控数据看板
</el-button>
</template>
</el-table-column>
</el-table>
@ -302,8 +310,14 @@ export default {
});
},
methods: {
goNoticeBoard(){
this.$router.push({ path: "/equip/equipdashboard"});
goNoticeBoard() {
this.$router.push({ path: "/equip/equipdashboard" });
},
handleToDataDash(equipId) {
this.$router.push({
path: "/equip/datadashboard",
query: { equipId: equipId },
});
},
handleDetails(equipId) {
this.$router.push({

View File

@ -128,6 +128,7 @@ export default {
this.submitFormData.status = -1;
await MaintenanceOrderApi.createRemoteMaintenanceOrder(this.submitFormData)
this.$modal.msgSuccess("提交成功");
this.$emit('child-event');
this.dialogVisible = false;
this.submitFormLoading = false;
},

View File

@ -148,8 +148,10 @@ export default {
this.submitFormData.customerId = this.alarmFormData.customerId;
this.submitFormData.alarmId = this.alarmFormData.equipAlarmId;
this.submitFormData.status = 0;
this.submitFormData.submitFlag = "0";
await MaintenanceOrderApi.updateRemoteMaintenanceOrder(this.submitFormData)
this.$modal.msgSuccess("提交成功");
this.$emit('child-event','0');
this.dialogVisible = false;
this.submitFormLoading = false;
},