Commit 8c12b2ea by chamberone

fix: 修复时间计算bug

1 parent ceaf4e51
......@@ -123,12 +123,12 @@ public class SolveServiceImpl implements SolveService {
LocalDateTime ldt2 = dateToLocalDateTime(order.getExpectTimeEnd());
int start = 60 * 8;
int end = 60 * 18;
if (ldt1 != null) {
start = ldt1.getMinute();
}
if (ldt2 != null) {
end = ldt2.getMinute();
}
if (ldt1 != null) {
start = ldt1.getHour() * 60 + ldt1.getMinute();
}
if (ldt2 != null) {
end = ldt2.getHour() * 60 + ldt2.getMinute();
}
// 40分钟兜低(技能未能正确匹配原因)
......
......@@ -359,11 +359,8 @@ public class DispatchSolutionUtils {
constraintMatchTotalMap.forEach((key, value) -> {
if (!value.getScore().isFeasible()) {
// 违反硬约束
System.err.printf("%s 匹配%s次 hard得分:%s%n", value.getConstraintName(), value.getConstraintMatchCount(),
value.getScore().hardScore());
value.getConstraintMatchSet().stream().sorted(comparing(ConstraintMatch::getScore))
.forEach(constraintMatch -> {
String text = "";
switch (ConstraintNameEnum.valueOf(value.getConstraintName())) {
case skillMatch:
case customerTimeWindowsMatch:
......@@ -371,7 +368,6 @@ public class DispatchSolutionUtils {
// 违反硬约束对象,根据具体约束返回不同类型对象
if (indictedObject instanceof Customer) {
Customer customer = (Customer) indictedObject;
text += customer.getCode() + ",";
// 更新shadow变量
updateShadowVariable(customer);
......@@ -380,8 +376,6 @@ public class DispatchSolutionUtils {
customer.getTechnician().getCustomerList().remove(customer);
}
}
System.out.printf(" 预约单(%s)违反约束,扣分%s%n", text,
constraintMatch.getScore().toShortString());
break;
default:
break;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!