Commit 112e27de by huangjinxin

fix:插单优化

1 parent 6bc91fe9
...@@ -7,6 +7,7 @@ import com.dituhui.pea.order.enums.OrderPeaTagsEnum; ...@@ -7,6 +7,7 @@ import com.dituhui.pea.order.enums.OrderPeaTagsEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum; import com.dituhui.pea.order.enums.ServiceStatusEnum;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -84,9 +85,17 @@ public class OrderUtil { ...@@ -84,9 +85,17 @@ public class OrderUtil {
* @return * @return
*/ */
public static Boolean isDelay(OrderInfo order) { public static Boolean isDelay(OrderInfo order) {
if (order.getDt().isBefore(LocalDate.now())) {
return false;
}
if (!order.getServiceStatus().equals(ServiceStatusEnum.INIT.getCode()) && !order.getServiceStatus().equals(ServiceStatusEnum.CONTACTED.getCode())) { if (!order.getServiceStatus().equals(ServiceStatusEnum.INIT.getCode()) && !order.getServiceStatus().equals(ServiceStatusEnum.CONTACTED.getCode())) {
return false; return false;
} }
if (ObjectUtil.isNull(order.getPlanStartTime())) {
if (order.getExpectTimeBegin().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) {
return true;
}
}
if (order.getPlanStartTime().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) { if (order.getPlanStartTime().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) {
return true; return true;
} }
...@@ -101,9 +110,17 @@ public class OrderUtil { ...@@ -101,9 +110,17 @@ public class OrderUtil {
* @return * @return
*/ */
public static Boolean isOvertime(OrderInfo order) { public static Boolean isOvertime(OrderInfo order) {
if (order.getDt().isBefore(LocalDate.now())) {
return false;
}
if (!order.getServiceStatus().equals(ServiceStatusEnum.STARTED.getCode()) || ObjectUtil.isNotNull(order.getActualEndTime())) { if (!order.getServiceStatus().equals(ServiceStatusEnum.STARTED.getCode()) || ObjectUtil.isNotNull(order.getActualEndTime())) {
return false; return false;
} }
if (ObjectUtil.isNull(order.getPlanEndTime())) {
if (order.getExpectTimeEnd().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) {
return true;
}
}
if (order.getPlanEndTime().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) { if (order.getPlanEndTime().getTime() + 10 * 60 * 1000 < System.currentTimeMillis()) {
return true; return true;
} }
...@@ -118,9 +135,17 @@ public class OrderUtil { ...@@ -118,9 +135,17 @@ public class OrderUtil {
* @return * @return
*/ */
public static Boolean isDelay(OrderInfoEntity order) { public static Boolean isDelay(OrderInfoEntity order) {
if (order.getDt().isBefore(LocalDate.now())) {
return false;
}
if (!order.getServiceStatus().equals(ServiceStatusEnum.INIT.getCode()) && !order.getServiceStatus().equals(ServiceStatusEnum.CONTACTED.getCode())) { if (!order.getServiceStatus().equals(ServiceStatusEnum.INIT.getCode()) && !order.getServiceStatus().equals(ServiceStatusEnum.CONTACTED.getCode())) {
return false; return false;
} }
if (ObjectUtil.isNull(order.getPlanEndTime())) {
if (order.getExpectTimeEnd().plusMinutes(10).isBefore(LocalDateTime.now())) {
return true;
}
}
if (order.getPlanStartTime().plusMinutes(10).isBefore(LocalDateTime.now())) { if (order.getPlanStartTime().plusMinutes(10).isBefore(LocalDateTime.now())) {
return true; return true;
} }
...@@ -135,9 +160,17 @@ public class OrderUtil { ...@@ -135,9 +160,17 @@ public class OrderUtil {
* @return * @return
*/ */
public static Boolean isOvertime(OrderInfoEntity order) { public static Boolean isOvertime(OrderInfoEntity order) {
if (order.getDt().isBefore(LocalDate.now())) {
return false;
}
if (!order.getServiceStatus().equals(ServiceStatusEnum.STARTED.getCode()) || ObjectUtil.isNotNull(order.getActualEndTime())) { if (!order.getServiceStatus().equals(ServiceStatusEnum.STARTED.getCode()) || ObjectUtil.isNotNull(order.getActualEndTime())) {
return false; return false;
} }
if (ObjectUtil.isNull(order.getPlanEndTime())) {
if (order.getExpectTimeEnd().plusMinutes(10).isBefore(LocalDateTime.now())) {
return true;
}
}
if (order.getPlanEndTime().plusMinutes(10).isBefore(LocalDateTime.now())) { if (order.getPlanEndTime().plusMinutes(10).isBefore(LocalDateTime.now())) {
return true; return true;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!