电影院售票管理系统文档格式.docx
《电影院售票管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《电影院售票管理系统文档格式.docx(37页珍藏版)》请在冰豆网上搜索。
![电影院售票管理系统文档格式.docx](https://file1.bdocx.com/fileroot1/2023-2/1/e3954f61-a129-41c9-8048-7abdc3db932a/e3954f61-a129-41c9-8048-7abdc3db932a1.gif)
publicclassStart{
publicstaticvoidmain(String[]args){
newLogin().start();
packageservice;
publicinterfaceUserService{
publicvoidmenu();
//查看全部电影
publicvoidgetAll();
//通过电影名称查询电影
publicvoidgetByName();
//通过放映时间查询电影
publicvoidgetByItem();
//购买普通票
publicvoidbyTicket();
//购买学生折扣票
publicvoidbyDiscount();
//购买免费票优惠券
publicvoidbyFree();
publicinterfaceAdminService{
//菜单
//查看所有
//添加电影
publicvoidaddFilm();
//删除电影
publicvoiddelFilm();
//更新电影
publicvoidupFilm();
//售票查询
publicvoidgetTicket();
packageservice.impl;
importentity.Film;
importentity.Seat;
importservice.UserService;
publicclassUserLoginimplementsUserService{
Scannerinput=newScanner(System.in);
List<
Film>
listFilm=newArrayList<
();
Seat>
listSeat=newArrayList<
FilmDaoImplfdi=newFilmDaoImpl();
publicvoidmenu(){
"
4:
购票;
5:
返回上一层;
6:
退出;
"
intchose=input.nextInt();
switch(chose){
case1:
getAll();
break;
case2:
getByName();
case3:
getByItem();
case4:
byTicket();
case5:
case6:
System.exit(0);
default:
}
publicvoidgetAll(){
+"
\t"
+"
影片类型"
票价"
播放时间"
listFilm=fdi.getAll();
for(Filmfilm:
listFilm){
+film.getPoster()+"
+film.getDirector()+"
+film.getAcotr()+"
+film.getType()+"
+film.getPrice()+"
+film.getItem());
listFilm.clear();
menu();
publicvoidgetByName(){
Stringname=input.next();
listFilm=fdi.getByName(name);
if(listFilm!
=null){
+"
for(Filmfilm:
listFilm){
+film.getPoster()+"
+film.getDirector()+"
+film.getAcotr()+"
+film.getType()+"
+film.getPrice()+"
+film.getItem());
}
listFilm.clear();
menu();
else{
this.getByName();
}
publicvoidgetByItem(){
StringItem=input.next();
//listFilm=fdi.getByItem("
15:
00"
listFilm=fdi.getByItem(Item);
publicvoidbyTicket(){
Stringitem=input.next();
//返回该电影的座位信息
//Seatseat=fdi.getSeates("
中国功夫"
"
Filmfilm=newFilm(name,item);
Seatseat=fdi.getSeates(film);
if(seat!
=null){
StringticketType=null;
booleanflagTicketType=true;
while(flagTicketType){
intchose=input.nextInt();
switch(chose){
case1:
ticketType="
普通票"
;
flagTicketType=false;
break;
case2:
学生票"
case3:
免费票"
default:
}
}
printSeat(seat);
//输出座位信息
booleanflagIndex=true;
Stringindex=null;
while(flagIndex){
index=input.next();
if(seat.isSold(index)){//该座位已经卖出
else{
flagIndex=false;
}
fdi.buyTicket(film,index,ticketType);
this.byTicket();
@Override
publicvoidbyDiscount(){
//TODOAuto-generatedmethodstub
publicvoidbyFree(){
//座位信息
publicvoidprintSeat(Seatseat){
for(inti=0;
i<
7;
i++){
for(intj=0;
j<
j++){
importservice.AdminService;
importentity.AdminUser;
publicclassLogin{
Scannerinput=newScanner(System.in);
publicvoidstart(){
case1:
/*AdminUseradmin=newAdminUser();
Stringname=input.next();
Stringpwd=input.next();
if(name.equals(admin.getUserName())&
&
pwd.equals(admin.getUesrPassword()))*/
newAdminLogin().menu();
break;
case2:
newUserLogin().menu();
case3:
default:
this.start();
this.start();
publicclassAdminLoginimplementsAdminService{
list=newArrayList<
修改电影;
售票查询;
7:
addFilm();
delFilm();
upFilm();
getTicket();
case7:
this.menu();
break;
intnum=0;
list=fdi.getAll();
list){
num++;
list.clear();
publicvoidaddFilm(){
Stringposter=input.next();
Stringdirector=input.next();
Stringacotr=input.next();
Stringtype=input.next();
Stringprice=input.next();
Filmfilm=newFilm(name,poster,director,acotr,type,price,item);
//Filmfilm=newFilm("
东成西就"
e-w"
刘镇伟"
郑伊健"
喜剧"
150"
50"
fdi.addFilm(film);
publicvoiddelFilm(){
booleanexist=fdi.delateFilm(film);
//booleanexist=fdi.delateFilm("
非常完美"
time);
if(exist){
this.delFilm();
publicvoidupFilm(){
Stringproperty=input.next();
Stringvalue=input.next();
//fdi.updateFilm("
蜘蛛侠"
"
14:
搞笑"
intmessage=fdi.updateFilm(film,property,value);
switch(message){
publicvoidgetTicket(){
Filmfilm=newFilm(name,item);
Seatseat=fdi.getTicket(film);
this.getTicket();
packageentity;
publicclassTicket{
privateStringtype;
privateintordinaryNum=0;
privateintstudentNum=0;
privateintfreeNum=0;
publicStringgetType(){
returntype;
publicvoidsetType(Stringtype){
this.type=type;
switch(type){
case"
:
ordinaryNum++;
studentNum++;
freeNum++;
default:
publicintgetOrdinaryNum(){
returnordinaryNum;
publicvoidsetOrdinaryNum(intordinaryNum){
this.ordinaryNum=ordinaryNum;
publicintgetStudentNum(){
returnstudentNum;
publicvoidsetStudentNum(intstudentNum){
this.studentNum=studentNum;
publicintgetFreeNum(){
returnfreeNum;
publicvoidsetFreeNum(intfreeNum){
this.freeNum=freeNum;
publicclassSeat{
privateStringindex;
privateTicketticket;
privateFilmfilm;
privateString[][]seats=newString[7][7];
publicSeat(Stringindex,Ticketticket,Filmfilm){
this.index=index;
this.ticket=ticket;
this.film=film;
publicSeat(){
seats[i][j]=(i+1)+"
-"
+(j+1);
publicStringgetIndex(){
returnindex;
publicvoidsetIndex(Stringindex){
String[]str=index.split("
setSeats(Integer.parseInt(str[0]),Integer.parseInt(str[1]));
publicTicketgetTicket(){
returnticket;
publicvoidsetTicket(Ticketticket){
publicFilmgetFilm(){
returnfilm;
publicvoidsetFilm(Filmfilm){
privatevoidsetSeats(intx,inty){
seats[x-1][y-1]="
已售"
publicString[][]getSeats(){
returnseats;
publicbooleanisSold(Stringindex){
inta=Integer.parseInt(str[0]);
intb=Integer.parseInt(str[1]);
if(!
seats[a-1][b-1].equals(index)){
returntrue;
else
returnfalse;
publicclassFilm{
privateintid;
//序号
privateStringName;
//电影名称
privateStringPoster;
//英文名
privateStringDirector;
//导演
privateStringAcotr;
//演员
privateStringType;
//电影类型
privateStringPrice;
//电影价格
//privateStringSchedule;
//时刻表
privateStringItem;
//放映时间
publicFilm(){