This commit is contained in:
Your Name
2026-06-04 09:57:14 +08:00
parent 26b2cde699
commit 32f8e19bf1
4 changed files with 15 additions and 8 deletions
@@ -435,7 +435,7 @@ final class GancaoLogisticsRouteService
}
/**
* 批量同步:选取候选订单(已上传甘草、且未签收/未取消的)
* 批量同步:选取候选订单(已上传甘草、且未完成/未签收/未取消的)
*
* @return array{total:int, success:int, failed:int, skipped:int, assistant_cleared:int, assistant_skipped_assign_log:int, assistant_lines:list<string>, details:array<int, array<string,mixed>>}
*/
@@ -464,8 +464,8 @@ final class GancaoLogisticsRouteService
$w->whereIn('gancao_order_state', [110, 20, 30, 90])
->whereOr('tracking_number', '<>', '');
});
// 排除已取消(4)、已签收(6);已完成(3)仍跑一次以补齐路由
$q->whereNotIn('fulfillment_status', [4, 6]);
// 排除已完成(3)、已取消(4)、已签收(6)
$q->whereNotIn('fulfillment_status', [3, 4, 6]);
}
$orders = $q->order('id', 'desc')->limit($limit)->select();
@@ -481,6 +481,12 @@ final class GancaoLogisticsRouteService
*/
private static function appendSyncOneResult(array &$stats, PrescriptionOrder $order): void
{
$fs = (int) ($order->fulfillment_status ?? 0);
if (in_array($fs, [3, 6], true)) {
$stats['skipped']++;
return;
}
$stats['total']++;
try {
$r = self::syncOne($order);