def getAboutMsg(self,data): openid = objWeixin.getOpenid(data) imei = data.imei _ret = db.query('SELECT * FROM Device WHERE imei="{0}"'.format(imei)) cfgPara = { "result":"failed" } if len(_ret)>0: dev = _ret[0] #查询该imei所属的管理分组 _group = db.query("""SELECT *,DeviceGroup.id AS grpId FROM DeviceGroup,GroupHasDevice WHERE GroupHasDevice.imei ='{0}' AND GroupHasDevice.devicegroup_id =DeviceGroup.id AND DeviceGroup.type = "管理分组" """.format(imei)) if len(_group)>0: grp = _group[0] grpName = grp.name grpId = grp.grpId _ret = db.query("SELECT * FROM BusLine WHERE busgroupid={0}".format(grpId)) busline = _ret[0] busline_id = busline.id company_id = busline.company_id else: grpName = "未知" grpId = -1 company_id = 0 busline_id = -1 cfgPara = { "result" :"success", "name" :dev.name, "openid" :openid, "busline_id" :busline_id, "grpName" :grpName, "grpId" :grpId, "devType" :("天网1代" if dev.devType=="" else dev.devType), "manufacturer" :dev.manufacturer, "imei" :dev.imei, "phone" :dev.phone, "arm_type" :dev.arm_type, "seat_type" :dev.seat_type, "create_at" :dev.regedit_at.strftime("%Y-%m-%d"), "warehouse_id" :dev.warehouse_id, "company_id" :company_id, } if web.ctx.method=='GET': sharePara=tradeObj.genPreSharePara("transfer",openid,imei) #设定缺省车型 sharePara["sel"]={"midbus":"","bed":"","test":""} sharePara["sel"][dev.seat_type]='selected = "selected"' sharePara["company_id"]= company_id jdkSign = objWeixin.get_jdk_sign(self.env['url']) _cfgPara=json.dumps(cfgPara,ensure_ascii=False) ret = self.render.single_device_mgr(_cfgPara,jdkSign,sharePara) else: ret = uTools.formatPostMsg(cfgPara) return ret
def POST(self): data = web.input() openid = objWeixin.getOpenid(data) act = data.act.upper() if act =="ABOUT" : ret = self.getAboutMsg(data) elif act == 'SEAT-STATUS-AUTO': ret = self.getSeatsByImeiAuto("customer",openid,data) elif act == 'SEAT-STATUS-DEBUG': ret = self.getSeatsByImeiDebug("operator",openid,data) elif act == 'SEAT-STATUS-TEST': #ret = self.getSeatsByImeiAuto("operator",openid,data) ret = self.getSeatsByImeiDebug("operator",openid,data) elif act == 'SEAT-BUSBOX-DEBUG': #ret = self.getSeatsByImeiAuto("operator",openid,data) ret = self.getSeatsBusboxDebug("operator",openid,data) elif act =='BIND-NEW-DEVICE': ret = self.bindNewDeviceMsg(openid,data) elif act =="UPDATE-DEVICE": ret = self.updateManagerDeviceGroup(openid,data) elif act =="UPDATE-DEVICE-CFG": ret = self.updateDeviceCfg(openid,data) elif act == 'FRIEND-MANAGER': return self.friendManager(openid,data.imei) elif act =='UPDATE-SHARE-PRIVILEGE': ret = self.updateSharePrivilege(openid,data) elif act =="CFG-BUS-SEAT": ret = self.cfgBusSeat(openid,data) elif act =='ONLINE-TEST': ret = self.getOnlineTestViewMsg(openid) elif act =='GET-ONLINE-STATE': ret = self.getOnlineState(openid,data) return ret
def GET(self): data = web.input() #print web.ctx.env['REQUEST_METHOD'] self.env = iconfig.getEnvObj() self.url = self.env['url'] openid = objWeixin.getOpenid(data) if data.has_key('act'): act = data.act.upper() else: act = "MINE_TRACK" logstat.logAccessUrl(openid, act) #记录用户访问 if (act == "MINE_TRACK"): #处理2种情况: #1.初次打开时,依据openid自动获取imei #2.指定imei的情况 ret = self.getMineTrackMsg(openid, data) elif (act == "TEST"): ret = self.getTest(openid, data) elif (act == "HISTORY-TRACK"): ret = self.getHistoryTrackMsg(openid, data) elif (act == "HISTORY-STAT"): ret = self.getHistoryStatMsg(openid, data) elif (act == "BAIDU-HISTORY-TRACK"): ret = self.getHistoryTrackMsg(openid, data, "BAIDU") return ret
def GET(self): data = web.input() act = uTools.get_act(data) self.env = icfg.getEnvObj() openid = objWeixin.getOpenid(data) logstat.logAccessUrl(openid,act) #记录用户访问 ret = "" if act == 'SEAT-STATUS-AUTO': ret = self.getSeatsByImeiAuto("customer",openid,data) elif act == 'SEAT-STATUS-DEBUG': ret = self.getSeatsByImeiDebug("operator",openid,data) elif act =="SEAT-STATUS-TEST": #ret = self.getSeatsByImeiAuto("operator",openid,data) ret = self.getSeatsByImeiDebug("operator",openid,data) elif act =="SEAT-STATUS-HIS": ret = self.getSeatsByImeiAuto("operator-history",openid,data) elif act =="ABOUT" : ret = self.getBusConfigMsg(data) elif act =="BUS-CONFIG" : ret = self.getBusConfigMsg(data) elif act =='BIND-NEW-DEVICE': ret = self.bindNewDeviceMsg(openid,data) elif act == 'FRIEND-MANAGER': ret = self.friendManager(openid,data.imei) elif act =='ONLINE-TEST': ret = self.getOnlineTestViewMsg(openid) elif act =='GET-ONLINE-STATE': ret = self.getOnlineState(openid,data) return ret
def POST(self): data = web.input() if not data.has_key('act'): return act = data.act.upper() openid = objWeixin.getOpenid(data) if linedb.isEmployee(openid) == False: return web.seeother(urlHome) if act == 'USER-POS': ret = self.postUserPos(openid, data) elif act == 'LINE-BUSES': ret = self.getLineBuses(openid, data) elif act == 'COMPANY-BUSES': ret = self.getCompanyBuses(openid, data) elif act == 'SET-LINE-NAME': ret = self.setLineName(openid, data) elif act == 'DELETE-LINE': ret = self.delLine(openid, data) elif act == 'SET-LINE-SITE': ret = self.setLineSite(openid, data) elif act == 'DEL-LINE-SITE': ret = self.delLineSite(openid, data) elif act == 'UPDATE-LINE-SITE': ret = self.updateLineSite(openid, data) elif act == 'UPDATE-ONE-SITE': ret = self.updateOneLineSite(openid, data) elif act == 'UPDATE-LINE-PRICE': ret = self.updateLinePrice(openid, data) elif act == 'SEND-MSG-COMPANY': return self.sendMsg2Company(openid, data) return ret
def GET(self): data = web.input() act = uTools.get_act(data) self.env = icfg.getEnvObj() self.url = self.env['url'] openid = objWeixin.getOpenid(data) logstat.logAccessUrl(openid, act) #记录用户访问 ret = "" if act == 'BUSLINE-HOME': ret = self.getCompanyBusLines(openid, data) elif act == 'LINE-BUSES': ret = self.getLineBuses(openid, data) elif act == 'HOME': ret = self.getCompanyBusLines(openid, data) elif act == 'COMPANY-BUSES': ret = self.getCompanyBuses(openid, data) elif act == 'DESIGN-LINE-SITE': ret = self.designLineSite(openid, data) elif act == 'DESIGN-LINE-SITE-QQ': ret = self.designLineSiteQQ(openid, data) elif act == 'DESIGN-LINE-PRICE': ret = self.designLinePrice(openid, data) elif act == 'START-LINE-STAT': ret = self.startLineStat(openid, data) return ret
def GET(self): data = web.input() act = uTools.get_act(data) self.env = icfg.getEnvObj() openid = objWeixin.getOpenid(data) logstat.logAccessUrl(openid, act) #记录用户访问 ret = None if act == 'BUSTRAVEL-CURRENT': ret = self.get_bustravel_current(openid, data) elif act == 'BUSTRAVEL-DETAIL': ret = self.get_bustravel_detail(openid, data) return ret
def POST(self): data = web.input() if not data.has_key('act'): return act = data.act.upper() openid = objWeixin.getOpenid(data) if act == 'GET-GROUP-BY-IMEI': ret = self.getGroupByImeiMsg(openid, data) elif (act == "HISTORY-TRACK"): ret = self.getHistoryTrackMsg(openid, data) elif (act == "BAIDU-HISTORY-TRACK"): ret = self.getHistoryTrackMsg(openid, data, "BAIDU") elif (act == "HISTORY-STAT"): ret = self.getHistoryStatMsg(openid, data) elif (act == 'MINE_TRACK'): ret = self.getMineTrackMsg(openid, data) return ret
def POST(self): data = web.input() self.env = icfg.getEnvObj() act = uTools.get_act(data) imei = data.imei openid = objWeixin.getOpenid(data) if act == "HOME": ret = self.home(openid, data) elif act == "UPDATE-ITEMS": ret = self.updateSecurityItem(openid, data) elif act == "RESET-SF": ret = self.resetSF(openid, data) elif act == "SPEAKER-SUNG": ret = self.speakerSung(openid, imei) elif act == "MONITOR-SETUP": ret = self.monitorSetup(openid, imei, data.state) return ret
def GET(self): data = web.input() self.env = icfg.getEnvObj() act = uTools.get_act(data) ret = "" openid = objWeixin.getOpenid(data) accessLog = True #记录访问情况 if act == "HOME": ret = self.home(openid, data) elif act == "RESET-SF": ret = self.resetSF(openid, data) elif act == "SPEAKER-SUNG": ret = self.speakerSung(openid, data.imei) elif act == "AUTO-MONITOR": #定时自动检测 accessLog = False ret = self.autoMonitor() elif act == "OFFLINE-NOTIFY": #定时自动检测 accessLog = False ret = self.offlineNotify(data) if accessLog == True: logstat.logAccessUrl(openid, act) #记录用户访问 return ret
def POST(self): data = web.input() openid = objWeixin.getOpenid(data) act = data.act.upper() ret = None return ret