Commit 15e151c0 by Ren Ping

fix:RESCHEDULED工单也可自动派单

1 parent aea74809
...@@ -12,6 +12,7 @@ import java.util.stream.Collectors; ...@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.optaplanner.constraint.streams.drools.DroolsConstraintStreamScoreDirector; import org.optaplanner.constraint.streams.drools.DroolsConstraintStreamScoreDirector;
...@@ -36,6 +37,7 @@ import com.dituhui.pea.dispatch.pojo.Customer; ...@@ -36,6 +37,7 @@ import com.dituhui.pea.dispatch.pojo.Customer;
import com.dituhui.pea.dispatch.pojo.DispatchSolution; import com.dituhui.pea.dispatch.pojo.DispatchSolution;
import com.dituhui.pea.dispatch.pojo.Technician; import com.dituhui.pea.dispatch.pojo.Technician;
@Slf4j
public class DispatchSolutionUtils { public class DispatchSolutionUtils {
/** /**
...@@ -385,6 +387,11 @@ public class DispatchSolutionUtils { ...@@ -385,6 +387,11 @@ public class DispatchSolutionUtils {
// 违反硬约束对象,根据具体约束返回不同类型对象 // 违反硬约束对象,根据具体约束返回不同类型对象
if (indictedObject instanceof Customer) { if (indictedObject instanceof Customer) {
Customer customer = (Customer) indictedObject; Customer customer = (Customer) indictedObject;
log.warn(">>> 工单({})违背 customerTimeWindowsMatch 硬约束: engineerCode: {}, arriveTime: {},departureTime: {}",
customer.getCode(),
null != customer.getTechnician() ? customer.getTechnician().getCode() : null,
customer.getArrivalTime(),
customer.getDepartureTime());
// 更新shadow变量 // 更新shadow变量
updateShadowVariable(customer); updateShadowVariable(customer);
// 移除技术员 // 移除技术员
...@@ -403,6 +410,11 @@ public class DispatchSolutionUtils { ...@@ -403,6 +410,11 @@ public class DispatchSolutionUtils {
for (Customer customer : customerList) { for (Customer customer : customerList) {
if (!customer.isInTechnicianTimeWindows() if (!customer.isInTechnicianTimeWindows()
&& !StrUtil.equals("CONFIRM", customer.getStatus())) { && !StrUtil.equals("CONFIRM", customer.getStatus())) {
log.warn(">>> 工单({})违背 customerTimeWindowsMatch 硬约束: engineerCode: {}, arriveTime: {},departureTime: {}",
customer.getCode(),
null != customer.getTechnician() ? customer.getTechnician().getCode() : null,
customer.getArrivalTime(),
customer.getDepartureTime());
// 更新shadow变量 // 更新shadow变量
updateShadowVariable(customer); updateShadowVariable(customer);
// 移除技术员 // 移除技术员
...@@ -418,6 +430,11 @@ public class DispatchSolutionUtils { ...@@ -418,6 +430,11 @@ public class DispatchSolutionUtils {
// 违反硬约束对象,根据具体约束返回不同类型对象 // 违反硬约束对象,根据具体约束返回不同类型对象
if (indictedObject instanceof Customer) { if (indictedObject instanceof Customer) {
Customer customer = (Customer) indictedObject; Customer customer = (Customer) indictedObject;
log.warn(">>> 工单({})违背 customerTimeWindowsMatch 硬约束: engineerCode: {}, arriveTime: {},departureTime: {}",
customer.getCode(),
null != customer.getTechnician() ? customer.getTechnician().getCode() : null,
customer.getArrivalTime(),
customer.getDepartureTime());
// 更新shadow变量 // 更新shadow变量
updateShadowVariable(customer); updateShadowVariable(customer);
// 移除技术员 // 移除技术员
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!