def _(step): from random import choice import string plate_ = do_commit( models.Plate( name=u"浙%s %s%s%s%s%s" % (choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase)))) return do_commit(models.UnloadSession(plate_=plate_, gross_weight=1000))
def _(step, customer, harbor): plate = do_commit(models.Plate(name=generate(5))) unload_session = do_commit(models.UnloadSession(plate_=plate, gross_weight=50000)) product_type = do_commit(models.ProductType(name=generate(5))) product = do_commit(models.Product(name=generate(5), product_type=product_type)) procedure = do_commit(models.Procedure(name=generate(5))) goods_receipt = do_commit(models.GoodsReceipt(customer=customer, unload_session=unload_session)) for i in xrange(3): goods_receipt_entry = do_commit( models.GoodsReceiptEntry(goods_receipt=goods_receipt, product=product, weight=5000, harbor=harbor)) return goods_receipt
def _(step, customer, harbor, plate, product): us = do_commit(models.UnloadSession(plate_=plate, gross_weight=123123123)) from lite_mms.constants.cargo import STATUS_CLOSED us.status = STATUS_CLOSED import datetime us.finish_time = datetime.datetime.now() do_commit(us) ut = do_commit( models.UnloadTask(customer=customer, unload_session=us, harbor=harbor, creator=None, pic_path="", product=product, is_last=False)) return us
def _(step, customer, harbor, product): from random import choice import string plate_ = do_commit( models.Plate( name=u"浙%s %s%s%s%s%s" % (choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase), choice(string.ascii_lowercase)))) us = do_commit(models.UnloadSession(plate_=plate_, gross_weight=100000)) from lite_mms.constants.cargo import STATUS_WEIGHING ut = do_commit( models.UnloadTask(customer=customer, unload_session=us, harbor=harbor, creator=None, pic_path="", product=product, is_last=False)) us.status = STATUS_WEIGHING return us
def _(step, customer, harbor, order_type=constants.STANDARD_ORDER_TYPE, weight=5000): plate = do_commit(models.Plate(name=generate(5))) unload_session = do_commit(models.UnloadSession(plate_=plate, gross_weight=50000)) product_type = do_commit(models.ProductType(name=generate(5))) product = do_commit(models.Product(name=generate(5), product_type=product_type)) procedure = do_commit(models.Procedure(name=generate(5))) goods_receipt = do_commit(models.GoodsReceipt(customer=customer, unload_session=unload_session)) order = do_commit(models.Order(creator=None, goods_receipt=goods_receipt)) if order_type == constants.STANDARD_ORDER_TYPE: sub_order = do_commit( models.SubOrder(harbor=harbor, order=order, product=product, quantity=weight, weight=weight, unit="KG")) work_command = do_commit( models.WorkCommand(sub_order=sub_order, org_weight=weight, org_cnt=weight, procedure=procedure)) qir = do_commit(models.QIReport(work_command=work_command, quantity=weight, weight=weight, result=constants.quality_inspection.FINISHED, actor_id=None)) else: sub_order = models.SubOrder(harbor=harbor, order=order, product=product, quantity=weight/10, weight=weight, unit=u"刀", order_type=constants.EXTRA_ORDER_TYPE) work_command = do_commit( models.WorkCommand(sub_order=sub_order, org_weight=weight, org_cnt=weight/10, procedure=procedure)) qir = do_commit(models.QIReport(work_command=work_command, quantity=weight/10, weight=weight, result=constants.quality_inspection.FINISHED, actor_id=None)) return do_commit(models.StoreBill(qir=qir))
def _(step, plate_name): plate_ = do_commit(models.Plate(name=plate_name)) do_commit(models.UnloadSession(plate_=plate_, gross_weight=123)) return plate_
def _(step, weight, plate_): return do_commit(models.UnloadSession(plate_=plate_, gross_weight=weight))
def _(step): plate_ = do_commit(models.Plate(name=u"浙F oofoo")) return do_commit(models.UnloadSession(plate_=plate_, gross_weight=1000))