From cf80753f737fa78e2a5661e94ebb176a471a0ce6 Mon Sep 17 00:00:00 2001 From: xusd Date: Fri, 1 Nov 2024 13:42:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E6=A3=80=E6=96=B9=E6=A1=88=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/InspectionPlanController.java | 9 + .../vo/InspectionPlanListReqVO.java | 8 + .../inspection/vo/InspectionPlanRespVO.java | 4 + .../controller/equip/vo/EquipSelectionVO.java | 2 + .../vo/ExclusiveInspectionInfoFeedbackVO.java | 12 ++ .../vo/InspectionInfoFeedbackVO.java | 18 +- .../inspection/vo/InspectionInfoRespVO.java | 12 ++ .../vo/InspectionInfoSaveReqVO.java | 3 - .../inspection/InspectionFeedbackDO.java | 43 +++++ .../inspection/InspectionInfoDO.java | 6 + .../inspection/InspectionPlanDO.java | 6 +- .../inspection/InspectionFeedbackMapper.java | 19 ++ .../inspection/InspectionPlanMapper.java | 24 ++- .../inspection/InspectionFeedbackService.java | 43 +++++ .../InspectionFeedbackServiceImpl.java | 54 ++++++ .../inspection/InspectionInfoServiceImpl.java | 77 +++++++-- .../inspection/InspectionPlanService.java | 10 ++ .../inspection/InspectionPlanServiceImpl.java | 21 +++ .../MaintenanceOrderServiceImpl.java | 2 - .../inspection/InspectionFeedbackMapper.xml | 10 ++ imt-ui/src/api/system/inspection/plan.js | 9 + .../inspection/inspectionInfo/index.vue | 121 +++++++++++-- .../inspectionPlanFeedbackTree.vue | 117 +++++++++++++ ...bmitMaintenanceExclusivePatrolPlanForm.vue | 21 ++- .../AlarmSubmitMaintenancePatrolPlanForm.vue | 162 +++++++++++++++--- .../alarmSubmitMaintenanceOrderForm.vue | 14 +- 26 files changed, 748 insertions(+), 79 deletions(-) create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionFeedbackDO.java create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionFeedbackMapper.java create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackService.java create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackServiceImpl.java create mode 100644 imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/inspection/InspectionFeedbackMapper.xml create mode 100644 imt-ui/src/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/InspectionPlanController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/InspectionPlanController.java index 170303a..d9d8dbc 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/InspectionPlanController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/InspectionPlanController.java @@ -97,6 +97,15 @@ public class InspectionPlanController { return success(BeanUtils.toBean(list, InspectionPlanRespVO.class)); } + @GetMapping("/listHaveFeedback") + @Operation(summary = "获得点检方案列表(带反馈)") + @PreAuthorize("@ss.hasPermission('imt:inspection-plan:query')") + public CommonResult> getInspectionPlanHaveFeedbackList(@Valid InspectionPlanListReqVO reqVO) { + List list = inspectionPlanService.getInspectionPlanHaveFeedbackList(reqVO); + list.sort(Comparator.comparing(InspectionPlanDO::getSort)); + return success(BeanUtils.toBean(list, InspectionPlanRespVO.class)); + } + @GetMapping("/export-excel") @Operation(summary = "导出点检方案 Excel") @PreAuthorize("@ss.hasPermission('imt:inspection-plan:export')") diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanListReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanListReqVO.java index c1aa9d1..9226825 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanListReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanListReqVO.java @@ -3,6 +3,8 @@ package com.inspur.module.system.controller.admin.inspection.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.util.List; + /** * @Author zhangjunwen * @create 2024/10/23 @@ -15,4 +17,10 @@ public class InspectionPlanListReqVO { @Schema(description = "点检方案状态") private Integer status; + + @Schema(description = "点检方案ids") + private List inspectionPlanIds; + + @Schema(description = "点检工单id") + private String inspectionId; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanRespVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanRespVO.java index 7533c46..1059747 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanRespVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/inspection/vo/InspectionPlanRespVO.java @@ -53,4 +53,8 @@ public class InspectionPlanRespVO { @Schema(description = "点检方案级别") @ExcelProperty("点检方案级别") private Integer level; + + @Schema(description = "点检方案反馈") + @ExcelProperty("点检方案反馈") + private String feedBack; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipSelectionVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipSelectionVO.java index 7b3726b..3c679cb 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipSelectionVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/equip/vo/EquipSelectionVO.java @@ -13,4 +13,6 @@ public class EquipSelectionVO { private String equipNo; + private String equipName; + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/ExclusiveInspectionInfoFeedbackVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/ExclusiveInspectionInfoFeedbackVO.java index 8b4f0e1..474a5c5 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/ExclusiveInspectionInfoFeedbackVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/ExclusiveInspectionInfoFeedbackVO.java @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * 定制化点检反馈 @@ -22,4 +23,15 @@ public class ExclusiveInspectionInfoFeedbackVO { @NotBlank(message = "定制化点检反馈不能为空") private String exclusiveInspectionFeedback; + @Schema(description = "是否关闭报警") + private Boolean closeAlarm; + + @Schema(description = "报警id", example = "20802") + @NotBlank(message = "报警id不能为空") + private String alarmId; + + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private Integer status; + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoFeedbackVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoFeedbackVO.java index 63a8474..0722ebc 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoFeedbackVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoFeedbackVO.java @@ -1,10 +1,12 @@ package com.inspur.module.system.controller.inspection.vo; +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import java.util.List; /** * 点检反馈 @@ -22,8 +24,18 @@ public class InspectionInfoFeedbackVO { @Schema(description = "点检方案补充") private String inspectionPlanSupplement; - @Schema(description = "根据点检树点检是否通过") - @NotNull(message = "点检是否通过不能为空") - private Boolean isPass; + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private Integer status; + + @Schema(description = "是否关闭报警") + private Boolean closeAlarm; + + @Schema(description = "报警id", example = "20802") + @NotBlank(message = "报警id不能为空") + private String alarmId; + + @Schema(description = "点检反馈") + private List feedbackList; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoRespVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoRespVO.java index ad18d8f..3afa7fb 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoRespVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoRespVO.java @@ -24,14 +24,26 @@ public class InspectionInfoRespVO { @ExcelProperty("设备id") private String equipId; + @Schema(description = "设备名称", example = "23331") + @ExcelProperty("设备名称") + private String equipName; + @Schema(description = "客户id", example = "4797") @ExcelProperty("客户id") private String customerId; + @Schema(description = "客户名称", example = "4797") + @ExcelProperty("客户名称") + private String customerName; + @Schema(description = "点检方案id", example = "20275") @ExcelProperty("点检方案id") private String inspectionPlanId; + @Schema(description = "点检方案", example = "20275") + @ExcelProperty("点检方案") + private String inspectionPlanName; + @Schema(description = "报警id", example = "20275") @ExcelProperty("报警id") private String alarmId; diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java index 4e67371..3d4904b 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java @@ -40,7 +40,4 @@ public class InspectionInfoSaveReqVO { @Schema(description = "定制化点检反馈") private String exclusiveInspectionFeedback; - @Schema(description = "是否关闭报警") - private Boolean closeAlarm; - } \ 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/inspection/InspectionFeedbackDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionFeedbackDO.java new file mode 100644 index 0000000..95f5da5 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionFeedbackDO.java @@ -0,0 +1,43 @@ +package com.inspur.module.system.dal.dataobject.inspection; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.inspur.framework.mybatis.core.dataobject.BaseDO; + +import java.util.List; + +/** + * 点检方案反馈 DO + * + * @author 管理员 + */ +@TableName("imt_inspection_feedback") +@KeySequence("imt_inspection_feedback_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class InspectionFeedbackDO { + + /** + * 点检工单id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String inspectionId; + /** + * 点检方案id + */ + private Long inspectionPlanId; + /** + * 点检反馈内容 + */ + private String inspectionFeedbackContent; + + /** + * 点检方案ids + */ + @TableField(exist = false) + private List inspectionPlanIds; + +} \ 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/inspection/InspectionInfoDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionInfoDO.java index afae2cc..8d2a0da 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionInfoDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionInfoDO.java @@ -74,4 +74,10 @@ public class InspectionInfoDO extends BaseDO { */ private Long tenantId; + @TableField(exist = false) + private String customerName; + @TableField(exist = false) + private String equipName; + @TableField(exist = false) + private String inspectionPlanName; } \ 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/inspection/InspectionPlanDO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionPlanDO.java index b01e98a..cb40077 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionPlanDO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/dataobject/inspection/InspectionPlanDO.java @@ -66,5 +66,9 @@ public class InspectionPlanDO extends BaseDO { * 级别 */ private Integer level; - + /** + * 点检方案反馈 + */ + @TableField(exist = false) + private String feedBack; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionFeedbackMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionFeedbackMapper.java new file mode 100644 index 0000000..703d632 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionFeedbackMapper.java @@ -0,0 +1,19 @@ +package com.inspur.module.system.dal.mysql.inspection; + +import com.inspur.framework.mybatis.core.mapper.BaseMapperX; +import com.inspur.framework.tenant.core.aop.TenantIgnore; +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 点检方案反馈 Mapper + * + * @author 管理员 + */ +@Mapper +public interface InspectionFeedbackMapper extends BaseMapperX { + + @TenantIgnore + int deleteByInspectionId(@Param("inspectionId") String inspectionId); +} \ 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/mysql/inspection/InspectionPlanMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionPlanMapper.java index 1185157..30686bf 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionPlanMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionPlanMapper.java @@ -6,7 +6,11 @@ package com.inspur.module.system.dal.mysql.inspection; */ import java.util.*; +import java.util.stream.Collectors; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX; import com.inspur.framework.mybatis.core.mapper.BaseMapperX; @@ -35,10 +39,22 @@ public interface InspectionPlanMapper extends BaseMapperX { } default List selectList(InspectionPlanListReqVO reqVO){ - return selectList(new LambdaQueryWrapperX() - .likeIfPresent(InspectionPlanDO::getInspectionName, reqVO.getInspectionName()) - .eqIfPresent(InspectionPlanDO::getStatus, reqVO.getStatus()) - ); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapperX<>(); + if (StrUtil.isNotBlank(reqVO.getInspectionName())){ + queryWrapper.like(InspectionPlanDO::getInspectionName, reqVO.getInspectionName()); + } + if (Objects.nonNull(reqVO.getStatus())){ + queryWrapper.eq(InspectionPlanDO::getStatus, reqVO.getStatus()); + } + if (CollUtil.isNotEmpty(reqVO.getInspectionPlanIds())){ + List inspectionPlanIds = reqVO.getInspectionPlanIds(); + // 构建 FIND_IN_SET 的 OR 条件 + String findInSetConditions = inspectionPlanIds.stream() + .map(id -> "FIND_IN_SET('" + id + "', ancestors)") + .collect(Collectors.joining(" OR ")); + queryWrapper.and(i->i.in(InspectionPlanDO::getInspectionPlanId, reqVO.getInspectionPlanIds()).or().apply("(" + findInSetConditions + ")")); + } + return selectList(queryWrapper); } } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackService.java new file mode 100644 index 0000000..28a3677 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackService.java @@ -0,0 +1,43 @@ +package com.inspur.module.system.service.inspection; + +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; + +import java.util.List; + +/** + * 点检方案反馈 Service 接口 + * + * @author 管理员 + */ +public interface InspectionFeedbackService { + + /** + * 批量新增 + * + * @Author xusd + * @Date 15:54 2024/10/30 + * @param inspectionFeedbackDOList 新增数据 + * @return java.lang.Boolean + */ + Boolean batchInsert(List inspectionFeedbackDOList); + + /** + * 根据点检工单ids删除 + * + * @Author xusd + * @Date 15:54 2024/10/30 + * @param inspectionId 点检工单id + * @return int + */ + int deleteByInspectionId(String inspectionId); + + /** + * 根据工单id查询 + * + * @Author xusd + * @Date 16:03 2024/10/30 + * @param inspectionFeedbackDO 点检工单id + * @return java.util.List + */ + List selectList(InspectionFeedbackDO inspectionFeedbackDO); +} \ 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/inspection/InspectionFeedbackServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackServiceImpl.java new file mode 100644 index 0000000..3165ca2 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionFeedbackServiceImpl.java @@ -0,0 +1,54 @@ +package com.inspur.module.system.service.inspection; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.inspur.framework.tenant.core.aop.TenantIgnore; +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; +import com.inspur.module.system.dal.mysql.inspection.InspectionFeedbackMapper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +import org.springframework.validation.annotation.Validated; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + + +/** + * 点检方案反馈 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class InspectionFeedbackServiceImpl implements InspectionFeedbackService { + + @Resource + private InspectionFeedbackMapper inspectionFeedbackMapper; + + @Override + @TenantIgnore + public Boolean batchInsert(List inspectionFeedbackDOList) { + return inspectionFeedbackMapper.insertBatch(inspectionFeedbackDOList); + } + + @Override + public int deleteByInspectionId(String inspectionId) { + return inspectionFeedbackMapper.deleteByInspectionId(inspectionId); + } + + @Override + @TenantIgnore + public List selectList(InspectionFeedbackDO inspectionFeedbackDO) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (Objects.nonNull(inspectionFeedbackDO.getInspectionId())){ + queryWrapper.eq(InspectionFeedbackDO::getInspectionId, inspectionFeedbackDO.getInspectionId()); + } + if (CollUtil.isNotEmpty(inspectionFeedbackDO.getInspectionPlanIds())){ + queryWrapper.in(InspectionFeedbackDO::getInspectionPlanId, inspectionFeedbackDO.getInspectionPlanIds()); + } + return inspectionFeedbackMapper.selectList(queryWrapper); + } +} \ 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/inspection/InspectionInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java index 1e6db16..81f3d47 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.inspur.module.system.service.inspection; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; @@ -9,27 +10,31 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.inspur.framework.common.exception.ServiceException; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.tenant.core.aop.TenantIgnore; +import com.inspur.module.system.controller.admin.inspection.vo.InspectionPlanListReqVO; +import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO; +import com.inspur.module.system.controller.equip.vo.EquipSelectionVO; import com.inspur.module.system.controller.inspection.vo.*; import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; import com.inspur.module.system.dal.dataobject.inspection.InspectionInfoDO; +import com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.mysql.inspection.InspectionInfoMapper; import com.inspur.module.system.service.alarm.AlarmDataService; import com.inspur.module.system.service.baseData.CustomerInfoService; +import com.inspur.module.system.service.equip.EquipInfoService; import com.inspur.module.system.service.maintenance.MaintenanceOrderService; import org.aspectj.weaver.ast.Var; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import com.inspur.framework.common.util.object.BeanUtils; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; import static com.inspur.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -56,6 +61,15 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { @Resource private AlarmDataService alarmDataService; + @Resource + private InspectionFeedbackService inspectionFeedbackService; + + @Resource + private EquipInfoService equipInfoService; + + @Resource + private InspectionPlanService inspectionPlanService; + @Override @TenantIgnore public String createInspectionInfo(InspectionInfoSaveReqVO createReqVO) { @@ -82,18 +96,18 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { validateInspectionInfoExists(updateReqVO.getInspectionId()); // 更新 InspectionInfoDO updateObj = BeanUtils.toBean(updateReqVO, InspectionInfoDO.class); - if (updateReqVO.getCloseAlarm()) { - alarmDataService.closeAllAlarmDataByEquipAlarmId(updateObj.getAlarmId()); - } inspectionInfoMapper.updateById(updateObj); } @Override + @Transactional(rollbackFor = Exception.class) public void deleteInspectionInfo(String id) { // 校验存在 validateInspectionInfoExists(id); // 删除 inspectionInfoMapper.deleteById(id); + //删除点检反馈关联表 + inspectionFeedbackService.deleteByInspectionId(id); } private void validateInspectionInfoExists(String id) { @@ -110,27 +124,56 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { @Override public PageResult getInspectionInfoPage(InspectionInfoPageReqVO pageReqVO) { - return inspectionInfoMapper.selectPage(pageReqVO); + PageResult page = inspectionInfoMapper.selectPage(pageReqVO); + List list = page.getList(); + if (CollUtil.isNotEmpty(list)){ + List customerList = customerInfoService.selection(true); + Map customerListMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName)); + List equipList = equipInfoService.selection(); + Map equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipName)); + List inspectionPlanList = inspectionPlanService.getInspectionPlanList(new InspectionPlanListReqVO()); + Map inspectionPlanMap = inspectionPlanList.stream().collect(Collectors.toMap(InspectionPlanDO::getInspectionPlanId, InspectionPlanDO::getInspectionName)); + list.forEach(item->{ + item.setCustomerName(customerListMap.get(item.getCustomerId())); + item.setEquipName(equipMap.get(item.getEquipId())); + if (StrUtil.isNotBlank(item.getInspectionPlanId())){ + String[] split = item.getInspectionPlanId().split(","); + List inspectionPlanNameList = new ArrayList<>(); + for (String s : split) { + inspectionPlanNameList.add(inspectionPlanMap.get(Long.parseLong(s))); + } + if (CollUtil.isNotEmpty(inspectionPlanNameList)){ + item.setInspectionPlanName(CollUtil.join(inspectionPlanNameList,",")); + } + } + }); + } + return page; } @Override + @Transactional(rollbackFor = Exception.class) public Boolean inspectionFeedback(InspectionInfoFeedbackVO vo) { - InspectionInfoDO inspectionInfoDO = new InspectionInfoDO(); - inspectionInfoDO.setInspectionId(vo.getInspectionId()); - inspectionInfoDO.setInspectionPlanSupplement(vo.getInspectionPlanSupplement()); - //通过 - if (vo.getIsPass()) { - inspectionInfoDO.setStatus(2); - } else { - inspectionInfoDO.setStatus(1); - } + InspectionInfoDO inspectionInfoDO = BeanUtils.toBean(vo, InspectionInfoDO.class); int i = inspectionInfoMapper.updateById(inspectionInfoDO); + if (vo.getCloseAlarm()) { + alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId()); + } + //点检树新增 + if (CollUtil.isNotEmpty(vo.getFeedbackList())){ + List feedbackList = vo.getFeedbackList(); + feedbackList.forEach(item->item.setInspectionId(vo.getInspectionId())); + inspectionFeedbackService.batchInsert(feedbackList); + } return i > 0; } @Override public Boolean exclusiveInspectionFeedback(ExclusiveInspectionInfoFeedbackVO vo) { InspectionInfoDO inspectionInfoDO = BeanUtils.toBean(vo, InspectionInfoDO.class); + if (vo.getCloseAlarm()) { + alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId()); + } return inspectionInfoMapper.updateById(inspectionInfoDO) > 0; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanService.java index ed2a174..016c7a9 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanService.java @@ -67,4 +67,14 @@ public interface InspectionPlanService { * 获取点检方案列表 */ List getInspectionPlanList(InspectionPlanListReqVO reqVO); + + /** + * 获得点检方案列表(带反馈) + * + * @Author xusd + * @Date 15:31 2024/10/31 + * @param reqVO 请求参数 + * @return java.util.List + */ + List getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanServiceImpl.java index 8bc2afa..049dc69 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionPlanServiceImpl.java @@ -5,8 +5,11 @@ package com.inspur.module.system.service.inspection; * @create 2024/10/21 */ +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.inspur.framework.tenant.core.aop.TenantIgnore; +import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -15,6 +18,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; import com.inspur.module.system.controller.admin.inspection.vo.*; import com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO; @@ -39,6 +43,9 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { @Resource private InspectionPlanMapper inspectionPlanMapper; + @Resource + private InspectionFeedbackService inspectionFeedbackService; + @Override public Long createInspectionPlan(InspectionPlanSaveReqVO createReqVO) { // 插入 @@ -106,4 +113,18 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { public List getInspectionPlanList(InspectionPlanListReqVO reqVO){ return inspectionPlanMapper.selectList(reqVO); } + + @Override + public List getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO) { + List inspectionPlanDOS = inspectionPlanMapper.selectList(reqVO); + if (CollUtil.isNotEmpty(inspectionPlanDOS) && CollUtil.isNotEmpty(reqVO.getInspectionPlanIds())){ + List feedbackList = inspectionFeedbackService.selectList(new InspectionFeedbackDO() + .setInspectionId(reqVO.getInspectionId())); + if (CollUtil.isNotEmpty(feedbackList)){ + Map feedbackMap = feedbackList.stream().collect(Collectors.toMap(InspectionFeedbackDO::getInspectionPlanId, InspectionFeedbackDO::getInspectionFeedbackContent)); + inspectionPlanDOS.forEach(item-> item.setFeedBack(feedbackMap.get(item.getInspectionPlanId()))); + } + } + return inspectionPlanDOS; + } } 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 2207ae3..e73814f 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 @@ -135,8 +135,6 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { InspectionInfoSaveReqVO inspectionInfoSaveReqVO = new InspectionInfoSaveReqVO(); inspectionInfoSaveReqVO.setInspectionId(createReqVO.getInspectionId()); inspectionInfoSaveReqVO.setStatus(3); - //是否关闭报警 - inspectionInfoSaveReqVO.setCloseAlarm(false); InspectionInfoServiceImpl inspectionInfoService = SpringUtils.getBean(InspectionInfoServiceImpl.class); inspectionInfoService.updateInspectionInfo(inspectionInfoSaveReqVO); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/inspection/InspectionFeedbackMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/inspection/InspectionFeedbackMapper.xml new file mode 100644 index 0000000..822697f --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/inspection/InspectionFeedbackMapper.xml @@ -0,0 +1,10 @@ + + + + + + delete from imt_inspection_feedback + where inspection_id = #{inspectionId} + + + \ No newline at end of file diff --git a/imt-ui/src/api/system/inspection/plan.js b/imt-ui/src/api/system/inspection/plan.js index 5c279e5..902aa49 100644 --- a/imt-ui/src/api/system/inspection/plan.js +++ b/imt-ui/src/api/system/inspection/plan.js @@ -68,3 +68,12 @@ export function getInspectionPlanList(params) { params, }); } + +// 获得点检方案列表(带反馈) +export function getInspectionPlanListHaveFeedback(params) { + return request({ + url: "/imt/inspection-plan/listHaveFeedback", + method: "get", + params, + }); +} diff --git a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue index d9eeebc..a9af5e2 100644 --- a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue +++ b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue @@ -63,9 +63,9 @@ - - - + + + @@ -104,8 +104,28 @@ - - {{ inspectionFeedbackData.inspectionPlanId }} + +
+
+ +
+
@@ -113,7 +133,7 @@ - +
@@ -125,9 +145,9 @@ - - - {{ exclusiveInspectionFeedbackData.inspectionPlanId }} + + + {{ exclusiveInspectionFeedbackData.inspectionPlanSupplement }} @@ -141,7 +161,7 @@ - +
@@ -159,14 +179,28 @@ import InspectionInfoForm from './InspectionInfoForm.vue'; import {getEquipCascader} from "@/api/system/equip/equipInfo"; import {getCustomerSelection} from "@/api/system/baseData/customerInfo"; import {DICT_TYPE, getDictDatas} from "@/utils/dict"; +import * as InspectionPlanApi from "@/api/system/inspection/plan"; +import {VueOkrTree} from "@/components/VueOkrTree"; +import Vue from "vue"; +import inspectionPlanFeedbackTree from "@/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue" export default { name: "InspectionInfo", components: { + VueOkrTree, InspectionInfoForm, + inspectionPlanFeedbackTree }, data() { return { + inspectionPlanIds:null, + inspectionId:null, + feedbackList:[], + eventBus: new Vue(), + treeData:[], + props: { + label: "inspectionName", + }, inspectionStatusList:[], exclusiveInspectionFeedbackTitle:"定制化点检反馈", exclusiveInspectionFeedbackVisible:false, @@ -220,16 +254,24 @@ export default { }, }; }, + provide() { + return { + eventBus: this.eventBus, + }; + }, created() { this.getList(); this.initSelection(); }, methods: { + objToList(obj) { + return [obj]; + }, async submitExclusiveInspectionFeedback(){ await this.$refs.exclusiveInspectionFeedbackRef.validate(); this.exclusiveInspectionFeedbackData.status = this.exclusiveInspectionFeedbackData.inspectionFeedbackStatus; this.exclusiveInspectionFeedbackData.closeAlarm = this.exclusiveInspectionFeedbackData.status === 3; - await InspectionInfoApi.updateInspectionInfo(this.exclusiveInspectionFeedbackData).then(res=>{ + await InspectionInfoApi.exclusiveInspectionFeedback(this.exclusiveInspectionFeedbackData).then(res=>{ this.$modal.msgSuccess("提交成功"); this.exclusiveInspectionFeedbackVisible = false; this.getList(); @@ -239,29 +281,74 @@ export default { await this.$refs.inspectionFeedbackRef.validate(); this.inspectionFeedbackData.status = this.inspectionFeedbackData.inspectionFeedbackStatus; this.inspectionFeedbackData.closeAlarm = this.inspectionFeedbackData.status === 3; - await InspectionInfoApi.updateInspectionInfo(this.inspectionFeedbackData).then(res=>{ + this.inspectionFeedbackData.feedbackList = this.feedbackList; + await InspectionInfoApi.inspectionFeedback(this.inspectionFeedbackData).then(res=>{ this.$modal.msgSuccess("提交成功"); this.inspectionFeedbackVisible = false; this.getList(); }) }, - inspectionFeedback(row){ + async inspectionFeedback(row){ + this.feedbackList = []; + this.treeData = []; this.inspectionFeedbackVisible = true; this.inspectionFeedbackData = {}; this.inspectionFeedbackLoading = true; - InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ + await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ this.inspectionFeedbackData = res.data; this.inspectionFeedbackLoading = false; }) + const data = { + inspectionPlanIds: this.inspectionFeedbackData.inspectionPlanId.split(',') + } + await InspectionPlanApi.getInspectionPlanList(data).then(res=>{ + this.treeData = this.handleTree( + res.data, + "inspectionPlanId", + "parentInspectionId" + ); + }); + this.eventBus.$on("inputCompleted", this.handleGlobalInputCompleted); }, - exclusiveInspectionFeedback(row){ + handleGlobalInputCompleted({ node, inputValue }) { + // 在这里处理全局的输入值 + console.log("全局节点信息:", node); + console.log("全局输入值:", inputValue); + // 你可以将节点信息和输入值进行进一步处理,比如保存到数据库或发送到服务器 + if (this.feedbackList.length > 0) { + const obj = this.feedbackList.find(item => item.inspectionPlanId === node.data.inspectionPlanId); + if (obj != null){ + this.feedbackList.map(item => { + if (item.inspectionPlanId === node.data.inspectionPlanId) { + item.inspectionFeedbackContent = inputValue; + } + }); + }else { + let data = { + inspectionFeedbackContent: inputValue, + inspectionPlanId: node.data.inspectionPlanId + } + this.feedbackList.push(data); + } + } else { + let data = { + inspectionFeedbackContent: inputValue, + inspectionPlanId: node.data.inspectionPlanId + } + this.feedbackList.push(data); + } + }, + async exclusiveInspectionFeedback(row){ this.exclusiveInspectionFeedbackVisible = true; this.exclusiveInspectionFeedbackData = {}; this.exclusiveInspectionFeedbackLoading = true; - InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ + await InspectionInfoApi.getInspectionInfo(row.inspectionId).then(res=>{ this.exclusiveInspectionFeedbackData = res.data; + this.inspectionPlanIds = this.exclusiveInspectionFeedbackData.inspectionPlanId.split(',') + this.inspectionId = row.inspectionId; this.exclusiveInspectionFeedbackLoading = false; }) + await this.$refs.inspectionPlanFeedbackTree.initTree(); }, initSelection(){ getCustomerSelection().then((res) => { diff --git a/imt-ui/src/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue b/imt-ui/src/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue new file mode 100644 index 0000000..61458b8 --- /dev/null +++ b/imt-ui/src/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue @@ -0,0 +1,117 @@ + + diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenanceExclusivePatrolPlanForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenanceExclusivePatrolPlanForm.vue index 0e04af2..acf147a 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenanceExclusivePatrolPlanForm.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenanceExclusivePatrolPlanForm.vue @@ -4,7 +4,7 @@
报警信息
- + @@ -64,9 +64,9 @@
点检工单信息
- - - {{ inspectionInfo.inspectionPlanId }} + + + {{ inspectionInfo.inspectionPlanSupplement }} @@ -75,7 +75,7 @@
定制化点检
- + @@ -93,11 +93,15 @@ import {getSubmitOrderDetails} from '@/api/system/alarm/equipalarmdata' import {parseTime} from "../../../../utils/ruoyi"; import * as inspectionInfoApi from "@/api/system/inspection/inspectionInfo"; +import inspectionPlanFeedbackTree from "@/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue" export default { name: "alarmSubmitMaintenanceOrderForm", + components:{inspectionPlanFeedbackTree}, data() { return { + inspectionId: null, + inspectionPlanIds:null, inspectionInfo:{}, dialogTitle: "点检工单提交", dialogVisible: false, @@ -113,15 +117,17 @@ export default { }, methods: { parseTime, - open(inspectionId) { + async open(inspectionId) { this.alarmFormData = {}; this.submitFormData = {}; this.inspectionInfo = {}; this.alarmFormLoading = true this.submitFormLoading = true; this.inspectionInfoLoading = true; - inspectionInfoApi.getInspectionInfo(inspectionId).then(res=>{ + await inspectionInfoApi.getInspectionInfo(inspectionId).then(res=>{ this.inspectionInfo = res.data; + this.inspectionId = this.inspectionInfo.inspectionId + this.inspectionPlanIds = this.inspectionInfo.inspectionPlanId.split(',') //获取报警详情 getSubmitOrderDetails(this.inspectionInfo.alarmId).then(res=>{ console.log(res); @@ -136,6 +142,7 @@ export default { this.inspectionInfoLoading = false; }) }) + await this.$refs.inspectionPlanFeedbackTree.initTree(); }, async submitOrder(){ this.submitFormLoading = true; diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue index d4d558f..4fa7daa 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue @@ -64,16 +64,80 @@
点检工单信息
- - - - -
- 提 交 - 取 消 -
+ + + + + + + + 选择点检方案 + + +
+ +
+ + + + +
+ + +
+ +
+
+
+
+
@@ -82,24 +146,76 @@ import {getSubmitOrderDetails} from '@/api/system/alarm/equipalarmdata' import {parseTime} from "../../../../utils/ruoyi"; import * as InspectionInfoApi from "@/api/system/inspection/inspectionInfo"; +import {VueOkrTree} from "@/components/VueOkrTree"; +import * as InspectionPlanApi from "@/api/system/inspection/plan"; +import Vue from "vue"; export default { name: "alarmSubmitMaintenanceOrderForm", + components: {VueOkrTree}, data() { return { + eventBus: new Vue(), + props: { + label: "inspectionName", + }, + inspectionPlanLoading:false, + inspectionPlanTreeData:[], + inspectionPlanList:[], + inspectionPlanTitle:"选择点检方案", + inspectionPlanVisible:false, dialogTitle: "点检工单提交", dialogVisible: false, alarmFormData:{}, alarmFormLoading:false, submitFormData:{}, submitFormLoading:false, - submitFormRules:{ - patrolPlan: [{ required: true, message: '点检方案不能为空', trigger: 'blur' }] - } + submitFormRules: { + inspectionPlanId: [ + { required: true, message: "点检方案不能为空", trigger: "blur" }, + ], + }, } }, + provide() { + return { + eventBus: this.eventBus, + }; + }, methods: { parseTime, + selectedInspectionPlanTreeChange(){ + console.log("选择:", this.inspectionPlanList); + }, + objToList(obj){ + return [obj]; + }, + async handleSelectInspectionPlan(){ + this.inspectionPlanVisible = true; + this.inspectionPlanLoading = true; + this.inspectionPlanTreeData = []; + this.inspectionPlanList = []; + try { + const res = await InspectionPlanApi.getInspectionPlanList(); + this.inspectionPlanTreeData = this.handleTree( + res.data, + "inspectionPlanId", + "parentInspectionId" + ); + console.log("treeData:", this.inspectionPlanTreeData); + } finally { + this.inspectionPlanLoading = false; + } + }, + submitSelectInspectionPlan(){ + if (this.inspectionPlanList.length === 0){ + this.$message.error("请至少选择一个点检方案"); + }else { + this.submitFormData.inspectionPlanId = this.inspectionPlanList.join(','); + this.submitFormData.inspectionPlanName = this.inspectionPlanTreeData.filter(item=>this.inspectionPlanList.includes(item.inspectionPlanId)).map(item=>item.inspectionName).join(',') + this.inspectionPlanVisible = false; + } + }, open(alarmId) { this.alarmFormData = {}; this.submitFormData = {}; @@ -118,17 +234,21 @@ export default { }) }, async submitOrder(){ + console.log(this.submitFormData); this.submitFormLoading = true; - await this.$refs.submitForm.validate(); - this.submitFormData.equipId = this.alarmFormData.equipId; - this.submitFormData.customerId = this.alarmFormData.customerId; - this.submitFormData.alarmId = this.alarmFormData.equipAlarmId; - this.submitFormData.status = 0; - await InspectionInfoApi.createInspectionInfo(this.submitFormData) - this.$modal.msgSuccess("提交成功"); - this.$emit('child-event'); - this.dialogVisible = false; - this.submitFormLoading = false; + try { + // await this.$refs.submitForm.validate(); + this.submitFormData.equipId = this.alarmFormData.equipId; + this.submitFormData.customerId = this.alarmFormData.customerId; + this.submitFormData.alarmId = this.alarmFormData.equipAlarmId; + this.submitFormData.status = 0; + await InspectionInfoApi.createInspectionInfo(this.submitFormData) + this.$modal.msgSuccess("提交成功"); + this.$emit('child-event'); + this.dialogVisible = false; + }finally { + this.submitFormLoading = false; + } }, }, } diff --git a/imt-ui/src/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue b/imt-ui/src/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue index 9925c9c..5fa9816 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue @@ -65,8 +65,8 @@
点检工单信息
- - {{ inspectionInfo.inspectionPlanId }} + + {{ inspectionInfo.inspectionPlanSupplement }} @@ -118,11 +118,15 @@ import {getSubmitOrderDetails} from '@/api/system/alarm/equipalarmdata' import {parseTime} from "../../../../utils/ruoyi"; import * as MaintenanceOrderApi from "@/api/system/maintenance/maintenance"; import * as inspectionInfoApi from "@/api/system/inspection/inspectionInfo"; +import inspectionPlanFeedbackTree from "@/views/system/inspectionPlan/inspectionPlanFeedbackTree.vue" export default { name: "alarmSubmitMaintenanceOrderForm", + components: {inspectionPlanFeedbackTree}, data() { return { + inspectionPlanIds:null, + inspectionInfoLoading:false, inspectionId:null, inspectionInfo:{}, orderId: null, @@ -140,13 +144,14 @@ export default { }, methods: { parseTime, - open(inspectionId) { + async open(inspectionId) { this.inspectionId = inspectionId; this.inspectionInfo = {}; this.alarmFormData = {}; this.submitFormData = {}; - inspectionInfoApi.getInspectionInfo(inspectionId).then(res=>{ + await inspectionInfoApi.getInspectionInfo(inspectionId).then(res=>{ this.inspectionInfo = res.data; + this.inspectionPlanIds = this.inspectionInfo.inspectionPlanId.split(',') //获取报警详情 getSubmitOrderDetails(this.inspectionInfo.alarmId).then(res=>{ console.log(res); @@ -161,6 +166,7 @@ export default { this.inspectionInfoLoading = false; }) }) + await this.$refs.inspectionPlanFeedbackTree.initTree(); }, async submitOrder(){ this.submitFormLoading = true;