本文整理匯總了Python中sellcard.common.Method.upChangeCode方法的典型用法代碼示例。如果您正苦於以下問題:Python Method.upChangeCode方法的具體用法?Python Method.upChangeCode怎麽用?Python Method.upChangeCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sellcard.common.Method
的用法示例。
在下文中一共展示了Method.upChangeCode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: save
# 需要導入模塊: from sellcard.common import Method [as 別名]
# 或者: from sellcard.common.Method import upChangeCode [as 別名]
#.........這裏部分代碼省略.........
card_addtime=datetime.datetime.now(), shop_code=shopCode,
is_store=0, card_blance=card['cardVal'])
resSave = obj.id
else:
resUpdate = queryCard.update(card_status=status, card_action=action, shop_code=shopCode)
if (resUpdate == 0 and resSave == 0):
raise MyError(card['cardId'] + '狀態更新失敗')
#2、保存支付信息
isThird = False
payDiscDict = mth.getPayDiscDict()
ChangePaymentList = []
for pay in payList:
orderPay = OrderChangeCardPayment()
orderPay.order_id = order_sn
orderPay.pay_id = pay['payId']
# 處理混合支付的優惠
is_pay = 1
if pay['payId'] in ('3', '4'):
is_pay = '0'
elif pay['payId'] == '6':
isThird = True
is_pay = '0'
disRate = payDiscDict[pay['payId']]
disc = discCash = float(pay['payVal']) * float(disRate)
elif pay['payId'] in ('7', '8', '10', '11'):
isThird = True
disRate = payDiscDict[pay['payId']]
disc = discCash = float(pay['payVal']) * float(disRate)
orderPay.is_pay = is_pay
if pay['payId'] == '9':
isThird = True
mth.upChangeCode(hjsList, shopCode)
orderPay.pay_value = pay['payVal']
orderPay.remarks = pay['payRmarks']
ChangePaymentList.append(orderPay)
OrderChangeCardPayment.objects.bulk_create(ChangePaymentList)
#3、保存order信息
order = OrderChangeCard()
order.order_sn = order_sn
order.operator_id = operator
order.depart = depart
order.shop_code = shopCode
order.user_name = buyerName
order.user_phone = buyerPhone
order.total_in_amount = totalNumIn
order.total_in_price = totalValIn
order.total_out_amount = totalNumOut
order.total_out_price = totalValOut
order.disc_rate = disRate
order.disc = disc
order.disc_cash = discCash
order.disc_pay = discPay
order.add_time = created_time
order.save()
#4、分別創建orderInfo列表
cardOutInfoList =[]
changeCardInfoList = []
cardInIdList = []
cardCommonIdList=[]
cardIsStoreIdList = []
cardCommonInNum=cardIsStoreInNum = 0