Commit 3f126ebb by Ren Ping

feat:增加服务类消息预警自动任务

1 parent 8df57e96
......@@ -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!