__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:
        # 支付宝反馈配送在途
        InnerInvoker.payment_zhifubao_notice(order_id=order_id, pay_status='0')

    sleep(tmsBase.wait_time)
    ExpressUtil.express_check_order_state(order_ids=order_ids, state='配送在途'.decode('utf-8'))
    RainbowUtil.rainbow_check_order_state(order_ids=order_ids, state='配送在途'.decode('utf-8'))
Exemple #2
0
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,
                                     order_ids=order_ids,
                                     feedback_result=sys.argv[6],
                                     account=sys.argv[8])
Exemple #3
0
__author__ = 'bida'

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

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

    order_ids = sys.argv[6].split(',')

    RainbowFlow.sorting_forward_to_delivery_dealer(order_ids=order_ids,
                                                   delivery_dealer=delivery_dealer,
                                                   is_merchant=sys.argv[5] == 'False' and False or False,
                                                   account=sys.argv[2])
    sleep(tmsBase.wait_time)

    if sys.argv[4] == '1':
        # 配送失败退
        ExpressFlow.express_return_on_fail(order_ids=order_ids, express_account=sys.argv[3],
                                           operating_center_account=sys.argv[1])

    if sys.argv[4] == '2':
        # 换货成功退
        ExpressFlow.express_return_on_success(order_ids=order_ids, express_account=sys.argv[3])