管理信息系统 课程设计

1          系统概要说明

众所周知,当今社会信息科技日新月异,各种需要的、不需要的信息充斥网络各个角落。当网络用户对某种信息产生需求时,特定主题的网络论坛则是很好的信息来源。

论坛如同雨后春笋般的出现,并迅速的发展壮大。现在的论坛几乎涵盖了我们生活的各个方面,几乎每一个人都可以找到自己感兴趣或者需要了解的论坛。但综合类的论坛由于广便难于精,于是专题性的论坛继而出现。

爱美之心人皆有之。生活质量越来越高的今天,人们对于美的需求亦越来越大。但是网络上杂而糙的护肤、化妆的信息难以筛选,故而护肤、化妆方面的信息需要有一个整合信息,并且能够互相交流经验的平台。

本网站的设计与实现使用了Python+Flask+MysqL的web建设技术,并且使用HTML和CSS/DIV技术使网站页面更具灵活性。主要实现了用户的注册登录、文章分类搜索、个人信息、历史发布等10个功能模块。

2         网站结构设计

3       模块详细设计

3.1         登录、注册、登出

3,2个人中心

3.3 修改个人信息

3.4  搜索文章

3.5 文章分类

3.6  发布文章、评论

4       数据库设计

4.1  E-R图

4.2  数据字典

表4-2-1 用户信息表


表中列名


数据类型


是否为空


说明


id


Int


Not null(主键)


标识id


username


String


Not null


用户名


_password


String


Not null


密码


icon


String


Not null


头像文件名

表4-2-2 问答信息表


表中列名


数据类型


是否为空


说明


id


int


Not null(主键)


标识id


title


string


Not null


题目


detail


text


Not null


内容


creat_time


datetime


Not null


发布时间


author_id


Int


Not null(外键)


作者id


cf


Int


Not null(外键)


分类


look


Int


Not null


浏览量


click


int


Not null


点击量

表4-2-3  评论信息表


表中列名


数据类型


是否为空


说明


id


int


Not null(主键)


标识id


author_id


Int


Not null(外键)


作者id


question_id


Int


Not null(外键)


问答id


creat_time


datetime


Not null


发布时间


detial


text


Not null


内容

表4-2-4问答分类信息表


表中列名


数据类型


是否为空


说明


id


Int


Not null(主键)


标识id


name


string


Not null


分类名称

表4-2-5收藏信息表


表中列名


数据类型


是否为空


说明


id


Int


Not null(主键)


标识id


book_id


Int


Not null(外键)


问答id


collection


Int


Not null(外键)


收藏用户id


creat_time


datetime


Not null


收藏时间

5       系统实现的关键算法与数据结构

5.1 登录、注册、登出

# 退出
@app.route(‘/logout/‘)
def logout():
    session.pop(‘username‘)
    return redirect(url_for(‘index‘))
# 登陆
@app.route(‘/login/‘, methods=[‘GET‘, ‘POST‘])
def login():
    if request.method == ‘GET‘:
        return render_template(‘login.html‘)
    else:
        username = request.form.get(‘username‘)
        password = request.form.get(‘password‘)
        user = User.query.filter(User.username == username).first()
        if user:
            if user.check_password(password):
                session[‘username‘] = user.username
                session[‘user_id‘] = user.id
                session.permanent = True
                # 重新定位到首页
                return redirect(url_for(‘index‘))
            else:
                # 重新定位到注册
                return redirect(url_for(‘login‘))
        else:
            return redirect(url_for(‘login‘))

# 注册
@app.route(‘/regist/‘, methods=[‘GET‘, ‘POST‘])
def regist():
    if request.method == ‘GET‘:
        # 打开注册页的模板
        return render_template(‘regist.html‘)
    else:  # 收到用户上传的信息
        username = request.form.get(‘username‘)
        password = request.form.get(‘password‘)
        user = User.query.filter(User.username == username).first()
        if user:
            return ‘error:user exitst‘
        else:
            user = User(username=username, password=password)
            db.session.add(user)  # 加入数据库
            db.session.commit()
            return redirect(url_for(‘login‘))

# 定义一个装饰器出验证用户有是否是登陆
# 定义一个参数函数
def loginFirst(func):
    # 定义一个函数将其返回
    @wraps(func)
    def wrapper(*args, **kwargs):
        if session.get(‘username‘):
            return func(*args, **kwargs)
        else:
            return redirect(url_for(‘login‘))
            # 返回一个函数
    return wrapper

5.2  个人中心

# 某用户发布过的所有问题、评论,个人信息、我的收藏
@app.route(‘/comment/<user_id>/<num>‘)
def comment(user_id, num):
    user = User.query.filter(User.id == user_id).first()
    content = {
        ‘comment‘: user.comment,
        ‘questions‘: user.question,
        ‘user2‘: user,
    }
    if (num == ‘1‘):
        return render_template(‘subComment1.html‘, **content, title=‘全部问题‘)
    elif (num == ‘2‘):
        return render_template(‘subComment2.html‘, **content)
    elif (num == ‘3‘):
        return render_template(‘subComment3.html‘, **content)
    elif (num == ‘4‘):
        content = {
            ‘comment‘: user.comment,
            ‘questions‘: user.collection.all(),
            ‘user2‘: user,
        }
        return render_template(‘subComment1.html‘, **content, title=‘我的收藏‘)
    else:
        return render_template(‘subComment1.html‘, **content)
#修改密码
@app.route(‘/setPassword/<id>‘, methods=[‘GET‘, ‘POST‘])
@loginFirst
def setPassword(id):
    if request.method == ‘GET‘:
        return render_template(‘setPassword.html‘)
    else:
        user = User.query.filter(User.id == id).first()
        if user:
            if user.check_password(request.form.get(‘old‘)):
                user.password = request.form.get(‘new1‘)
                db.session.commit()
                info = ‘修改成功‘
            else:
                info = ‘原密码错误‘
        else:
            info = ‘未知错误‘
        return redirect(url_for(‘index‘, info=info))
# 上传头像
@app.route(‘/uploadLogo/<user_id>‘, methods=[‘GET‘, ‘POST‘])
def uploadLogo(user_id):
    user = User.query.filter(User.id == user_id).first()
    f = request.files[‘logo‘]
    basepath = os.path.dirname(__file__)  # 当前文件所在路径
    upload_path = os.path.join(basepath, ‘static/uploads‘, f.filename)  # 注意:没有的文件夹一定要先创建,不然会提示没有该路径
    f.save(upload_path)
    user.icon = ‘uploads/‘ + f.filename
    db.session.commit()
    return redirect(url_for(‘setPassword‘, id=user_id));

5.3 搜索文章

# 模糊查找
@app.route(‘/search‘)
def search():
    qu = request.args.get(‘q‘)
    c = ‘‘ if request.args.get(‘c‘) == ‘‘ else request.args.get(‘c‘)
    query = Question.query.filter(
        or_(
            Question.title.contains(qu),
            Question.detail.contains(qu),
        ),
        Question.cf.like(‘%‘ + c + ‘%‘),
    ).order_by(‘-creat_time‘).all()
    context = {
        ‘questions‘: query,
        ‘cf‘: Cf.query.all(),
        ‘hot‘: Question.query.order_by(‘-click‘).all()[0:4]
    }
    return render_template(‘index.html‘, **context)

5.4  文章分类

@app.route(‘/‘)
def index():
    if request.args.get(‘info‘):
        info = request.args.get(‘info‘)
    else:
        info = None
    context = {
        ‘questions‘: Question.query.order_by(‘-creat_time‘).all()[0:4],
        ‘cf‘: Cf.query.all(),
        ‘info‘: info,
        ‘hot‘: Question.query.order_by(‘-click‘).all()[0:4]
    }
    return render_template(‘index.html‘, **context)

5.5  点赞收藏

@app.route(‘/detail/<question_id>‘, methods=[‘GET‘, ‘POST‘])
@loginFirst
def detail(question_id):
    quest = Question.query.filter(Question.id == question_id).first()
    u = User.query.filter(User.id == session.get(‘user_id‘)).first()
    if request.method == ‘POST‘:
        if request.form.get(‘click‘) == ‘1‘:
            quest.click = quest.click + 1
        if request.form.get(‘collection‘) == ‘1‘:
            user = u
            user.collection.append(quest)
            db.session.add(user)
    col = u.collection.filter_by(id=question_id).first()
    if col is None:
        col = {}
    comment = Comment.query.filter(Comment.question_id == question_id).order_by(‘-creat_time‘).all()
    quest.look = quest.look + 1
    content = {
        ‘ques‘: quest,
        ‘comment‘: comment,
        ‘col‘: col,
        ‘questions‘: Question.query.filter(Question.cf == quest.cf).all(),
    }
    return render_template(‘detail.html‘, **content)

5.6  发布文章、评论

# 发布问答
@app.route(‘/question‘, methods=[‘GET‘, ‘POST‘])
@loginFirst
def question():
    if request.method == ‘GET‘:
        cf = Cf.query.all()
        return render_template(‘question.html‘, cf=cf)
    else:
        title = request.form.get(‘title‘)
        detail = request.form.get(‘detail‘)
        author_id = request.form.get(‘author_id‘)
        cf = request.form.get(‘cf‘)
        question = Question(title=title, detail=detail, author_id=author_id, cf=cf)
        db.session.add(question)  # 加入数据库
        db.session.commit()
        return redirect(url_for(‘index‘))
# 发布评论
@app.route(‘/answer/‘, methods=[‘GET‘, ‘POST‘])
def answer():
    if request.method == ‘POST‘:
        question_id = request.form.get(‘question_id‘)
        author_id = request.form.get(‘author_id‘)
        detail = request.form.get(‘detail‘)
        comment = Comment(question_id=question_id, author_id=author_id, detail=detail)
        db.session.add(comment)
        db.session.commit()
        return redirect(url_for(‘detail‘, question_id=question_id))

6     成品展示

6.1首页

6.2 发布问答页

6.3  个人中心

6.4  详情页

6.5登录页

6.6 注册页

6.7 搜索

原文地址:https://www.cnblogs.com/888abc/p/9186611.html

时间: 2024-08-29 01:38:46

管理信息系统 课程设计的相关文章

管理信息系统 课程设计(2018-6-16)

1. 引言  在这个信息技术发展飞快的时代,信息也不再是像从前那么单一,具体的形式来存在的,所以我们对于信息也不能以以前的态度去面对,我们要有更好的方法去管理信息,利用Python+Flask+MysqL和HTML+CSS去制作一个属于自己的网站,把信息进行统一的管理,才会跟上时代,不断进步. 在网络技术不断的发展之下,一些网页布局与后端链接有了更多的模式,特别是在网络上的管理信息系统的不断优化,这一模型概念也有了紧跟大局的改变.我们要学会挖掘其中的功能和优点.本次课程设计我主要是设计一个方便大

管理信息系统课程设计

系统概要说明 该网站是由Python+Flask+MysqL的web建设技术开发的.本系统是一个论坛网站,集个人.评论于一身.未注册的用户只可以浏览文章,注册成为该系统的用户,可以发表文章.评论,上传头像,修改密码,点赞收藏,并且对此作样式修改. 系统目标:对系统有一个整体的认识,包括每个功能实现的流程,产生的数据,技术基础等 进行概要设计: 1.设计系统的总体架构 2.利用顺序图描述基于该架构下各个类如何协作实现各个待开发的功能 3.整理总结出数据字典 4.对每一个功能进行检查并且改善    

四川职业技术学院辅导员工作管理信息系统的设计与开发--文献随笔(十四)

一.基本信息 标题:四川职业技术学院辅导员工作管理信息系统的设计与开发 时间:2013 出版源:电子科技大学 关键词:辅导员; 学生管理; 面向对象; 统一建模语言; 二.研究背景 问题定义:面临日益复杂繁缛的工作,仅靠传统手工的辅导员管理显然不能适应信息技术发展给社会和高校发展带来的积极效应,但是针对辅导员工作的配套管理软件严重缺乏,开发一个适合辅导员工作的管理软件,提高办公质量,加强班级管理,是适应学校个方面发展的要求和学生管理工作中急需解决的问题. 难点:系统分析,包括可行性分许,系统性能

山东青年政治学院学生工作管理信息系统的设计与实现--文献随笔(十五)

一.基本信息 标题:山东青年政治学院学生工作管理信息系统的设计与实现 时间:2014 出版源:山东大学 关键词:学生工作管理信息系统; J2EE; 流程管理; 权限; 二.研究背景 问题定义:伴随着高考入学率的提高,高校招生人数不断增加,同时激增了高校的在校生数量,新生入学时的基本信息少则十几条,多则三.四十条,入校后的学生个人信息会逐渐增多,如何处理好如此大量的学生相关数据信息,如何更好的组织学生个人信息,更加快捷的管理学生信息小显得尤为重要.随着计算机应用范围的逐渐扩大,靠计算机来实现学生个

管理信息系统的开发与管理

1.带label的文本输入区域 <label for=""></label><textarea " id=""></textarea> {% extends 'base.html' %} {% block title %} Question&answer {% endblock %} {% block head %} <link href="{{ url_for('static',fi

数据结构-课程设计-职工管理系统

职工管理管理系统--课程设计 本次课程设计,我还挺幸运的,抽到一道这么简单的题,思路很简单,但拓展很强,相比其他同学的,我这个简直是...,真是运气太好了, 代码写了1500多行吧,做课程设计中,我也学到了很多东西,代码太多,就放到了github上了 下面是一个总体概述,和一个README.md 其中README中以前分开写过,这次把他都写到了一起,所以就有点多~~~ 先来一个总体概述: 1.fstream的使用 字符串使用 3.排序的实现 排序使用的选择排序,采用的存储方式为链式结构,根据对象

C++/C课程设计(2)工资管理系统功能说明

原文取自个人博客:www.jycoder.com欢迎访问 百度网盘下载源代码:Demo.zip 百度网盘下载软件文档:软件文档.zip 工资管理系统 一,     基本功能要求: 1)以密码登录系统 密码登录时读取文件info.txt(保存员工信息)和Admin.txt(保存管理员息) 如果密码错误或者用户账号不存在,会给出相应提示 二,     主功能界面 菜单布局,对应不同功能 2)录入员工信息具体工资,计算相应的税金(计算规则参见最新公布的政策) 3)查询并显示所有的员工具体信息 4)显示

数据结构——课程设计

  <数据结构课程设计>   课程题目 模拟电话客服管理系统 课程编号 j1620102 学生姓名 吴佳煜 所在专业 信息管理与信息系统 所在班级 信管1133 任课老师 易学明 实习时间 二〇一四年十二月二十五日 设计成绩 老师评语 一.课程设计题目 赵斌是一个信管专业的学生,大学四年顺利毕业了.在毕业季,他也像其他学子一样,投身于求职大军,投出一份又一份求职简历,在苦苦地等待之后,他接到了中国移动通信公司广东分司的面试通知书,通知他于本月1号10点到公司面试.当天,晴空万里,艳阳高照,他身

数据库课程设计

数 据库课程设计是在学生系统的学习了数据库原理课程后,依照关系型数据库的基本原理,综合运用所学的知识,以小组为单位,设计开发一个小型的管理信息系统 (MIS).通过对一个实际问题的分析.设计与实现,将原理与应用相结合,使学生学会怎样把书本上学到的知识用于解决实际问题,培养学生的动手能力:还有一 方面,使学生能深入理解和灵活掌握教学内容. 整体设计要求: 四到五人为一个小组,小组成员既要有相互合作的精神,又要分工明白.每一个学生都必须充分了解整个设计的全过程. 通讯录 1.功能需求: 1)网络版,