├── README.md
├── img
├── mobile.jpg
└── web.jpg
├── train-user
├── .browserslistrc
├── .eslintrc.js
├── .gitignore
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── QR.png
│ │ ├── bac.jpg
│ │ ├── back.png
│ │ ├── indexicon
│ │ │ ├── 1579093807378_MyOffice功能测试流程 (1).docx
│ │ │ ├── all.png
│ │ │ ├── grid1.jpg
│ │ │ ├── grid2.png
│ │ │ ├── grid3.jpg
│ │ │ ├── grid4.jpg
│ │ │ ├── lunch.jpg
│ │ │ ├── restaurant.png
│ │ │ ├── reverse.png
│ │ │ ├── screen.png
│ │ │ ├── serve.png
│ │ │ ├── swiper1.jpg
│ │ │ ├── swiper2.jpg
│ │ │ └── swiper3.jpg
│ │ ├── login.jpg
│ │ ├── logo.png
│ │ ├── mine.png
│ │ ├── mineactive.png
│ │ ├── mineicon
│ │ │ └── head.jpg
│ │ ├── order.png
│ │ ├── order
│ │ │ ├── arrive.png
│ │ │ └── arrive1.png
│ │ ├── orderactive.png
│ │ ├── train.png
│ │ └── trainactive.png
│ ├── components
│ │ └── HelloWorld.vue
│ ├── main.js
│ ├── router
│ │ └── index.js
│ └── views
│ │ ├── ChangeTicket.vue
│ │ ├── CityList.vue
│ │ ├── ConfirmOrder.vue
│ │ ├── DetailOrder.vue
│ │ ├── Index.vue
│ │ ├── Login.vue
│ │ ├── Mine.vue
│ │ ├── Order.vue
│ │ ├── QueryTrain.vue
│ │ ├── SelectUser.vue
│ │ ├── register.vue
│ │ └── tabbar.vue
├── vue.config.js
└── yarn.lock
├── train.sql
├── train
├── .gitignore
├── .mvn
│ └── wrapper
│ │ ├── MavenWrapperDownloader.java
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── lemon
│ │ │ │ └── train
│ │ │ │ ├── ServletInitializer.java
│ │ │ │ ├── TrainApplication.java
│ │ │ │ ├── common
│ │ │ │ ├── AsyncTask.java
│ │ │ │ ├── GloablExceptionHandler.java
│ │ │ │ ├── ResponseResult.java
│ │ │ │ └── TimeHandle.java
│ │ │ │ ├── config
│ │ │ │ └── InterceptorConfig.java
│ │ │ │ ├── controller
│ │ │ │ ├── OrderController.java
│ │ │ │ ├── PriceManageController.java
│ │ │ │ ├── TrainController.java
│ │ │ │ └── UserController.java
│ │ │ │ ├── entity
│ │ │ │ ├── Holiday.java
│ │ │ │ ├── HolidayExample.java
│ │ │ │ ├── Orderinfo.java
│ │ │ │ ├── OrderinfoExample.java
│ │ │ │ ├── Orders.java
│ │ │ │ ├── OrdersExample.java
│ │ │ │ ├── Orderseat.java
│ │ │ │ ├── OrderseatExample.java
│ │ │ │ ├── Passenger.java
│ │ │ │ ├── Pricemanage.java
│ │ │ │ ├── Seatinfo.java
│ │ │ │ ├── SeatinfoExample.java
│ │ │ │ ├── Train.java
│ │ │ │ ├── TrainExample.java
│ │ │ │ ├── Traininfo.java
│ │ │ │ ├── TraininfoExample.java
│ │ │ │ ├── Traininfos.java
│ │ │ │ ├── TraininfosExample.java
│ │ │ │ ├── Trainseat.java
│ │ │ │ ├── TrainseatExample.java
│ │ │ │ ├── Trainstate.java
│ │ │ │ ├── TrainstateExample.java
│ │ │ │ ├── Trainticket.java
│ │ │ │ ├── TrainticketExample.java
│ │ │ │ ├── User.java
│ │ │ │ └── UserExample.java
│ │ │ │ ├── mapper
│ │ │ │ ├── HolidayMapper.java
│ │ │ │ ├── OrderinfoMapper.java
│ │ │ │ ├── OrdersMapper.java
│ │ │ │ ├── OrderseatMapper.java
│ │ │ │ ├── SeatinfoMapper.java
│ │ │ │ ├── TrainMapper.java
│ │ │ │ ├── TraininfoMapper.java
│ │ │ │ ├── TraininfosMapper.java
│ │ │ │ ├── TrainseatMapper.java
│ │ │ │ ├── TrainstateMapper.java
│ │ │ │ ├── TrainticketMapper.java
│ │ │ │ └── UserMapper.java
│ │ │ │ └── service
│ │ │ │ ├── OrderService.java
│ │ │ │ ├── PriceManageService.java
│ │ │ │ ├── TrainService.java
│ │ │ │ ├── UserService.java
│ │ │ │ └── impl
│ │ │ │ ├── OrderServiceImpl.java
│ │ │ │ ├── PriceManageServiceImpl.java
│ │ │ │ ├── TrainServiceImpl.java
│ │ │ │ └── UserServiceImpl.java
│ │ └── resources
│ │ │ ├── 1.txt
│ │ │ ├── application.yml
│ │ │ ├── banner.txt
│ │ │ ├── generator
│ │ │ └── generatorConfig.xml
│ │ │ ├── mapper
│ │ │ ├── HolidayMapper.xml
│ │ │ ├── OrderinfoMapper.xml
│ │ │ ├── OrdersMapper.xml
│ │ │ ├── OrderseatMapper.xml
│ │ │ ├── SeatinfoMapper.xml
│ │ │ ├── TrainMapper.xml
│ │ │ ├── TraininfoMapper.xml
│ │ │ ├── TraininfosMapper.xml
│ │ │ ├── TrainseatMapper.xml
│ │ │ ├── TrainstateMapper.xml
│ │ │ ├── TrainticketMapper.xml
│ │ │ └── UserMapper.xml
│ │ │ └── train.sql
│ └── test
│ │ └── java
│ │ └── com
│ │ └── lemon
│ │ └── train
│ │ ├── DateTimeTest.java
│ │ ├── TrainApplicationTests.java
│ │ └── traintest.java
└── train
│ ├── .gitignore
│ ├── .mvn
│ └── wrapper
│ │ ├── MavenWrapperDownloader.java
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
│ ├── mvnw
│ ├── mvnw.cmd
│ ├── pom.xml
│ └── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── lemon
│ │ │ └── train
│ │ │ ├── ServletInitializer.java
│ │ │ ├── TrainApplication.java
│ │ │ ├── common
│ │ │ ├── AsyncTask.java
│ │ │ ├── GloablExceptionHandler.java
│ │ │ ├── ResponseResult.java
│ │ │ └── TimeHandle.java
│ │ │ ├── config
│ │ │ └── InterceptorConfig.java
│ │ │ ├── controller
│ │ │ ├── OrderController.java
│ │ │ ├── PriceManageController.java
│ │ │ ├── TrainController.java
│ │ │ └── UserController.java
│ │ │ ├── entity
│ │ │ ├── Holiday.java
│ │ │ ├── HolidayExample.java
│ │ │ ├── Orderinfo.java
│ │ │ ├── OrderinfoExample.java
│ │ │ ├── Orders.java
│ │ │ ├── OrdersExample.java
│ │ │ ├── Orderseat.java
│ │ │ ├── OrderseatExample.java
│ │ │ ├── Passenger.java
│ │ │ ├── Pricemanage.java
│ │ │ ├── Seatinfo.java
│ │ │ ├── SeatinfoExample.java
│ │ │ ├── Train.java
│ │ │ ├── TrainExample.java
│ │ │ ├── Traininfo.java
│ │ │ ├── TraininfoExample.java
│ │ │ ├── Traininfos.java
│ │ │ ├── TraininfosExample.java
│ │ │ ├── Trainseat.java
│ │ │ ├── TrainseatExample.java
│ │ │ ├── Trainstate.java
│ │ │ ├── TrainstateExample.java
│ │ │ ├── Trainticket.java
│ │ │ ├── TrainticketExample.java
│ │ │ ├── User.java
│ │ │ └── UserExample.java
│ │ │ ├── mapper
│ │ │ ├── HolidayMapper.java
│ │ │ ├── OrderinfoMapper.java
│ │ │ ├── OrdersMapper.java
│ │ │ ├── OrderseatMapper.java
│ │ │ ├── SeatinfoMapper.java
│ │ │ ├── TrainMapper.java
│ │ │ ├── TraininfoMapper.java
│ │ │ ├── TraininfosMapper.java
│ │ │ ├── TrainseatMapper.java
│ │ │ ├── TrainstateMapper.java
│ │ │ ├── TrainticketMapper.java
│ │ │ └── UserMapper.java
│ │ │ └── service
│ │ │ ├── OrderService.java
│ │ │ ├── PriceManageService.java
│ │ │ ├── TrainService.java
│ │ │ ├── UserService.java
│ │ │ └── impl
│ │ │ ├── OrderServiceImpl.java
│ │ │ ├── PriceManageServiceImpl.java
│ │ │ ├── TrainServiceImpl.java
│ │ │ └── UserServiceImpl.java
│ └── resources
│ │ ├── 1.txt
│ │ ├── application.yml
│ │ ├── banner.txt
│ │ ├── generator
│ │ └── generatorConfig.xml
│ │ ├── mapper
│ │ ├── HolidayMapper.xml
│ │ ├── OrderinfoMapper.xml
│ │ ├── OrdersMapper.xml
│ │ ├── OrderseatMapper.xml
│ │ ├── SeatinfoMapper.xml
│ │ ├── TrainMapper.xml
│ │ ├── TraininfoMapper.xml
│ │ ├── TraininfosMapper.xml
│ │ ├── TrainseatMapper.xml
│ │ ├── TrainstateMapper.xml
│ │ ├── TrainticketMapper.xml
│ │ └── UserMapper.xml
│ │ └── train.sql
│ └── test
│ └── java
│ └── com
│ └── lemon
│ └── train
│ ├── DateTimeTest.java
│ ├── TrainApplicationTests.java
│ └── traintest.java
└── vue-manage-system
├── .browserslistrc
├── .gitignore
├── .prettierrc
├── LICENSE
├── README_EN.md
├── babel.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── index.html
└── table.json
├── screenshots
├── wms1.png
├── wms2.png
└── wms3.png
├── src
├── App.vue
├── api
│ └── index.js
├── assets
│ ├── 404_images
│ │ ├── 404.png
│ │ └── 404_cloud.png
│ ├── css
│ │ ├── color-dark.css
│ │ ├── icon.css
│ │ ├── main.css
│ │ └── theme-green
│ │ │ ├── color-green.css
│ │ │ ├── fonts
│ │ │ ├── element-icons.ttf
│ │ │ └── element-icons.woff
│ │ │ └── index.css
│ ├── img
│ │ ├── img.jpg
│ │ └── login-bg.jpg
│ └── logo.png
├── components
│ ├── common
│ │ ├── Header.vue
│ │ ├── Home.vue
│ │ ├── Sidebar.vue
│ │ ├── Tags.vue
│ │ ├── bus.js
│ │ ├── directives.js
│ │ └── i18n.js
│ └── page
│ │ ├── 403.vue
│ │ ├── 404.vue
│ │ ├── AddTrain.vue
│ │ ├── BaseCharts.vue
│ │ ├── BaseForm.vue
│ │ ├── BaseTable.vue
│ │ ├── Dashboard.vue
│ │ ├── DepartTrain.vue
│ │ ├── Donate.vue
│ │ ├── DragDialog.vue
│ │ ├── DragList.vue
│ │ ├── I18n.vue
│ │ ├── Icon.vue
│ │ ├── Login.vue
│ │ ├── Markdown.vue
│ │ ├── Permission.vue
│ │ ├── PriceManage.vue
│ │ ├── Tabs.vue
│ │ ├── Upload.vue
│ │ └── VueEditor.vue
├── main.js
├── router
│ └── index.js
└── utils
│ └── request.js
└── vue.config.js
/README.md:
--------------------------------------------------------------------------------
1 | ## 火车售票系统
2 |
3 | :blush:本系统使用了Vue作为前端框架,Vant组件和element ui作为前端前端UI,后端使用了springboot和Mybatis,数据库使用了Mysql关系型数据库,具有用户移动端和web管理端两个终端。
4 |
5 | ----------
6 | ##### :100: 模块介绍
7 |
8 | train模块为后端项目,支持用户前端和管理后台的api请求;train-user为前端用户项目;vue-manage-system为管理后台项目,使用[后台模板](https://github.com/lin-xin/vue-manage-system)魔改的。
9 |
10 | ----------
11 | ##### :hammer:系统主要功能
12 |
13 | - [x] 火车票预订
14 | - [x] 火车票改签
15 | - [x] 火车票退票
16 | - [x] 车票节假日价格浮动
17 | - [x] 火车发布和新增
18 |
19 | _:wrench:这次项目只做了简单的售票业务,而且假设每辆火车只有起点和终点,为了方便移植和编写,项目只用了Mysql数据库,不过Mysql做了很多底层代码,创建了视图、存储过程和一些触发器,另外项目还有很多待优化的地方,管理员界面套用了vue后台管理模板,在基础业务外还可以添加很多功能。_
20 |
21 | -----------
22 |
23 | ##### 需要的环境和软件:rainbow::
24 |
25 | > 1. node
26 | > 2. maven
27 | > 3. mysql8.0
28 | > 4. Vscode
29 | > 5. Intellij IDEA
30 |
31 | ##### 帮助过程:trophy:
32 |
33 | 1. 安装启动数据库Mysql8.0,打开可视化工具将train.sql数据库脚本文件导入(不要直接运行脚本,在Navicat右键运行SQL文件,或者在DBeaver新建train,如何右键train数据库>工具>Restore database)。
34 | 2. 启动服务端,安装打开Intellij IDEA软件,导入train项目文件夹,找到application.yml文件修改数据库连接配置(配置为自己环境的数据库连接配置),完成后启动项目。
35 | 3. 打开Vscode,导入vue-manage-system和train-user项目,代开vue.config.js文件可以进行端口号的修改,然后执行npm install安装依赖,最后执行npm run serve 运行程
36 | 4. 管理员默认账号密码admin和123456,用户端已存在测试账号密码 匿名用户和123456
37 | 5. 有些数据已经过期可以根据需求删减,火车查询列次是只能查询当前时间之后的火车班次
38 |
39 | -----
40 |
41 | :black_nib:下面展示两个终端的主页
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/img/mobile.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/img/mobile.jpg
--------------------------------------------------------------------------------
/img/web.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/img/web.jpg
--------------------------------------------------------------------------------
/train-user/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/train-user/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | 'extends': [
7 | 'plugin:vue/essential',
8 | 'eslint:recommended'
9 | ],
10 | parserOptions: {
11 | parser: 'babel-eslint'
12 | },
13 | rules: {
14 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/train-user/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 | pnpm-debug.log*
14 |
15 | # Editor directories and files
16 | .idea
17 | .vscode
18 | *.suo
19 | *.ntvs*
20 | *.njsproj
21 | *.sln
22 | *.sw?
23 |
--------------------------------------------------------------------------------
/train-user/README.md:
--------------------------------------------------------------------------------
1 | # train-user
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/train-user/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/train-user/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "train-user",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.19.2",
12 | "element-ui": "^2.13.2",
13 | "js-md5": "^0.7.3",
14 | "md5": "^2.2.1",
15 | "qs": "^6.9.4",
16 | "vant": "^2.8.5",
17 | "vue": "^2.6.11",
18 | "vue-router": "^3.2.0"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "~4.4.0",
22 | "@vue/cli-plugin-eslint": "~4.4.0",
23 | "@vue/cli-plugin-router": "~4.4.0",
24 | "@vue/cli-service": "~4.4.0",
25 | "babel-eslint": "^10.1.0",
26 | "babel-plugin-import": "^1.13.0",
27 | "core-js": "^3.6.5",
28 | "eslint": "^6.7.2",
29 | "eslint-plugin-vue": "^6.2.2",
30 | "less": "^3.11.2",
31 | "less-loader": "^6.1.0",
32 | "vue-template-compiler": "^2.6.11"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/train-user/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/public/favicon.ico
--------------------------------------------------------------------------------
/train-user/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/train-user/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
33 |
--------------------------------------------------------------------------------
/train-user/src/assets/QR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/QR.png
--------------------------------------------------------------------------------
/train-user/src/assets/bac.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/bac.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/back.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/1579093807378_MyOffice功能测试流程 (1).docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/1579093807378_MyOffice功能测试流程 (1).docx
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/all.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/grid1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/grid1.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/grid2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/grid2.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/grid3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/grid3.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/grid4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/grid4.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/lunch.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/lunch.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/restaurant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/restaurant.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/reverse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/reverse.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/screen.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/serve.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/serve.png
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/swiper1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/swiper1.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/swiper2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/swiper2.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/indexicon/swiper3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/indexicon/swiper3.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/login.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/login.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/logo.png
--------------------------------------------------------------------------------
/train-user/src/assets/mine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/mine.png
--------------------------------------------------------------------------------
/train-user/src/assets/mineactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/mineactive.png
--------------------------------------------------------------------------------
/train-user/src/assets/mineicon/head.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/mineicon/head.jpg
--------------------------------------------------------------------------------
/train-user/src/assets/order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/order.png
--------------------------------------------------------------------------------
/train-user/src/assets/order/arrive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/order/arrive.png
--------------------------------------------------------------------------------
/train-user/src/assets/order/arrive1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/order/arrive1.png
--------------------------------------------------------------------------------
/train-user/src/assets/orderactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/orderactive.png
--------------------------------------------------------------------------------
/train-user/src/assets/train.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/train.png
--------------------------------------------------------------------------------
/train-user/src/assets/trainactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train-user/src/assets/trainactive.png
--------------------------------------------------------------------------------
/train-user/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |
9 |
Installed CLI Plugins
10 |
15 |
Essential Links
16 |
23 |
Ecosystem
24 |
31 |
32 |
33 |
34 |
42 |
43 |
44 |
60 |
--------------------------------------------------------------------------------
/train-user/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import ElementUI from 'element-ui';
5 | import 'element-ui/lib/theme-chalk/index.css';
6 | import Vant from 'vant';
7 | import 'vant/lib/index.css';
8 | import { Lazyload } from 'vant';
9 | import axios from 'axios'
10 | import qs from 'qs'
11 | import md5 from 'js-md5'
12 |
13 | Vue.prototype.$md5 = md5;
14 | Vue.prototype.$qs = qs
15 | Vue.prototype.$axios = axios
16 | Vue.prototype.$axios.defaults.baseURL = 'http://localhost:8081/'
17 | //Lazyload 是 Vue 指令,使用前需要对指令进行注册
18 | Vue.use(Lazyload)
19 | Vue.use(Vant);
20 |
21 | Vue.config.productionTip = false
22 | Vue.use(ElementUI);
23 |
24 | new Vue({
25 | router,
26 | render: h => h(App)
27 | }).$mount('#app')
--------------------------------------------------------------------------------
/train-user/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueRouter from 'vue-router'
3 | import Login from '../views/Login.vue'
4 | import Register from '../views/register.vue'
5 | import Tabbar from '../views/tabbar.vue'
6 | import Index from '../views/Index.vue'
7 | import Order from '../views/Order.vue'
8 | import Mine from '../views/Mine.vue'
9 | import Citylist from '../views/CityList.vue'
10 | import Querytrain from '../views/QueryTrain.vue'
11 | import ConfirmOrder from '../views/ConfirmOrder.vue'
12 | import SelectUser from '../views/SelectUser.vue'
13 | import DetailOrder from '../views/DetailOrder.vue'
14 | import ChangeTicket from '../views/ChangeTicket.vue'
15 |
16 | Vue.use(VueRouter)
17 |
18 | const routes = [{
19 | path: '/',
20 | name: 'Login',
21 | component: Login
22 | },
23 | {
24 | path: '/register',
25 | name: 'register',
26 | component: Register
27 | },
28 | {
29 | path: '/citylist',
30 | name: 'citylist',
31 | component: Citylist
32 | },
33 | {
34 | path: '/querytrain',
35 | name: 'querytrain',
36 | component: Querytrain
37 | },
38 | {
39 | path: '/confirmorder',
40 | name: 'confirmorder',
41 | component: ConfirmOrder
42 | },
43 | {
44 | path: '/selectuser',
45 | name: 'selectuser',
46 | component: SelectUser
47 | },
48 | {
49 | path: '/detailorder',
50 | name: 'detailorder',
51 | component: DetailOrder
52 | },
53 | {
54 | path: '/changeticket',
55 | name: 'changeticket',
56 | component: ChangeTicket
57 | },
58 | {
59 | path: '/tabbar',
60 | name: 'tabbar',
61 | component: Tabbar,
62 | children: [{
63 | path: '/index',
64 | name: 'index',
65 | component: Index,
66 | }, {
67 | path: '/order',
68 | name: 'order',
69 | component: Order,
70 | }, {
71 | path: '/mine',
72 | name: 'mine',
73 | component: Mine,
74 | }]
75 | }
76 |
77 | ]
78 |
79 |
80 |
81 | const router = new VueRouter({
82 | mode: 'history',
83 | base: process.env.BASE_URL,
84 | routes
85 | })
86 |
87 | export default router
--------------------------------------------------------------------------------
/train-user/src/views/CityList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
30 |
31 |
32 |
33 |
62 |
63 |
--------------------------------------------------------------------------------
/train-user/src/views/Mine.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
{{user.name}}
13 |
编辑资料
14 |
15 |
实名核验
16 |
我的餐饮·特产
17 |
温馨服务
18 |
关于
19 |
登出
20 |
21 |
22 |
23 |
54 |
55 |
--------------------------------------------------------------------------------
/train-user/src/views/SelectUser.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 添加乘车人
12 | 下拉刷新可获取乘车人最新状态
13 |
14 |
15 | {{item.name}}
16 | {{item.idcard}}
17 |
18 | 成人
19 | 学生
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
95 |
96 |
--------------------------------------------------------------------------------
/train-user/src/views/tabbar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
64 |
--------------------------------------------------------------------------------
/train-user/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | devServer: {
3 | port: 8888,
4 | open: true
5 | },
6 | // 基本路径
7 | publicPath: "./", // 可以设置成相对路径,这样所有的资源都会被链接为相对路径,打出来的包可以被部署在任意路径
8 | outputDir: "dist", //打包时生成的生产环境构建文件的目录
9 | assetsDir: 'public', // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
10 | }
--------------------------------------------------------------------------------
/train/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/train/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/train/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/train/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.2.8.RELEASE
9 |
10 |
11 | com.zstu
12 | demo
13 | 0.0.1-SNAPSHOT
14 | war
15 | demo
16 | Demo project for Spring Boot
17 |
18 |
19 | 1.8
20 |
21 |
22 |
23 |
24 | org.springframework.boot
25 | spring-boot-starter-web
26 |
27 |
28 | org.mybatis.spring.boot
29 | mybatis-spring-boot-starter
30 | 2.1.3
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-devtools
36 | runtime
37 | true
38 |
39 |
40 | org.projectlombok
41 | lombok
42 | true
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-starter-tomcat
47 | provided
48 |
49 |
50 | org.springframework.boot
51 | spring-boot-starter-test
52 | test
53 |
54 |
55 | org.junit.vintage
56 | junit-vintage-engine
57 |
58 |
59 |
60 |
61 | mysql
62 | mysql-connector-java
63 |
64 |
65 |
66 | io.github.yedaxia
67 | japidocs
68 | 1.4
69 |
70 |
71 |
72 |
73 | com.github.pagehelper
74 | pagehelper-spring-boot-starter
75 | 1.2.5
76 |
77 |
78 |
79 |
80 |
81 |
82 | org.springframework.boot
83 | spring-boot-maven-plugin
84 |
85 |
86 | org.mybatis.generator
87 | mybatis-generator-maven-plugin
88 | 1.3.7
89 |
90 | true
91 | src/main/resources/generator/generatorConfig.xml
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/ServletInitializer.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train;
2 |
3 | import org.springframework.boot.builder.SpringApplicationBuilder;
4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
5 |
6 | public class ServletInitializer extends SpringBootServletInitializer {
7 |
8 | @Override
9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
10 | return application.sources(TrainApplication.class);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/TrainApplication.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train;
2 |
3 | import org.mybatis.spring.annotation.MapperScan;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 |
7 | @SpringBootApplication
8 | @MapperScan("com.lemon.train.mapper")
9 | public class TrainApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(TrainApplication.class, args);
13 | // DocsConfig config = new DocsConfig();
14 | // config.setProjectPath("D:\\work\\intellij\\work\\train"); // 项目根目录
15 | // config.setProjectName("ProjectName"); // 项目名称
16 | // config.setApiVersion("V1.0"); // 声明该API的版本
17 | // config.setDocsPath("D:\\work\\intellij\\work\\train\\doc"); // 生成API 文档所在目录
18 | // config.setAutoGenerate(Boolean.TRUE); // 配置自动生成
19 | // Docs.buildHtmlDocs(config); // 执行生成文档
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/common/AsyncTask.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.common;
2 |
3 | import com.lemon.train.mapper.OrdersMapper;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.scheduling.annotation.Async;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | @Async
10 | public class AsyncTask {
11 |
12 | @Autowired
13 | OrdersMapper ordersMapper;
14 |
15 | /**
16 | * 用户登录时判断
17 | * @param id
18 | */
19 | public void updateOrderState(Integer id){
20 | ordersMapper.updateOrderState(id);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/common/GloablExceptionHandler.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LXT2017/TrainTicketSystem/f10e2cc84327d6779a505cbce6642a380f4f6bce/train/src/main/java/com/lemon/train/common/GloablExceptionHandler.java
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/common/ResponseResult.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.common;
2 |
3 | public class ResponseResult {
4 |
5 | private String msg;
6 | private Integer code;
7 | private T data;
8 |
9 | public ResponseResult() {
10 | }
11 |
12 | public ResponseResult(Integer code, String msg, T data) {
13 | this.data = data;
14 | this.code = code;
15 | this.msg = msg;
16 | }
17 |
18 | public String getMsg() {
19 | return msg;
20 | }
21 |
22 | public void setMsg(String msg) {
23 | this.msg = msg;
24 | }
25 |
26 | public Integer getCode() {
27 | return code;
28 | }
29 |
30 | public void setCode(Integer code) {
31 | this.code = code;
32 | }
33 |
34 | public T getData() {
35 | return data;
36 | }
37 |
38 | public void setData(T data) {
39 | this.data = data;
40 | }
41 |
42 | @Override
43 | public String toString() {
44 | return "ResponseResult{" +
45 | ", msg='" + msg + '\'' +
46 | ", code=" + code +
47 | ", data=" + data +
48 | '}';
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/common/TimeHandle.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.common;
2 |
3 | import org.springframework.stereotype.Component;
4 |
5 | import java.text.ParseException;
6 | import java.text.SimpleDateFormat;
7 | import java.util.Date;
8 |
9 | @Component
10 | public class TimeHandle {
11 |
12 | public static int getDayDiffer(Date startDate, Date endDate) throws ParseException {
13 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
14 | long startDateTime = dateFormat.parse(dateFormat.format(startDate)).getTime();
15 | long endDateTime = dateFormat.parse(dateFormat.format(endDate)).getTime();
16 | return (int) ((endDateTime - startDateTime) / (1000 * 3600 * 24));
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/config/InterceptorConfig.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.web.servlet.config.annotation.CorsRegistry;
5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6 |
7 | @Configuration
8 | public class InterceptorConfig implements WebMvcConfigurer {
9 |
10 | /**
11 | * 跨域支持
12 | *
13 | * @param registry
14 | */
15 | @Override
16 | public void addCorsMappings(CorsRegistry registry) {
17 | registry.addMapping("/**")
18 | .allowedOrigins("*")
19 | .allowCredentials(true)
20 | .allowedMethods("GET", "POST", "DELETE", "PUT", "PATCH", "OPTIONS", "HEAD")
21 | .maxAge(3600 * 24);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/controller/OrderController.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.controller;
2 |
3 |
4 | import com.lemon.train.common.ResponseResult;
5 | import com.lemon.train.entity.Orderinfo;
6 | import com.lemon.train.entity.Orders;
7 | import com.lemon.train.service.OrderService;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import java.text.ParseException;
12 | import java.text.SimpleDateFormat;
13 | import java.util.Date;
14 | import java.util.Map;
15 |
16 | @RestController
17 | @RequestMapping("order")
18 | public class OrderController {
19 |
20 |
21 | @Autowired
22 | OrderService orderService;
23 |
24 | /**
25 | * 订单查询
26 | * @param orders
27 | * @return
28 | */
29 | @PostMapping("/submitorder")
30 | public ResponseResult submitOrder(@RequestBody Orders orders){
31 | return orderService.submitOrder(orders);
32 | }
33 |
34 |
35 |
36 | /**
37 | * 查询所有订单
38 | * @param orderId
39 | * @return
40 | */
41 | @GetMapping("/queryorders")
42 | public ResponseResult queryOrders(Integer orderId){
43 | return orderService.queryOrders(orderId);
44 | }
45 |
46 |
47 | /**
48 | * 查询单一订单
49 | * @param id
50 | * @return
51 | */
52 | @GetMapping("/getdetailorder")
53 | public ResponseResult getDetailOrder(Integer id){
54 | return orderService.getDetailOrder(id);
55 | }
56 |
57 |
58 | /**
59 | * 删除订单
60 | */
61 | @PostMapping("/delorder")
62 | public ResponseResult delOrder(Integer id){
63 | return orderService.delOrder(id);
64 | }
65 |
66 | /**
67 | * 订单退票
68 | */
69 | @PostMapping("/deleteorder")
70 | public ResponseResult deleteOrder(@RequestBody Orderinfo orderinfo){
71 | return orderService.deleteOrder(orderinfo);
72 | }
73 |
74 | /**
75 | * 订单改签
76 | */
77 | @PostMapping("/changeticket")
78 | public ResponseResult changeTicket(@RequestBody Map map) throws ParseException {
79 | int trainid = (int) map.get("trainid");
80 | SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
81 | Date date = formatter.parse((String) map.get("traindate"));
82 | int orderid=(int) map.get("orderid");
83 | return orderService.changeTicket(trainid,date,orderid);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/controller/PriceManageController.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.controller;
2 |
3 |
4 | import com.lemon.train.common.ResponseResult;
5 | import com.lemon.train.entity.Holiday;
6 | import com.lemon.train.entity.Pricemanage;
7 | import com.lemon.train.service.PriceManageService;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import java.text.ParseException;
12 | import java.text.SimpleDateFormat;
13 | import java.util.Date;
14 | import java.util.List;
15 | import java.util.Map;
16 |
17 |
18 | @RestController
19 | @RequestMapping("price")
20 | public class PriceManageController {
21 |
22 | @Autowired
23 | PriceManageService priceManageService;
24 |
25 | /**
26 | * 查询
27 | * @return
28 | */
29 | @GetMapping("/getdiscount")
30 | public ResponseResult getDiscount(){
31 | return priceManageService.getDiscount();
32 | }
33 |
34 | /**
35 | * 更新折扣
36 | */
37 | @PostMapping("/updatediscount")
38 | public ResponseResult updateDiscount(@RequestBody Pricemanage priceManage){
39 | System.out.println(priceManage);
40 | return priceManageService.updateDiscount(priceManage);
41 | }
42 |
43 | /**
44 | * 发布单一节假日
45 | */
46 | @PostMapping("/postsingleholiday")
47 | public ResponseResult postSingleHoliday(@RequestBody Holiday holiday){
48 | System.out.println(holiday);
49 | return priceManageService.postSingleHoliday(holiday);
50 | }
51 |
52 | /**
53 | * 发布一段时间的节假日
54 | */
55 | @PostMapping("/postmultipleholiday")
56 | public ResponseResult postMultipleHoliday(@RequestBody Map map) throws ParseException {
57 |
58 | int status = Integer.parseInt((String) map.get("status"));
59 | List vacation = (List) map.get("vacation");
60 | SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd" );
61 | Date start = sdf.parse(vacation.get(0));
62 | Date end = sdf.parse(vacation.get(1));
63 | return priceManageService.postMultipleHoliday(start,end,status);
64 | }
65 |
66 |
67 | /**
68 | * 当天交易额
69 | */
70 | @GetMapping("/gettodaytotalprice")
71 | public ResponseResult getTodayTotalPrice(String orderdate) throws ParseException {
72 | SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd" );
73 | Date odate = sdf.parse(orderdate);
74 | return priceManageService.getTodayTotalPrice(odate);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/controller/TrainController.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.controller;
2 |
3 | import com.lemon.train.common.ResponseResult;
4 | import com.lemon.train.entity.Traininfos;
5 | import com.lemon.train.service.TrainService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.web.bind.annotation.*;
8 |
9 | import java.text.ParseException;
10 | import java.text.SimpleDateFormat;
11 | import java.util.Date;
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 |
16 | @RestController
17 | @RequestMapping("train")
18 | public class TrainController {
19 |
20 | @Autowired
21 | TrainService trainService;
22 |
23 | /**
24 | * 车票查询
25 | * @return
26 | */
27 | @GetMapping("/trainticketquery")
28 | public ResponseResult trainTicketQuery(String startcity, String endcity, String traindate,Integer traintype) throws ParseException {
29 | SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
30 | Date date = formatter.parse(traindate);
31 | return trainService.trainTicketQuery(startcity, endcity, date,traintype);
32 | }
33 |
34 |
35 | /**
36 | * 节假日价格折扣查询
37 | */
38 | @GetMapping("/holidaydiscount")
39 | public ResponseResult holidayDiscount(String traindate) throws ParseException {
40 | SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
41 | Date date = formatter.parse(traindate);
42 | return trainService.holidayDiscount(date);
43 | }
44 |
45 |
46 |
47 |
48 |
49 |
50 | /**
51 | * 管理员端
52 | * 火车新增
53 | */
54 | @PostMapping("addtrain")
55 | public ResponseResult addTrain(@RequestBody Traininfos traininfos){
56 | return trainService.addTrain(traininfos);
57 | }
58 |
59 | /**
60 | * 管理员火车信息查询
61 | */
62 | @GetMapping("/querytrains")
63 | public ResponseResult queryTrains(){
64 | return trainService.queryTrains();
65 |
66 | }
67 |
68 |
69 | /**
70 | * 管理员单个火车发布或者全部发布
71 | */
72 | @PostMapping("/departtrains")
73 | public ResponseResult departTrains(Integer id, String traindate) throws ParseException {
74 | SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
75 | Date date = formatter.parse(traindate);
76 | return trainService.departTrain(id,date);
77 | }
78 |
79 | /**
80 | * 管理多个火车表的发布
81 | */
82 | @PostMapping("/departtrainsselective")
83 | public ResponseResult departTrainsSelective(@RequestBody Map map) throws ParseException {
84 | SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
85 | Date date = formatter.parse((String) map.get("traindate"));
86 | return trainService.departTrainsSelective((List)map.get("idlist"),date);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/controller/UserController.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.controller;
2 |
3 |
4 | import com.lemon.train.common.ResponseResult;
5 | import com.lemon.train.entity.User;
6 | import com.lemon.train.service.UserService;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.beans.factory.annotation.Qualifier;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | @RequestMapping("user")
12 | @RestController
13 | public class UserController {
14 |
15 | @Qualifier("user")
16 | @Autowired
17 | UserService userService;
18 |
19 | @PostMapping("/login")
20 | public ResponseResult userLogin(String username, String password){
21 | return userService.userLogin(username,password);
22 | }
23 |
24 | @PostMapping("/register")
25 | public ResponseResult userRegister(@RequestBody User user){
26 | return userService.userRegister(user);
27 | }
28 |
29 | @GetMapping("/querypassenger")
30 | public ResponseResult queryPassenger(String id){
31 | return userService.queryPassenger(id);
32 | }
33 |
34 |
35 | /**
36 | * 管理员登录
37 | */
38 | @PostMapping("/adminlogin")
39 | public ResponseResult adminLogin(String username,String password){
40 | return userService.adminLogin(username,password);
41 | }
42 |
43 | /**
44 | * 管理员端
45 | * 根据条件查询
46 | */
47 | @GetMapping("/queryalluser")
48 | public ResponseResult queryAllUser(Integer pagenum,String condition, Integer pagesize){
49 | return userService.queryAllUser(pagenum,condition,pagesize);
50 | }
51 |
52 | /**
53 | * 用户的表更新
54 | */
55 | @PutMapping("/putuser")
56 | public ResponseResult putUser(@RequestBody User user){
57 | return userService.putUser(user);
58 | }
59 |
60 | /**
61 | * 根据真实姓名模糊查询
62 | */
63 | @GetMapping("/vagueusers")
64 | public ResponseResult vagueUsers(String realname){
65 | return userService.vagueUsers(realname);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Holiday.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 |
5 | import java.util.Date;
6 |
7 | public class Holiday {
8 |
9 |
10 | private Date vacation;
11 |
12 | private Integer status;
13 | @JsonFormat(pattern = "yyyy-MM-dd")
14 | public Date getVacation() {
15 | return vacation;
16 | }
17 |
18 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
19 | public void setVacation(Date vacation) {
20 | this.vacation = vacation;
21 | }
22 |
23 | public Integer getStatus() {
24 | return status;
25 | }
26 |
27 | public void setStatus(Integer status) {
28 | this.status = status;
29 | }
30 |
31 | @Override
32 | public String toString() {
33 | StringBuilder sb = new StringBuilder();
34 | sb.append(getClass().getSimpleName());
35 | sb.append(" [");
36 | sb.append("Hash = ").append(hashCode());
37 | sb.append(", vacation=").append(vacation);
38 | sb.append(", status=").append(status);
39 | sb.append("]");
40 | return sb.toString();
41 | }
42 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Orders.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import org.springframework.format.annotation.DateTimeFormat;
5 |
6 | import java.math.BigDecimal;
7 | import java.util.Date;
8 |
9 | public class Orders {
10 | private Integer id;
11 |
12 | private Integer status;
13 |
14 | private BigDecimal price;
15 |
16 | private Date traindate;
17 |
18 | private Date createtime;
19 |
20 | private Integer userId;
21 |
22 | private Integer trainId;
23 |
24 | private Integer seattype;
25 |
26 | private Integer carriage;
27 |
28 | private String seat;
29 |
30 | private Integer orderId;
31 |
32 | public Integer getId() {
33 | return id;
34 | }
35 |
36 | public void setId(Integer id) {
37 | this.id = id;
38 | }
39 |
40 | public Integer getStatus() {
41 | return status;
42 | }
43 |
44 | public void setStatus(Integer status) {
45 | this.status = status;
46 | }
47 |
48 | public BigDecimal getPrice() {
49 | return price;
50 | }
51 |
52 | public void setPrice(BigDecimal price) {
53 | this.price = price;
54 | }
55 |
56 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
57 | public Date getTraindate() {
58 | return traindate;
59 | }
60 |
61 | @DateTimeFormat(pattern = "yyyy-MM-dd")
62 | public void setTraindate(Date traindate) {
63 | this.traindate = traindate;
64 | }
65 |
66 | public Date getCreatetime() {
67 | return createtime;
68 | }
69 |
70 | public void setCreatetime(Date createtime) {
71 | this.createtime = createtime;
72 | }
73 |
74 | public Integer getUserId() {
75 | return userId;
76 | }
77 |
78 | public void setUserId(Integer userId) {
79 | this.userId = userId;
80 | }
81 |
82 | public Integer getTrainId() {
83 | return trainId;
84 | }
85 |
86 | public void setTrainId(Integer trainId) {
87 | this.trainId = trainId;
88 | }
89 |
90 | public Integer getSeattype() {
91 | return seattype;
92 | }
93 |
94 | public void setSeattype(Integer seattype) {
95 | this.seattype = seattype;
96 | }
97 |
98 | public Integer getCarriage() {
99 | return carriage;
100 | }
101 |
102 | public void setCarriage(Integer carriage) {
103 | this.carriage = carriage;
104 | }
105 |
106 | public String getSeat() {
107 | return seat;
108 | }
109 |
110 | public void setSeat(String seat) {
111 | this.seat = seat == null ? null : seat.trim();
112 | }
113 |
114 | public Integer getOrderId() {
115 | return orderId;
116 | }
117 |
118 | public void setOrderId(Integer orderId) {
119 | this.orderId = orderId;
120 | }
121 |
122 | @Override
123 | public String toString() {
124 | StringBuilder sb = new StringBuilder();
125 | sb.append(getClass().getSimpleName());
126 | sb.append(" [");
127 | sb.append("Hash = ").append(hashCode());
128 | sb.append(", id=").append(id);
129 | sb.append(", status=").append(status);
130 | sb.append(", price=").append(price);
131 | sb.append(", traindate=").append(traindate);
132 | sb.append(", createtime=").append(createtime);
133 | sb.append(", userId=").append(userId);
134 | sb.append(", trainId=").append(trainId);
135 | sb.append(", seattype=").append(seattype);
136 | sb.append(", carriage=").append(carriage);
137 | sb.append(", seat=").append(seat);
138 | sb.append(", orderId=").append(orderId);
139 | sb.append("]");
140 | return sb.toString();
141 | }
142 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Orderseat.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import java.util.Date;
4 |
5 | public class Orderseat {
6 | private Integer id;
7 |
8 | private Integer status;
9 |
10 | private Date orderdate;
11 |
12 | private Integer trainId;
13 |
14 | private Integer seatId;
15 |
16 | public Integer getId() {
17 | return id;
18 | }
19 |
20 | public void setId(Integer id) {
21 | this.id = id;
22 | }
23 |
24 | public Integer getStatus() {
25 | return status;
26 | }
27 |
28 | public void setStatus(Integer status) {
29 | this.status = status;
30 | }
31 |
32 | public Date getOrderdate() {
33 | return orderdate;
34 | }
35 |
36 | public void setOrderdate(Date orderdate) {
37 | this.orderdate = orderdate;
38 | }
39 |
40 | public Integer getTrainId() {
41 | return trainId;
42 | }
43 |
44 | public void setTrainId(Integer trainId) {
45 | this.trainId = trainId;
46 | }
47 |
48 | public Integer getSeatId() {
49 | return seatId;
50 | }
51 |
52 | public void setSeatId(Integer seatId) {
53 | this.seatId = seatId;
54 | }
55 |
56 | @Override
57 | public String toString() {
58 | StringBuilder sb = new StringBuilder();
59 | sb.append(getClass().getSimpleName());
60 | sb.append(" [");
61 | sb.append("Hash = ").append(hashCode());
62 | sb.append(", id=").append(id);
63 | sb.append(", status=").append(status);
64 | sb.append(", orderdate=").append(orderdate);
65 | sb.append(", trainId=").append(trainId);
66 | sb.append(", seatId=").append(seatId);
67 | sb.append("]");
68 | return sb.toString();
69 | }
70 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Passenger.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Passenger {
7 | private Integer id;
8 |
9 | private String name;
10 |
11 | private String idcard;
12 |
13 | private Integer type;
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Pricemanage.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | public class Pricemanage {
4 | private Integer id;
5 |
6 | private Double returnprice;
7 |
8 | private Double discount1;
9 |
10 | private Double discount2;
11 |
12 | private Double discount3;
13 |
14 | public Integer getId() {
15 | return id;
16 | }
17 |
18 | public void setId(Integer id) {
19 | this.id = id;
20 | }
21 |
22 | public Double getReturnprice() {
23 | return returnprice;
24 | }
25 |
26 | public void setReturnprice(Double returnprice) {
27 | this.returnprice = returnprice;
28 | }
29 |
30 | public Double getDiscount1() {
31 | return discount1;
32 | }
33 |
34 | public void setDiscount1(Double discount1) {
35 | this.discount1 = discount1;
36 | }
37 |
38 | public Double getDiscount2() {
39 | return discount2;
40 | }
41 |
42 | public void setDiscount2(Double discount2) {
43 | this.discount2 = discount2;
44 | }
45 |
46 | public Double getDiscount3() {
47 | return discount3;
48 | }
49 |
50 | public void setDiscount3(Double discount3) {
51 | this.discount3 = discount3;
52 | }
53 |
54 | @Override
55 | public String toString() {
56 | StringBuilder sb = new StringBuilder();
57 | sb.append(getClass().getSimpleName());
58 | sb.append(" [");
59 | sb.append("Hash = ").append(hashCode());
60 | sb.append(", id=").append(id);
61 | sb.append(", returnprice=").append(returnprice);
62 | sb.append(", discount1=").append(discount1);
63 | sb.append(", discount2=").append(discount2);
64 | sb.append(", discount3=").append(discount3);
65 | sb.append("]");
66 | return sb.toString();
67 | }
68 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Seatinfo.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import java.util.Date;
4 |
5 | public class Seatinfo {
6 | private Integer id;
7 |
8 | private String name;
9 |
10 | private Integer traintype;
11 |
12 | private Integer carriage;
13 |
14 | private Integer seattype;
15 |
16 | private String seat;
17 |
18 | public Seatinfo(Integer id, Integer carriage, Integer seattype, String seat, Date orderdate) {
19 | this.id= id;
20 | this.carriage = carriage;
21 | this.seattype = seattype;
22 | this.seat = seat;
23 | this.orderdate = orderdate;
24 | }
25 |
26 | private Integer status;
27 |
28 | private Date orderdate;
29 |
30 | private Integer orderseatid;
31 |
32 | public Integer getId() {
33 | return id;
34 | }
35 |
36 | public void setId(Integer id) {
37 | this.id = id;
38 | }
39 |
40 | public String getName() {
41 | return name;
42 | }
43 |
44 | public void setName(String name) {
45 | this.name = name == null ? null : name.trim();
46 | }
47 |
48 | public Integer getTraintype() {
49 | return traintype;
50 | }
51 |
52 | public void setTraintype(Integer traintype) {
53 | this.traintype = traintype;
54 | }
55 |
56 | public Integer getCarriage() {
57 | return carriage;
58 | }
59 |
60 | public void setCarriage(Integer carriage) {
61 | this.carriage = carriage;
62 | }
63 |
64 | public Integer getSeattype() {
65 | return seattype;
66 | }
67 |
68 | public void setSeattype(Integer seattype) {
69 | this.seattype = seattype;
70 | }
71 |
72 | public String getSeat() {
73 | return seat;
74 | }
75 |
76 | public void setSeat(String seat) {
77 | this.seat = seat == null ? null : seat.trim();
78 | }
79 |
80 | public Integer getStatus() {
81 | return status;
82 | }
83 |
84 | public void setStatus(Integer status) {
85 | this.status = status;
86 | }
87 |
88 | public Date getOrderdate() {
89 | return orderdate;
90 | }
91 |
92 | public void setOrderdate(Date orderdate) {
93 | this.orderdate = orderdate;
94 | }
95 |
96 | public Integer getOrderseatid() {
97 | return orderseatid;
98 | }
99 |
100 | public void setOrderseatid(Integer orderseatid) {
101 | this.orderseatid = orderseatid;
102 | }
103 |
104 | @Override
105 | public String toString() {
106 | StringBuilder sb = new StringBuilder();
107 | sb.append(getClass().getSimpleName());
108 | sb.append(" [");
109 | sb.append("Hash = ").append(hashCode());
110 | sb.append(", id=").append(id);
111 | sb.append(", name=").append(name);
112 | sb.append(", traintype=").append(traintype);
113 | sb.append(", carriage=").append(carriage);
114 | sb.append(", seattype=").append(seattype);
115 | sb.append(", seat=").append(seat);
116 | sb.append(", status=").append(status);
117 | sb.append(", orderdate=").append(orderdate);
118 | sb.append(", orderseatid=").append(orderseatid);
119 | sb.append("]");
120 | return sb.toString();
121 | }
122 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Train.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | public class Train {
4 | private Integer id;
5 |
6 | private String name;
7 |
8 | private Integer type;
9 |
10 | public Integer getId() {
11 | return id;
12 | }
13 |
14 | public void setId(Integer id) {
15 | this.id = id;
16 | }
17 |
18 | public String getName() {
19 | return name;
20 | }
21 |
22 | public void setName(String name) {
23 | this.name = name == null ? null : name.trim();
24 | }
25 |
26 | public Integer getType() {
27 | return type;
28 | }
29 |
30 | public void setType(Integer type) {
31 | this.type = type;
32 | }
33 |
34 | @Override
35 | public String toString() {
36 | StringBuilder sb = new StringBuilder();
37 | sb.append(getClass().getSimpleName());
38 | sb.append(" [");
39 | sb.append("Hash = ").append(hashCode());
40 | sb.append(", id=").append(id);
41 | sb.append(", name=").append(name);
42 | sb.append(", type=").append(type);
43 | sb.append("]");
44 | return sb.toString();
45 | }
46 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Traininfo.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 |
5 | import java.math.BigDecimal;
6 | import java.util.Date;
7 |
8 | public class Traininfo {
9 | private Integer id;
10 |
11 | private String startcity;
12 |
13 | private Date starttime;
14 |
15 | private String endcity;
16 |
17 | private Date endtime;
18 |
19 | private BigDecimal fprice;
20 |
21 | private BigDecimal sprice;
22 |
23 | private Integer fnum;
24 |
25 | private Integer snum;
26 |
27 | private Integer trainId;
28 |
29 | private String duration;
30 |
31 | public Integer getId() {
32 | return id;
33 | }
34 |
35 | public void setId(Integer id) {
36 | this.id = id;
37 | }
38 |
39 | public String getStartcity() {
40 | return startcity;
41 | }
42 |
43 | public void setStartcity(String startcity) {
44 | this.startcity = startcity == null ? null : startcity.trim();
45 | }
46 |
47 | @JsonFormat(pattern = "HH:mm:ss",timezone="GMT+8")
48 | public Date getStarttime() {
49 | return starttime;
50 | }
51 |
52 | public void setStarttime(Date starttime) {
53 | this.starttime = starttime;
54 | }
55 |
56 | public String getEndcity() {
57 | return endcity;
58 | }
59 |
60 | public void setEndcity(String endcity) {
61 | this.endcity = endcity == null ? null : endcity.trim();
62 | }
63 |
64 | @JsonFormat(pattern = "HH:mm:ss",timezone="GMT+8")
65 | public Date getEndtime() {
66 | return endtime;
67 | }
68 |
69 | public void setEndtime(Date endtime) {
70 | this.endtime = endtime;
71 | }
72 |
73 | public BigDecimal getFprice() {
74 | return fprice;
75 | }
76 |
77 | public void setFprice(BigDecimal fprice) {
78 | this.fprice = fprice;
79 | }
80 |
81 | public BigDecimal getSprice() {
82 | return sprice;
83 | }
84 |
85 | public void setSprice(BigDecimal sprice) {
86 | this.sprice = sprice;
87 | }
88 |
89 | public Integer getFnum() {
90 | return fnum;
91 | }
92 |
93 | public void setFnum(Integer fnum) {
94 | this.fnum = fnum;
95 | }
96 |
97 | public Integer getSnum() {
98 | return snum;
99 | }
100 |
101 | public void setSnum(Integer snum) {
102 | this.snum = snum;
103 | }
104 |
105 | public Integer getTrainId() {
106 | return trainId;
107 | }
108 |
109 | public void setTrainId(Integer trainId) {
110 | this.trainId = trainId;
111 | }
112 |
113 | public String getDuration() {
114 | return duration;
115 | }
116 |
117 | public void setDuration(String duration) {
118 | this.duration = duration == null ? null : duration.trim();
119 | }
120 |
121 | @Override
122 | public String toString() {
123 | StringBuilder sb = new StringBuilder();
124 | sb.append(getClass().getSimpleName());
125 | sb.append(" [");
126 | sb.append("Hash = ").append(hashCode());
127 | sb.append(", id=").append(id);
128 | sb.append(", startcity=").append(startcity);
129 | sb.append(", starttime=").append(starttime);
130 | sb.append(", endcity=").append(endcity);
131 | sb.append(", endtime=").append(endtime);
132 | sb.append(", fprice=").append(fprice);
133 | sb.append(", sprice=").append(sprice);
134 | sb.append(", fnum=").append(fnum);
135 | sb.append(", snum=").append(snum);
136 | sb.append(", trainId=").append(trainId);
137 | sb.append(", duration=").append(duration);
138 | sb.append("]");
139 | return sb.toString();
140 | }
141 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Trainseat.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | public class Trainseat {
4 | private Integer id;
5 |
6 | private Integer carriage;
7 |
8 | private Integer type;
9 |
10 | private String seat;
11 |
12 | private Integer trainId;
13 |
14 | public Integer getId() {
15 | return id;
16 | }
17 |
18 | public void setId(Integer id) {
19 | this.id = id;
20 | }
21 |
22 | public Integer getCarriage() {
23 | return carriage;
24 | }
25 |
26 | public void setCarriage(Integer carriage) {
27 | this.carriage = carriage;
28 | }
29 |
30 | public Integer getType() {
31 | return type;
32 | }
33 |
34 | public void setType(Integer type) {
35 | this.type = type;
36 | }
37 |
38 | public String getSeat() {
39 | return seat;
40 | }
41 |
42 | public void setSeat(String seat) {
43 | this.seat = seat == null ? null : seat.trim();
44 | }
45 |
46 | public Integer getTrainId() {
47 | return trainId;
48 | }
49 |
50 | public void setTrainId(Integer trainId) {
51 | this.trainId = trainId;
52 | }
53 |
54 | @Override
55 | public String toString() {
56 | StringBuilder sb = new StringBuilder();
57 | sb.append(getClass().getSimpleName());
58 | sb.append(" [");
59 | sb.append("Hash = ").append(hashCode());
60 | sb.append(", id=").append(id);
61 | sb.append(", carriage=").append(carriage);
62 | sb.append(", type=").append(type);
63 | sb.append(", seat=").append(seat);
64 | sb.append(", trainId=").append(trainId);
65 | sb.append("]");
66 | return sb.toString();
67 | }
68 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Trainstate.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | public class Trainstate {
4 | private Integer id;
5 |
6 | private Integer status;
7 |
8 | private Integer trainId;
9 |
10 | public Integer getId() {
11 | return id;
12 | }
13 |
14 | public void setId(Integer id) {
15 | this.id = id;
16 | }
17 |
18 | public Integer getStatus() {
19 | return status;
20 | }
21 |
22 | public void setStatus(Integer status) {
23 | this.status = status;
24 | }
25 |
26 | public Integer getTrainId() {
27 | return trainId;
28 | }
29 |
30 | public void setTrainId(Integer trainId) {
31 | this.trainId = trainId;
32 | }
33 |
34 | @Override
35 | public String toString() {
36 | StringBuilder sb = new StringBuilder();
37 | sb.append(getClass().getSimpleName());
38 | sb.append(" [");
39 | sb.append("Hash = ").append(hashCode());
40 | sb.append(", id=").append(id);
41 | sb.append(", status=").append(status);
42 | sb.append(", trainId=").append(trainId);
43 | sb.append("]");
44 | return sb.toString();
45 | }
46 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/Trainticket.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import java.util.Date;
4 |
5 | public class Trainticket {
6 | private Integer id;
7 |
8 | private Integer fnum;
9 |
10 | public Trainticket(Integer fnum, Integer snum, Date ticketdate, Integer trainId) {
11 | this.fnum = fnum;
12 | this.snum = snum;
13 | this.ticketdate = ticketdate;
14 | this.trainId = trainId;
15 | }
16 |
17 | private Integer snum;
18 |
19 | private Date ticketdate;
20 |
21 | private Integer trainId;
22 |
23 | public Integer getId() {
24 | return id;
25 | }
26 |
27 | public void setId(Integer id) {
28 | this.id = id;
29 | }
30 |
31 | public Integer getFnum() {
32 | return fnum;
33 | }
34 |
35 | public void setFnum(Integer fnum) {
36 | this.fnum = fnum;
37 | }
38 |
39 | public Integer getSnum() {
40 | return snum;
41 | }
42 |
43 | public void setSnum(Integer snum) {
44 | this.snum = snum;
45 | }
46 |
47 | public Date getTicketdate() {
48 | return ticketdate;
49 | }
50 |
51 | public void setTicketdate(Date ticketdate) {
52 | this.ticketdate = ticketdate;
53 | }
54 |
55 | public Integer getTrainId() {
56 | return trainId;
57 | }
58 |
59 | public void setTrainId(Integer trainId) {
60 | this.trainId = trainId;
61 | }
62 |
63 | @Override
64 | public String toString() {
65 | StringBuilder sb = new StringBuilder();
66 | sb.append(getClass().getSimpleName());
67 | sb.append(" [");
68 | sb.append("Hash = ").append(hashCode());
69 | sb.append(", id=").append(id);
70 | sb.append(", fnum=").append(fnum);
71 | sb.append(", snum=").append(snum);
72 | sb.append(", ticketdate=").append(ticketdate);
73 | sb.append(", trainId=").append(trainId);
74 | sb.append("]");
75 | return sb.toString();
76 | }
77 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.entity;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.fasterxml.jackson.annotation.JsonIgnore;
5 |
6 | import java.util.Date;
7 |
8 | public class User {
9 | private Integer id;
10 |
11 | private String username;
12 |
13 | private String realname;
14 |
15 | @JsonIgnore
16 | private String password;
17 |
18 | private Integer status;
19 |
20 | private String idcard;
21 |
22 | private String phone;
23 |
24 | private Integer type;
25 |
26 | private String country;
27 |
28 | private Date createdate;
29 |
30 | public Integer getId() {
31 | return id;
32 | }
33 |
34 | public void setId(Integer id) {
35 | this.id = id;
36 | }
37 |
38 | public String getUsername() {
39 | return username;
40 | }
41 |
42 | public void setUsername(String username) {
43 | this.username = username == null ? null : username.trim();
44 | }
45 |
46 | public String getRealname() {
47 | return realname;
48 | }
49 |
50 | public void setRealname(String realname) {
51 | this.realname = realname == null ? null : realname.trim();
52 | }
53 |
54 | public String getPassword() {
55 | return password;
56 | }
57 |
58 | public void setPassword(String password) {
59 | this.password = password == null ? null : password.trim();
60 | }
61 |
62 | public Integer getStatus() {
63 | return status;
64 | }
65 |
66 | public void setStatus(Integer status) {
67 | this.status = status;
68 | }
69 |
70 | public String getIdcard() {
71 | return idcard;
72 | }
73 |
74 | public void setIdcard(String idcard) {
75 | this.idcard = idcard == null ? null : idcard.trim();
76 | }
77 |
78 | public String getPhone() {
79 | return phone;
80 | }
81 |
82 | public void setPhone(String phone) {
83 | this.phone = phone == null ? null : phone.trim();
84 | }
85 |
86 | public Integer getType() {
87 | return type;
88 | }
89 |
90 | public void setType(Integer type) {
91 | this.type = type;
92 | }
93 |
94 | public String getCountry() {
95 | return country;
96 | }
97 |
98 | public void setCountry(String country) {
99 | this.country = country == null ? null : country.trim();
100 | }
101 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
102 | public Date getCreatedate() {
103 | return createdate;
104 | }
105 |
106 | public void setCreatedate(Date createdate) {
107 | this.createdate = createdate;
108 | }
109 |
110 | @Override
111 | public String toString() {
112 | StringBuilder sb = new StringBuilder();
113 | sb.append(getClass().getSimpleName());
114 | sb.append(" [");
115 | sb.append("Hash = ").append(hashCode());
116 | sb.append(", id=").append(id);
117 | sb.append(", username=").append(username);
118 | sb.append(", realname=").append(realname);
119 | sb.append(", password=").append(password);
120 | sb.append(", status=").append(status);
121 | sb.append(", idcard=").append(idcard);
122 | sb.append(", phone=").append(phone);
123 | sb.append(", type=").append(type);
124 | sb.append(", country=").append(country);
125 | sb.append(", createdate=").append(createdate);
126 | sb.append("]");
127 | return sb.toString();
128 | }
129 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/HolidayMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Holiday;
4 | import com.lemon.train.entity.HolidayExample;
5 | import com.lemon.train.entity.Pricemanage;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.apache.ibatis.annotations.Select;
8 |
9 | import java.util.Date;
10 | import java.util.List;
11 | import java.util.Map;
12 |
13 | public interface HolidayMapper {
14 | long countByExample(HolidayExample example);
15 |
16 | int deleteByExample(HolidayExample example);
17 |
18 | int deleteByPrimaryKey(Date vacation);
19 |
20 | int insert(Holiday record);
21 |
22 | int insertSelective(Holiday record);
23 |
24 | List selectByExample(HolidayExample example);
25 |
26 | Holiday selectByPrimaryKey(Date vacation);
27 |
28 | int updateByExampleSelective(@Param("record") Holiday record, @Param("example") HolidayExample example);
29 |
30 | int updateByExample(@Param("record") Holiday record, @Param("example") HolidayExample example);
31 |
32 | int updateByPrimaryKeySelective(Holiday record);
33 |
34 | int updateByPrimaryKey(Holiday record);
35 |
36 | // 通过状态获得
37 | double getSpecialDiscount(Map map);
38 |
39 | //更新折扣表
40 | int updateDiscountById(Pricemanage priceManage);
41 |
42 | @Select("select * from pricemanage where id=1 limit 1")
43 | Pricemanage getDiscount();
44 |
45 | //获得当天交易额
46 | void getToalPrice(Map map);
47 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/OrderinfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Orderinfo;
4 | import com.lemon.train.entity.OrderinfoExample;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.apache.ibatis.annotations.Select;
7 |
8 | import java.util.List;
9 |
10 | public interface OrderinfoMapper {
11 | long countByExample(OrderinfoExample example);
12 |
13 | int deleteByExample(OrderinfoExample example);
14 |
15 | int insert(Orderinfo record);
16 |
17 | int insertSelective(Orderinfo record);
18 |
19 | List selectByExample(OrderinfoExample example);
20 |
21 | int updateByExampleSelective(@Param("record") Orderinfo record, @Param("example") OrderinfoExample example);
22 |
23 | int updateByExample(@Param("record") Orderinfo record, @Param("example") OrderinfoExample example);
24 |
25 | @Select("select * from orderinfo where id=#{id}")
26 | Orderinfo selectDetailOrder(Integer id);
27 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/OrdersMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Orders;
4 | import com.lemon.train.entity.OrdersExample;
5 | import org.apache.ibatis.annotations.Param;
6 |
7 | import java.util.Date;
8 | import java.util.List;
9 |
10 | public interface OrdersMapper {
11 | long countByExample(OrdersExample example);
12 |
13 | int deleteByExample(OrdersExample example);
14 |
15 | int deleteByPrimaryKey(Integer id);
16 |
17 | int insert(Orders record);
18 |
19 | int insertSelective(Orders record);
20 |
21 | List selectByExample(OrdersExample example);
22 |
23 | Orders selectByPrimaryKey(Integer id);
24 |
25 | int updateByExampleSelective(@Param("record") Orders record, @Param("example") OrdersExample example);
26 |
27 | int updateByExample(@Param("record") Orders record, @Param("example") OrdersExample example);
28 |
29 | int updateByPrimaryKeySelective(Orders record);
30 |
31 | int updateByPrimaryKey(Orders record);
32 |
33 |
34 | /**
35 | * 修改火车的票数,后期可以集成到redis
36 | */
37 | int decreaseTrainNum(Integer trainId, Date traindate,Integer type);
38 |
39 | int increaseTrainNum(Integer trainId, Date traindate,Integer type);
40 |
41 | int updateOrderState(Integer id);
42 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/OrderseatMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 |
4 | import com.lemon.train.entity.Orderseat;
5 | import com.lemon.train.entity.OrderseatExample;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | public interface OrderseatMapper {
12 | long countByExample(OrderseatExample example);
13 |
14 | int deleteByExample(OrderseatExample example);
15 |
16 | int deleteByPrimaryKey(Integer id);
17 |
18 | int insert(Orderseat record);
19 |
20 | int insertSelective(Orderseat record);
21 |
22 | List selectByExample(OrderseatExample example);
23 |
24 | Orderseat selectByPrimaryKey(Integer id);
25 |
26 | int updateByExampleSelective(@Param("record") Orderseat record, @Param("example") OrderseatExample example);
27 |
28 | int updateByExample(@Param("record") Orderseat record, @Param("example") OrderseatExample example);
29 |
30 | int updateByPrimaryKeySelective(Orderseat record);
31 |
32 | int updateByPrimaryKey(Orderseat record);
33 |
34 | /**
35 | * 返回座位主键
36 | */
37 | Orderseat selectSeatPrimaryKey(Date orderdate, Integer trainid,Integer type);
38 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/SeatinfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Seatinfo;
4 | import com.lemon.train.entity.SeatinfoExample;
5 | import org.apache.ibatis.annotations.Param;
6 |
7 | import java.util.List;
8 |
9 | public interface SeatinfoMapper {
10 | long countByExample(SeatinfoExample example);
11 |
12 | int deleteByExample(SeatinfoExample example);
13 |
14 | int insert(Seatinfo record);
15 |
16 | int insertSelective(Seatinfo record);
17 |
18 | List selectByExample(SeatinfoExample example);
19 |
20 | int updateByExampleSelective(@Param("record") Seatinfo record, @Param("example") SeatinfoExample example);
21 |
22 | int updateByExample(@Param("record") Seatinfo record, @Param("example") SeatinfoExample example);
23 |
24 | int selectBySelective(Seatinfo seatinfo);
25 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/TrainMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Train;
4 | import com.lemon.train.entity.TrainExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | public interface TrainMapper {
9 | long countByExample(TrainExample example);
10 |
11 | int deleteByExample(TrainExample example);
12 |
13 | int deleteByPrimaryKey(Integer id);
14 |
15 | int insert(Train record);
16 |
17 | int insertSelective(Train record);
18 |
19 | List selectByExample(TrainExample example);
20 |
21 | Train selectByPrimaryKey(Integer id);
22 |
23 | int updateByExampleSelective(@Param("record") Train record, @Param("example") TrainExample example);
24 |
25 | int updateByExample(@Param("record") Train record, @Param("example") TrainExample example);
26 |
27 | int updateByPrimaryKeySelective(Train record);
28 |
29 | int updateByPrimaryKey(Train record);
30 | }
--------------------------------------------------------------------------------
/train/src/main/java/com/lemon/train/mapper/TraininfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.lemon.train.mapper;
2 |
3 | import com.lemon.train.entity.Traininfo;
4 | import com.lemon.train.entity.TraininfoExample;
5 | import org.apache.ibatis.annotations.Param;
6 | import org.apache.ibatis.annotations.Select;
7 |
8 | import java.util.List;
9 | import java.util.Map;
10 |
11 | public interface TraininfoMapper {
12 | long countByExample(TraininfoExample example);
13 |
14 | int deleteByExample(TraininfoExample example);
15 |
16 | int deleteByPrimaryKey(Integer id);
17 |
18 | int insert(Traininfo record);
19 |
20 | int insertSelective(Traininfo record);
21 |
22 | List selectByExample(TraininfoExample example);
23 |
24 | Traininfo selectByPrimaryKey(Integer id);
25 |
26 | int updateByExampleSelective(@Param("record") Traininfo record, @Param("example") TraininfoExample example);
27 |
28 | int updateByExample(@Param("record") Traininfo record, @Param("example") TraininfoExample example);
29 |
30 | int updateByPrimaryKeySelective(Traininfo record);
31 |
32 | int updateByPrimaryKey(Traininfo record);
33 |
34 | List