Commit a5280d59 by 刘鑫

Merge branch 'develop' of https://gitlab.dituhui.com/bsh/project/project into develop

2 parents 907ebb6c f8d4ef2f
......@@ -93,16 +93,18 @@ public class DispatchConstraintProvider implements ConstraintProvider {
.asConstraint(ConstraintNameEnum.technicianCapacityMatch.name());
}
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())))
|| (customer.getExclusiveTechnicianCode() != null
&& (customer.getTechnician() == null || StrUtil.contains("," + customer.getExclusiveTechnicianCode() + ",", "," + customer.getTechnician().getCode() + ","))))
.penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50)
.asConstraint(ConstraintNameEnum.dispatchedMatch.name());
}
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())) ||
// 已排除但是分给了这个人
(customer.getExclusiveTechnicianCode() != null && customer.getTechnician() != null
&& StringUtils.equals(customer.getExclusiveTechnicianCode(),
customer.getTechnician().getCode())))
.penalizeLong(HardSoftLongScore.ONE_HARD, customer -> 50)
.asConstraint(ConstraintNameEnum.dispatchedMatch.name());
}
// protected Constraint customerTimeWindowsMatch1(ConstraintFactory factory) {
// return factory.forEach(Customer.class).filter(
......
......@@ -271,6 +271,11 @@ public class SolveServiceImpl implements SolveService {
customer.setExclusiveTechnicianCode(Objects.nonNull(orderInfo.getAppointEngineerCodes()) ?
orderInfo.getAppointEngineerCodes().trim() : null);
}
log.info(
"订单指定排除工程师, teamId:{}, batchNo:{}, orderId:{}, dispatchedTechnicianCode:{}, exclusiveTechnicianCode:{}",
teamId, batchNo, order.getOrderId(), customer.getDispatchedTechnicianCode(),
customer.getExclusiveTechnicianCode());
customerList.add(customer);
});
......
......@@ -105,9 +105,10 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
"and DATE_ADD(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_branch_id = :orgBranchId", nativeQuery = true)
long countOvertimeByDtAndOrgBranchId(LocalDate dt, String orgBranchId);
@Query(value = "from OrderInfoEntity where orderStatus <> 'CANCELED' and engineerCode is not null"
+ " and planStartTime is not null and planEndTime is not null and planStartTime>?1"
+ " and ((actualStartTime is null and planStartTime<= ?2) "
+ " or (actualStartTime is not null and actualEndTime is null and planEndTime<= ?2))")
@Query(value = "from OrderInfoEntity where orderStatus <> 'CANCELED'"
+ " and engineerCode is not null and engineerCode<>''"
+ " and expectTimeBegin is not null and expectTimeEnd is not null and expectTimeBegin>?1"
+ " and ((actualStartTime is null and expectTimeBegin<= ?2) "
+ " or (actualStartTime is not null and actualEndTime is null and expectTimeEnd<= ?2))")
List<OrderInfoEntity> getDelayOrTimeoutOrder(LocalDateTime today, LocalDateTime now);
}
......@@ -84,7 +84,7 @@ public class ServiceMsgScheduler {
engineerName,
orderInfoEntity.getEngineerCode(),
orderInfoEntity.getOrderId(),
DateUtil.format(orderInfoEntity.getPlanStartTime(), "yyyy-MM-dd HH:mm")
DateUtil.format(orderInfoEntity.getExpectTimeBegin(), "yyyy-MM-dd HH:mm")
));
} else {//超时
dto.setContent(String.format(timeoutContent,
......@@ -92,7 +92,7 @@ public class ServiceMsgScheduler {
engineerName,
orderInfoEntity.getEngineerCode(),
orderInfoEntity.getOrderId(),
DateUtil.format(orderInfoEntity.getPlanEndTime(), "yyyy-MM-dd HH:mm")
DateUtil.format(orderInfoEntity.getExpectTimeEnd(), "yyyy-MM-dd HH:mm")
));
}
......
......@@ -92,4 +92,4 @@ scheduler:
day-offset-begin: 0
day-offset-end: 14
service-msg: 0 40 11,17 * * ?
\ No newline at end of file
service-msg: 0 35 11,17,15 * * ?
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!