def insert(self, doctor): doctor_id = getTimeStamp() doctor['doctor_id'] = doctor_id doctor['create_time'] = getTime() doctor['update_time'] = getTime() doctor['delete_flag'] = '1' doctor_collection = getCollection(collectionName=self.__collectionName) doctor_collection.insert(doctor) return doctor
def insert(self, wxsys): #wxsys['program_id'] = getTimeStamp() wxsys['access_token'] = '' wxsys['program_message'] = '' wxsys['create_time'] = getTime() wxsys['update_time'] = getTime() wxsys_collection = getCollection(collectionName=self.__collectionName) wxsys_collection.insert(wxsys) return wxsys['program_id']
def insert(self, service): service_id = getTimeStamp() service['service_id'] = service_id service['create_time'] = getTime() service['update_time'] = getTime() service['delete_flag'] = '1' service_collection = getCollection( collectionName=self.__collectionName) service_collection.insert(service) return service
def insert(self, party): party['party_id'] = getTimeStamp() party['create_time'] = getTime() party['update_time'] = getTime() party['party_status'] = '1' party['party_attend_num'] = 0 party['payment_flag'] = '0' party_collection = getCollection(collectionName=self.__collectionName) party_collection.insert(party) return party['party_id']
def insert(self, attendee): attendee['attend_id'] = getTimeStamp() attendee['create_time'] = getTime() attendee['update_time'] = getTime() attendee['attend_status'] = '1' attendee['payment_flag'] = '0' attendee_collection = getCollection( collectionName=self.__collectionName) attendee_collection.insert(attendee) return attendee['attend_id']
def insert(self, engineer): engineer_id = getTimeStamp() engineer['engineer_id'] = engineer_id engineer['create_time'] = getTime() engineer['update_time'] = getTime() engineer['flag'] = '1' engineer['openId'] = '' engineer['nickname'] = '' engineer_collection = getCollection( collectionName=self.__collectionName) engineer_collection.insert(engineer) return engineer_id
def insert(self, wxsyslicense): wxsyslicense['license_num'] = getTimeStamp() if wxsyslicense['license_start_date'] == '': wxsyslicense['license_start_date'] = getToday() wxsyslicense['license_end_date'] = addDays( wxsyslicense['license_start_date'], int(wxsyslicense['license_period']) + 1) wxsyslicense['focal_openId'] = '' wxsyslicense['create_time'] = getTime() wxsyslicense['update_time'] = getTime() wxsyslicense_collection = getCollection( collectionName=self.__collectionName) wxsyslicense_collection.insert(wxsyslicense) return wxsyslicense['license_num']
def insert(self, issue): issue_id = getTimeStamp() issue['issue_id'] = issue_id issue['create_time'] = getTime() issue['update_time'] = getTime() issue['issue_status'] = '1' issue['logs'] = [{ 'openId': issue['request_openId'], 'nickname': issue['nickname'], 'description': '发起申请', 'create_time': getTime() }] issue_collection = getCollection(collectionName=self.__collectionName) issue_collection.insert(issue) return issue_id
def update(self, party): party_collection = getCollection(collectionName=self.__collectionName) party_id = party['party_id'] party['update_time'] = getTime() for key in party: if key != 'party_id' and key != '_id' : party_collection.update({'party_id': party_id}, {'$set': {key: party[key]}})
def update(self, wxsys): wxsys_collection = getCollection(collectionName=self.__collectionName) program_id = wxsys['program_id'] wxsys['update_time'] = getTime() for key in wxsys: if key != 'program_id' and key != '_id': wxsys_collection.update({'program_id': program_id}, {'$set': { key: wxsys[key] }})
def update(self, issue): issue_collection = getCollection(collectionName=self.__collectionName) issue_id = issue['issue_id'] issue['update_time'] = getTime() for key in issue: if key != 'issue_id' and key != '_id': issue_collection.update({'issue_id': issue_id}, {'$set': { key: issue[key] }}) return issue
def update(self, attendee): attendee_collection = getCollection( collectionName=self.__collectionName) attend_id = attendee['attend_id'] attendee['update_time'] = getTime() for key in attendee: if key != 'attend_id' and key != '_id': attendee_collection.update({'attend_id': attend_id}, {'$set': { key: attendee[key] }})
def update(self, engineer): engineer_collection = getCollection( collectionName=self.__collectionName) engineer_id = engineer['engineer_id'] engineer['update_time'] = getTime() for key in engineer: if key != 'engineer_id' and key != '_id': engineer_collection.update({'engineer_id': engineer_id}, {'$set': { key: engineer[key] }}) return self.findByEngineerId(engineer_id=engineer_id)
def doSaveLogs(): issue = {} message = '' if request.method == 'GET': #issue['license_num'] = request.args.get('license_num') issue['issue_id'] = request.args.get('issue_id') logs = {} logs['openId'] = request.args.get('openId') logs['description'] = request.args.get('process_comment') logs['nickname'] = request.args.get('nickname') logs['create_time'] = getTime() issue['logs'] = logs message = updateIssueLogs(issue) return make_response(json.dumps(message))
def update(self, wxsyslicense): wxsyslicense_collection = getCollection( collectionName=self.__collectionName) license_num = wxsyslicense['license_num'] wxsyslicense['license_end_date'] = addDays( wxsyslicense['license_end_date'], int(wxsyslicense['license_period']) + 1) wxsyslicense['update_time'] = getTime() for key in wxsyslicense: if key != 'license_num' and key != '_id': wxsyslicense_collection.update( {'license_num': license_num}, {'$set': { key: wxsyslicense[key] }}) return license_num
def doSetstatus(): result = {} if request.method == 'GET': issue = {} issue_id = request.args.get('issue_id') issue_status = request.args.get('issue_status') issue['issue_id'] = issue_id issue['issue_status'] = issue_status description = '' if issue_status == '9': description = '确认处理情况,没有问题。' elif issue_status == '0': description = '报修取消。' logs = {} logs['openId'] = request.args.get('openId') logs['description'] = description logs['nickname'] = request.args.get('nickname') logs['create_time'] = getTime() issue['logs'] = logs result = updateIssueStatus(issue) return make_response(json.dumps(result))