From 515aff7f48942b52eea2e1b048cd205477fc7221 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Tue, 5 Dec 2023 11:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=85=BB=E7=94=A8=E6=97=B6=E3=80=81?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/device/service/impl/DevicePDAServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index f65d34f7..73282be1 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -121,11 +121,14 @@ public class DevicePDAServiceImpl implements IDevicePDAService { timeArray.add(order.getOrderEnd()); order.setTimeArray(timeArray); + String planName = equOrderMapper.selectPlanNameByPlanCode(order.getPlanCode()); + if (planName != null) { + order.setPlanName(planName); + } + // 设备名称 order.setEquipmentName(equipmentMapper.selectEquipmentByEquipmentCode(order.getEquipmentCode()).getEquipmentName()); - order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(order.getOrderCode())); - order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop())); List detailList = equOrderDetailMapper.selectEquOrderDetailByOrderCode(order.getOrderCode()); @@ -253,6 +256,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { // 更新工单信息 equOrder.setOrderStatus("1"); // 状态为已完成 + equOrder.setOrderStart(DateUtils.getNowDate());// 设置检查时间 equOrder.setUpdateTime(DateUtils.getNowDate()); equOrder.setUpdateBy(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName()); @@ -328,6 +332,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService { if (maintenanceFlag) { // 设置结束时间 equOrder.setOrderEnd(DateUtils.getNowDate()); + // 设置保养用时 + long diff = equOrder.getOrderEnd().getTime() - equOrder.getOrderStart().getTime(); + equOrder.setOrderCostTime(String.valueOf(diff/60000)); // 创建设备对象用于更新设备状态 Equipment equ = new Equipment(); equ.setEquipmentCode(equOrder.getEquipmentCode());