建站之星好不,怎么自己做网站,动漫设计与制作实训报告,大数据培训开发工具#xff1a;eclipse#xff0c;jdk1.8
服务器#xff1a;tomcat7.0
数据库#xff1a;mysql5.7
技术#xff1a; springspringMVCmybaitsEasyUI
项目包括用户前台和管理后台两部分#xff0c;功能介绍如下#xff1a;
一、用户(前台)功能#xff1a;
用…开发工具eclipsejdk1.8
服务器tomcat7.0
数据库mysql5.7
技术 springspringMVCmybaitsEasyUI
项目包括用户前台和管理后台两部分功能介绍如下
一、用户(前台)功能
用户进入物流快递管理系统后可以进行在线下单下单完成后可以查询订单状态接着用户可以浏览相关物流快递的新闻资讯用户可以浏览网站提供的业务范围最后用户如果需要投诉或者反馈信息可以给网站在线留言。
在线下单用户可以在线下单填写发货人、收货人和货物相关信息即可。
查询订单用户下单后可以输入订单号查询物流快递订单的状态。
浏览新闻用户可以在网站上浏览相关物流快递的最新资讯。
浏览业务用户可以浏览网站上的业务介绍了解业务范围明确自己的物流快递需求。
在线留言用户可以给网站在线留言填写相关信息即可。
二、管理员(后台)功能
管理员首先登录系统可以进行菜单管理、角色管理、用户管理、订单管理、新闻管理、留言管理、查看日志。
菜单管理管理员可以增、删、改和查菜单信息。
角色管理对角色信息进行管理可以增、删、改和查角色信息。
用户管理对用户信息进行管理可以添加、修改、查询和删除用户信息。
订单管理对订单信息进行管理可以添加、修改、查询和删除订单信息。
新闻管理对新闻进行管理可以添加、修改、查询和删除新闻资讯。
留言管理对留言信息进行管理可以修改和删除留言信息。
查看日志可以查看系统的详细日志信息。
文档截图 前台用户截图 后台管理员截图 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 {Autowiredprivate NewsCategoryService newsCategoryService;Autowiredprivate NewsService newsService;/*** 新闻列表页面* param model* return*/RequestMapping(value/list,methodRequestMethod.GET)public ModelAndView list(ModelAndView model){model.addObject(newsCategoryList, newsCategoryService.findAll());model.setViewName(news/list);return model;}/*** 新闻添加页面* param model* return*/RequestMapping(value/add,methodRequestMethod.GET)public ModelAndView add(ModelAndView model){model.addObject(newsCategoryList, newsCategoryService.findAll());model.setViewName(news/add);return model;}/*** 新闻添加* param news* return*/RequestMapping(value/add,methodRequestMethod.POST)ResponseBodypublic MapString,String add(News news){MapString,String ret new HashMapString, String();if(news null){ret.put(type, error);ret.put(msg, 请填写正确的信息);return ret;}if(StringUtils.isEmpty(news.getTitle())){ret.put(type, error);ret.put(msg, 新闻标题不能为空);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, 新闻摘要不能为空);return ret;}if(StringUtils.isEmpty(news.getTags())){ret.put(type, error);ret.put(msg, 新闻标签不能为空);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, 新闻内容不能为空);return ret;}news.setCreateTime(new Date());if(newsService.add(news) 0){ret.put(type, error);ret.put(msg, 添加失败请联系管理员);return ret;}ret.put(type, success);ret.put(msg, 添加成功);return ret;}/*** 新闻编辑页面* param model* return*/RequestMapping(value/edit,methodRequestMethod.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,methodRequestMethod.POST)ResponseBodypublic MapString,String edit(News news){MapString,String ret new HashMapString, String();if(news null){ret.put(type, error);ret.put(msg, 请填写正确的信息);return ret;}if(StringUtils.isEmpty(news.getTitle())){ret.put(type, error);ret.put(msg, 新闻标题不能为空);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, 新闻摘要不能为空);return ret;}if(StringUtils.isEmpty(news.getTags())){ret.put(type, error);ret.put(msg, 新闻标签不能为空);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, 新闻内容不能为空);return ret;}if(newsService.edit(news) 0){ret.put(type, error);ret.put(msg, 修改失败请联系管理员);return ret;}ret.put(type, success);ret.put(msg, 修改成功);return ret;}/*** 删除新闻* param id* return*/RequestMapping(value/delete,methodRequestMethod.POST)ResponseBodypublic MapString,String delete(Long id){MapString,String ret new HashMapString, String();if(id null){ret.put(type, error);ret.put(msg, 请选择要删除的信息);return ret;}try{if(newsService.delete(id) 0){ret.put(type, error);ret.put(msg, 删除失败请联系管理员);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,methodRequestMethod.POST)ResponseBodypublic MapString,Object getList(RequestParam(nametitle,requiredfalse,defaultValue) String title,RequestParam(nameauthor,requiredfalse,defaultValue) String author,RequestParam(namecategoryId,requiredfalse) Long categoryId,Page page){MapString,Object ret new HashMapString, Object();MapString,Object queryMap new HashMapString, 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,methodRequestMethod.POST)ResponseBodypublic MapString, String uploadPhoto(MultipartFile photo,HttpServletRequest request){MapString, String ret new HashMapString, 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()){//若不存在改目录则创建目录savePathFile.mkdir();}String filename new Date().getTime().suffix;try {//将文件保存至指定目录photo.transferTo(new File(savePathfilename));}catch (Exception e) {// TODO Auto-generated catch blockret.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;}
}