基于javaweb+mysql的ssm校园快递物流管理系统(java+jsp+ssm+javabean+mysql+tomcat)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
内容:源码+数据库脚本+论文
本系统采用SSM框架和MySQL数据库进行开发实现。
本系统实现了三大模块:
管理员模块具备快递人员管理、物流订单管理、取件发件管理以及系统其他配置功能;
用户模块具备发布代取件、送件信息管理、评价功能和查询订单功能等;
快递员模块具备物流订单管理功能和公告功能。
管理员
用户
快递员
技术框架
JavaBean JSP SSM(Spring SpringMVC MyBatis) MySQL Bootstrap JavaScript CSS
基于javaweb+mysql的SSM校园快递物流管理系统(java+jsp+ssm+javabean+mysql+tomcat)
* @param response
* @return
*/
@RequestMapping(value = "/list.action")
public String list(Yuangong yuangong, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<Yuangong> pagers = yuangongDao.findByEntity(yuangong);
model.addAttribute("pagers", pagers);
return "admin/yuangong/yuangong_list";
}
/**
* 跳转添加页面
*/
@RequestMapping(value = "/add.action")
public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
return "admin/yuangong/yuangong_add";
}
/**
* 跳至修改页面
*
* @return
*/
@RequestMapping(value = "/edit.action")
public String edit(Integer id, Model model) {
Yuangong bean = yuangongDao.load(id);
model.addAttribute("bean", bean);
return "admin/yuangong/yuangong_edit";
}
/**
* 添加信息保存
*/
@RequestMapping(value = "/save.action")
public String save(Yuangong yuangong, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
yuangongDao.insert(yuangong);
return "redirect:/yuangong/list.action";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Yuangong yuangong, Model model, HttpServletRequest request, HttpServletResponse response) {
yuangongDao.update(yuangong);
public String update1(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
Dqorder dqordertt = new Dqorder();
dqordertt.setYid(dqorder.getYid());
dqordertt.setYname(dqorder.getYname());
Pager<Dqorder> pagers = dqorderDao.findByEntity1(dqordertt);
if(pagers.getDatas().size() > 0){
model.addAttribute("msg", "用户评分太低不能接单");
return "common/succ";
}
dqorderDao.update(dqorder);
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
dqorderDao.update(dqorder);
// return "redirect:/dqorder/list.action";
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/del.action")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
// 真正删除
dqorderDao.deleteById(id);
// 状态删除
// Dqorder dqorder = dqorderDao.load(id);
// load.setDel(1);
// dqorderDao.update(load);
return "redirect:/dqorder/list.action";
/**
* 登陆接口
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/login.action")
public String list(@RequestParam String userName, @RequestParam String userPw, @RequestParam Integer userType, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
System.out.println("userType" + userType);
try {
Thread.sleep(700);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (userType == 0)//
{
Admin admin = new Admin();
admin.setUsername(userName);
admin.setUserpwd(userPw);
Pager<Admin> pagers = adminDao.findByEntity(admin);
if (pagers.getTotal() == 0) {
request.setAttribute("msg", "用户名或者密码错误!");
return "login";
} else {
admin = (Admin) pagers.getDatas().get(0);
session.setAttribute("userType", 0);
session.setAttribute("admin", admin);
return "admin/index";
}
}
if (userType == 1)//用户登录
{
Yuangong user = new Yuangong();
user.setLoginname(userName);
user.setPwd(userPw);
Pager<Yuangong> pagers = yuangongDao.findByEntity(user);
if (pagers.getTotal() == 0) {
request.setAttribute("msg", "用户名或者密码错误!");
return "login";
} else {
user = (Yuangong) pagers.getDatas().get(0);
session.setAttribute("userType", 1);
session.setAttribute("yuangong", user);
return "admin/index";
}
userDao.deleteById(id);
// 状态删除
// User user = userDao.load(id);
// load.setDel(1);
// userDao.update(load);
return "redirect:/user/list.action";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<User> pagers = userDao.findByEntity(user);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", user);
return jsonObject.toString();
}
// --------------------------------------- 华丽分割线------------------------------ //
}
@Controller
@RequestMapping(value = "/order")
*/
@RequestMapping(value = "/list.action")
public String list(User user, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<User> pagers = userDao.findByEntity(user);
model.addAttribute("pagers", pagers);
return "admin/user/user_list";
}
/**
* 跳转添加页面
*/
@RequestMapping(value = "/add.action")
public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
return "admin/user/user_add";
}
/**
* 跳至修改页面
*
* @return
*/
@RequestMapping(value = "/edit.action")
public String edit(Integer id, Model model) {
User bean = userDao.load(id);
model.addAttribute("bean", bean);
return "admin/user/user_edit";
}
/**
* 添加信息保存
*/
@RequestMapping(value = "/save.action")
public String save(User user, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
userDao.insert(user);
return "redirect:/user/list.action";
}
/**
* 添加信息保存
*/
@RequestMapping(value = "/reg.action")
public String reg(User user, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
userDao.insert(user);
return "/login";
}
// 真正删除
yuangongDao.deleteById(id);
// 状态删除
// Yuangong yuangong = yuangongDao.load(id);
// load.setDel(1);
// yuangongDao.update(load);
return "redirect:/yuangong/list.action";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(Yuangong yuangong, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<Yuangong> pagers = yuangongDao.findByEntity(yuangong);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", yuangong);
return jsonObject.toString();
}
}
public YuangongDaoImpl getYuangongDao() {
return yuangongDao;
}
public void setYuangongDao(YuangongDaoImpl yuangongDao) {
this.yuangongDao = yuangongDao;
}
@Autowired
private UserDaoImpl userDao;
public UserDaoImpl getUserDao() {
return userDao;
}
public void setUserDao(UserDaoImpl userDao) {
this.userDao = userDao;
}
/**
* 登陆接口
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/login.action")
public String list(@RequestParam String userName, @RequestParam String userPw, @RequestParam Integer userType, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
System.out.println("userType" + userType);
try {
Thread.sleep(700);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (userType == 0)//
{
Admin admin = new Admin();
admin.setUsername(userName);
admin.setUserpwd(userPw);
Pager<Admin> pagers = adminDao.findByEntity(admin);
if (pagers.getTotal() == 0) {
/**
* 分页查询 返回list json(通过对象)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(Admin admin, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<Admin> pagers = adminDao.findByEntity(admin);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", admin);
return jsonObject.toString();
}
}
@Controller
@RequestMapping(value = "/user")
/**
* @version 1.0
* @deprecated 管理员操作管理
*/
@Controller
@RequestMapping(value = "/admin")
public class AdminController extends BaseController {
/**
* 依赖注入 start dao/===
*/
@Autowired
private AdminDaoImpl adminDao;
public AdminDaoImpl getAdminDao() {
return adminDao;
}
public void setAdminDao(AdminDaoImpl adminDao) {
this.adminDao = adminDao;
}
// --------------------------------------- 华丽分割线 ------------------------------//
/**
* @param request
* @param response
/**
* @param request
* @param response
* @return
* @deprecated list()
*/
@RequestMapping(value = "/list.action")
public String list(Admin admin, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<Admin> pagers = adminDao.findByEntity(admin);
model.addAttribute("pagers", pagers);
return "admin/admin/admin_list";
}
/**
*
* @version 1.0
* @deprecated 跳转添加页面
*/
@RequestMapping(value = "/add.action")
public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
return "admin/admin/admin_add";
}
/**
* @return
* @version 1.0
* @deprecated 跳至修改页面
*/
@RequestMapping(value = "/edit.action")
public String edit(Integer id, Model model) {
Admin bean = adminDao.load(id);
model.addAttribute("bean", bean);
return "admin/admin/admin_edit";
}
/**
* @version 1.0
* @deprecated 添加信息保存
*/
@RequestMapping(value = "/save.action")
public String save(Admin admin, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
@RequestMapping(value = "/del.action")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
// 真正删除
userDao.deleteById(id);
// 状态删除
// User user = userDao.load(id);
// load.setDel(1);
// userDao.update(load);
return "redirect:/user/list.action";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<User> pagers = userDao.findByEntity(user);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", user);
return jsonObject.toString();
}
// --------------------------------------- 华丽分割线------------------------------ //
}
@Controller
@RequestMapping(value = "/order")
@RequestMapping(value = "/pingjia2.action")
public String pingjia2(Integer id, Model model) {
Dqorder bean = dqorderDao.load(id);
model.addAttribute("bean", bean);
return "admin/dqorder/dqorder_pingjia2";
}
/**
* 添加信息保存
*/
@RequestMapping(value = "/save.action")
public String save(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
dqorderDao.insert(dqorder);
model.addAttribute("msg", "订单创建成功");
return "common/succ";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update1.action")
public String update1(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
Dqorder dqordertt = new Dqorder();
dqordertt.setYid(dqorder.getYid());
dqordertt.setYname(dqorder.getYname());
Pager<Dqorder> pagers = dqorderDao.findByEntity1(dqordertt);
if(pagers.getDatas().size() > 0){
model.addAttribute("msg", "用户评分太低不能接单");
return "common/succ";
}
dqorderDao.update(dqorder);
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
dqorderDao.update(dqorder);
// return "redirect:/dqorder/list.action";
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 删除通过主键
// return "redirect:/order/list.action";
model.addAttribute("msg", "订单删除成功");
return "common/succ";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(Order order, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<Order> pagers = orderDao.findByEntity(order);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", order);
return jsonObject.toString();
}
// --------------------------------------- 华丽分割线------------------------------ //
}
@Controller
@RequestMapping(value = "/gonggao")
public class GonggaoController extends BaseController{
/**
* 依赖注入 start dao/===
*/
@Autowired
@Controller
@RequestMapping(value = "/gonggao")
public class GonggaoController extends BaseController{
/**
* 依赖注入 start dao/===
*/
@Autowired
private GonggaoDaoImpl gonggaoDao;
public GonggaoDaoImpl getGonggaoDao() {
return gonggaoDao;
}
public void setGonggaoDao(GonggaoDaoImpl gonggaoDao) {
this.gonggaoDao = gonggaoDao;
}
// --------------------------------------- 华丽分割线 ------------------------------//
/**
* 分页查询 返回list对象(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/list.action")
public String list(Gonggao gonggao, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<Gonggao> pagers = gonggaoDao.findByEntity(gonggao);
model.addAttribute("pagers", pagers);
return "admin/gonggao/gonggao_list";
}
/**
* 跳转添加页面
*/
@RequestMapping(value = "/add.action")
public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
return "admin/gonggao/gonggao_add";
}
/**
* 跳至修改页面
*
* @return
*/
@RequestMapping(value = "/edit.action")
public String edit(Integer id, Model model) {
Gonggao bean = gonggaoDao.load(id);
* 分页查询 返回list对象(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/list2.action")
public String list2(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<Dqorder> pagers = dqorderDao.findByEntity(dqorder);
model.addAttribute("pagers", pagers);
return "admin/dqorder/dqorder_list2";
}
/**
* 分页查询 返回list对象(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/list3.action")
public String list3(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
Pager<Dqorder> pagers = dqorderDao.findByEntity(dqorder);
model.addAttribute("pagers", pagers);
return "admin/dqorder/dqorder_list3";
}
/**
* 跳转添加页面
*/
@RequestMapping(value = "/add.action")
public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
return "admin/dqorder/dqorder_add";
}
/**
* 跳至修改页面
*
* @return
*/
@RequestMapping(value = "/edit.action")
public String edit(Integer id, Model model) {
Dqorder bean = dqorderDao.load(id);
model.addAttribute("bean", bean);
return "admin/dqorder/dqorder_edit";
}
/**
* 跳至修改页面
}
/**
* @version 1.0
* @deprecated 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Admin admin, Model model, HttpServletRequest request, HttpServletResponse response) {
adminDao.update(admin);
return "redirect:/admin/list.action";
}
/**
* @return
* @version 1.0
* @deprecated 删除通过主键
*/
@RequestMapping(value = "/del.action")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
Admin bean = adminDao.load(id);
if (!"admin".equals(bean.getUsername())) {
// 真正删除
adminDao.deleteById(id);
}
// 状态删除
// Admin admin = adminDao.load(id);
// load.setDel(1);
// adminDao.update(load);
return "redirect:/admin/list.action";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
*
* @param request
* @param response
Gonggao bean = gonggaoDao.load(id);
model.addAttribute("bean", bean);
return "admin/gonggao/gonggao_edit";
}
/**
* 添加信息保存
*/
@RequestMapping(value = "/save.action")
public String save(Gonggao gonggao, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
gonggaoDao.insert(gonggao);
return "redirect:/gonggao/list.action";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Gonggao gonggao, Model model, HttpServletRequest request, HttpServletResponse response) {
gonggaoDao.update(gonggao);
return "redirect:/gonggao/list.action";
}
/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/del.action")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
// 真正删除
gonggaoDao.deleteById(id);
// 状态删除
// Gonggao gonggao = gonggaoDao.load(id);
// load.setDel(1);
// gonggaoDao.update(load);
return "redirect:/gonggao/list.action";
}
// --------------------------------------- 华丽分割线------------------------------------------------------//
/**
* 分页查询 返回list json(通过对象)
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
@ResponseBody
public String findByObjByEntity(Gonggao gonggao, Model model, HttpServletRequest request, HttpServletResponse response) {
// 分页查询
Pager<Gonggao> pagers = gonggaoDao.findByEntity(gonggao);
JSONObject jsonObject = JsonUtil2.getJsonObject();
dqorderDao.insert(dqorder);
model.addAttribute("msg", "订单创建成功");
return "common/succ";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update1.action")
public String update1(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
Dqorder dqordertt = new Dqorder();
dqordertt.setYid(dqorder.getYid());
dqordertt.setYname(dqorder.getYname());
Pager<Dqorder> pagers = dqorderDao.findByEntity1(dqordertt);
if(pagers.getDatas().size() > 0){
model.addAttribute("msg", "用户评分太低不能接单");
return "common/succ";
}
dqorderDao.update(dqorder);
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 保存修改信息
*/
@RequestMapping(value = "/update.action")
public String update(Dqorder dqorder, Model model, HttpServletRequest request, HttpServletResponse response) {
dqorderDao.update(dqorder);
// return "redirect:/dqorder/list.action";
model.addAttribute("msg", "操作成功");
return "common/succ";
}
/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/del.action")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {