From 61ec02e4c9996ec86055729bad07d5da615054ed Mon Sep 17 00:00:00 2001 From: xusd Date: Fri, 20 Sep 2024 09:29:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=20=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E8=A1=A8=E5=8D=95=20=E5=AE=A1=E6=89=B9=E4=BA=BA?= =?UTF-8?q?=EF=BC=9A=E5=8F=91=E8=B5=B7=E4=BA=BA=E8=87=AA=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaintenanceOrderController.java | 11 +- .../vo/MaintenanceSubmitApproveVO.java | 24 +++ .../maintenance/MaintenanceOrderService.java | 9 +- .../MaintenanceOrderServiceImpl.java | 14 +- .../src/api/system/maintenance/maintenance.js | 7 +- .../bpm/processInstance/create/index.vue | 89 ++++++++-- .../maintenance/maintenanceInfo/create.vue | 71 +++++++- .../maintenance/maintenanceInfo/index.vue | 162 +++++++++++++++++- 8 files changed, 337 insertions(+), 50 deletions(-) create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitApproveVO.java diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java index 540d1c0..2a6fe69 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java @@ -1,10 +1,7 @@ package com.inspur.module.system.controller.maintenance; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.service.maintenance.MaintenanceOrderService; import org.springframework.web.bind.annotation.*; @@ -110,9 +107,9 @@ public class MaintenanceOrderController { @Operation(summary = "提交审批") @PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:submitApprove')") - @GetMapping("/submitApprove/{id}") - public Boolean submitApprove(@PathVariable("id") String id){ - return maintenanceOrderService.submitApprove(id); + @PostMapping("/submitApprove") + public Boolean submitApprove(@Valid @RequestBody MaintenanceSubmitApproveVO vo){ + return maintenanceOrderService.submitApprove(vo); } } \ 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/MaintenanceSubmitApproveVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitApproveVO.java new file mode 100644 index 0000000..44a502b --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitApproveVO.java @@ -0,0 +1,24 @@ +package com.inspur.module.system.controller.maintenance.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +/** + * @Author xusd + * @Date 2024/9/19 17:51 + **/ +@Data +public class MaintenanceSubmitApproveVO { + + @Schema(description = "维修工单id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "维修工单id不能为空") + private String maintenanceOrderId; + + @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}") + private Map> startUserSelectAssignees; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java index cff86fd..2f4c8b6 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java @@ -1,10 +1,7 @@ package com.inspur.module.system.service.maintenance; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import javax.validation.*; @@ -98,8 +95,8 @@ public interface MaintenanceOrderService { * * @Author xusd * @Date 18:19 2024/9/12 - * @param id + * @param vo * @return java.lang.Boolean */ - Boolean submitApprove(String id); + Boolean submitApprove(MaintenanceSubmitApproveVO vo); } \ 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 14f11d8..73db251 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 @@ -12,10 +12,7 @@ import com.inspur.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO; import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO; import com.inspur.module.system.controller.equip.vo.EquipSelectionVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; 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; @@ -237,20 +234,19 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { @Override @Transactional(rollbackFor = Exception.class) - public Boolean submitApprove(String id) { + public Boolean submitApprove(MaintenanceSubmitApproveVO vo) { // 发起 BPM 流程 // Map processInstanceVariables = new HashMap<>(); // processInstanceVariables.put("day", day); - Map> startUserSelectAssignees = new HashMap<>(); String processInstanceId = processInstanceApi.createProcessInstance(getLoginUserId(), new BpmProcessInstanceCreateReqDTO() .setProcessDefinitionKey(PROCESS_KEY) // .setVariables(processInstanceVariables) - .setBusinessKey(String.valueOf(id)) - .setStartUserSelectAssignees(startUserSelectAssignees)); + .setBusinessKey(vo.getMaintenanceOrderId()) + .setStartUserSelectAssignees(vo.getStartUserSelectAssignees())); // 将工作流的编号、状态、审批状态,更新到 业务表 中 return maintenanceOrderMapper.updateById(new MaintenanceOrderDO() - .setMaintenanceOrderId(id) + .setMaintenanceOrderId(vo.getMaintenanceOrderId()) .setProcessInstanceId(processInstanceId) .setStatus(1) .setApproveStatus(1)) > 0; diff --git a/imt-ui/src/api/system/maintenance/maintenance.js b/imt-ui/src/api/system/maintenance/maintenance.js index a1cbbc1..938558b 100644 --- a/imt-ui/src/api/system/maintenance/maintenance.js +++ b/imt-ui/src/api/system/maintenance/maintenance.js @@ -70,9 +70,10 @@ export function getRemoteMaintenanceOrderRecord(id) { } // 提交审批 -export function submitMaintenanceApprove(id) { +export function submitMaintenanceApprove(data) { return request({ - url: '/maintenance/submitApprove/' + id, - method: 'get' + url: '/maintenance/submitApprove', + method: 'post', + data: data }) } diff --git a/imt-ui/src/views/bpm/processInstance/create/index.vue b/imt-ui/src/views/bpm/processInstance/create/index.vue index a5a16d4..4ae654a 100644 --- a/imt-ui/src/views/bpm/processInstance/create/index.vue +++ b/imt-ui/src/views/bpm/processInstance/create/index.vue @@ -33,10 +33,45 @@ 申请信息【{{ selectProcessInstance.name }}】 选择其它流程 - +
+
+ +
@@ -61,6 +96,7 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {decodeFields} from "@/utils/formGenerator"; import Parser from '@/components/parser/Parser' import {createProcessInstance} from "@/api/bpm/processInstance"; +import {listSimpleUsers} from '@/api/system/user' import {getModel} from "@/api/bpm/model"; // 流程实例的发起 @@ -71,6 +107,7 @@ export default { }, data() { return { + test:[], // 遮罩层 loading: true, // 表格数据 @@ -95,6 +132,9 @@ export default { // 数据字典 categoryDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY), + startUserSelectAssigneesFormRules:{}, + startUserSelectTasks:[], + userList:[], }; }, created() { @@ -123,24 +163,49 @@ export default { }, /** 处理选择流程的按钮操作 **/ handleSelect(row) { + console.log("row",row); // 设置选择的流程 this.selectProcessInstance = row; - console.log(row) + this.startUserSelectAssignees = {} + console.log("row",row) // 流程表单 - if (row.formId) { - // 设置对应的表单 - this.detailForm = { - ...JSON.parse(row.formConf), - fields: decodeFields(row.formFields) - } - + if (row.formType === 10) { // 加载流程图 - getProcessDefinitionBpmnXML(row.id).then(response => { + getProcessDefinitionBpmnXML(row.id).then(async response => { + console.log("response.data", response.data) this.bpmnXML = response.data.bpmnXml; + this.startUserSelectTasks = response.data.startUserSelectTasks; + // 设置指定审批人 + if (this.startUserSelectTasks.length > 0) { + console.log("this.startUserSelectTasks",this.startUserSelectTasks) + // this.detailForm.formRules.push({ + // type: 'startUserSelect', + // props: { + // title: '指定审批人' + // } + // }) + // 设置校验规则 + for (const userTask of this.startUserSelectTasks) { + this.$set(this.startUserSelectAssignees, userTask.id, []); + this.$set(this.startUserSelectAssigneesFormRules, userTask.id, [{required: true, message: '请选择审批人', trigger: 'change'}]); + } + // 加载用户列表 + await listSimpleUsers().then(res=>{ + this.userList = res.data; + console.log("this.userList",this.userList); + }) + } + console.log("this.startUserSelectAssigneesFormRules",this.startUserSelectAssigneesFormRules) + // 设置对应的表单 + this.detailForm = { + ...JSON.parse(row.formConf), + fields: decodeFields(row.formFields), + formRules: this.startUserSelectAssigneesFormRules, + } + console.log("this.detailForm",this.detailForm) }) } else if (row.formCustomCreatePath) { - this.$router.push({ path: row.formCustomCreatePath}); - // 这里暂时无需加载流程图,因为跳出到另外个 Tab; + this.$router.push({ path: row.formCustomCreatePath, query: { id: row.id}}); } }, /** 提交按钮 */ diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue index e748e6d..851530b 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/create.vue @@ -79,7 +79,36 @@ - @@ -130,6 +229,8 @@ import {getCustomerSelection} from '@/api/system/baseData/customerInfo' import RemoteMaintenanceOrderForm from './RemoteMaintenanceOrderForm.vue'; import {DICT_TYPE} from "@/utils/dict"; import ApproveRecord from "@/views/bpm/processInstance/approveRecord.vue"; +import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition"; +import {listSimpleUsers} from "@/api/system/user"; export default { name: "RemoteMaintenanceOrder", @@ -144,6 +245,12 @@ export default { }, data() { return { + submitApproveForm:{}, + startUserSelectAssignees:{}, + startUserSelectAssigneesFormRules:{}, + startUserSelectTasks:[], + userList:[], + submitApproveOpen: false, cascaderValue:[], equipCascader:[], componentSelection:[], @@ -180,14 +287,55 @@ export default { this.initSelection(); }, methods: { - submitApprove(row){ + closeSubmitApprove(){ + this.submitApproveOpen = false; + this.$refs.startUserSelectAssigneesFormRef.resetFields(); + }, + openSubmitApprove(row){ const maintenanceOrderId = row.maintenanceOrderId; - this.$modal.confirm('是否确认提交维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?').then(()=>{ + console.log(maintenanceOrderId); + // 加载流程图实体 + getProcessDefinitionBpmnXML(null,"maintenance_approve").then(async response => { + console.log("response.data", response.data) + this.bpmnXML = response.data.bpmnXml; + this.startUserSelectTasks = response.data.startUserSelectTasks; + // 设置指定审批人 + if (this.startUserSelectTasks.length > 0) { + this.submitApproveOpen = true; + RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderRecord(maintenanceOrderId).then(res=>{ + console.log("res.data",res.data); + this.submitApproveForm = res.data; + }) + listSimpleUsers().then(res=>{ + this.userList = res.data; + }) + console.log("this.startUserSelectTasks",this.startUserSelectTasks) + // 设置校验规则 + for (const userTask of this.startUserSelectTasks) { + this.$set(this.startUserSelectAssignees, userTask.id, []); + this.$set(this.startUserSelectAssigneesFormRules, userTask.id, [{required: true, message: '请选择审批人', trigger: 'change'}]); + } + }else { + this.$modal.confirm('是否确认提交维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?').then(()=>{ + this.submitApprove(row.maintenanceOrderId); + }) + } + }) + }, + async submitApprove(maintenanceOrderId){ + console.log(maintenanceOrderId); + if (this.startUserSelectTasks.length > 0) { + await this.$refs.startUserSelectAssigneesFormRef.validate(); + } + const data = { + maintenanceOrderId:maintenanceOrderId, + startUserSelectAssignees: this.startUserSelectAssignees + } + await RemoteMaintenanceOrderApi.submitMaintenanceApprove(data).then(res=>{ this.loading = true; - RemoteMaintenanceOrderApi.submitMaintenanceApprove(maintenanceOrderId).then(res=>{ - this.getList(); - this.$modal.msgSuccess("提交审批成功"); - }) + this.$modal.msgSuccess("提交审批成功"); + this.submitApproveOpen = false; + this.getList(); }) }, openApproveRecord(approveId){ From ef6edf9ac1d17aabae3bf660ee41b0280b3ceec4 Mon Sep 17 00:00:00 2001 From: xusd Date: Tue, 8 Oct 2024 14:31:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=82=B9=E6=A3=80=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/alarm/EquipAlarmDataController.java | 8 +- .../MaintenanceOrderController.java | 11 +- .../vo/MaintenanceOrderRespVO.java | 2 + .../vo/MaintenanceOrderSaveReqVO.java | 3 + .../vo/MaintenanceSubmitPatrolPlanVO.java | 28 ++++ .../maintenance/MaintenanceOrderDO.java | 4 + .../service/alarm/EquipAlarmDataService.java | 12 +- .../alarm/EquipAlarmDataServiceImpl.java | 21 ++- .../maintenance/MaintenanceOrderService.java | 15 +- .../MaintenanceOrderServiceImpl.java | 10 +- imt-ui/src/api/system/alarm/equipalarmdata.js | 8 ++ .../views/system/alarm/alarmdata/index.vue | 36 ++++- .../AlarmSubmitMaintenancePatrolPlanForm.vue | 136 ++++++++++++++++++ .../RemoteMaintenanceOrderForm.vue | 17 ++- .../alarmSubmitMaintenanceOrderForm.vue | 11 +- .../maintenance/maintenanceInfo/details.vue | 5 + 16 files changed, 293 insertions(+), 34 deletions(-) create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitPatrolPlanVO.java create mode 100644 imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java index 07ed92b..7e14ff6 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java @@ -106,8 +106,14 @@ public class EquipAlarmDataController { @GetMapping("/isSubmitOrder/{alarmId}") @Operation(summary = "判断报警是否已经提交工单") - public CommonResult isSubmitOrder(@PathVariable("alarmId") String alarmId){ + public CommonResult isSubmitOrder(@PathVariable("alarmId") String alarmId){ return success(equipAlarmDataService.isSubmitOrder(alarmId)); } + @GetMapping("/isSubmitPatrolPlan/{alarmId}") + @Operation(summary = "判断报警是否已经提交点检方案") + public CommonResult isSubmitPatrolPlan(@PathVariable("alarmId") String alarmId){ + return success(equipAlarmDataService.isSubmitPatrolPlan(alarmId)); + } + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java index fce1542..9c832d6 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/MaintenanceOrderController.java @@ -1,10 +1,7 @@ package com.inspur.module.system.controller.maintenance; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.service.maintenance.MaintenanceOrderService; import org.springframework.web.bind.annotation.*; @@ -121,4 +118,10 @@ public class MaintenanceOrderController { return success(maintenanceOrderService.getMaintenanceCountByEquipId(equipId)); } + @Operation(summary = "提交点检方案") + @PostMapping("/submitPatrolPlan") + public CommonResult submitPatrolPlan(@Valid @RequestBody MaintenanceSubmitPatrolPlanVO vo){ + return success(maintenanceOrderService.submitPatrolPlan(vo)); + } + } \ 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/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 0f3cc1d..2c6a391 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 @@ -96,4 +96,6 @@ public class MaintenanceOrderRespVO { @Schema(description = "报告id") private String reportId; + @Schema(description = "点检方案") + private String patrolPlan; } \ 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 4d5edd3..fc479d5 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 @@ -67,4 +67,7 @@ public class MaintenanceOrderSaveReqVO { @Schema(description = "报警id") private String alarmId; + @Schema(description = "点检方案") + private String patrolPlan; + } \ 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/MaintenanceSubmitPatrolPlanVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitPatrolPlanVO.java new file mode 100644 index 0000000..0df431b --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceSubmitPatrolPlanVO.java @@ -0,0 +1,28 @@ +package com.inspur.module.system.controller.maintenance.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 提交点检方案 + * + * @Author xusd + * @Date 2024/9/29 9:51 + **/ +@Data +public class MaintenanceSubmitPatrolPlanVO { + + /** + * 维修工单id + */ + @NotBlank(message = "维修工单id不能为空") + private String maintenanceOrderId; + + /** + * 点检方案 + */ + @NotBlank(message = "点检方案不能为空") + private String patrolPlan; + +} 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 e82d298..e7f6bcf 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 @@ -85,6 +85,10 @@ public class MaintenanceOrderDO extends BaseDO { * 报警id */ private String alarmId; + /** + * 点检方案 + */ + private String patrolPlan; @TableField(exist = false) private String equipNo; diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java index bc15485..268100f 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java @@ -74,7 +74,17 @@ public interface EquipAlarmDataService { * @Author xusd * @Date 16:44 2024/9/14 * @param alarmId 报警id + * @return java.lang.String + */ + String isSubmitOrder(String alarmId); + + /** + * 判断报警是否已经提交点检方案 + * + * @Author xusd + * @Date 9:16 2024/10/8 + * @param alarmId 报警id * @return java.lang.Boolean */ - Boolean isSubmitOrder(String alarmId); + Boolean isSubmitPatrolPlan(String alarmId); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java index 8d55df0..e029a9a 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java @@ -1,5 +1,8 @@ package com.inspur.module.system.service.alarm; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.inspur.framework.tenant.core.aop.TenantIgnore; @@ -105,9 +108,21 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { @Override @TenantIgnore - public Boolean isSubmitOrder(String alarmId) { - MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectOne(MaintenanceOrderDO::getAlarmId, alarmId); - return Objects.nonNull(maintenanceOrderDO); + public String isSubmitOrder(String alarmId) { + List list = maintenanceOrderMapper.selectList(new LambdaQueryWrapper() + .eq(MaintenanceOrderDO::getAlarmId, alarmId) + .eq(MaintenanceOrderDO::getStatus,-1) + .orderByDesc(MaintenanceOrderDO::getCreateTime)); + if (CollUtil.isNotEmpty(list)){ + return list.get(0).getMaintenanceOrderId(); + } + return null; } + @Override + public Boolean isSubmitPatrolPlan(String alarmId) { + List list = maintenanceOrderMapper.selectList(new LambdaQueryWrapper() + .eq(MaintenanceOrderDO::getAlarmId, alarmId)); + return !CollUtil.isEmpty(list); + } } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java index 3d00040..f7f2fef 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderService.java @@ -1,10 +1,7 @@ package com.inspur.module.system.service.maintenance; import com.inspur.framework.common.pojo.PageResult; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import javax.validation.*; @@ -112,4 +109,14 @@ public interface MaintenanceOrderService { * @return java.lang.Long */ Long getMaintenanceCountByEquipId(String equipId); + + /** + * 提交点检方案 + * + * @Author xusd + * @Date 9:55 2024/9/29 + * @param vo vo + * @return java.lang.Boolean + */ + Boolean submitPatrolPlan(MaintenanceSubmitPatrolPlanVO vo); } \ 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 c1872c6..7deaf09 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 @@ -12,10 +12,7 @@ import com.inspur.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO; import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO; import com.inspur.module.system.controller.equip.vo.EquipSelectionVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRecordsPageReqVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO; -import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO; +import com.inspur.module.system.controller.maintenance.vo.*; 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; @@ -260,4 +257,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { public Long getMaintenanceCountByEquipId(String equipId) { return maintenanceOrderMapper.selectCount(MaintenanceOrderDO::getEquipId,equipId); } + + @Override + public Boolean submitPatrolPlan(MaintenanceSubmitPatrolPlanVO vo) { + return maintenanceOrderMapper.updateById(new MaintenanceOrderDO().setMaintenanceOrderId(vo.getMaintenanceOrderId()).setPatrolPlan(vo.getPatrolPlan())) > 0; + } } \ No newline at end of file diff --git a/imt-ui/src/api/system/alarm/equipalarmdata.js b/imt-ui/src/api/system/alarm/equipalarmdata.js index f825005..75aa32f 100644 --- a/imt-ui/src/api/system/alarm/equipalarmdata.js +++ b/imt-ui/src/api/system/alarm/equipalarmdata.js @@ -67,3 +67,11 @@ export function isSubmitOrder(alarmId) { method: "get", }); } + +// 判断报警是否已经提交点检方案 +export function isSubmitPatrolPlan(alarmId) { + return request({ + url: "/imt/equip-alarm-data/isSubmitPatrolPlan/" + alarmId, + method: "get", + }); +} diff --git a/imt-ui/src/views/system/alarm/alarmdata/index.vue b/imt-ui/src/views/system/alarm/alarmdata/index.vue index e9f16ba..a7d8fe4 100644 --- a/imt-ui/src/views/system/alarm/alarmdata/index.vue +++ b/imt-ui/src/views/system/alarm/alarmdata/index.vue @@ -364,7 +364,14 @@ >
+ 点检方案提交 + @@ -506,6 +513,7 @@ >
+ @@ -518,11 +526,14 @@ import { getFieldList } from "@/api/data/query.js"; import { getAlarmRules } from "@/api/system/alarm/alarmrules"; import AlarmSubmitMaintenanceOrderForm from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue"; +import AlarmSubmitMaintenancePatrolPlanForm + from "@/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue"; var _ = require("lodash"); export default { name: "AlarmData", components: { AlarmSubmitMaintenanceOrderForm, + AlarmSubmitMaintenancePatrolPlanForm, AlarmDataForm, }, data() { @@ -598,22 +609,30 @@ export default { loading: false, selectedRow: {}, datetimeRange: [], - showOrderSubmit: false, + maintenanceOrderId: null, + showPatrolPlanSubmit: true, }; }, created() { this.getThrList(); this.getTreList(); - this.getIsSubmitOrder(); + this.showSubmitButton(); 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 + //判断显示维修工单提交还是显示点检方案提交 + 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 + }) + } }) }, async handleAlarmDataQuery(row) { @@ -711,7 +730,10 @@ 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) }, /**echart表初始化 */ initchart(xData, yData, name, unit) { diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue new file mode 100644 index 0000000..a69326b --- /dev/null +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue @@ -0,0 +1,136 @@ + + diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue index b76e0e2..f179cf6 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/RemoteMaintenanceOrderForm.vue @@ -5,7 +5,7 @@ - + - + @@ -25,7 +25,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -51,9 +51,12 @@ - + + + {{formData.patrolPlan}} +