Commit bb1a8006 by chamberone

feat: 算法支持已排除工程师

1 parent ab627f1b
......@@ -26,7 +26,7 @@ public enum ConstraintNameEnum {
*/
technicianCapacityMatch,
/**
* 已分配匹配
* 已分配和已排除技术员匹配
*/
dispatchedMatch,
......
......@@ -93,10 +93,14 @@ public class DispatchConstraintProvider implements ConstraintProvider {
}
protected Constraint dispatchedMatch(ConstraintFactory factory) {
return factory.forEach(Customer.class)
.filter(customer -> customer.getDispatchedTechnicianCode() != null
&& ((customer.getTechnician() == null) || (!StringUtils
.equals(customer.getDispatchedTechnicianCode(), customer.getTechnician().getCode()))))
return factory.forEach(Customer.class).filter(customer ->
// 已分配
(customer.getDispatchedTechnicianCode() != null && ((customer.getTechnician() == null)
|| (!StringUtils.equals(customer.getDispatchedTechnicianCode(), customer.getTechnician().getCode()))))
||
// 已排除
(customer.getExclusiveTechnicianCode() != null && ((customer.getTechnician() == null) || (StringUtils
.equals(customer.getExclusiveTechnicianCode(), customer.getTechnician().getCode())))))
.penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50)
.asConstraint(ConstraintNameEnum.dispatchedMatch.name());
}
......
......@@ -21,8 +21,12 @@ public class Customer {
private long id;
private String code;
// 已分配
private String dispatchedTechnicianCode;
// 已排除
private String exclusiveTechnicianCode;
// orderid(code)+dt 确定唯一一条工单
private String dt;
@JsonIgnore
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!