Introduction:
With the continuous popularization and development of network, under the support of network technology, train booking management system has been rapidly developed. First of all, we have to start from the actual needs of users. By understanding the needs of users, the development of the targeted page, personal center, user management, vehicle information management, booking information management ticket, train ticket order management, order management, system management, and other functions, the network brought the convenience to the user the function to adjust the system, the design of the system allows users to use more convenient, The main purpose of this system is to bring users fast, efficient, safe, users can operate as long as at home. At the same time with the development of e-commerce, online train ticket booking management system has also received the attention of the majority of users.
So far, the Development of the Internet has solved a lot of problems that we can’t solve, making our work more convenient and improving our work efficiency. At present, all walks of life are using network information management procedures, different users are also exposed to information management, especially in the major e-commerce industry should be widely operated. Through analysis and summary of the current network environment development, the development of the train ticket management system can change the way past the train ticket management system, change the traditional line train ticket booking management system of the state, due to the increasing of users, using the traditional offline train ticket management system model has been far from satisfied with user requirements, And a growing number of state-owned enterprises to train tickets will be launched in online management system, so developing a train ticket booking management system of state-owned enterprises can be solved to offline train booking management system of the subject, the design of website guarantee the integrity of the information security, so as to improve the work efficiency, guarantee the system safe and normal operation.
Functional design:
This train booking management system mainly includes two function modules, namely user function module and administrator function module.
(1) Administrator module: the core user in the system is the administrator. After the administrator logs in, the administrator can manage the background system through the administrator function. The main functions are: home page, personal center, user management, model information management, train number information management, ticket purchase order management, change order management, refund order management, system management and other functions. The administrator use case diagram is shown below.
(2) Users: Home page, personal center, ticket purchase order management, change order, refund order management and other functions, as shown in the figure.(3) Front desk home page: home page, train number information, train information, personal center, background management and other functions, front desk home page as shown in the figure.
Function screenshots:
Administrator login: Enter the user name, password, and role entered during registration
User home page:
Train Number information:
Train Information:
Personal Center:
Change information:
Order Information:
Background management:
User management:
Model Management:
Train Number Management:
Booking Management:
Refund Management:
Change management:
Train Information:
Round figure, etc
Key source code:
/** * Login related */
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/** * login */
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null| |! user.getPassword().equals(password)) {return R.error("Incorrect account number or password");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/** * Register */
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
return R.error("User already exists");
}
userService.insert(user);
return R.ok();
}
/** * exit */
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("Exit successful");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("Account does not exist");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("Password reset to 123456");
}
/** * list */
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/** * list */
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/** * info */
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/** * Get user session user information */
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/** * save */
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
return R.error("User already exists");
}
userService.insert(user);
return R.ok();
}
/** * modify */
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);// All updates
return R.ok();
}
/** * delete */
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
returnR.ok(); }}Copy the code
/** * Upload the file mapping table */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
@Autowired
private ConfigService configService;
@Async
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
if (file.isEmpty()) {
throw new EIException("Upload file cannot be empty");
}
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") +1);
File upload = new File("D:/work/");
if(! upload.exists()) { upload.mkdirs(); } String fileName =new Date().getTime()+"."+fileExt;
File dest = new File(upload+"/"+fileName);
file.transferTo(dest);
if(StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name"."faceFile"));
if(configEntity==null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
configService.insertOrUpdate(configEntity);
}
return R.ok().put("file", fileName);
}
/** * Download file */
@IgnoreAuth
@RequestMapping("/download")
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(! path.exists()) { path =new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
if(! upload.exists()) { upload.mkdirs(); } File file =new File(upload.getAbsolutePath()+"/"+fileName);
if(file.exists()){
/*if(! fileService.canRead(file, SessionManager.getSessionUser())){ getResponse().sendError(403); } * /
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", fileName);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); }}catch (IOException e) {
e.printStackTrace();
}
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR); }}Copy the code
Database design:
Checixinxi table:
The serial number | The field names | The field type | The size of the | Allow null | The maximum length | note |
1 | id | Int | 4 | 10 | ||
2 | addtime | 150 | 255 | |||
3 | checimingcheng | 150 | 255 | |||
4 | huochemingcheng | DateTime | 8 | 255 | ||
5 | chepai | 150 | 255 | |||
6 | tupian | DateTime | 8 | 255 | ||
7 | qidianzhan | 150 | 255 | |||
8 | zhongdianzhan | DateTime | 8 | 255 | ||
9 | tujing | 150 | 255 | |||
10 | riqi | DateTime | 8 | 255 | ||
11 | chufashijian | 150 | 255 | |||
12 | shizhang | DateTime | 8 | 255 | ||
13 | zuoweileixing | 150 | 255 | |||
14 | jiage | DateTime | 8 | 255 | ||
15 | piaoshu | 150 | 255 |
Chexingxinxi table:
The serial number | The field names | The field type | The size of the | Allow null | The maximum length | note |
1 | id | Int | 4 | 10 | ||
2 | addtime | 150 | 255 | |||
3 | huochebianhao | 150 | 255 | |||
4 | huochemingcheng | DateTime | 8 | 255 | ||
5 | shisu | 150 | 255 | |||
6 | zuoweishu | DateTime | 8 | 255 | ||
7 | chepai | 150 | 255 |
Gaiqiandingdan table:
The serial number | The field names | The field type | The size of the | Allow null | The maximum length | note |
1 | id | Int | 4 | 10 | ||
2 | addtime | 150 | 255 | |||
3 | dingdanbianhao | 150 | 255 | |||
4 | checimingcheng | 150 | 255 | |||
5 | chepai | DateTime | 8 | 255 | ||
6 | qidianzhan | shangpinleixing | DateTime | 8 | 255 | |
7 | zhongdianzhan | 255 | ||||
8 | zongjiage | DateTime | 255 | |||
9 | gaiqianriqi | DateTime | 255 | |||
10 | yonghuming | DateTime | 255 | |||
11 | xingming | DateTime | 255 | |||
12 | shouji | DateTime | 255 |
Goupiaodingdan table:
The serial number | The field names | The field type | The size of the | Allow null | The maximum length | note |
1 | id | Int | 4 | 10 | ||
2 | addtime | 150 | 255 | |||
3 | dingdanbianhao | 150 | 255 | |||
4 | checimingcheng | 150 | 255 | |||
5 | chepai | DateTime | 8 | 255 | ||
6 | qidianzhan | DateTime | 255 | |||
7 | zhongdianzhan | 255 | ||||
8 | chufashijian | shangpinleixing | DateTime | 8 | 255 | |
9 | zuoweileixing | shangpinleixing | DateTime | 8 | 255 | |
10 | jiage | shangpinleixing | DateTime | 8 | 255 | |
11 | piaoshu | shangpinleixing | DateTime | 8 | 255 | |
12 | zongjiage | shangpinleixing | DateTime | 8 | 255 | |
13 | zongjiage | shangpinleixing | DateTime | 8 | 255 | |
14 | goumairiqi | shangpinleixing | DateTime | 8 | 255 | |
15 | yonghuming | shangpinleixing | DateTime | 8 | 255 | |
16 | xingming | shangpinleixing | DateTime | 8 | 255 | |
17 | shouji | shangpinleixing | DateTime | 8 | 255 | |
18 | shenfenzheng | shangpinleixing | DateTime | 8 | 255 |
Thesis Report:
Pick to
1 introduction
1.1 Research Background
1.2 Research Status
1.3 Research Content
2 Key system technologies
2.1 Spring Boot Framework
2.2 JAVA technology
2.3 MYSQL Database
2.4 B/S structure
3 System Analysis
3.1 Feasibility Analysis
3.1.1 Technical feasibility
3.1.2 Economic feasibility
3.1.3 Operation feasibility
3.2 System performance analysis
3.3 System function analysis
3.4 System process analysis
3.4.1 Login Process
3.4.2 Registration process
3.4.3 Process for Adding Information
3.4.4 Process for Deleting Information
4 System Design
4.1 System outline design
4.2 System structure design
4.3 System sequence diagram design
4.3.1 Login module sequence diagram
4.3.2 Adding an Information module Sequence diagram
4.4 Database Design
4.4.1 Database E-R diagram design
4.4.2 Database table design
Chapter 5 detailed system design
5.1 Front Page Function modules
5.2 Administrator Function Modules
5.3 User Function Modules
6 System Test
6.1 Test Definition
6.2 Test Purpose
6.3 Test Scheme
(1) Module test
(2) Integration test:
(3) Acceptance Test:
6.4 System Analysis
7 the conclusion
reference
Xie ci
Source code:
Like, like, follow, comment, check out 👇👇🏻👇🏻 👇🏻👇🏻
Clocked articles updated 208/365 days