def extcheck(ext_id): ext = orderBlock.Extbyid(ext_id) print(u"\n<订单项信息>") print("%s: %s" % ("订单项ID", ext.ext_list[0]["ID"])) print("%s: %s" % ("订单ID", ext.ext_list[0]["ORDER_ID"])) print("%s: %s" % ("产品名称", ext.ext_list[0]["NAME"])) print("%s: %s" % ("订单项状态", ext.ext_list[0]["STATUS"])) print("%s: %s" % ("资源UUID", ext.ext_list[0]["RETURN_ID"])) print("%s: %s" % ("资源是否删除", ext.ext_list[0]["IS_DELETE"])) print("%s: %s" % ("BOSS_ORDER_ID", ext.ext_list[0]["BOSS_ORDER_ID"])) print("%s: %s" % ("ORDER_TIME", ext.ext_list[0]["ORDER_TIME"])) print("%s: %s" % ("EFFECTIVE_TIME", ext.ext_list[0]["EFFECTIVE_TIME"])) print("%s: %s" % ("END_TIME", ext.ext_list[0]["END_TIME"])) print("%s: %s" % ("资源池", ext.ext_list[0]["CMP_POOL_ID"])) if ext.ext_list[0]["STATUS"] not in [u'已开通', u'已关闭']: print(u"\n<异常订单项检查>") orderextcheck(ext.ext_list[0]) elif ext.ext_list[0]["STATUS"] in [ u'已开通' ] and ext.ext_list[0]["BOSS_ORDER_ID"] is None: print bbosstimeoutcheck(ext.ext_list[0]) print(u"\n<客户信息>") order = orderBlock.Order(ext.ext_list[0]["ORDER_ID"]) user = userBlock.userInfo(order.cmp_customer_id) user.userInfo_id() print("%s: %s" % ("BOSS_CUST_ID", user.boss_cust_id)) print("%s: %s" % ("USER_ID", user.user_id)) print("%s: %s" % ("USER_NAME", user.user_name)) print("%s: %s" % ("CUSTOMER_ID", user.customer_id)) print("%s: %s" % ("REG_SOURCE", user.reg_source))
def ordercheck(order): order = orderBlock.Order(order) promotion = orderBlock.Promotion(order.order_id) if promotion.promotion_exist: print("<此订单 %s 为促销订单>" % (order.order_id)) if order.order_exist: print(u"\n<订单信息>") print("%s: %s" % ("订单号", order.order_id)) print("%s: %s" % ("订单类型", order.order_type)) print("%s: %s" % ("订单状态", order.order_status)) print("%s: %s" % ("父订单号", order.parent_id)) print("%s: %s" % ("订购时间", order.order_time)) print("%s: %s" % ("订单来源", order.order_source)) print(u"\n<用户信息>") user = userBlock.userInfo(order.cmp_customer_id) user.userInfo_id() print("%s: %s" % ("BOSS_CUST_ID", user.boss_cust_id)) print("%s: %s" % ("USER_ID", user.user_id)) print("%s: %s" % ("USER_NAME", user.user_name)) print("%s: %s" % ("CUSTOMER_ID", user.customer_id)) print("%s: %s" % ("REG_SOURCE", user.reg_source)) print(u"\n<订单项信息>") ext = orderBlock.Ext(order.order_id) print(u'订单项数量:%s' % ext.ext_num) print("#" * 44) for item_ext in ext.ext_list: if item_ext['STATUS'] not in [u'已开通', u'已关闭', u'同步EBOSS审批待反馈']: print("%s: %s" % ("订单项ID", item_ext["ID"])) print("%s: %s" % ("产品名称", item_ext["NAME"])) print("%s: %s" % ("订单项状态", item_ext["STATUS"])) print("%s: %s" % ("BOSS_ORDER_ID", item_ext["BOSS_ORDER_ID"])) print("%s: %s" % ("资源池", item_ext["CMP_POOL_ID"])) orderextcheck(item_ext) print("#" * 44) else: print("%s: %s" % ("订单项ID", item_ext["ID"])) print("%s: %s" % ("产品名称", item_ext["NAME"])) print("%s: %s" % ("订单项状态", item_ext["STATUS"])) print("%s: %s" % ("资源UUID", item_ext["RETURN_ID"])) print("%s: %s" % ("资源是否删除", item_ext["IS_DELETE"])) print("%s: %s" % ("BOSS_ORDER_ID", item_ext["BOSS_ORDER_ID"])) print("%s: %s" % ("ORDER_TIME", item_ext["ORDER_TIME"])) print("%s: %s" % ("EFFECTIVE_TIME", item_ext["EFFECTIVE_TIME"])) print("%s: %s" % ("END_TIME", item_ext["END_TIME"])) print("%s: %s" % ("资源池", item_ext["CMP_POOL_ID"])) print("#" * 44) return ext.ext_num
def phoneNew(user_name, phone, email, customer_id, phone_new): user = userBlock.userInfoNew(user_name, phone, email, customer_id, phone_new) user.userInfo_all() if user.result: """用户存在""" user = userBlock.userInfo(phone_new) user.userInfo_phone() if user.user_exist: print "您要修改的新手机号码已经被使用,无法更改。" else: user = userBlock.userInfoNew(user_name, phone, email, customer_id, phone_new) user.newuserphone() print "\n修改成功,烦请通知客户记得修改密码或者邮箱以便修改后的信息可以同步其他子系统!\n" else: print "您需要修改手机号的用户不存在,请重新核对用户信息"
def testUser(self): user = userBlock.userInfo('13802883437') user.userInfo_phone() self.assertEqual(user.cust_status, "注册待归档", 'get userinfo fail')
def customerid(customerid): user = userBlock.userInfo(customerid) user.userInfo_id() usercheck(user)
def email(email): user = userBlock.userInfo(email) user.userInfo_email() usercheck(user)
def phone(phone): user = userBlock.userInfo(phone) user.userInfo_phone() usercheck(user)
def username(username): user = userBlock.userInfo(username) user.userInfo_username() usercheck(user)