1
0
forked from erp-dev/erp

feat: new api for plate order (get_plate_order_by_state_status)

This commit is contained in:
2025-12-25 17:18:44 +08:00
parent 2c5174a1ec
commit ff1ea2482d
21 changed files with 936 additions and 58 deletions

View File

@@ -22,6 +22,38 @@ class Command(BaseCommand):
default=0.02,
help='每次明道云请求之间的最小间隔用于限流50qps 建议 >= 0.02',
)
parser.add_argument(
'--sort-direction',
choices=['asc', 'desc'],
default='asc',
help='按 ctime 升序asc或降序desc抓取',
)
parser.add_argument(
'--use-checkpoint',
dest='use_checkpoint',
action='store_true',
default=True,
help='读取 DataSync 游标(默认开启)',
)
parser.add_argument(
'--skip-checkpoint',
dest='use_checkpoint',
action='store_false',
help='忽略 DataSync 游标,从第一页开始',
)
parser.add_argument(
'--update-checkpoint',
dest='update_checkpoint',
action='store_true',
default=True,
help='同步完成后写入 DataSync 记录(默认开启)',
)
parser.add_argument(
'--skip-checkpoint-write',
dest='update_checkpoint',
action='store_false',
help='本次同步不写入 DataSync 记录',
)
def handle(self, *args, **options):
payload = sync_mdy_plate_orders_to_staging(
@@ -31,5 +63,8 @@ class Command(BaseCommand):
with_related=options['with_related'],
max_related_per_type=options['max_related_per_type'],
request_interval_seconds=options['request_interval_seconds'],
use_checkpoint=options['use_checkpoint'],
update_checkpoint=options['update_checkpoint'],
sort_direction=options['sort_direction'],
)
self.stdout.write(self.style.SUCCESS(str(payload)))