Commit e3c4d75f by levphon

工单导入

1 parent 82235b26
......@@ -151,26 +151,16 @@ public class WorkOrderImportListener extends AnalysisEventListener<WorkOrderImpo
log.warn(woi.toString());
return false;
}
}
ZonedDateTime nowTime = ZonedDateTime.now();
ZonedDateTime dateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(woi.getServiceTime().toInstant().toEpochMilli()), ZoneId.systemDefault());
Duration duration = Duration.between(nowTime, dateTime).abs();
if (duration.toDays() < 0) {
woi.setImportFailReason("期望服务日期不能小于当前日期");
log.warn(woi.toString());
return false;
}
//检查未完成工单
WorkOrder workOrder = workOrderService.getIncompleteWorkOrder(BizServiceTypeEnum.INSTALL.getType(), woi.getVin());
if (workOrder != null) {
woi.setImportFailReason("存在相同的车架号");
log.warn(woi.toString());
return false;
}
ZonedDateTime nowTime = ZonedDateTime.now();
ZonedDateTime dateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(woi.getServiceTime().toInstant().toEpochMilli()), ZoneId.systemDefault());
Duration duration = Duration.between(nowTime, dateTime).abs();
if (duration.toDays() < 0) {
woi.setImportFailReason("期望服务日期不能小于当前日期");
log.warn(woi.toString());
return false;
}
if (needInstallFlag) {
//需要安装时,检查设备组合
boolean checkDeviceComposeFlag = workOrderService.checkDeviceCompose(woi);
if (!checkDeviceComposeFlag) {
......@@ -180,6 +170,14 @@ public class WorkOrderImportListener extends AnalysisEventListener<WorkOrderImpo
}
}
//检查未完成工单
WorkOrder workOrder = workOrderService.getIncompleteWorkOrder(BizServiceTypeEnum.INSTALL.getType(), woi.getVin());
if (workOrder != null) {
woi.setImportFailReason("存在相同的车架号");
log.warn(woi.toString());
return false;
}
//去掉数字
if (StringUtils.isNotEmpty(woi.getServiceApm())) {
woi.setServiceApm(woi.getServiceApm().replace("1", "").replace("2", ""));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!