基于SSM的旅游管理系統設計與實現

末尾獲取源碼
開發語言:Java
Java開發工具:JDK1.8
后端框架:SSM
前端:采用JSP技術開發
數據庫:MySQL5.7和Navicat管理工具結合
服務器:Tomcat8.5
開發軟件:IDEA / Eclipse
是否Maven項目:是


目錄

一、項目簡介

二、系統功能

三、系統項目截圖

用戶信息管理

景點信息管理

酒店信息管理

新聞信息管理

四、核心代碼

登錄相關

文件上傳

封裝

五、總結


一、項目簡介

現代經濟快節奏發展以及不斷完善升級的信息化技術,讓傳統數據信息的管理升級為軟件存儲,歸納,集中處理數據信息的管理方式。本思途旅游管理系統就是在這樣的大環境下誕生,其可以幫助管理者在短時間內處理完畢龐大的數據信息,使用這種軟件工具可以幫助管理人員提高事務處理效率,達到事半功倍的效果。此思途旅游管理系統利用當下成熟完善的SSM框架,使用跨平臺的可開發大型商業網站的Java語言,以及最受歡迎的RDBMS應用軟件之一的Mysql數據庫進行程序開發.思途旅游管理系統的開發根據操作人員需要設計的界面簡潔美觀,在功能模塊布局上跟同類型網站保持一致,程序在實現基本要求功能時,也為數據信息面臨的安全問題提供了一些實用的解決方案。可以說該程序在幫助管理者高效率地處理工作事務的同時,也實現了數據信息的整體化,規范化與自動化。


二、系統功能



三、系統項目截圖

用戶信息管理

此頁面提供給管理員的功能有:用戶信息的查詢管理,可以刪除用戶信息、修改用戶信息、新增用戶信息,還進行了對用戶名稱的模糊查詢的條件

景點信息管理

此頁面提供給管理員的功能有:查看已發布的景點信息數據,修改景點信息,景點信息作廢,即可刪除。

酒店信息管理

此頁面提供給管理員的功能有:根據酒店信息進行條件查詢,還可以對酒店信息進行新增、修改、查詢操作等等。

?

新聞信息管理

此頁面提供給管理員的功能有:根據新聞信息進行新增、修改、查詢操作等等。

?


四、核心代碼

登錄相關


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登錄相關*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登錄*/@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("賬號或密碼不正確");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注冊*/@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("用戶已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密碼重置*/@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("賬號不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密碼已重置為:123456");}/*** 列表*/@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);}/*** 列表*/@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));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 獲取用戶的session用戶信息*/@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);}/*** 保存*/@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("用戶已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

文件上傳

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上傳文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上傳文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上傳文件不能為空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);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();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));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);}/*** 下載文件*/@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);}}

封裝

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回數據*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知異常,請聯系管理員");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

五、總結

通過對思途旅游管理系統的開發,讓我深刻明白開發一個程序軟件需要經歷的流程,當確定要開發一個思途旅游管理系統的程序時,我在開發期間,對其功能進行合理的需求分析,然后才是程序軟件的功能的框架設計,數據庫的實體與數據表設計,程序軟件的功能詳細界面實現,以及程序的功能測試等進行全方位的細致考慮,雖然在此過程中,各個環節都遇到了大大小小的困難,但是通過對這些問題進行反復的分析,深入的思考,借助各種相關文獻資料提供的方法與解決思路成功解決面臨的各個問題,最后成功的讓我開發的思途旅游管理系統得以正常運行。

思途旅游管理系統在功能上面是基本可以滿足用戶對系統的操作,但是這個程序軟件也有許多方面是不足的,因此,在下一個時間階段,有幾點需要改進的地方需要提出來,它們分別是:

(1)操作頁面可以滿足用戶簡易操作的要求,但是在頁面多樣化設計層面上需要把一些比較豐富的設計結構考慮進來。

(2)程序軟件的總體安全性能需要優化,例如程序的退出安全性,以及程序的并發性等問題都需要進行安全性升級,讓開發的思途旅游管理系統與現實中的相關網站更貼合。

(3)需要對程序的數據結構方面,程序的代碼方面等進行優化,讓運行起來的程序可以保持穩定運行,也讓程序能夠保證短時間內處理相關事務,節省處理事務的時間,提高事務處理的效率,同時對服務器上資源占用的比例進行降低。

思途旅游管理系統的開發一方面是對自身專業知識技能進行最終考核,另一方面也是讓自己學會獨立解決程序開發過程中所遇到的問題,掌握將理論知識運用于程序開發實踐的方法。思途旅游管理系統的開發最終目標就是讓系統更具人性化,同時在邏輯設計上,讓系統能夠更加的嚴謹。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/161322.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/161322.shtml
英文地址,請注明出處:http://en.pswp.cn/news/161322.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

大文件導出

關于大文件導出的優化迭代情況如下&#xff1a; 計算機配置&#xff1a;四核16G內存 初始版本為單線程單文件導出文件&#xff0c;mybatis讀 opencsv寫&#xff0c;耗時將近三小時&#xff1b; 第一輪優化改為多線程單文件&#xff0c;提高讀數據效率&#xff0c;時間僅縮減十分…

數據分析基礎之《matplotlib(1)—介紹》

一、什么是matplotlib 1、專門用于開發2D圖表&#xff08;包括3D圖表&#xff09; 2、使用起來及其簡單 3、以漸進、交互方式實現數據可視化 4、matplotlib mat&#xff1a;matrix&#xff08;矩陣&#xff09; plot&#xff1a;畫圖 lib&#xff1a;庫 二、為什么要學習m…

記錄一次因內存不足而導致hiveserver2和namenode進程宕機的排查

背景 最近發現集群主節點總有進程宕機&#xff0c;定位了大半天才找到原因&#xff0c;分享一下 排查過程 查詢hiveserver2和namenode日志&#xff0c;都是正常的&#xff0c;突然日志就不記錄了&#xff0c;直到我重啟之后又恢復工作了。 排查各種日志都是正常的&#xff0…

vue3 + vue-router + keep-alive緩存頁面

1.vue-router中增加mate.keepAlive和deepth屬性 {path: /,name: home,component: HomeView,meta: {// 當前頁面要不要緩存keepAlive: false,// 當前頁面層級deepth: 1,}},{path: /list,name: list,component: ListView,meta: {// 當前頁面要不要緩存keepAlive: true,// 當前頁…

代碼規范之-理解ESLint、Prettier、EditorConfig

前言 團隊多人協同開發項目&#xff0c;困擾團隊管理的一個很大的問題就是&#xff1a;無可避免地會出現每個開發者編碼習慣不同、代碼風格迥異&#xff0c;為了代碼高可用、可維護性&#xff0c;需要從項目管理上盡量統一和規范代碼。理想的方式需要在項目工程化方面&#xff…

Kafka官方生產者和消費者腳本簡單使用

問題 怎樣使用Kafka官方生產者和消費者腳本進行消費生產和消費?這里假設已經下載了kafka官方文件,并已經解壓. 生產者配置文件 producer_hr.properties bootstrap.servers10.xx.xx.xxx:9092,10.xx.xx.xxx:9092,10.xx.xx.xxx:9092 compression.typenone security.protocolS…

部署jekins遇到的問題

jdk問題 我用的jdk版本是21的結果版本太新了&#xff0c;啟動jekins服務的時候總是報錯最后在jekins的安裝目錄下面的jekinsErr.log查看日志發現是jdk問題最后換了一個17版本的就解決了。 unity和jekins jekins和Git源碼管理 jekins和Git聯動使用 我想讓jekins每次打包的時…

【css/vue】使用css變量,在同一個頁面根據不同情況改變字號等樣式

解決方法是&#xff1a;將 css 的屬性使用 v-bind 與 Vue 組件的屬性綁定&#xff0c;當組件的屬性變化時&#xff0c;css 對應的屬性值也就會隨之變化&#xff1b; 具體實現代碼&#xff1a; <template><div><span class"navTitle">標題名</s…

3D電路板在線渲染案例

從概念上講,這是有道理的,因為PCB印制電路板上的走線從一個連接到下一個連接的路線基本上是平面的。 然而,我們生活在一個 3 維世界中,能夠以這種方式可視化電路以及相應的組件,對于設計過程很有幫助。本文將介紹KiCad中基本的3D查看功能,以及如何使用NSDT 3DConvert在線…

Day38力扣打卡

打卡記錄 網格中的最小路徑代價&#xff08;動態規劃&#xff09; 鏈接 class Solution:def minPathCost(self, grid: List[List[int]], moveCost: List[List[int]]) -> int:m, n len(grid), len(grid[0])f [[0x3f3f3f3f3f] * n for _ in range(m)]f[0] grid[0]for i i…

【洛谷 B2010】帶余除法 題解(順序結構+四則運算)

帶余除法 題目描述 給定被除數和除數&#xff0c;求整數商及余數。此題中請使用默認的整除和取余運算&#xff0c;無需對結果進行任何特殊處理。 輸入格式 一行&#xff0c;包含兩個整數&#xff0c;依次為被除數和除數&#xff08;除數非零&#xff09;&#xff0c;中間用…

Sentinel 授權規則 (AuthorityRule)

Sentinel 是面向分布式、多語言異構化服務架構的流量治理組件&#xff0c;主要以流量為切入點&#xff0c;從流量路由、流量控制、流量整形、熔斷降級、系統自適應過載保護、熱點流量防護等多個維度來幫助開發者保障微服務的穩定性。 SpringbootDubboNacos 集成 Sentinel&…

一分鐘快速了解Python3.12新特性

Python 3.12&#xff0c;作為Python編程語言的最新穩定版&#xff0c;引入了一系列對語言和標準庫的改變&#xff0c;發布于2023年10月2日。重點變化包括&#xff1a; 新語法特性: PEP 695 引入類型形參語法和 type 語句&#xff0c;允許創建更明確的泛型類和函數。PEP 701 改進…

Unity 三維場景的搭建 軟件構造實驗報告

實驗2&#xff1a;仿真系統功能實現 1.實驗目的 &#xff08;1&#xff09;熟悉在Unity中設置仿真場景&#xff1b; &#xff08;2&#xff09;熟悉在Unity中C#語言的使用&#xff1b; &#xff08;3&#xff09;熟悉仿真功能的實現。 2.實驗內容 新建一個仿真場景&#x…

SpringBoot_websocket實戰

SpringBoot_websocket實戰 前言1.websocket入門1.1 websocket最小化配置1.1.1 后端配置1.1.2 前端配置 1.2 websocket使用sockjs1.2.1 后端配置1.2.2 前端配置 1.3 websocket使用stomp協議1.3.1 后端配置1.3.2 前端配置 2.websocket進階2.1 websocket與stomp有什么區別2.2 webs…

思維模型 重疊效應

本系列文章 主要是 分享 思維模型 &#xff0c;涉及各個領域&#xff0c;重在提升認知。相似內容易被混淆或遺忘。 1 重疊效應的應用 1.1 重疊效應在教育中的應用 1 通過避免重疊效應提升學習效率 為了避免重疊效應&#xff0c;通過對比、歸納等方法來幫助學生更好地理解和掌…

黑馬React18: Redux

黑馬React: Redux Date: November 19, 2023 Sum: Redux基礎、Redux工具、調試、美團案例 Redux介紹 Redux 是React最常用的集中狀態管理工具&#xff0c;類似于Vue中的Pinia&#xff08;Vuex&#xff09;&#xff0c;可以獨立于框架運行 作用&#xff1a;通過集中管理的方式管…

VPS配置了swap沒發揮作用怎么辦

1 swap配置了但沒用上 我的服務器內存是2G&#xff0c;裝多一點東西就不夠用&#xff0c;于是我給他分配了2G的swap&#xff0c;等了幾小時&#xff0c;swap還是一點都沒有使用 Linux中Swap&#xff08;即&#xff1a;交換分區&#xff09;&#xff0c;類似于Windows的虛擬內存…

MongoDB的常用操作以及python連接MongoDB

一,MongoDB的啟動 mongod --dbpath..\data\db mongodb注意同時開兩個窗口&#xff0c;不要關&#xff01; 二, MongoDB的簡單使用 簡單介紹一下mongoDB中一些操作 show dbs: 顯示所有數據庫 show databases: 顯示所有數據庫 use xxxx: 使用指定數據庫/創建數據庫&#xff08…

Linux 與大型機 z/OS

大型機 國際商業機器公司&#xff08;International Business Machine Corporation&#xff09;&#xff0c;簡稱為 IBM&#xff0c;實際上是當今大型機的代名詞。作為大型企業技術解決方案提供商&#xff0c;IBM 在其漫長的生命周期中生產了各種產品。 他們的前身是計算、制表…