From 92615d8e281946f81d3dcdc42a2116342e6b3b91 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 8 Nov 2023 10:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/device/domain/vo/InspectionWorkVO.java | 10 ++++++++++ .../com/op/device/mapper/EquOrderEquSpareMapper.java | 7 +++++++ .../device/service/impl/InspectionWorkServiceImpl.java | 9 +++++++++ .../resources/mapper/device/EquOrderEquSpareMapper.xml | 5 +++++ 4 files changed, 31 insertions(+) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/vo/InspectionWorkVO.java b/op-modules/op-device/src/main/java/com/op/device/domain/vo/InspectionWorkVO.java index ec53c3fc..4189bab8 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/vo/InspectionWorkVO.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/vo/InspectionWorkVO.java @@ -2,6 +2,7 @@ package com.op.device.domain.vo; import com.op.device.domain.EquOrder; import com.op.device.domain.EquOrderDetail; +import com.op.device.domain.EquOrderEquSpare; import com.op.device.domain.Equipment; import java.util.List; @@ -11,6 +12,15 @@ public class InspectionWorkVO { private EquOrder order; private Equipment equ; private List detailList; + private List spareList; + + public List getSpareList() { + return spareList; + } + + public void setSpareList(List spareList) { + this.spareList = spareList; + } public EquOrder getOrder() { return order; diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquSpareMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquSpareMapper.java index a752d8f6..1d073bb6 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquSpareMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquSpareMapper.java @@ -65,4 +65,11 @@ public interface EquOrderEquSpareMapper { * @return */ List selectEquOrderEquSpareByParentCode(String code); + + /** + * 通过工单code查询备件信息 + * @param orderCode + * @return + */ + List selectEquOrderEquSpareByOrderCode(String orderCode); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/InspectionWorkServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/InspectionWorkServiceImpl.java index 52b514ae..1c2279e6 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/InspectionWorkServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/InspectionWorkServiceImpl.java @@ -33,6 +33,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { private EquOrderStandardMapper equOrderStandardMapper; @Autowired private EquPlanMapper equPlanMapper; + @Autowired + private EquOrderEquSpareMapper equOrderEquSpareMapper; /** * 查询巡检记录 @@ -44,6 +46,7 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { @DS("#header.poolName") public AjaxResult selectEquOrderByOrderId(String orderId) { InspectionWorkVO workVO = new InspectionWorkVO(); + // 查询工单信息 EquOrder order = equOrderMapper.selectEquOrderByOrderId(orderId); // 设置计划名称 EquPlan equPlan = equPlanMapper.selectEquPlanByPlanCode(order.getPlanCode()); @@ -51,11 +54,15 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { order.setPlanName(equPlan.getPlanName()); } + // 查询备件信息 + List spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByOrderCode(order.getOrderCode()); + // 替换循环周期 order.setPlanLoopType(equOrderMapper.changeLoopType(order.getPlanLoopType())); Equipment equipment = equipmentMapper.selectEquipmentByEquipmentCode(order.getEquipmentCode()); + // 查询检查项、标准 List detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); for (EquOrderDetail detail : detailList) { List standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode()); @@ -76,6 +83,8 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { } detail.setStandardList(standardList); } + + workVO.setSpareList(spareList); workVO.setOrder(order); workVO.setEqu(equipment); workVO.setDetailList(detailList); diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml index b191f4a0..d3771813 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquSpareMapper.xml @@ -55,6 +55,11 @@ where parent_code = #{parentCode} + + insert into equ_order_equ_spare