當前位置: 首頁>>代碼示例>>Python>>正文


Python commodel.Connection_Stock類代碼示例

本文整理匯總了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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:10,代碼來源:grants.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:10,代碼來源:cardInfo_model.py

示例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]
        
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:10,代碼來源:dayreport_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:11,代碼來源:addcard_model.py

示例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)        
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:13,代碼來源:opencard_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:22,代碼來源:memberQuery.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:22,代碼來源:memberAdd_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:16,代碼來源:congZhi_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:16,代碼來源:searchstock_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:19,代碼來源:cardeditpwd_model.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:37,代碼來源:grouplist_model.py

示例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
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:72,代碼來源:orderlist_model.py

示例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'],
#.........這裏部分代碼省略.........
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:101,代碼來源:massage.py

示例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
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:81,代碼來源:customermodel.py

示例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)
開發者ID:huboqiao,項目名稱:kmvip,代碼行數:28,代碼來源:guashi_model.py


注:本文中的application.lib.commodel.Connection_Stock類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。