Example #1
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])
Example #2
0
# -*- encoding:utf-8 -*-
import sys
from time import sleep
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\..\\'))
from keywords.tms.interface.innerInvoker import InnerInvoker
from keywords.tms.express.expressFlow import ExpressFlow
from keywords.tms.express.expressUtil import ExpressUtil
from keywords.tms.rainbow import RainbowUtil
from parameters.tms import tmsBase

__author__ = 'bida'

if __name__ == '__main__':
    order_ids = InnerInvoker.create_change_and_refund_order(count=2, operate_type='3')[0]
    sleep(tmsBase.wait_time)

    ExpressFlow.express_return_return(account='AUTOEXPRESS', order_ids=order_ids)

    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'))
Example #3
0
from keywords.tms.interface.innerInvoker import InnerInvoker
from keywords.tms.base.baseInfo import BaseInfo
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 time import sleep


__author__ = 'bida'

if __name__ == '__main__':
    order_ids = InnerInvoker.create_change_and_refund_order(count=2, operate_type='4')[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_return_on_fail(order_ids=order_ids, express_account='AUTOEXPRESS', operating_center_account='TIANJINOPERATION')

    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'))
    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'))

    sleep(tmsBase.wait_time)
    for order_id in order_ids:
        # 支付宝反馈配送成功
        InnerInvoker.payment_zhifubao_notice(order_id=order_id, pay_status='1')
from keywords.tms.express.expressUtil import ExpressUtil
from parameters.tms import tmsBase

__author__ = 'bida'

if __name__ == '__main__':
    order_ids = InnerInvoker.create_merchant_order(items=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',
                                                   is_merchant=True)
    sleep(tmsBase.wait_time)
    ExpressFlow.express_delivery_api(account='AUTOEXPRESS',
                                     target='3',
                                     distributor_short_name='autoexpress',
                                     order_ids=order_ids,
                                     feedback_result='6303')

    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'))
Example #6
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])
Example #7
0
# -*- encoding:utf-8 -*-
import sys
from time import sleep
# reload(sys)
# sys.setdefaultencoding('gbk')
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\..\\'))
from keywords.tms.express.expressFlow import ExpressFlow

if __name__ == '__main__':
    ExpressFlow.express_delivery(account=sys.argv[1],
                                 target=sys.argv[3],
                                 order_ids=sys.argv[2].split(','),
                                 feedback_result=sys.argv[4])
Example #8
0
    sleep(tmsBase.wait_time)

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

    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_return_on_success(order_ids=order_ids, express_account='AUTOEXPRESS')

    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'))

    refund_order_id = BillingFlow.billing_return_refund(account='ADMIN', order_nos=order_ids)

    sleep(tmsBase.wait_time)
    BillingUtil.billing_check_refund_order_state(account='ADMIN', refund_bill_id=refund_order_id,
                                                 status='已审核'.decode('utf-8'),
                                                 deduct_status='可抵'.decode('utf-8'))
Example #9
0
# -*- encoding:utf-8 -*-
import sys

# reload(sys)
# sys.setdefaultencoding('gbk')
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..\\..\\..\\"))
from keywords.tms.express.expressFlow import ExpressFlow

__author__ = "bida"

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

    ExpressFlow.express_return_return(
        account=sys.argv[1], order_ids=sys.argv[3].split(","), feedback_result=sys.argv[2]
    )