def continually_create_change_and_refund_order(minute=1, thread_num="", count=10, interval="0.01"): """ :param count: :param minute:持续时间 :param thread_num: 线程名称 :param interval: 创建运单时间间隔 """ client = KafkaClient(hosts=tmsBase.kafka_client) topic = client.topics[KafkaTopics.RAINBOW.value] duration = minute * 60 start_time = datetime.now() end_time = datetime.now() length = 0 print "Thread-%s begin batch create change and refund orders" % thread_num with topic.get_producer() as producer: while (end_time - start_time).seconds < duration: length += InnerInvoker.create_change_and_refund_order( count=count, thread_no=thread_num, interval=interval, producer=producer )[1] end_time = datetime.now() print "Thread-%s totally created %s change and refund orders" % (thread_num, length)
# -*- 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'))
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.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 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,
# -*- 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.interface.innerInvoker import InnerInvoker __author__ = 'bida' if __name__ == '__main__': InnerInvoker.create_change_and_refund_order(count=sys.argv[1], operate_type=sys.argv[2], entrepot_id=sys.argv[3], receive_street_id=sys.argv[4], distributor=sys.argv[5].decode('gbk'), armoney=sys.argv[6], pay_id=sys.argv[7], shipment_type=sys.argv[8], send_city=sys.argv[9])
# -*- encoding:utf-8 -*- import sys import os # reload(sys) # sys.setdefaultencoding('gbk') sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..\\..\\..\\')) from keywords.tms.interface.innerInvoker import InnerInvoker __author__ = 'bida' if __name__ == '__main__': if len(sys.argv) == 1: print '请输入订单号'.decode('utf-8') sys.exit(-1) else: InnerInvoker.wms_return_confirmation(order_ids=sys.argv[1], operation=sys.argv[2])
# -*- 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.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 __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='3', order_ids=order_ids,
# -*- 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.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 __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',
# -*- 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.interface.innerInvoker import InnerInvoker __author__ = 'bida' if __name__ == '__main__': for order_id in sys.argv[1].split(','): InnerInvoker.payment_zhifubao_notice(order_id=order_id, pay_status=sys.argv[2])