- 开发语言:Python
- 框架:django
- Python版本:python3.8
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:PyCharm
系统展示
系统首页

系统注册

招聘信息

个人中心

管理员登录

管理员功能界面

用户管理

招聘信息管理

留言板管理

系统管理

摘要
随着网络科技的不断发展以及人们经济水平的逐步提高,计算机如今已成为人们生活中不可缺少的一部分,为招聘信息方便管理,基于Python技术设计与实现了一款简洁、轻便的管理系统。本系统解决了招聘信息管理中的主要问题,包括个人中心、用户管理、招聘信息管理、留言板管理、系统管理等功能。本系统采用了Python语言的Django框架,数据采用MySQL数据库进行存储。结合B/S结构进行开发设计,功能强大,界面化操作便于上手。本系统具有良好的易用性和安全性,系统功能齐全,可以满足招聘信息管理的相关工作。
研究背景
随着科学技术的不断发展,计算机现在已经成为了社会的必需品,人们通过网络可以获得海量的信息,这些信息可以和各行各业进行关联,招聘信息推荐系统也不例外,它给招聘信息带来了更多的选择和便捷。为解决这样的问题,招聘信息推荐系统应运而生并快速发展,目前已成为众多公司的应用模块,同时也引起了学术界的长期关注。
关键技术
Python是解释型的脚本语言,在运行过程中,把程序转换为字节码和机器语言,说明性语言的程序在运行之前不必进行编译,而是一个专用的解释器,当被执行时,它都会被翻译,与之对应的还有编译性语言。
同时,这也是一种用于电脑编程的跨平台语言,这是一门将编译、交互和面向对象相结合的脚本语言(script language)。
Django用Python编写,属于开源Web应用程序框架。采用(模型M、视图V和模板t)的框架模式。该框架以比利时吉普赛爵士吉他手詹戈·莱因哈特命名。该架构的主要组件如下:
1.用于创建模型的对象关系映射。
2.最终目标是为用户设计一个完美的管理界面。
3.是目前最流行的URL设计解决方案。
4.模板语言对设计师来说是最友好的。
5.缓存系统。
Vue是一款流行的开源JavaScript框架,用于构建用户界面和单页面应用程序。Vue的核心库只关注视图层,易于上手并且可以与其他库或现有项目轻松整合。
MYSQL数据库运行速度快,安全性能也很高,而且对使用的平台没有任何的限制,所以被广泛应运到系统的开发中。MySQL是一个开源和多线程的关系管理数据库系统,MySQL是开放源代码的数据库,具有跨平台性。
B/S(浏览器/服务器)结构是目前主流的网络化的结构模式,它能够把系统核心功能集中在服务器上面,可以帮助系统开发人员简化操作,便于维护和使用。
系统分析
对系统的可行性分析以及对所有功能需求进行详细的分析,来查看该系统是否具有开发的可能。

系统设计
功能模块设计和数据库设计这两部分内容都有专门的表格和图片表示。

系统实现
当人们打开系统的网址后,首先看到的就是首页界面。在这里,人们能够看到系统的导航条,通过导航条导航进入各功能展示页面进行操作。管理员进入主页面,主要功能包括对个人中心、用户管理、招聘信息管理、留言板管理、系统管理等功能进行操作。
代码实现
python
# coding:utf-8
def schemaName_cal(request, tableName, columnName):
'''
计算规则接口
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, 'data': []}
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getcomputedbycolumn(
m,
m,
columnName
)
print(data)
if data:
try:
sum='%.05f' % float(data.get("sum"))
except:
sum=0.00
try:
max='%.05f' % float(data.get("max"))
except:
max=0.00
try:
min='%.05f' % float(data.get("min"))
except:
min=0.00
try:
avg='%.05f' % float(data.get("avg"))
except:
avg=0.00
msg['data'] = {
"sum": sum,
"max": max,
"min": min,
"avg": avg,
}
break
return JsonResponse(msg)
def schemaName_file_upload(request):
'''
上传
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": "成功", "data": {}}
file = request.FILES.get("file")
if file:
filename = file.name
filesuffix = filename.split(".")[-1]
file_name = "{}.{}".format(int(float(time.time()) * 1000), filesuffix)
filePath = os.path.join(os.getcwd(), "templates/front", file_name)
print("filePath===========>", filePath)
with open(filePath, 'wb+') as destination:
for chunk in file.chunks():
destination.write(chunk)
msg["file"] = file_name
# 判断是否需要保存为人脸识别基础照片
req_dict = request.session.get("req_dict")
type1 = req_dict.get("type", 0)
print("type1=======>",type1)
type1 = int(type1)
if type1 == 1:
params = {"name":"faceFile","value": file_name}
config.createbyreq(config, config, params)
return JsonResponse(msg)
def schemaName_file_download(request):
'''
下载
'''
if request.method in ["POST", "GET"]:
req_dict = request.session.get("req_dict")
filename = req_dict.get("fileName")
filePath = os.path.join(os.getcwd(), "templates/front", filename)
print("filePath===========>", filePath)
file = open(filePath, 'rb')
response = HttpResponse(file)
response['Content-Type'] = 'text/plain'
response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(filePath)
response['Content-Length'] = os.path.getsize(filePath)
return response
def schemaName_follow_level(request, tableName, columnName, level, parent):
'''
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, 'data': []}
# 组合查询参数
params = {
"level": level,
"parent": parent
}
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getbyparams(
m,
m,
params
)
# 只需要此列的数据
for i in data:
msg['data'].append(i.get(columnName))
break
return JsonResponse(msg)
def schemaName_follow(request, tableName, columnName):
'''
根据option字段值获取某表的单行记录接口
组合columnName和columnValue成dict,传入查询方法
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, 'data': []}
# 组合查询参数
params = request.session.get('req_dict')
columnValue = params.get("columnValue")
params = {columnName: columnValue}
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getbyparams(
m,
m,
params
)
if len(data)>0:
msg['data'] = data[0]
break
return JsonResponse(msg)
def schemaName_location(request):
'''
定位
:return:
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": mes.normal_code, "address": ''}
req_dict = request.session.get('req_dict')
datas = config.getbyparams(config, config, {"name": "baidu_ditu_ak"})
if len(datas) > 0:
baidu_ditu_ak = datas[0].get("baidu_ditu_ak")
else:
baidu_ditu_ak = 'QvMZVORsL7sGzPyTf5ZhawntyjiWYCif'
lat = req_dict.get("lat", 24.2943350100)
lon = req_dict.get("lng", 116.1287866600)
msg['address'] = geocoding(baidu_ditu_ak, lat, lon)
return JsonResponse(msg)
def schemaName_matchface(request):
'''
baidubce百度人脸识别
'''
if request.method in ["POST", "GET"]:
try:
msg = {"code": normal_code}
req_dict = request.session.get("req_dict")
face1 = req_dict.get("face1")
file_path1 = os.path.join(os.getcwd(),"templates/front",face1)
face2 = req_dict.get("face2")
file_path2 = os.path.join(os.getcwd(), "templates/front", face2)
data = config.getbyparams(config, config, {"name": "APIKey"})
client_id = data[0].get("value")
data = config.getbyparams(config, config, {"name": "SecretKey"})
client_secret = data[0].get("value")
bdb = BaiDuBce()
score = bdb.bd_check2pic(client_id, client_secret, file_path1, file_path2)
msg['score'] = score
return JsonResponse(msg)
except:
return JsonResponse({"code": 500, "msg": "匹配失败", "score": 0})
def schemaName_option(request, tableName, columnName):
'''
获取某表的某个字段列表接口
:param request:
:param tableName:
:param columnName:
:return:
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, 'data': []}
new_params = {}
params = request.session.get("req_dict")
if params.get('conditionColumn') != None and params.get('conditionValue') != None:
new_params[params['conditionColumn']] = params['conditionValue']
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getbyColumn(
m,
m,
columnName,
new_params
)
msg['data'] = data
break
return JsonResponse(msg)
def schemaName_remind_tablename_columnname_type(request, tableName, columnName, type)->int:
'''
前台提醒接口(通用接口,不需要登陆)
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, 'data': []}
# 组合查询参数
params = request.session.get("req_dict")
remindstart = int(params.get('remindstart')) if params.get('remindstart') != None else None
remindend = int(params.get('remindend')) if params.get('remindend') != None else None
if int(type) == 1: # 数字
if remindstart == None and remindend != None:
params['remindstart'] = 0
elif remindstart != None and remindend == None:
params['remindend'] = 999999
elif remindstart == None and remindend == None:
params['remindstart'] = 0
params['remindend'] = 999999
elif int(type) == 2: # 日期
current_time = int(time.time())
if remindstart == None and remindend != None:
starttime = current_time - 60 * 60 * 24 * 365 * 2
params['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * remindend
params['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
elif remindstart != None and remindend == None:
starttime = current_time - 60 * 60 * 24 * remindstart
params['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * 365 * 2
params['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
elif remindstart == None and remindend == None:
starttime = current_time - 60 * 60 * 24 * 365 * 2
params['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * 365 * 2
params['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getbetweenparams(
m,
m,
columnName,
params
)
msg['count'] = len(data)
break
return JsonResponse(msg)
def schemaName_tablename_remind_columnname_type(request, tableName, columnName, type):
'''
后台提醒接口,判断authSeparate和authTable的权限
'''
if request.method in ["POST", "GET"]:
print("schemaName_tablename_remind_columnname_type==============>")
msg = {"code": normal_code, 'data': []}
req_dict = request.session.get("req_dict")
remindstart = int(req_dict.get('remindstart')) if req_dict.get('remindstart')!=None else None
remindend = int(req_dict.get('remindend')) if req_dict.get('remindend')!=None else None
print("req_dict===================>",req_dict)
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
tableModel=m
break
# 获取全部列名
columns = tableModel.getallcolumn(tableModel, tableModel)
# 当前登录用户所在表
tablename = request.session.get("tablename")
# 当列属性authTable有值(某个用户表)[该列的列名必须和该用户表的登陆字段名一致],则对应的表有个隐藏属性authTable为"是",那么该用户查看该表信息时,只能查看自己的
try:
__authTables__ =tableModel.__authTables__
except:
__authTables__ = {}
if __authTables__ != {}:
for authColumn, authTable in __authTables__.items():
if authTable == tablename:
params = request.session.get("params")
req_dict[authColumn] = params.get(authColumn)
break
'''__authSeparate__此属性为真,params添加userid,后台只查询个人数据'''
try:
__authSeparate__ =tableModel.__authSeparate__
except:
__authSeparate__ = None
if __authSeparate__ == "是":
tablename = request.session.get("tablename")
if tablename != "users" and 'userid' in columns:
try:
pass
# req_dict['userid'] = request.session.get("params").get("id")
except:
pass
# 组合查询参数
if int(type) == 1: # 数字
if remindstart == None and remindend != None:
req_dict['remindstart'] = 0
elif remindstart != None and remindend == None:
req_dict['remindend'] = 999999
elif remindstart == None and remindend == None:
req_dict['remindstart'] = 0
req_dict['remindend'] = 999999
elif int(type) == 2: # 日期
current_time = int(time.time())
if remindstart == None and remindend != None:
starttime = current_time - 60 * 60 * 24 * 365 * 2
req_dict['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * remindend
req_dict['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
elif remindstart != None and remindend == None:
starttime = current_time + 60 * 60 * 24 * remindstart
req_dict['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * 365 * 2
req_dict['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
elif remindstart == None and remindend == None:
starttime = current_time - 60 * 60 * 24 * 365 * 2
req_dict['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * 365 * 2
req_dict['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
else:
starttime = current_time + 60 * 60 * 24 * remindstart
req_dict['remindstart'] = time.strftime("%Y-%m-%d", time.localtime(starttime))
endtime = current_time + 60 * 60 * 24 * remindend
req_dict['remindend'] = time.strftime("%Y-%m-%d", time.localtime(endtime))
print("req_dict==============>",req_dict)
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
data = m.getbetweenparams(
m,
m,
columnName,
req_dict
)
msg['count'] = len(data)
break
return JsonResponse(msg)
def schemaName_sh(request, tableName):
'''
根据主键id修改table表的sfsh状态接口
'''
if request.method in ["POST", "GET"]:
print('tableName=========>', tableName)
msg = {"code": normal_code, "msg": "成功", "data": {}}
req_dict = request.session.get("req_dict")
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
# 查询结果
data1 = m.getbyid(
m,
m,
req_dict.get('id')
)
if data1[0].get("sfsh") == '是':
req_dict['sfsh'] = '否'
else:
req_dict['sfsh'] = '否'
# 更新
res = m.updatebyparams(
m,
m,
req_dict
)
# logging.warning("schemaName_sh.res=====>{}".format(res))
if res!=None:
msg["code"]=crud_error_code
msg["code"]=mes.crud_error_code
break
return JsonResponse(msg)
def schemaName_upload(request, fileName):
'''
'''
if request.method in ["POST", "GET"]:
return HttpResponseRedirect ("/{}/front/{}".format(schemaName,fileName))
def schemaName_group_quyu(request, tableName, columnName):
'''
{
"code": 0,
"data": [
{
"total": 2,
"shangpinleibie": "水果"
},
{
"total": 1,
"shangpinleibie": "蔬菜"
}
]
}
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": "成功", "data": {}}
allModels = apps.get_app_config('main').get_models()
where = {}
for m in allModels:
if m.__tablename__ == tableName:
for item in m.__authTables__.items():
if request.session.get("tablename") == item[1]:
where[item[0]] = request.session.get("params").get(item[0])
msg['data'] = m.groupbycolumnname(
m,
m,
columnName,
where
)
break
return JsonResponse(msg)
def schemaName_value_quyu(request, tableName, xColumnName, yColumnName):
'''
按值统计接口,
{
"code": 0,
"data": [
{
"total": 10.0,
"shangpinleibie": "aa"
},
{
"total": 20.0,
"shangpinleibie": "bb"
},
{
"total": 15.0,
"shangpinleibie": "cc"
}
]
}
'''
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": "成功", "data": {}}
allModels = apps.get_app_config('main').get_models()
where = {}
for m in allModels:
if m.__tablename__ == tableName:
for item in m.__authTables__.items():
if request.session.get("tablename") == item[1]:
where[item[0]] = request.session.get("params").get(item[0])
msg['data'] = m.getvaluebyxycolumnname(
m,
m,
xColumnName,
yColumnName,
where
)
break
return JsonResponse(msg)
def schemaName_value_riqitj(request, tableName, xColumnName, yColumnName, timeStatType):
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": "成功", "data": {}}
where = ' where 1 = 1 '
allModels = apps.get_app_config('main').get_models()
for m in allModels:
if m.__tablename__ == tableName:
for item in m.__authTables__.items():
if request.session.get("tablename") == item[1]:
where = where + " and " + item[0] + " = '" + request.session.get("params").get(item[0]) + "' "
sql = ''
if timeStatType == '日':
sql = "SELECT DATE_FORMAT({0}, '%Y-%m-%d') {0}, sum({1}) total FROM {3} {2} GROUP BY DATE_FORMAT({0}, '%Y-%m-%d')".format(xColumnName, yColumnName, where, tableName, '%Y-%m-%d')
if timeStatType == '月':
sql = "SELECT DATE_FORMAT({0}, '%Y-%m') {0}, sum({1}) total FROM {3} {2} GROUP BY DATE_FORMAT({0}, '%Y-%m')".format(xColumnName, yColumnName, where, tableName, '%Y-%m')
if timeStatType == '年':
sql = "SELECT DATE_FORMAT({0}, '%Y') {0}, sum({1}) total FROM {3} {2} GROUP BY DATE_FORMAT({0}, '%Y')".format(xColumnName, yColumnName, where, tableName, '%Y')
L = []
cursor = connection.cursor()
cursor.execute(sql)
desc = cursor.description
data_dict = [dict(zip([col[0] for col in desc], row)) for row in cursor.fetchall()]
for online_dict in data_dict:
for key in online_dict:
if 'datetime.datetime' in str(type(online_dict[key])):
online_dict[key] = online_dict[key].strftime(
"%Y-%m-%d %H:%M:%S")
else:
pass
L.append(online_dict)
msg['data'] = L
return JsonResponse(msg)
def schemaName_spider(request, tableName):
if request.method in ["POST", "GET"]:
msg = {"code": normal_code, "msg": "成功", "data": []}
# Linux
cmd = "cd /yykj/python/9999/spider05zp2 && scrapy crawl "+tableName+"Spider -a databaseName=djangowvp2z"
# Windows
# cmd = "cd C:\\test1\\spider && scrapy crawl " + tableName + "Spider"
os.system(cmd)
return JsonResponse(msg)
系统测试
系统测试不仅仅是发现系统潜在的BUG或错误,而更为重要的是为用户提供一个良好的体验和安全可使用的产品服务。而通过发现错误或潜在的问题,将有助于提升产品的竞争力,这也是软件测试的其中的重要目的之一。
尽管软件测试的方法有好几种,但现目前主要采用的是包括以功能性为主要测试方向的黑盒测试以及以逻辑性为主要测试方向的白盒测试,由于这也是二种不一样的测试方式,因此最先白盒测试是依据程序的内部结构逻辑总体设计测试用例的方式。 因而,也称之为构造测试和夹层玻璃实例测试,将手机软件视为全透明的黑盒,依据程序的构造和解决逻辑挑选适宜的测试实例,测试手机软件的逻辑途径和步骤, 科学研究其与设计方案是不是一致的黑盒测试主要是挑选充足的测试用例,充足遮盖源码,尽量多地发觉程序中产生的不正确。 关键有这两种方式。 一种称为逻辑未来展望法,另一种称为途径未来展望法。
结论
本文介绍了开发招聘信息推荐系统的全部过程,该系统运用了Python语言进行编写、MySQL数据库存储数据和Django框架搭建出了一款简洁方便的招聘信息推荐系统。对用户来说,只有简单的操作,不需要担心复杂的界面,难懂的操作来完成招聘信息推荐系统最基本的工作,节约时间和资源。对管理员来说,可以清晰明了的检查招聘信息的管理情况,增删改查都通过后台系统完成,得益于数据库建表的工作大大简化。使得开发者和管理员的工作变得更加方便简单。