This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager as om | |
from bridge.corelib import checkout_manager as cm | |
def fix_orders(oids): | |
for oid in oids: | |
o = om.get_order_by_orderid(oid) | |
c = cm.get_checkout_by_checkoutid(o.checkoutid) | |
ce = c.ext_info_proto() | |
ce.checkout_payment_info.payment_flag |= 2 | |
print cm.set_checkout_status(c.user_id, c.checkoutid, 'manual fix', operator='haiyan.huo@shopeemobile.com', status=c.status, payment_type=c.payment_type, checkout_info=ce.SerializeToString()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager as om | |
def move(osns): | |
for osn in osns: | |
o = om.get_order_by_sn(osn) | |
print om.set_order_logistics_info( | |
userid=o.user_id, | |
orderid=o.orderid, | |
reason='manual_fix', | |
operator='lisha.li@shopeemobile.com', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager as om | |
from bridge.paylib import escrow_manager as em | |
o = om.get_order_by_orderid(oid) | |
em.calculate_escrow_amount(o) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager | |
from bridge.protobuf.pb import beeshop_db_pb2 as pbdb | |
with open('orders.csv') as f: | |
for line in f: | |
ordersn = line.strip() | |
order = order_manager.get_order_by_sn(ordersn) | |
if order.logistics_status != pbdb.LOGISTICS_DELIVERY_FAILED: | |
print order.orderid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
from django.conf import settings | |
r = redis.StrictRedis(connection_pool=settings.REDIS_CONNECTION_POOL) | |
r.delete('SYNC-BANK-STATEMENTS-SPM-CTIME-ID') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = {'currency': 'IDR', | |
'memo': None, | |
'payments': u'[{"channel_params":{},"channel_id":8010100,"amount":50000000000,"payment_type":14,"currency":"IDR"}]', | |
'platform': 1, | |
'provision_entities': u'[{"expire_time":1508615966,"channel_id":8005401,"entity_id":14744,"channel_params":{"fund_account_id":8003001}}]', | |
'request_ip': None, | |
'total_amount': 50000000000L, | |
'transaction_extra_data': None, | |
'transaction_id': None, | |
'transaction_type': 4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager | |
from bridge.loglib import logistic_manager | |
f = open('fix.csv') | |
for line in f: | |
shopid, orderid, logid, conno = line.strip().split(' ') | |
order = order_manager.get_order_by_orderid(orderid) | |
result = order_manager.set_order_logistics_info(order=order, logistics_info={'logisticsid': logid}) | |
if 'error' in result: | |
print shopid, orderid, logid, result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.corelib import order_manager | |
from common import convert | |
f = open('orderids.csv') | |
g = open('data.csv', 'w') | |
g.write('orderid,channelid,created_date,arrange_pickup_by_date\n') | |
for line in f: | |
orderid = int(line.strip()) | |
order = order_manager.get_order_by_orderid(orderid) | |
ext = order.ext_info_proto() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bridge.loglib.channels.jne import jne_cashless; x = jne_cashless.JNECashlessChannel(); x.init_logistic(261492, 427193, 80005) | |
from bridge.loglib.channels.jne.jne import JNEReportManager as j; x = j(); from bridge.loglib import logistic_manager as lm; l = lm.get_logistic(4899); x.process_logistic_update(l) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from bridge.loglib.channels.seven import * | |
update_type = 'SIN' | |
file_names = [] | |
for file_name in os.listdir(os.path.join(SevenSettings.BASE_DIR, update_type)): | |
if '20171299' in file_name: | |
file_names.append(file_name) |
OlderNewer