1
This commit is contained in:
@@ -179,7 +179,7 @@ public class JDUtils {
|
|||||||
@Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
|
@Scheduled(cron = "0 * * * * ?") // 每分钟执行一次
|
||||||
public void fetchLatestOrder() throws Exception {
|
public void fetchLatestOrder() throws Exception {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LocalDateTime lastMinute = now.minusMinutes(10).withSecond(0).withNano(0);
|
LocalDateTime lastMinute = now.minusMinutes(30).withSecond(0).withNano(0);
|
||||||
|
|
||||||
UnionOpenOrderRowQueryResponse response = fetchOrdersForDateTime(lastMinute, true, 1); // 真实代表实时订单
|
UnionOpenOrderRowQueryResponse response = fetchOrdersForDateTime(lastMinute, true, 1); // 真实代表实时订单
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
@@ -207,8 +207,9 @@ public class JDUtils {
|
|||||||
* 扫描订单发送到微信
|
* 扫描订单发送到微信
|
||||||
* 每分钟的30秒执行一次
|
* 每分钟的30秒执行一次
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "30 * * * * ?")
|
@Scheduled(cron = "*/10 * * * * ?")
|
||||||
public void sendOrderToWx() {
|
public void sendOrderToWx() {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
int[] parm = {-1};
|
int[] parm = {-1};
|
||||||
List<OrderRow> orderRows = orderRowRepository.findByValidCodeNotInOrderByOrderTimeDesc(parm);
|
List<OrderRow> orderRows = orderRowRepository.findByValidCodeNotInOrderByOrderTimeDesc(parm);
|
||||||
if (!orderRows.isEmpty()) {
|
if (!orderRows.isEmpty()) {
|
||||||
@@ -216,6 +217,7 @@ public class JDUtils {
|
|||||||
orderToWx(orderRow, true);
|
orderToWx(orderRow, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logger.info("扫描订单发送到微信耗时:{} ms, 订单数:{} ", System.currentTimeMillis() - start, orderRows.size());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,7 +644,7 @@ public class JDUtils {
|
|||||||
|
|
||||||
Map<String, Long> skuIdViolationCountMap = filterOrdersByDays.stream().filter(orderRow -> orderRow.getValidCode() == 27
|
Map<String, Long> skuIdViolationCountMap = filterOrdersByDays.stream().filter(orderRow -> orderRow.getValidCode() == 27
|
||||||
|| orderRow.getValidCode() == 28
|
|| orderRow.getValidCode() == 28
|
||||||
|| orderRow.getValidCode() == 2).filter(orderRow -> orderRow.getSkuName() != null).collect(Collectors.groupingBy(OrderRow::getSkuName, Collectors.counting()));
|
).filter(orderRow -> orderRow.getSkuName() != null).collect(Collectors.groupingBy(OrderRow::getSkuName, Collectors.counting()));
|
||||||
List<Map.Entry<String, Long>> sortedViolationCounts = skuIdViolationCountMap.entrySet().stream()
|
List<Map.Entry<String, Long>> sortedViolationCounts = skuIdViolationCountMap.entrySet().stream()
|
||||||
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
|
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
|
||||||
Integer num = 0;
|
Integer num = 0;
|
||||||
@@ -657,7 +659,7 @@ public class JDUtils {
|
|||||||
// 订单状态查询
|
// 订单状态查询
|
||||||
if (order.startsWith("3") || order.startsWith("2")) {
|
if (order.startsWith("3") || order.startsWith("2")) {
|
||||||
List<OrderRow> orderRowList = orderRowRepository.findByOrderId(Long.parseLong(order));
|
List<OrderRow> orderRowList = orderRowRepository.findByOrderId(Long.parseLong(order));
|
||||||
if (orderRowList.size() > 0) {
|
if (!orderRowList.isEmpty()) {
|
||||||
OrderRow orderRow = orderRowList.get(0);
|
OrderRow orderRow = orderRowList.get(0);
|
||||||
content.append(getFormattedOrderInfo(orderRow, orderRow.getValidCode()));
|
content.append(getFormattedOrderInfo(orderRow, orderRow.getValidCode()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user