Commit 8c12b2ea by chamberone

fix: 修复时间计算bug

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