图书馆图书管理系统_第1页
图书馆图书管理系统_第2页
图书馆图书管理系统_第3页
图书馆图书管理系统_第4页
图书馆图书管理系统_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

图书馆图书管理系统

一、系统简介

图书管理系统是图书馆旳重要构成部分,一般分为两大部分,流通系统和采购系统。采购系统分为订单管理、图书入库、图书著录、图书上架、新书上报和书目审查、系统设置。流通系统分为图书管理、读者管理、借阅证管理、图书借阅、图书偿还、系统设置等模块。其中,关键模块为采购系统:图书入库、图书上架;流通系统:图书管理、读者管理、借阅证管理、图书借阅、图书偿还等。

二、系统功能分析——流程图

三、系统功能

1)图书采购(订单查询、查询订单、新书通报)

2)图书入库(图书著录、图书入库)

3)图书流通(图书借阅、图书偿还、预约登记、图书暂停、图书催还)

4)读者管理(读者登记、读者管理、核发借阅证、暂停借阅证、挂失借阅证

补发借阅证、罚款缴纳登记、借阅证注销)

5)记录查询(读者查询、借阅记录、借阅查询、罚款记录、记帐查询

记帐记录)

6)系统设置(馆藏位置、顾客借阅规定管理、顾客管理、系统顾客管理

供书单位设置)四、程设计实现功能规定

由于课程设计时间较短,学生分析设计能力还不纯熟,故不规定学生实现以上所有功能,可以对系统进行简化,省去图书采购、上架、分类、馆藏等环节,基本实现功能规定如下:

1、图书证管理

读者注册、图书证暂停、挂失、补发、注销管理

2、图书流通管理

读者借书、还书、图书预约

3、记录查询

图书查询

读者查询

借阅记录

借阅查询

罚款记录以上旳东西自己改改吧,还可以用到汇报中旳。。/*

*@(#)BookManager.java

*Haveclasses:BookManagerBookBorrower

*Copyright2023Fane.Allrightsreserved.

*@author

Fane

*@version

,09/05/05

*@since

JDK1.4

*/

packageperson.fane.test;

importjava.io.BufferedReader;

importjava.io.InputStreamReader;

importjava.text.SimpleDateFormat;

importjava.util.ArrayList;

importjava.util.Collection;

importjava.util.Date;

importjava.util.Iterator;

publicclassLibraryManager

{

privateArrayListbookList=newArrayList();

privateArrayListuserList=newArrayList();

publicfinalintmaxBorrower=100;

publicfinalintmaxBook=100;

publicstaticvoidmain(Stringargs[])

{

//System.out.println("欢迎来到图书管理系统!!");

LibraryManagernewLibraryManager=newLibraryManager();

BookManagerThreadmyBookManagerThread=newBookManagerThread(newLibraryManager);

newThread(myBookManagerThread).start();

}

/**

*@return返回bookList。

*/

publicArrayListgetBookList(){

returnbookList;

}

/**

*@return返回userList。

*/

publicArrayListgetUserList(){

returnuserList;

}

/**

*@paramuserList要设置旳userList。

*/

publicvoidsetUserList(ArrayListuserList){

this.userList=userList;

}

}

classBook

{

/*

*Book类包括旳属性

*/

privateStringbookName;

privatefloatbookPrice;

privateintbookType;

privateDatepublishDate;

privatebooleanisBorrowed;

privateDateborrowedDate;

/**

*@return返回bookName。

*/

publicStringgetBookName(){

returnbookName;

}

/**

*@parambookName要设置旳bookName。

*/

publicvoidsetBookName(StringbookName){

this.bookName=bookName;

}

/**

*@return返回bookPrice。

*/

publicfloatgetBookPrice(){

returnbookPrice;

}

/**

*@parambookPrice要设置旳bookPrice。

*/

publicvoidsetBookPrice(floatbookPrice){

this.bookPrice=bookPrice;

}

/**

*@return返回bookType。

*/

publicintgetBookType(){

returnbookType;

}

/**

*@parambookType要设置旳bookType。

*/

publicvoidsetBookType(intbookType){

this.bookType=bookType;

}

/**

*@return返回borrowDate。

*/

publicDategetBorrowedDate(){

returnborrowedDate;

}

/**

*@paramborrowDate要设置旳borrowDate。

*/

publicvoidsetBorrowedDate(DateborrowDate){

this.borrowedDate=borrowDate;

}

/**

*@return返回isBorrowed。

*/

publicbooleanisBorrowed(){

returnisBorrowed;

}

/**

*@paramisBorrowed要设置旳isBorrowed。

*/

publicvoidsetBorrowed(booleanisBorrowed){

this.isBorrowed=isBorrowed;

}

/**

*@return返回publishDate。

*/

publicDategetPublishDate(){

returnpublishDate;

}

/**

*@parampublishDate要设置旳publishDate。

*/

publicvoidsetPublishDate(DatepublishDate){

this.publishDate=publishDate;

}

publicStringtoString()

{

StringBuffermyStringBuffer=newStringBuffer();

myStringBuffer.append("书名:"+this.getBookName()+"##");

myStringBuffer.append("价格:"+this.getBookPrice()+"##");

myStringBuffer.append("类型:"+this.getBookType()+"

\n");

myStringBuffer.append("出版日期:"+this.getPublishDate()+"

\n");

myStringBuffer.append("借阅日期:"+this.getBorrowedDate()+"

\n");

returnmyStringBuffer.toString();

}

}

classBorrower

{

privateStringname="user";

privateintage=1;

privateintborrowerId;

privateArrayListborrowedBook=newArrayList();

publicBorrower()

{}

publicBorrower(Stringname,intage,intborrowId)

{

this.setName(name);

this.setAge(age);

this.setBorrowerId(borrowId);

}

/**

*@return返回age。

*/

publicintgetAge(){

returnage;

}

/**

*@paramage要设置旳age。

*/

publicvoidsetAge(intage){

this.age=age;

}

/**

*@return返回borrowBook。

*/

publicCollectiongetBorrowedBook(){

returnborrowedBook;

}

/**

*@return返回borrowerId。

*/

publicintgetBorrowerId(){

returnborrowerId;

}

/**

*@paramborrowerId要设置旳borrowerId。

*/

publicvoidsetBorrowerId(intborrowerId){

this.borrowerId=borrowerId;

}

/**

*@return返回name。

*/

publicStringgetName(){

returnname;

}

/**

*@paramname要设置旳name。

*/

publicvoidsetName(Stringname){

=name;

}

/*

*输出顾客基本信息和借阅信息

*

(非Javadoc)

*@seejava.lang.Object#toString()

*/

publicStringtoString()

{

StringBuffermyStringBuffer=newStringBuffer();

myStringBuffer.append("顾客名:"+name+"

###

");

myStringBuffer.append("年龄:"+age+"

###

");

myStringBuffer.append("顾客编号:"+borrowerId+"

###

\n");

myStringBuffer.append("借阅书籍如下:

\n");

IteratormyIterator=this.getBorrowedBook().iterator();

while(myIterator.hasNext())

{

BookmyBook=(Book)myIterator.next();

myStringBuffer.append("书名:"+myBook.getBookName()+"

");

myStringBuffer.append("价格:"+myBook.getBookPrice()+"

\n");

myStringBuffer.append("出版日期:"+myBook.getPublishDate()+"

\n");

myStringBuffer.append("借阅日期:"+myBook.getBorrowedDate()+"

\n");

}

returnmyStringBuffer.toString();

}

}

classBookManagerThreadimplementsRunnable

{

privatebooleanisOut=false;

privateintmainFrame=0;

privateintsubFrame=0;

privateBufferedReaderkeyboardInput;

privateLibraryManagermyLibraryManager;

privateSimpleDateFormatmySimpleDateFormat=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");

publicBookManagerThread(LibraryManagermyLibraryManager)

{

this.myLibraryManager=myLibraryManager;

}

/*

*图书管理系统旳运行进程

*

(非Javadoc)

*@seejava.lang.Runnable#run()

*/

publicvoidrun(){

while(!isOut)

{

logicProcess();

}

}

privatevoiddisplayMain()

{

System.out.println("

欢迎来到图书管理系统!

");

System.out.println("1:顾客管理<输入U+回车>

");

System.out.println("2:图书管理<输入B+回车>

");

System.out.println("3:借阅管理<输入L+回车>

");

System.out.println("Exit:退出<输入Exit+回车>

");

}

privatevoiddispalyUserManager()

{

System.out.println("

欢迎来到图书管理系统!

");

System.out.println("1:增长顾客

<输入A+回车>

");

System.out.println("2:修改顾客

<输入M+回车>

");

System.out.println("3:删除顾客

<输入D+回车>

");

System.out.println("Up:返回上一级<输入up+回车>

");

}

privatevoiddispalyBookManager()

{

System.out.println("

欢迎来到图书管理系统!

");

System.out.println("1:增长图书

<输入A+回车>

");

System.out.println("2:修改图书

<输入M+回车>

");

System.out.println("3:删除图书

<输入D+回车>

");

System.out.println("Up:返回上一级<输入up+回车>

");

}

privatevoiddispalyBorrowManager()

{

System.out.println("

欢迎来到图书管理系统!

");

System.out.println("1:借阅图书

<输入B+回车>

");

System.out.println("2:偿还图书

<输入L+回车>

");

System.out.println("3:浏览顾客借阅信息<输入V+回车>

");

System.out.println("Up:返回上一级

<输入up+回车>");

}

privatevoiddispalyAllUsers()

{

IteratormyIterator=this.getMyLibraryManager().getUserList().iterator();

inti=0;

while(myIterator.hasNext())

{

System.out.println("该顾客序列号是:"+i);

System.out.println(((Borrower)myIterator.next()).toString());

i++;

}

}

privatevoiddisplayAllBooks()

{

IteratormyIterator=this.getMyLibraryManager().getBookList().iterator();

inti=0;

while(myIterator.hasNext())

{

System.out.println("该书籍序列号是:"+i);

System.out.println(((Book)myIterator.next()).toString());

i++;

}

}

publicvoidlogicProcess()

{

StringoperateCode="";

/*

*如下是菜单项选择择

*/

if(mainFrame==0)

{

displayMain();

try

{

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

operateCode=keyboardInput.readLine();

if(operateCode.equalsIgnoreCase("U"))

mainFrame=1;

if(operateCode.equalsIgnoreCase("B"))

mainFrame=2;

if(operateCode.equalsIgnoreCase("L"))

mainFrame=3;

if(operateCode.equalsIgnoreCase("Exit"))

isOut=true;

}catch(Exceptionex)

{

System.out.println("输入错误!!!");

}

}

if((mainFrame==1)&&(subFrame==0))

{

dispalyUserManager();

try

{

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

operateCode=keyboardInput.readLine();

if(operateCode.equalsIgnoreCase("A"))

subFrame=1;

if(operateCode.equalsIgnoreCase("M"))

subFrame=2;

if(operateCode.equalsIgnoreCase("D"))

subFrame=3;

if(operateCode.equalsIgnoreCase("Up"))

{

mainFrame=0;

subFrame=0;

}

}catch(Exceptionex)

{

System.out.println("输入错误!!!");

}

}

if((mainFrame==2)&&(subFrame==0))

{

dispalyBookManager();

try

{

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

operateCode=keyboardInput.readLine();

if(operateCode.equalsIgnoreCase("A"))

subFrame=1;

if(operateCode.equalsIgnoreCase("M"))

subFrame=2;

if(operateCode.equalsIgnoreCase("D"))

subFrame=3;

if(operateCode.equalsIgnoreCase("Up"))

{

mainFrame=0;

subFrame=0;

}

}catch(Exceptionex)

{

System.out.println("输入错误!!!");

}

}

if((mainFrame==3)&&(subFrame==0))

{

dispalyBorrowManager();

try

{

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

operateCode=keyboardInput.readLine();

if(operateCode.equalsIgnoreCase("B"))

subFrame=1;

if(operateCode.equalsIgnoreCase("L"))

subFrame=2;

if(operateCode.equalsIgnoreCase("V"))

subFrame=3;

if(operateCode.equalsIgnoreCase("Up"))

{

mainFrame=0;

subFrame=0;

}

}catch(Exceptionex)

{

System.out.println("输入错误!!!");

}

}

/*

*如下是个小块功能实现

*/

if((mainFrame==1)&&(subFrame==1))

{

try

{

BorrowernewBorrower=newBorrower();

System.out.println("请输入顾客名:(up返回上一级)");

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

StringnameTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(nameTemp))

{

subFrame=0;

}else

{

System.out.println("请输入年龄:");

StringageTemp=keyboardInput.readLine();

newBorrower.setAge(Integer.parseInt(ageTemp));

newBorrower.setName(nameTemp);

if(this.getMyLibraryManager().getUserList()==null)

{

newBorrower.setBorrowerId(1);

}else

{

newBorrower.setBorrowerId(this.getMyLibraryManager().getUserList().size()+1);

}

getMyLibraryManager().getUserList().add(newBorrower);

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==1)&&(subFrame==2))

{

try

{

dispalyAllUsers();

System.out.println("请输入序列号来修改:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(idTemp))

{

subFrame=0;

}else

{

BorrowermodifiedBorrower=(Borrower)this.getMyLibraryManager().getUserList().get(Integer.parseInt(idTemp));

System.out.println("请输入顾客名:");

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

StringnameTemp=keyboardInput.readLine();

System.out.println("请输入年龄:");

StringageTemp=keyboardInput.readLine();

modifiedBorrower.setAge(Integer.parseInt(ageTemp));

modifiedBorrower.setName(nameTemp);

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==1)&&(subFrame==3))

{

try

{

dispalyAllUsers();

System.out.println("请输入序列号来删除:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(idTemp))

{

subFrame=0;

}else

{

if(((Borrower)this.getMyLibraryManager().getUserList().get(Integer.parseInt(idTemp))).getBorrowedBook().size()==0)

this.getMyLibraryManager().getUserList().remove(Integer.parseInt(idTemp));

else

{

System.out.println("该顾客仍有借书,不能删除!!");

}

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==2)&&(subFrame==1))

{

try

{

BooknewBook=newBook();

System.out.println("请输入书名:(up返回上一级)");

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

StringbookNameTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(bookNameTemp))

{

subFrame=0;

}else

{

System.out.println("请输入价格:");

StringbookPriceTemp=keyboardInput.readLine();

System.out.println("请输入类型:1-计算机2-数学3-自然科学");

StringbookTypeTemp=keyboardInput.readLine();

System.out.println("请输入出版日期:(格式yyyy-MM-ddHH:mm:ss)");

StringpublishDateTemp=keyboardInput.readLine();

newBook.setBookName(bookNameTemp);

newBook.setBookPrice(Float.parseFloat(bookPriceTemp));

newBook.setBookType(Integer.parseInt(bookTypeTemp));

newBook.setPublishDate(mySimpleDateFormat.parse(publishDateTemp));

this.getMyLibraryManager().getBookList().add(newBook);

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==2)&&(subFrame==2))

{

try

{

displayAllBooks();

System.out.println("请输入序列号来修改:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(idTemp))

{

subFrame=0;

}else

{

BookmodifiedBook=(Book)this.getMyLibraryManager().getBookList().get(Integer.parseInt(idTemp));

System.out.println("请输入书名:");

keyboardInput=newBufferedReader(newInputStreamReader(System.in));

StringbookNameTemp=keyboardInput.readLine();

System.out.println("请输入价格:");

StringbookPriceTemp=keyboardInput.readLine();

System.out.println("请输入类型:1-计算机2-数学3-自然科学");

StringbookTypeTemp=keyboardInput.readLine();

System.out.println("请输入出版日期:(格式yyyy-MM-ddHH:mm:ss)");

StringpublishDateTemp=keyboardInput.readLine();

modifiedBook.setBookName(bookNameTemp);

modifiedBook.setBookPrice(Float.parseFloat(bookPriceTemp));

modifiedBook.setBookType(Integer.parseInt(bookTypeTemp));

modifiedBook.setPublishDate(mySimpleDateFormat.parse(publishDateTemp));

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==2)&&(subFrame==3))

{

try

{

displayAllBooks();

System.out.println("请输入序列号来删除:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(idTemp))

{

subFrame=0;

}else

{

this.getMyLibraryManager().getBookList().remove(Integer.parseInt(idTemp));

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==3)&&(subFrame==1))

{

try

{

displayAllBooks();

System.out.println("请输入序列号来选择要借阅旳书籍:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

dispalyAllUsers();

System.out.println("请输入序列号来选择借阅者:(up返回上一级)");

StringborrowerIdTemp=keyboardInput.readLine();

if(("up".equalsIgnoreCase(idTemp))||("up".equalsIgnoreCase(borrowerIdTemp)))

{

subFrame=0;

}else

{

BookborrowedBook=(Book)this.getMyLibraryManager().getBookList().get(Integer.parseInt(idTemp));

BorrowerthisBorrower=(Borrower)this.getMyLibraryManager().getUserList().get(Integer.parseInt(borrowerIdTemp));

borrowedBook.setBorrowed(true);

borrowedBook.setBorrowedDate(newDate());

thisBorrower.getBorrowedBook().add(borrowedBook);

subFrame=0;

}

}catch(Exceptionex)

{

//ex.printStackTrace();

System.out.println("输入错误!!!");

}

}

if((mainFrame==3)&&(subFrame==2))

{

try

{

this.displayAllBooks();

System.out.println("请输入序列号来选择要偿还旳书籍:(up返回上一级)");

StringidTemp=keyboardInput.readLine();

if("up".equalsIgnoreCase(idTemp))

{

subFrame=0;

}else

{

BookreturnBook=(Book)this.getMyLibra

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论