diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java index a12354a0..3a9e700d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java @@ -203,6 +203,26 @@ public class EquOrder extends BaseEntity { private Date orderEndArrayStart; private Date orderEndArrayEnd; + private List upkeepPictures; + + private String picturePath; + + public String getPicturePath() { + return picturePath; + } + + public void setPicturePath(String picturePath) { + this.picturePath = picturePath; + } + + public List getUpkeepPictures() { + return upkeepPictures; + } + + public void setUpkeepPictures(List upkeepPictures) { + this.upkeepPictures = upkeepPictures; + } + public List getOrderStartArray() { return orderStartArray; } 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 98e3c887..39f9bdfc 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 @@ -150,6 +150,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService { order.setPersonList(personList); + // 保养图片 + BaseFileData selectTemp = new BaseFileData(); + selectTemp.setSourceId(equOrder.getId()); + List upkeepPictures = equFileMapper.selectUrlList(selectTemp); + if (upkeepPictures != null) { + order.setUpkeepPictures(upkeepPictures); + } return success(order); } @@ -304,6 +311,23 @@ public class DevicePDAServiceImpl implements IDevicePDAService { if (equOrder.getPlanType().equals("maintenance")) { // 设置结束时间 equOrder.setOrderEnd(DateUtils.getNowDate()); + //上传附件 + if (StringUtils.isNotEmpty(equOrder.getPicturePath())) { + String[] ids = equOrder.getPicturePath().split(","); + List files = new ArrayList<>(); + BaseFileData file = null; + for (String id : ids) { + file = new BaseFileData(); + file.setFileId(IdUtils.fastSimpleUUID()); + file.setFileName(id.split("&fileName=")[1]); + file.setFileAddress(id); + file.setSourceId(equOrder.getOrderId()); + file.setCreateBy(SecurityUtils.getUsername()); + file.setCreateTime(new Date()); + files.add(file); + } + equFileMapper.insertEquFileBatch(files); + } } // 更新工单信息 @@ -413,6 +437,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService { order.setShutDown(pdadto.getShutDown()); // 设置开始时间 order.setOrderStart(DateUtils.getNowDate()); + // 设置保养人 + order.setPlanPerson(SecurityContextHolder.getUserName()); // 更新数据表 order.setUpdateBy(SecurityContextHolder.getUserName()); order.setUpdateTime(DateUtils.getNowDate()); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index 4291e868..ec503844 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -308,7 +308,7 @@ public class EquOrderServiceImpl implements IEquOrderService { } if (!hasError) { - // TODO 删除报修单 + // 删除报修单 if (equOrder.getRepairCode() != null) { if (!equOrder.getRepairCode().isEmpty()) { equRepairOrderMapper.deleteEquRepairOrderByRepairCode(equOrder.getRepairCode()); @@ -324,6 +324,23 @@ public class EquOrderServiceImpl implements IEquOrderService { long diffSeconds = (equOrder.getOrderEnd().getTime() - equOrder.getOrderStart().getTime()) / 60000; equOrder.setOrderCostTime(String.valueOf(diffSeconds)); } + // 保养图片 + if (StringUtils.isNotEmpty(equOrder.getPicturePath())) { + String[] ids = equOrder.getPicturePath().split(","); + List files = new ArrayList<>(); + BaseFileData file = null; + for (String id : ids) { + file = new BaseFileData(); + file.setFileId(IdUtils.fastSimpleUUID()); + file.setFileName(id.split("&fileName=")[1]); + file.setFileAddress(id); + file.setSourceId(equOrder.getOrderId()); + file.setCreateBy(SecurityUtils.getUsername()); + file.setCreateTime(new Date()); + files.add(file); + } + equFileMapper.insertEquFileBatch(files); + } } // 更新工单信息 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 aa85dd7d..3e04ee70 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 @@ -59,6 +59,14 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { order.setPlanName(equPlan.getPlanName()); } + // 保养图片 + BaseFileData selectTemp = new BaseFileData(); + selectTemp.setSourceId(orderId); + List upkeepPictures = equFileMapper.selectUrlList(selectTemp); + if (upkeepPictures != null) { + order.setUpkeepPictures(upkeepPictures); + } + // 查询备件信息 List spareList = equSpareApplyMapper.selectEquSpareApplyListByParentCode(order.getOrderCode()); @@ -86,7 +94,6 @@ public class InspectionWorkServiceImpl implements IInspectionWorkService { } } // 未达标图片 - BaseFileData selectTemp = new BaseFileData(); selectTemp.setSourceId(standard.getId()); selectTemp.setImageType("3"); List checkPictrueList = equFileMapper.selectUrlList(selectTemp); diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFileMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFileMapper.xml index fffe32f3..00829f88 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFileMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFileMapper.xml @@ -69,7 +69,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"