SSM-based cinema ticket purchase system [with source code]

Movie theater ticket purchase system based on SSM

Three consecutive access to source code

  1. Development language: Java
  2. Database: MySQL
  3. Technology: Spring+MyBatis+Layui+bootstrap
  4. Tools:IDEA/Ecilpse、Navicat、Maven

Roles: Admin, User

  • Administrators can manage users, movie information, theater information, show information, orders, comments, etc. of this system.
  • Users can register and log in to this system, view movies and comments, choose movie tickets they like, buy movie tickets at theaters, shows, and seats of their choice, review movies, pay orders, manage personal information, etc.

User homepage

insert image description here

Selection

insert image description here

seat selection

insert image description here

User pays

insert image description here

user comment

insert image description here

Background home page

insert image description here

Auditorium Management

insert image description here

order management

insert image description here

comment management

insert image description here

one. introduction

1.1 Purpose of writing

  This requirement is written to study the development process and application scenarios of the theater management system. Before software development, it is necessary to write a correct requirements analysis. Simply put, needs analysis is the analysis of user needs. Whether the requirements analysis results accurately reflect the actual requirements of users will directly affect the design of the later stage of the software, and affect whether the design results are reasonable and practical. Only by clarifying the application scenarios can we better meet customer needs. Requirements analysis is also the basis for post-technical personnel to maintain, update, accept and test. Therefore, it is very important to write the correct requirements.

1.2 Project Background

  With the development of the times, people have higher and higher requirements for the quality of life, followed by a gradual increase in entertainment needs. Among various entertainment activities, watching movies has become one of the main activities of contemporary people's entertainment. As the demand for watching movies increases, movie theaters also gradually increase. What followed was the emergence of issues such as theater ticket sales. The cumbersome and inefficient manual ticket sales have brought a lot of inconvenience to people, and the traditional ticket sales methods can no longer meet people's ticket purchase needs.
Now we are in a period of highly developed computer science and technology, computer science and technology has been applied to all aspects of society, but some theaters are still using manual ticket sales. Manual ticket sales require a lot of manpower and material resources. For theaters, the operating costs of theaters increase. For customers, manual ticket sales also cost users more time. Therefore, in order to reduce the cost of manpower and material resources and improve theater profitability , Save customers' time, solve problems like this, hereby write this theater management system. This system achieves the purpose of efficient ticket sales through the information management of film screenings, on-shelf, off-shelf, time, seats, and screening halls.

1.3 Definition of terms

Put on shelves (PUT ON SHELVES): Unbroadcasted and upcoming films are entered manually in the theater management system.
PULL OFF SHELVES: Films that have been broadcast or have not been broadcast are manually deleted from the theater management system.

two. problem domain

2.1 Project goals

  Through this theater management system, it is possible to reasonably arrange movie categories, movie showtimes, and movie showrooms. Ticket sales are made by theater ticket sellers. Through this system, you can check the seat arrangement, the remaining seats, the movie show time, the serial number of the movie theater, add and delete movies, provide customers with services such as ticket booking, ticket sales, and refunds, and reasonably arrange seats for customers who buy tickets. , so that customers can buy movie tickets for movies at their favorite time, and have a better viewing experience.
  At the same time, theater management personnel can also perform new operations on and off the shelves of films. Facilitate the update and modification of video information.

2.2 Project Scope

  This theater management system is suitable for all movie theater industries. It can manage the sale of movie tickets, query of remaining tickets, seat query, movie playing time, movie show, movie on-shelf and off-shelf and screening hall.

2.3 Project prospect

  With the development of the times, various programming languages ​​have been relatively perfect, and computer science and technology have become mature and have been applied to all walks of life, which has provided convenience for many enterprises, reduced operating costs, increased profits, and improved business services. efficiency. But from the current point of view, many movie theaters are still using the traditional method of selling movie tickets, which consumes a lot of manpower and material resources of the theater, and increases the operating cost of the theater and takes a lot of time for customers. This system can quickly and effectively solve these problems, improve the working efficiency of the theater, reduce the operating cost of the theater, and reduce the unnecessary time spent by customers buying movie tickets.

code:

package org.xjt.blog.controller;

import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.xjt.blog.entity.TComment;
import org.xjt.blog.entity.TMessage;
import org.xjt.blog.service.TMessageService;
import org.xjt.blog.utils.RespBean;

import java.util.Date;
import java.util.HashMap;

@RestController
@RequestMapping("/message")
public class TMessageController {
    
    
    @Autowired
    private TMessageService tMessageService;

    //获取用户的所有留言
    @GetMapping("/all")
    public RespBean getAllMessageByUid(@RequestParam("id") String id){
    
    
        return tMessageService.getAllMessageByUid(id);
    }

    //获取用户的所有留言
    @GetMapping("back/allNum")
    public RespBean backGetAllMessagesNum(){
    
    
        return tMessageService.backGetAllMessagesNum();
    }

    //添加留言
    @PostMapping("/add")
    public RespBean addMessage(@RequestBody HashMap<String,String> params) {
    
    
        System.out.println("params===================>");
        System.out.println(params);

        //博主id
        String user_id = params.get("user_id");
        //留言内容
        String content = params.get("content");
        //留言者id
        String creator_id = params.get("creator_id");
        String parent_message_id = params.get("parent_comment_id");
        if(!StringUtils.hasText(parent_message_id)){
    
    
            parent_message_id = "-1";
        }
        TMessage tMessage = new TMessage().setUserId(Long.valueOf(user_id)).setContent(content)
                .setCreatorId(Long.valueOf(creator_id)).setParentMessageId(Long.valueOf(parent_message_id))
                .setCreateTime(DateUtil.toLocalDateTime(new Date()));


        return tMessageService.addMessage(tMessage);
    }

    @GetMapping("/delete")
    public RespBean delete(@RequestParam("id") Long id) {
    
    
        return tMessageService.deleteMessageById(id);
    }
}

package com.sxl.controller;
 
 
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.ResourceBundle;
 
import javax.servlet.http.HttpServletRequest;
 
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
 
import com.sxl.util.JacksonJsonUtil;
import com.sxl.util.StringUtil;
import com.sxl.util.SystemProperties;
 
 
public class BaseController {
    
    
	public static final Long EXPIRES_IN = 1000 * 3600 * 24 * 1L;// 1天
 
	@Autowired
	private SystemProperties systemProperties;
 
	/**
	 * 获得配置文件内容
	 */
	public String getConfig(String key) {
    
    
		return systemProperties.getProperties(key);
	}
 
	/**
	 * 返回服务器地址 like http://192.168.1.1:8441/UUBean/
	 */
	public String getHostUrl(HttpServletRequest request) {
    
    
		String hostName = request.getServerName();
		Integer hostPort = request.getServerPort();
		String path = request.getContextPath();
 
		if (hostPort == 80) {
    
    
			return "http://" + hostName + path + "/";
		} else {
    
    
			return "http://" + hostName + ":" + hostPort + path + "/";
		}
	}
 
	/***
	 * 获取当前的website路径 String
	 */
	public static String getWebSite(HttpServletRequest request) {
    
    
		String returnUrl = request.getScheme() + "://"
				+ request.getServerName();
 
		if (request.getServerPort() != 80) {
    
    
			returnUrl += ":" + request.getServerPort();
		}
 
		returnUrl += request.getContextPath();
 
		return returnUrl;
	}
 
 
 
	/**
	 * 初始化HTTP头.
	 * 
	 * @return HttpHeaders
	 */
	public HttpHeaders initHttpHeaders() {
    
    
		HttpHeaders headers = new HttpHeaders();
		MediaType mediaType = new MediaType("text", "html",
				Charset.forName("utf-8"));
		headers.setContentType(mediaType);
		return headers;
	}
 
	/**
	 * 返回 信息数据
	 * 
	 * @param status
	 * @param msg
	 * @return
	 */
	public ResponseEntity<String> renderMsg(Boolean status, String msg) {
    
    
		if (StringUtils.isEmpty(msg)) {
    
    
			msg = "";
		}
		String str = "{
    
    \"status\":\"" + status + "\",\"msg\":\"" + msg + "\"}";
		ResponseEntity<String> responseEntity = new ResponseEntity<String>(str,
				initHttpHeaders(), HttpStatus.OK);
		return responseEntity;
	}
 
	/**
	 * 返回obj数据
	 * 
	 * @param status
	 * @param msg
	 * @param obj
	 * @return
	 */
	public ResponseEntity<String> renderData(Boolean status, String msg,
			Object obj) {
    
    
		if (StringUtils.isEmpty(msg)) {
    
    
			msg = "";
		}
		StringBuffer sb = new StringBuffer();
		sb.append("{");
		sb.append("\"status\":\"" + status + "\",\"msg\":\"" + msg + "\",");
		sb.append("\"data\":" + JacksonJsonUtil.toJson(obj) + "");
		sb.append("}");
 
		ResponseEntity<String> responseEntity = new ResponseEntity<String>(
				sb.toString(), initHttpHeaders(), HttpStatus.OK);
		return responseEntity;
	}
 
 
	/***
	 * 获取IP(如果是多级代理,则得到的是一串IP值)
	 */
	public static String getIpAddr(HttpServletRequest request) {
    
    
		String ip = request.getHeader("x-forwarded-for");
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    
    
			ip = request.getHeader("Proxy-Client-IP");
		}
 
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    
    
			ip = request.getHeader("WL-Proxy-Client-IP");
		}
 
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
    
    
			ip = request.getRemoteAddr();
		}
 
		if (ip != null && ip.length() > 0) {
    
    
			String[] ips = ip.split(",");
			for (int i = 0; i < ips.length; i++) {
    
    
				if (!"unknown".equalsIgnoreCase(ips[i])) {
    
    
					ip = ips[i];
					break;
				}
			}
		}
 
		return ip;
	}
 
	/**
	 * 国际化获得语言内容
	 * 
	 * @param key
	 *            语言key
	 * @param args
	 * @param argsSplit
	 * @param defaultMessage
	 * @param locale
	 * @return
	 */
	public static String getLanguage(String key, String args, String argsSplit,
			String defaultMessage, String locale) {
    
    
		String language = "zh";
		String contry = "cn";
		String returnValue = defaultMessage;
 
		if (!StringUtil.isEmpty(locale)) {
    
    
			try {
    
    
				String[] localeArray = locale.split("_");
				language = localeArray[0];
				contry = localeArray[1];
			} catch (Exception e) {
    
    
			}
		}
 
		try {
    
    
			ResourceBundle resource = ResourceBundle.getBundle("lang.resource",
					new Locale(language, contry));
			returnValue = resource.getString(key);
			if (!StringUtil.isEmpty(args)) {
    
    
				String[] argsArray = args.split(argsSplit);
				for (int i = 0; i < argsArray.length; i++) {
    
    
					returnValue = returnValue.replace("{" + i + "}",
							argsArray[i]);
				}
			}
		} catch (Exception e) {
    
    
		}
 
		return returnValue;
	}
}

Guess you like

Origin blog.csdn.net/2301_78335941/article/details/131045601