123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- import os
- import django
- import sys
- def setup_django():
-
- project_path = "D:/Document/code/vue/greater_wms"
- sys.path.append(project_path)
-
-
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'greaterwms.settings')
- django.setup()
- def main():
- try:
-
- from bin.views import LocationAllocation
-
- container_code = "12345"
- print(f"开始生成库位,托盘编码:{container_code}")
-
-
-
-
- allocator = LocationAllocation()
- number=allocator.get_pallet_count_by_batch(container_code)
- if number is None:
- print("❌ 该批次下无托盘,请检查托盘编码")
- return
- print(f"该批次下托盘总数:{number}")
-
- left_number = allocator.get_left_locationGroup_number_by_type()
- if not left_number:
- print("❌ 库位组剩余数量获取失败,请检查库位类型")
- return
- print(f"库位组剩余数量:{left_number}")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- print("✅ 方法生成成功!")
-
- except Exception as e:
- print(f"❌ 生成失败:{str(e)}")
- import traceback
- traceback.print_exc()
- if __name__ == "__main__":
- setup_django()
- main()
|