本文整理汇总了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