Commit e509492e by chamberone

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

1 parent d64e0934
...@@ -95,11 +95,13 @@ public class DispatchConstraintProvider implements ConstraintProvider { ...@@ -95,11 +95,13 @@ public class DispatchConstraintProvider implements ConstraintProvider {
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
&& StringUtils.equals(customer.getExclusiveTechnicianCode(),
customer.getTechnician().getCode())))
.penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50) .penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50)
.asConstraint(ConstraintNameEnum.dispatchedMatch.name()); .asConstraint(ConstraintNameEnum.dispatchedMatch.name());
} }
......
...@@ -272,6 +272,11 @@ public class SolveServiceImpl implements SolveService { ...@@ -272,6 +272,11 @@ public class SolveServiceImpl implements SolveService {
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!