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 { ...@@ -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);
}); });
......
...@@ -105,9 +105,10 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS ...@@ -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) "and DATE_ADD(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_branch_id = :orgBranchId", nativeQuery = true)
long countOvertimeByDtAndOrgBranchId(LocalDate dt, String orgBranchId); long countOvertimeByDtAndOrgBranchId(LocalDate dt, String orgBranchId);
@Query(value = "from OrderInfoEntity where orderStatus <> 'CANCELED' and engineerCode is not null" @Query(value = "from OrderInfoEntity where orderStatus <> 'CANCELED'"
+ " and planStartTime is not null and planEndTime is not null and planStartTime>?1" + " and engineerCode is not null and engineerCode<>''"
+ " and ((actualStartTime is null and planStartTime<= ?2) " + " and expectTimeBegin is not null and expectTimeEnd is not null and expectTimeBegin>?1"
+ " or (actualStartTime is not null and actualEndTime is null and planEndTime<= ?2))") + " 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); List<OrderInfoEntity> getDelayOrTimeoutOrder(LocalDateTime today, LocalDateTime now);
} }
...@@ -84,7 +84,7 @@ public class ServiceMsgScheduler { ...@@ -84,7 +84,7 @@ public class ServiceMsgScheduler {
engineerName, engineerName,
orderInfoEntity.getEngineerCode(), orderInfoEntity.getEngineerCode(),
orderInfoEntity.getOrderId(), orderInfoEntity.getOrderId(),
DateUtil.format(orderInfoEntity.getPlanStartTime(), "yyyy-MM-dd HH:mm") DateUtil.format(orderInfoEntity.getExpectTimeBegin(), "yyyy-MM-dd HH:mm")
)); ));
} else {//超时 } else {//超时
dto.setContent(String.format(timeoutContent, dto.setContent(String.format(timeoutContent,
...@@ -92,7 +92,7 @@ public class ServiceMsgScheduler { ...@@ -92,7 +92,7 @@ public class ServiceMsgScheduler {
engineerName, engineerName,
orderInfoEntity.getEngineerCode(), orderInfoEntity.getEngineerCode(),
orderInfoEntity.getOrderId(), 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: ...@@ -92,4 +92,4 @@ scheduler:
day-offset-begin: 0 day-offset-begin: 0
day-offset-end: 14 day-offset-end: 14
service-msg: 0 40 11,17 * * ? service-msg: 0 35 11,17,15 * * ?
\ No newline at end of file \ 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!