開發(fā)工具:eclipse,jdk1.8
服務(wù)器:tomcat7.0
數(shù)據(jù)庫:mysql5.7
技術(shù): spring+springMVC+mybaits+EasyUI
項(xiàng)目包括用戶前臺(tái)和管理后臺(tái)兩部分,功能介紹如下:?
一、用戶(前臺(tái))功能:
用戶進(jìn)入物流快遞管理系統(tǒng)后,可以進(jìn)行在線下單,下單完成后,可以查詢訂單狀態(tài);接著,用戶可以瀏覽相關(guān)物流快遞的新聞資訊;用戶可以瀏覽網(wǎng)站提供的業(yè)務(wù)范圍;最后,用戶如果需要投訴或者反饋信息,可以給網(wǎng)站在線留言。
在線下單:用戶可以在線下單,填寫發(fā)貨人、收貨人和貨物相關(guān)信息即可。
查詢訂單:用戶下單后,可以輸入訂單號(hào),查詢物流快遞訂單的狀態(tài)。
瀏覽新聞:用戶可以在網(wǎng)站上,瀏覽相關(guān)物流快遞的最新資訊。
瀏覽業(yè)務(wù):用戶可以瀏覽網(wǎng)站上的業(yè)務(wù)介紹,了解業(yè)務(wù)范圍,明確自己的物流快遞需求。
在線留言:用戶可以給網(wǎng)站在線留言,填寫相關(guān)信息即可。
二、管理員(后臺(tái))功能:
管理員首先登錄系統(tǒng),可以進(jìn)行菜單管理、角色管理、用戶管理、訂單管理、新聞管理、留言管理、查看日志。
菜單管理:管理員可以增、刪、改和查菜單信息。
角色管理:對角色信息進(jìn)行管理,可以增、刪、改和查角色信息。
用戶管理:對用戶信息進(jìn)行管理,可以添加、修改、查詢和刪除用戶信息。
訂單管理:對訂單信息進(jìn)行管理,可以添加、修改、查詢和刪除訂單信息。
新聞管理:對新聞進(jìn)行管理,可以添加、修改、查詢和刪除新聞資訊。
留言管理:對留言信息進(jìn)行管理,可以修改和刪除留言信息。
查看日志:可以查看系統(tǒng)的詳細(xì)日志信息。
文檔截圖:
N-131基于jsp,ssm物流快遞管理系統(tǒng)
前臺(tái)用戶截圖:
后臺(tái)管理員截圖:?
文章來源:http://www.zghlxwxcb.cn/news/detail-734889.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-734889.html
package com.ischoolbar.programmer.controller.admin;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.ischoolbar.programmer.entity.admin.News;
import com.ischoolbar.programmer.page.admin.Page;
import com.ischoolbar.programmer.service.admin.NewsCategoryService;
import com.ischoolbar.programmer.service.admin.NewsService;
/**
* 新聞控制器
* @author llq
*
*/
@RequestMapping("/admin/news")
@Controller
public class NewsController {
@Autowired
private NewsCategoryService newsCategoryService;
@Autowired
private NewsService newsService;
/**
* 新聞列表頁面
* @param model
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView list(ModelAndView model){
model.addObject("newsCategoryList", newsCategoryService.findAll());
model.setViewName("news/list");
return model;
}
/**
* 新聞添加頁面
* @param model
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.GET)
public ModelAndView add(ModelAndView model){
model.addObject("newsCategoryList", newsCategoryService.findAll());
model.setViewName("news/add");
return model;
}
/**
* 新聞添加
* @param news
* @return
*/
@RequestMapping(value="/add",method=RequestMethod.POST)
@ResponseBody
public Map<String,String> add(News news){
Map<String,String> ret = new HashMap<String, String>();
if(news == null){
ret.put("type", "error");
ret.put("msg", "請?zhí)顚懻_的信息!");
return ret;
}
if(StringUtils.isEmpty(news.getTitle())){
ret.put("type", "error");
ret.put("msg", "新聞標(biāo)題不能為空!");
return ret;
}
if(news.getCategoryId() == null){
ret.put("type", "error");
ret.put("msg", "請選擇新聞分類!");
return ret;
}
if(StringUtils.isEmpty(news.getAbstrs())){
ret.put("type", "error");
ret.put("msg", "新聞?wù)荒転榭眨?);
return ret;
}
if(StringUtils.isEmpty(news.getTags())){
ret.put("type", "error");
ret.put("msg", "新聞標(biāo)簽不能為空!");
return ret;
}
if(StringUtils.isEmpty(news.getPhoto())){
ret.put("type", "error");
ret.put("msg", "新聞封面圖片必須上傳!");
return ret;
}
if(StringUtils.isEmpty(news.getAuthor())){
ret.put("type", "error");
ret.put("msg", "新聞作者不能為空!");
return ret;
}
if(StringUtils.isEmpty(news.getContent())){
ret.put("type", "error");
ret.put("msg", "新聞內(nèi)容不能為空!");
return ret;
}
news.setCreateTime(new Date());
if(newsService.add(news) <= 0){
ret.put("type", "error");
ret.put("msg", "添加失敗,請聯(lián)系管理員!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "添加成功!");
return ret;
}
/**
* 新聞編輯頁面
* @param model
* @return
*/
@RequestMapping(value="/edit",method=RequestMethod.GET)
public ModelAndView edit(ModelAndView model,Long id){
model.addObject("newsCategoryList", newsCategoryService.findAll());
model.addObject("news", newsService.find(id));
model.setViewName("news/edit");
return model;
}
/**
* 新聞信息編輯
* @param newsCategory
* @return
*/
@RequestMapping(value="/edit",method=RequestMethod.POST)
@ResponseBody
public Map<String,String> edit(News news){
Map<String,String> ret = new HashMap<String, String>();
if(news == null){
ret.put("type", "error");
ret.put("msg", "請?zhí)顚懻_的信息!");
return ret;
}
if(StringUtils.isEmpty(news.getTitle())){
ret.put("type", "error");
ret.put("msg", "新聞標(biāo)題不能為空!");
return ret;
}
if(news.getCategoryId() == null){
ret.put("type", "error");
ret.put("msg", "請選擇新聞分類!");
return ret;
}
if(StringUtils.isEmpty(news.getAbstrs())){
ret.put("type", "error");
ret.put("msg", "新聞?wù)荒転榭眨?);
return ret;
}
if(StringUtils.isEmpty(news.getTags())){
ret.put("type", "error");
ret.put("msg", "新聞標(biāo)簽不能為空!");
return ret;
}
if(StringUtils.isEmpty(news.getPhoto())){
ret.put("type", "error");
ret.put("msg", "新聞封面圖片必須上傳!");
return ret;
}
if(StringUtils.isEmpty(news.getAuthor())){
ret.put("type", "error");
ret.put("msg", "新聞作者不能為空!");
return ret;
}
if(StringUtils.isEmpty(news.getContent())){
ret.put("type", "error");
ret.put("msg", "新聞內(nèi)容不能為空!");
return ret;
}
if(newsService.edit(news) <= 0){
ret.put("type", "error");
ret.put("msg", "修改失敗,請聯(lián)系管理員!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "修改成功!");
return ret;
}
/**
* 刪除新聞
* @param id
* @return
*/
@RequestMapping(value="/delete",method=RequestMethod.POST)
@ResponseBody
public Map<String,String> delete(Long id){
Map<String,String> ret = new HashMap<String, String>();
if(id == null){
ret.put("type", "error");
ret.put("msg", "請選擇要?jiǎng)h除的信息!");
return ret;
}
try{
if(newsService.delete(id) <= 0){
ret.put("type", "error");
ret.put("msg", "刪除失敗,請聯(lián)系管理員!");
return ret;
}
}catch(Exception e){
ret.put("type", "error");
ret.put("msg", "該新聞下有評論信息,不可刪除!");
return ret;
}
ret.put("type", "success");
ret.put("msg", "刪除成功!");
return ret;
}
/**
* 分頁模糊搜索查詢列表
* @param name
* @param page
* @return
*/
@RequestMapping(value="/list",method=RequestMethod.POST)
@ResponseBody
public Map<String,Object> getList(
@RequestParam(name="title",required=false,defaultValue="") String title,
@RequestParam(name="author",required=false,defaultValue="") String author,
@RequestParam(name="categoryId",required=false) Long categoryId,
Page page
){
Map<String,Object> ret = new HashMap<String, Object>();
Map<String,Object> queryMap = new HashMap<String, Object>();
queryMap.put("title", title);
queryMap.put("author", author);
if(categoryId != null && categoryId.longValue() != -1){
queryMap.put("categoryId", categoryId);
}
queryMap.put("offset", page.getOffset());
queryMap.put("pageSize", page.getRows());
ret.put("rows", newsService.findList(queryMap));
ret.put("total", newsService.getTotal(queryMap));
return ret;
}
/**
* 上傳圖片
* @param photo
* @param request
* @return
*/
@RequestMapping(value="/upload_photo",method=RequestMethod.POST)
@ResponseBody
public Map<String, String> uploadPhoto(MultipartFile photo,HttpServletRequest request){
Map<String, String> ret = new HashMap<String, String>();
if(photo == null){
ret.put("type", "error");
ret.put("msg", "選擇要上傳的文件!");
return ret;
}
if(photo.getSize() > 1024*1024*1024){
ret.put("type", "error");
ret.put("msg", "文件大小不能超過10M!");
return ret;
}
//獲取文件后綴
String suffix = photo.getOriginalFilename().substring(photo.getOriginalFilename().lastIndexOf(".")+1,photo.getOriginalFilename().length());
if(!"jpg,jpeg,gif,png".toUpperCase().contains(suffix.toUpperCase())){
ret.put("type", "error");
ret.put("msg", "請選擇jpg,jpeg,gif,png格式的圖片!");
return ret;
}
String savePath = request.getServletContext().getRealPath("/") + "/resources/upload/";
File savePathFile = new File(savePath);
if(!savePathFile.exists()){
//若不存在改目錄,則創(chuàng)建目錄
savePathFile.mkdir();
}
String filename = new Date().getTime()+"."+suffix;
try {
//將文件保存至指定目錄
photo.transferTo(new File(savePath+filename));
}catch (Exception e) {
// TODO Auto-generated catch block
ret.put("type", "error");
ret.put("msg", "保存文件異常!");
e.printStackTrace();
return ret;
}
ret.put("type", "success");
ret.put("msg", "用戶上傳圖片成功!");
ret.put("filepath",request.getServletContext().getContextPath() + "/resources/upload/" + filename );
return ret;
}
}
到了這里,關(guān)于基于jsp,ssm物流快遞管理系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!