Commit e509492e by chamberone

fix: 修复指定排除工程师逻辑

1 parent d64e0934
...@@ -93,16 +93,18 @@ public class DispatchConstraintProvider implements ConstraintProvider { ...@@ -93,16 +93,18 @@ public class DispatchConstraintProvider implements ConstraintProvider {
.asConstraint(ConstraintNameEnum.technicianCapacityMatch.name()); .asConstraint(ConstraintNameEnum.technicianCapacityMatch.name());
} }
protected Constraint dispatchedMatch(ConstraintFactory factory) { protected Constraint dispatchedMatch(ConstraintFactory factory) {
return factory.forEach(Customer.class).filter(customer -> return factory.forEach(Customer.class).filter(customer ->
// 已分配 // 已分配但是分给了别人
(customer.getDispatchedTechnicianCode() != null (customer.getDispatchedTechnicianCode() != null && customer.getTechnician() != null
&& (customer.getTechnician() == null || !StringUtils.equals(customer.getDispatchedTechnicianCode(), customer.getTechnician().getCode()))) && !StringUtils.equals(customer.getDispatchedTechnicianCode(), customer.getTechnician().getCode())) ||
|| (customer.getExclusiveTechnicianCode() != null // 已排除但是分给了这个人
&& (customer.getTechnician() == null || StrUtil.contains("," + customer.getExclusiveTechnicianCode() + ",", "," + customer.getTechnician().getCode() + ",")))) (customer.getExclusiveTechnicianCode() != null && customer.getTechnician() != null
.penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50) && StringUtils.equals(customer.getExclusiveTechnicianCode(),
.asConstraint(ConstraintNameEnum.dispatchedMatch.name()); customer.getTechnician().getCode())))
} .penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50)
.asConstraint(ConstraintNameEnum.dispatchedMatch.name());
}
// protected Constraint customerTimeWindowsMatch1(ConstraintFactory factory) { // protected Constraint customerTimeWindowsMatch1(ConstraintFactory factory) {
// return factory.forEach(Customer.class).filter( // return factory.forEach(Customer.class).filter(
......
...@@ -271,6 +271,11 @@ public class SolveServiceImpl implements SolveService { ...@@ -271,6 +271,11 @@ public class SolveServiceImpl implements SolveService {
customer.setExclusiveTechnicianCode(Objects.nonNull(orderInfo.getAppointEngineerCodes()) ? customer.setExclusiveTechnicianCode(Objects.nonNull(orderInfo.getAppointEngineerCodes()) ?
orderInfo.getAppointEngineerCodes().trim() : null); orderInfo.getAppointEngineerCodes().trim() : null);
} }
log.info(
"订单指定排除工程师, teamId:{}, batchNo:{}, orderId:{}, dispatchedTechnicianCode:{}, exclusiveTechnicianCode:{}",
teamId, batchNo, order.getOrderId(), customer.getDispatchedTechnicianCode(),
customer.getExclusiveTechnicianCode());
customerList.add(customer); customerList.add(customer);
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!