本文整理汇总了Python中application.lib.commodel.Connection_Stock类的典型用法代码示例。如果您正苦于以下问题:Python Connection_Stock类的具体用法?Python Connection_Stock怎么用?Python Connection_Stock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Connection_Stock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GrantsModel
class GrantsModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getGrantsFinger(self, groupId):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getGrantsFinger','data':groupId}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例2: CardInfo
class CardInfo(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getCardInfo(self, uid):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryUserCard','data':{'uid':uid}}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例3: DayreportModel
class DayreportModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getUser(self):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryUser','data':''}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data[0]
示例4: AddCardModel
class AddCardModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def sendCard(self, card,noid,addId):
data = {'card':card,'noid':noid, 'addId':addId}
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'addCard','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例5: OpenCardModel
class OpenCardModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def bindCard(self,userid,card,pwd,addid=''):
data = {'user_id':userid,'card':card,'pwd':pwd,'addid':addid}
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'bindCard','data':data}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
print r
return json.loads(r)
示例6: MemberQueryModel
class MemberQueryModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def queryMember(self, data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryMember','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def getMemberInfosss(self, data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getMemberInfosss','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def queryUserCard(self, IDcard):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryUserCard','data':IDcard}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例7: MemberAddModel
class MemberAddModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def sendImg(self,imgbyte):
self.conn.sendall(self.sendData(imgbyte,1) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def addMember(self,data,datainfo,uid):
self.conn.sendall(self.sendData(json.dumps({'node':'capital','act_fun':'memberAdd','data':{'data':data,'data_info':datainfo,'uid':uid}}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def checkIDcard(self, ID):
self.conn.sendall(self.sendData(json.dumps({'node':'capital','act_fun':'checkIdCard','data':ID}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例8: ChongZhiModel
class ChongZhiModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getCardInfo(self,cardid):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getCardInfo','data':{'cardid':cardid}}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def inRecharge(self, data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'inRecharge','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例9: SearchStockModel
class SearchStockModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def queryCustomer(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryCustomer','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def queryStockById(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryStockById','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例10: CardEidtPwdModel
class CardEidtPwdModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getCardInfo(self, cardid):
data={'cardid':cardid}
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getCardInfo','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def upCardPwd(self, cardid,pwd):
data={'cardid':cardid,'pwd':pwd}
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'updateCardPwd','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
示例11: GroupListModel
class GroupListModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getPower(self,data=''):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getPow2','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def deletePower(self,id):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'delGroup','data':id}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def groupAdd(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'addGroup','data':data}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def editPower(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'editGroup','data':data}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return str(r)
def getGroupInfo(self,groupid):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getGroupInfo','data':groupid}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return str(r)
示例12: OrderListModel
class OrderListModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def queryOrderList(self):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getOrderList','data':''}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
def queryOrderUsername(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getOrderUsername','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
def queryOrderDetail(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryOrderDetail','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
def delOrder(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'deleteOrder','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
def queryApplyName(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryApplyName','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询商品表与订单_info表
def queryGoodsAndOrderinfo(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryGoodsAndOrderinfo','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询订单表中某一订单的详情
def getOneOrder(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getOneOrder','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询某一订单下所有商品总价
def querySumZongjia(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'querySumZongjia','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询符合条件的订单
def filterOrderList(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'filterOrderList','data':data}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询所有用户的真实姓名及id
def queryNickname(self):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'queryNickname','data':''}),0) )
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
示例13: MassageModel
class MassageModel(Socket_model, QObject):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def getshots(self, data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getshot','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def noteMassage(self, data):
# 记录该短信到msglist
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'noteMassage','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def sendCustomMessage(self, data):# 接收短信模板数据, 发送短信
msg = self.getshots('')
# 判断短信模板完整性
if not msg['stat']:
return{'stat':False, 'msg': u'没有可用的短信模板,请在【基本资料维护》短信设置】中添加并启用'}
msg = msg['data'][0]
if str(msg['isactive']) != '0':
return {'stat':False, 'msg': u'当前短信模板未启用,请在【基本资料维护》短信设置】中 启用' }
if msg['username'] == '':
return{'stat':False, 'msg': u'您未设置短信平台账号,请在【基本资料维护》短信设置】中 设置'}
if msg['password'] == '':
return{'stat':False, 'msg': u'您未设置短信平台密码,请在【基本资料维护》短信设置】中 设置'}
if msg['url'] == '':
return{'stat':False, 'msg': u'您未设置短信平台url,请在【基本资料维护》短信设置】中 设置'}
if str(msg['type']) != '0':
return{'stat':False, 'msg': u'请在【基本资料维护》短信设置】中 设置提交方式为“get”'}
# 匹配短信模板
param = (msg['username'], msg['password'], data['toMobile'], data['content'])
url = msg['url'] + '&account=%s&password=%s&mobile=%s&content=%s'%param
result = SendMassage(url).send()
# 根据发送情况插入表
dom =parseString(result['result'])
statuDescription = dom.getElementsByTagName("msg").pop().firstChild.data
code = dom.getElementsByTagName("code").pop().firstChild.data
data['statu'] = statuDescription
data['time'] = result['time']
data['oparetion'] = u'自定义短信'
data['customerID'] = 0
self.noteMassage(data)
if cmp(statuDescription, u'提交成功') == 0:
return {'stat':True}
else:
return {'stat':False, 'msg':statuDescription}
def checkMessageText(self,data):
# 检查短信相关参数完整性
try:
if not data['customerID']:
return{'stat':False, 'msg': u'请传入接收短信的客户ID。'}
except:
return{'stat':False, 'msg': u'请传入接收短信的客户ID。'}
# 校验接收短信手机号
try:
if not check.checkMobilePhone(data['toMobile']):
return{'stat':False, 'msg': u'请传入正确的手机号。'}
except:
return{'stat':False, 'msg': u'请传入正确的手机号。'}
try:
if not data['content']['customerName']:
return{'stat':False, 'msg': u'请传入接收短信的客户名称。'}
except:
return{'stat':False, 'msg': u'请传入接收短信的客户名称。'}
try:
if not data['content']['cardID']:
return{'stat':False, 'msg': u'请传入接收短信的客户金荣卡号。'}
except:
return{'stat':False, 'msg': u'请传入接收短信的客户金荣卡号。'}
# 时间转换为中文字符串
try:
self.t = check.timeStamp(int(data['content']['time']), '%Y/%m/%d %H:%M')
except:
return{'stat':False, 'msg': u'请传入操作时间(时间戳)。'}
# 操作类型编号转换为汉字
try:
if not data['oparetion']:
return{'stat':False, 'msg': u'请传入操作。'}
except:
return{'stat':False, 'msg': u'请传入操作。'}
try:
float(data['content']['amount'])
except:
return{'stat':False, 'msg': u'请传入金额。'}
try:
float(data['content']['balance'])
except:
return{'stat':False, 'msg': u'请传入账户余额。'}
contentData = (data['content']['customerName'],
data['content']['cardID'],
self.t,
data['oparetion'],
#.........这里部分代码省略.........
示例14: CustomerModel
class CustomerModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
#查询客户卡的状态,密码,显示卡号
def findCustomerCardStat(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findCustomerCardStat','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询客户的状态
def findCustomerStat(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findCustomerStat','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
def getMemberInfo2(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getMemberInfo2','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询客户(customer)信息
def findOneCustomer(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findOneCustomer','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询客户(customerinfo)信息
def findOneCustomerAdditional(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findOneCustomerAdditional','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询客户绑定的卡,用客户ID查
def findCardWithUid(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findCardWithUid','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询此卡是否在数据库中已激活
def findCardExists(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findCardExists','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#为用户绑定此卡
def bindCardForCustomer(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'bindCardForCustomer','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#为用户挂失此卡
def guashiCardForCustomer(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'guashiCardForCustomer','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#查询最近一次交易内容
def findOneLog(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'findOneLog','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
#更新客户状态
def updateCustomerStat(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'updateCustomerStat','data':data}),0))
r = self.conn.recv(self.recvBuff)
data = json.loads(r[17:])
return data
示例15: GuashiModel
class GuashiModel(Socket_model):
def __init__(self):
Socket_model.__init__(self)
self.conn = Connection_Stock().getConnection()
def checkMember(self,idcard):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getMemberinfo','data':idcard}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def lossCard(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'lossCard','data':data}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def findAllFingerOneCard(self,data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'getMemberInfo1','data':data}),0))
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)
def frozenCard(self, data):
self.conn.sendall(self.sendData(json.dumps({'node':'logic','act_fun':'frozenCard','data':data}),0) )
r = self.conn.recv(self.recvBuff)
r = self.resolveRecvdata(r)
return json.loads(r)