Ejemplo n.º 1
0
 def __call__(self):
     # strong guaranteed here
     doc = database.codernity_db.get('id', self.node.tag, with_doc=True)
     delivery_session = get_delivery_session(doc['delivery_session_id'])
     remain = doc['remain']
     from lite_mms.apis import wraps
     finished_store_bill_list = [wraps(models.StoreBill.query.get(store_bill_id)) for store_bill_id in doc['finished_store_bill_id_list']]
     unfinished_store_bill = wraps(models.StoreBill.query.get(doc['unfinished_store_bill_id']))
     is_finished = doc['is_last_task']
     loader = models.User.query.get(doc['loader_id'])
     from lite_mms.portal.delivery_ws.webservices import create_delivery_task
     create_delivery_task(delivery_session, remain, finished_store_bill_list,
                          unfinished_store_bill, loader, is_finished)
Ejemplo n.º 2
0
def get_or_404(cls, id_):
    from lite_mms.database import db
    from lite_mms.apis import ModelWrapper, wraps

    assert issubclass(cls, db.Model) or issubclass(cls, ModelWrapper)

    return wraps(cls.query.get_or_404(id_))
Ejemplo n.º 3
0
 def __call__(self):
     # strong guaranteed here
     doc = database.codernity_db.get('id', self.node.tag, with_doc=True)
     delivery_session = get_delivery_session(doc['delivery_session_id'])
     remain = doc['remain']
     from lite_mms.apis import wraps
     finished_store_bill_list = [
         wraps(models.StoreBill.query.get(store_bill_id))
         for store_bill_id in doc['finished_store_bill_id_list']
     ]
     unfinished_store_bill = wraps(
         models.StoreBill.query.get(doc['unfinished_store_bill_id']))
     is_finished = doc['is_last_task']
     loader = models.User.query.get(doc['loader_id'])
     from lite_mms.portal.delivery_ws.webservices import create_delivery_task
     create_delivery_task(delivery_session, remain,
                          finished_store_bill_list, unfinished_store_bill,
                          loader, is_finished)
Ejemplo n.º 4
0
 def annotation(self):
     from lite_mms.apis import wraps
     doc = database.codernity_db.get('id', self.node.tag, with_doc=True)
     remain = doc['remain']
     unfinished_store_bill = wraps(models.StoreBill.query.get(doc['unfinished_store_bill_id']))
     d = OrderedDict()
     d[u'剩余仓单编号'] = unfinished_store_bill.id
     d[u'仓单原重'] = unfinished_store_bill.weight
     d[u'产品'] = unfinished_store_bill.sub_order.product.name + '(%s:%s)' % (unfinished_store_bill.sub_order.spec or '?',
                                                                         unfinished_store_bill.sub_order.type or '?')
     d[u'客户'] = unfinished_store_bill.sub_order.customer.name
     d[u'剩余重量'] = str(remain) + u'(公斤)'
     return d
Ejemplo n.º 5
0
 def annotation(self):
     from lite_mms.apis import wraps
     doc = database.codernity_db.get('id', self.node.tag, with_doc=True)
     remain = doc['remain']
     unfinished_store_bill = wraps(
         models.StoreBill.query.get(doc['unfinished_store_bill_id']))
     d = OrderedDict()
     d[u'剩余仓单编号'] = unfinished_store_bill.id
     d[u'仓单原重'] = unfinished_store_bill.weight
     d[u'产品'] = unfinished_store_bill.sub_order.product.name + '(%s:%s)' % (
         unfinished_store_bill.sub_order.spec
         or '?', unfinished_store_bill.sub_order.type or '?')
     d[u'客户'] = unfinished_store_bill.sub_order.customer.name
     d[u'剩余重量'] = str(remain) + u'(公斤)'
     return d
Ejemplo n.º 6
0
 def scaffold_list(self, models):
     return [wraps(obj) for obj in models]
Ejemplo n.º 7
0
def _(step, gr):
    from lite_mms.apis import wraps

    assert wraps(gr).stale
Ejemplo n.º 8
0
 def op(self, obj):
     wraps(obj).go(actor_id=current_user.id, action=constants.work_command.ACT_RETRIEVAL)
Ejemplo n.º 9
0
 def scaffold_list(self, models):
     return [wraps(obj) for obj in models]
Ejemplo n.º 10
0
 def scaffold_list(self, objs):
     return [wraps(obj) for obj in objs]
Ejemplo n.º 11
0
def _(step, gr):
    from lite_mms.apis import wraps

    assert wraps(gr).stale
Ejemplo n.º 12
0
 def scaffold_list(self, objs):
     return [wraps(obj) for obj in objs]
Ejemplo n.º 13
0
 def op(self, obj):
     wraps(obj).go(actor_id=current_user.id,
                   action=constants.work_command.ACT_RETRIEVAL)