保养不添加到报修

highway
wws 1 year ago
parent 54a704ba27
commit 0fa435b51c

@ -186,6 +186,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
boolean hasError = false;
boolean maintenanceFlag = false;
if (equOrder.getPlanType().equals("maintenance")) {
maintenanceFlag = true;
}
List<EquOrderDetail> detailList = equOrder.getDetailList();
for (EquOrderDetail detail : detailList) {
@ -256,7 +261,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
// 报修信息
if (checkRepair && hasError ) {
if (checkRepair && hasError && !maintenanceFlag) {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
@ -308,7 +313,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
// 保养逻辑
if (equOrder.getPlanType().equals("maintenance")) {
if (maintenanceFlag) {
// 设置结束时间
equOrder.setOrderEnd(DateUtils.getNowDate());
//上传附件

@ -196,6 +196,11 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
boolean hasError = false;
boolean maintenanceFlag = false;
if (equOrder.getPlanType().equals("maintenance")) {
maintenanceFlag = true;
}
List<EquOrderDetail> detailList = equOrder.getDetailList();
for (EquOrderDetail detail : detailList) {
@ -264,7 +269,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
// 报修信息
if (checkRepair && hasError) {
if (checkRepair && hasError && !maintenanceFlag) {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
@ -318,7 +323,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
// 保养逻辑
if (equOrder.getPlanType().equals("maintenance")) {
if (maintenanceFlag) {
// 用时
if (equOrder.getOrderStart() != null) {
long diffSeconds = (equOrder.getOrderEnd().getTime() - equOrder.getOrderStart().getTime()) / 60000;

Loading…
Cancel
Save