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());