Ejemplo n.º 1
0
# sys.setdefaultencoding('gbk')


sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\..\\'))
from keywords.tms.base.baseInfo import BaseInfo
from keywords.tms.express.expressFlow import ExpressFlow
from keywords.tms.rainbow import RainbowFlow
from parameters.tms import tmsBase

if __name__ == '__main__':
    if len(sys.argv) != 9:
        print '请输入运单号'.decode('utf-8')
        sys.exit(-1)

    if BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name=sys.argv[2].decode('gbk')) == 0:
        obj = BaseInfo.get_subdistributor_id(subdistributor_short_name=sys.argv[2].decode('gbk'))
        delivery_dealer = obj[0] + '-' + obj[1]
    else:
        delivery_dealer = BaseInfo.get_distributor_id(account='ADMIN',
                                                      distributor_short_name=sys.argv[2].decode('gbk')) + '-'
    order_ids = sys.argv[1].split(',')

    RainbowFlow.sorting_forward_to_delivery_dealer(order_ids=order_ids,
                                                   delivery_dealer=delivery_dealer,
                                                   is_merchant=sys.argv[3] == 'True' and True or False,
                                                   is_packaged=sys.argv[4] == 'True' and True or False,
                                                   account=sys.argv[7])
    target = sys.argv[5]
    if target != '0':
        sleep(tmsBase.wait_time)
        ExpressFlow.express_delivery(target=target,
from keywords.tms.rainbow import RainbowFlow, RainbowUtil
from keywords.tms.express.expressFlow import ExpressFlow
from keywords.tms.express.expressUtil import ExpressUtil
from parameters.tms import tmsBase
from keywords.tms.interface.posInvoker import PosInvoker


__author__ = 'bida'

if __name__ == '__main__':
    order_ids = InnerInvoker.create_self_operated_order(count=2)[0]

    sleep(tmsBase.wait_time)

    if BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name='autoexpress') == 0:
        obj = BaseInfo.get_subdistributor_id(subdistributor_short_name='autoexpress')
        delivery_dealer = obj[0] + '-' + obj[1]
    else:
        delivery_dealer = BaseInfo.get_distributor_id(account='ADMIN', distributor_short_name='autoexpress') + '-'

    RainbowFlow.sorting_forward_to_delivery_dealer(order_ids=order_ids,
                                                   delivery_dealer=delivery_dealer,
                                                   account='TIANJINSORTING')
    sleep(tmsBase.wait_time)
    ExpressFlow.express_delivery(target='2',
                                 order_ids=order_ids,
                                 feedback_result='SUCCESS',
                                 account='AUTOEXPRESS')

    sleep(tmsBase.wait_time)
    for order_id in order_ids: