From 66f8e463d01c4909411c66088a855a39e8c347e0 Mon Sep 17 00:00:00 2001 From: xusd Date: Sat, 14 Sep 2024 11:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=B4=E4=BF=AE=E6=8A=A5?= =?UTF-8?q?=E5=91=8Aid=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/vo/MaintenanceOrderRespVO.java | 6 ++++++ .../vo/MaintenanceOrderSaveReqVO.java | 3 +++ .../maintenance/MaintenanceOrderDO.java | 6 ++++++ .../MaintenanceOrderServiceImpl.java | 18 +++++++++++++++++- .../MaintenanceReportServiceImpl.java | 7 ------- .../RemoteMaintenanceOrderForm.vue | 2 ++ .../maintenance/maintenanceInfo/create.vue | 7 ++++++- .../maintenance/maintenanceInfo/details.vue | 9 +++++---- .../maintenance/maintenanceRecord/index.vue | 4 ++-- 9 files changed, 47 insertions(+), 15 deletions(-) diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderRespVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderRespVO.java index cec7e1e..0f3cc1d 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderRespVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderRespVO.java @@ -90,4 +90,10 @@ public class MaintenanceOrderRespVO { @Schema(description = "审批状态(bpm_process_instance_status)") private Integer approveStatus; + @Schema(description = "报警id") + private String alarmId; + + @Schema(description = "报告id") + private String reportId; + } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java index 5d1b237..4d5edd3 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java @@ -64,4 +64,7 @@ public class MaintenanceOrderSaveReqVO { @Schema(description = "审批状态(bpm_process_instance_status)") private Integer approveStatus; + @Schema(description = "报警id") + private String alarmId; + } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/maintenance/MaintenanceOrderDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/maintenance/MaintenanceOrderDO.java index 1cbbc27..e82d298 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/maintenance/MaintenanceOrderDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/maintenance/MaintenanceOrderDO.java @@ -81,6 +81,10 @@ public class MaintenanceOrderDO extends BaseDO { * 审批状态 */ private Integer approveStatus; + /** + * 报警id + */ + private String alarmId; @TableField(exist = false) private String equipNo; @@ -90,4 +94,6 @@ public class MaintenanceOrderDO extends BaseDO { private String customerName; @TableField(exist = false) private String executorName; + @TableField(exist = false) + private String reportId; } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java index e29015b..14f11d8 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java @@ -3,6 +3,7 @@ package com.inspur.module.system.service.maintenance; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.RandomUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.inspur.framework.common.enums.CommonStatusEnum; import com.inspur.framework.common.pojo.PageResult; @@ -16,9 +17,11 @@ import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecord import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; +import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO; 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.baseData.CustomerInfoService; import com.inspur.module.system.service.equip.ComponentInfoService; import com.inspur.module.system.service.equip.EquipInfoService; @@ -67,6 +70,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { @Resource private BpmProcessInstanceApi processInstanceApi; + @Resource + private MaintenanceReportMapper maintenanceReportMapper; + /** * OA 请假对应的流程定义 KEY */ @@ -130,7 +136,17 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { @Override public MaintenanceOrderDO getRemoteMaintenanceOrder(String id) { - return maintenanceOrderMapper.selectById(id); + MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectById(id); + //获取维修报告 + if (Objects.nonNull(maintenanceOrderDO)){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(MaintenanceReportDO::getMaintenanceOrderId,maintenanceOrderDO.getMaintenanceOrderId()); + MaintenanceReportDO maintenanceReportDO = maintenanceReportMapper.selectOne(queryWrapper); + if (Objects.nonNull(maintenanceReportDO)){ + maintenanceOrderDO.setReportId(maintenanceReportDO.getMaintenanceReportId()); + } + } + return maintenanceOrderDO; } @Override diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceReportServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceReportServiceImpl.java index 0d8a5db..a91aff9 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceReportServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceReportServiceImpl.java @@ -3,9 +3,7 @@ package com.inspur.module.system.service.maintenance; import com.inspur.framework.common.pojo.PageResult; import com.inspur.module.system.controller.maintenance.vo.MaintenanceReportPageReqVO; import com.inspur.module.system.controller.maintenance.vo.MaintenanceReportSaveReqVO; -import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO; -import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper; import com.inspur.module.system.dal.mysql.maintenance.MaintenanceReportMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -29,17 +27,12 @@ public class MaintenanceReportServiceImpl implements MaintenanceReportService { @Resource private MaintenanceReportMapper maintenanceReportMapper; - @Resource - private MaintenanceOrderMapper maintenanceOrderMapper; - @Override @Transactional(rollbackFor = Exception.class) public String createMaintenanceReport(MaintenanceReportSaveReqVO createReqVO) { // 插入 MaintenanceReportDO maintenanceReport = BeanUtils.toBean(createReqVO, MaintenanceReportDO.class); maintenanceReportMapper.insert(maintenanceReport); - //更新工单表中的报告id - maintenanceOrderMapper.updateById(new MaintenanceOrderDO().setMaintenanceOrderId(maintenanceReport.getMaintenanceOrderId()).setDiagnoiseReportId(maintenanceReport.getMaintenanceReportId())); // 返回 return maintenanceReport.getMaintenanceReportId(); } diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue index 3abca6d..b76e0e2 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue @@ -104,6 +104,7 @@ export default { processInstanceId: undefined, customerId: undefined, approveStatus: undefined, + reportId: undefined, }, // 表单校验 formRules: { @@ -230,6 +231,7 @@ export default { processInstanceId: undefined, customerId: undefined, approveStatus: undefined, + reportId: undefined, }; this.cascaderValue = []; this.resetForm("formRef"); diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue index 82987e3..e748e6d 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue @@ -8,7 +8,7 @@ @@ -124,6 +124,7 @@ export default { processInstanceId: undefined, customerId: undefined, faultType: undefined, + reportId: undefined, }, // 表单校验 // 表单校验 @@ -171,6 +172,7 @@ export default { }else { this.formData.equipId = null; } + console.log(value) }, initSelection(){ getEquipCascader().then(res=>{ @@ -211,9 +213,11 @@ export default { }, /** 提交按钮 */ async submitForm() { + console.log(this.formData) // 校验主表 await this.$refs["formRef"].validate(); this.formData.status = 1; + console.log(this.formData) await RemoteMaintenanceOrderApi.createRemoteMaintenanceOrder(this.formData) this.$modal.msgSuccess("提交成功"); this.$tab.closeOpenPage({ path: "/maintenance/remote-maintenance-order" }); @@ -234,6 +238,7 @@ export default { processInstanceId: undefined, customerId: undefined, faultType: undefined, + reportId: undefined, }; this.cascaderValue = []; this.resetForm("formRef"); diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/details.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/details.vue index 9855139..4527b3f 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/details.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/details.vue @@ -117,6 +117,7 @@ export default { processInstanceId: undefined, customerId: undefined, faultType: undefined, + reportId: undefined, }, reportFormData:{}, evaluateFormData:{}, @@ -172,8 +173,8 @@ export default { RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderRecord(this.id).then(res=>{ this.formData = res.data; //加载报告 - if (this.formData.diagnoiseReportId != null){ - MaintenanceReportApi.getMaintenanceReport(this.formData.diagnoiseReportId).then(res=>{ + if (this.formData.reportId != null){ + MaintenanceReportApi.getMaintenanceReport(this.formData.reportId).then(res=>{ this.reportFormData = res.data; this.evaluateFormData = res.data; }) @@ -213,8 +214,8 @@ export default { } //评价 else if ("Activity_048xfy8" === taskKey){ - this.evaluateFormData.maintenanceReportId = this.formData.diagnoiseReportId; - console.log(this.formData.diagnoiseReportId) + this.evaluateFormData.maintenanceReportId = this.formData.reportId; + console.log(this.formData.reportId) MaintenanceReportApi.submitEvaluate(this.evaluateFormData) console.log("评价表单提交!") } diff --git a/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue b/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue index 7933f41..a2eb7e8 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue @@ -109,9 +109,9 @@ - 维修报告 + 维修报告