当前位置:   article > 正文

基于javaweb+mysql的ssm校园快递物流管理系统(java+jsp+ssm+javabean+mysql+tomcat)_基于javaweb的配送系统

基于javaweb的配送系统

基于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)

	 * @return
	 */
	@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";
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
	
	/**
	 * 添加信息保存
	 */
	@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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
		
		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";
	}
	
		// --------------------------------------- 华丽分割线------------------------------------------------------//

	/**
	 * 分页查询 返回list json(通过对象)
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/findByObj.json", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
	@ResponseBody
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
	}

	public void setOrderDao(OrderDaoImpl orderDao) {
		this.orderDao = orderDao;
	}

	// --------------------------------------- 华丽分割线 ------------------------------//

	/**
	 * 分页查询 返回list对象(通过对象)
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/list.action")
	public String list(Order order, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
		Pager<Order> pagers = orderDao.findByEntity(order);
		model.addAttribute("pagers", pagers);
		return "admin/order/order_list";
	}

	/**
	 * 跳转添加页面
	 */
	@RequestMapping(value = "/add.action")
	public String add(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
		return "admin/order/order_add";
	}

	/**
	 * 跳至修改页面
	 * 
	 * @return
	 */
	@RequestMapping(value = "/edit.action")
	public String edit(Integer id, Model model) {
		Order bean = orderDao.load(id);
		model.addAttribute("bean", bean);
		return "admin/order/order_edit";
	}
	
	/**
	 * 添加信息保存
	 */
	@RequestMapping(value = "/save.action")
	public String save(Order order, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
		orderDao.insert(order);
		
		model.addAttribute("msg", "订单创建成功");
		
		return "common/succ";
	}
	
	
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
	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";
	}
	
		// --------------------------------------- 华丽分割线------------------------------------------------------//

	/**
	 * 分页查询 返回list json(通过对象)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

@Controller
@RequestMapping(value = "/user")
public class UserController extends BaseController{
	/**
	 * 依赖注入 start dao/===
	 */
	@Autowired
	private UserDaoImpl userDao;

	public UserDaoImpl getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDaoImpl userDao) {
		this.userDao = userDao;
	}

	// --------------------------------------- 华丽分割线 ------------------------------//

	/**
	 * 分页查询 返回list对象(通过对象)
	 * @param request
	 * @param response
	 * @return
	 */
	@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")
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
    }

    // --------------------------------------- 华丽分割线------------------------------------------------------//

    /**
     * 分页查询 返回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")
public class UserController extends BaseController{
	/**
	 * 依赖注入 start dao/===
	 */
	@Autowired
	private UserDaoImpl userDao;

	public UserDaoImpl getUserDao() {
		return userDao;
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
		// 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();
		jsonObject.put("pagers", pagers);
		jsonObject.put("obj", gonggao);
		return jsonObject.toString();
	}

	// --------------------------------------- 华丽分割线------------------------------	// 
}

@Controller
@RequestMapping(value = "/yuangong")
public class YuangongController extends BaseController{
	/**
	 * 依赖注入 start dao/===
	 */
	@Autowired
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
	
	/**
	 * 添加信息保存
	 */
	@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();
		jsonObject.put("pagers", pagers);
		jsonObject.put("obj", gonggao);
		return jsonObject.toString();
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
			{
				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";
				}
			}
			if (userType == 2)//用户登录
			{
				User user = new User();
				user.setLoginname(userName);
				user.setPwd(userPw);
				Pager<User> pagers = userDao.findByEntity(user);
				if (pagers.getTotal() == 0) {
					request.setAttribute("msg", "用户名或者密码错误!");
					return "login";
				} else {
					user = (User) pagers.getDatas().get(0);
					session.setAttribute("userType", 2);
					session.setAttribute("user", user);
					return "admin/index";
				}
			}
			return "admin/index";
	}
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
	/**
	 * 添加信息保存
	 */
	@RequestMapping(value = "/save.action")
	public String save(Order order, Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
		orderDao.insert(order);
		
		model.addAttribute("msg", "订单创建成功");
		
		return "common/succ";
	}
	
	
	/**
	 * 保存修改信息
	 */
	@RequestMapping(value = "/update.action")
	public String update(Order order, Model model, HttpServletRequest request, HttpServletResponse response) {
		orderDao.update(order);
		model.addAttribute("msg", "订单修改成功");
		return "common/succ";
	}

	/**
	 * 删除通过主键
	 * @return
	 */
	@RequestMapping(value = "/del.action")
	public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
		// 真正删除
		orderDao.deleteById(id);
		// 状态删除
		// Order order = orderDao.load(id);
		// load.setDel(1);
		// orderDao.update(load);
//		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) {
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
	@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);
		return "redirect:/yuangong/list.action";
	}

	/**
	 * 删除通过主键
	 * @return
	 */
	@RequestMapping(value = "/del.action")
	public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
		// 真正删除
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
	private YuangongDaoImpl yuangongDao;

	public YuangongDaoImpl getYuangongDao() {
		return yuangongDao;
	}

	public void setYuangongDao(YuangongDaoImpl yuangongDao) {
		this.yuangongDao = yuangongDao;
	}

	// --------------------------------------- 华丽分割线 ------------------------------//

	/**
	 * 分页查询 返回list对象(通过对象)
	 * @param request
	 * @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";
	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
     *
     * @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) {
        adminDao.insert(admin);
        return "redirect:/admin/list.action";
    }

    /**
     * @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";
    }

    /**
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
	}
	
	/**
	 * 跳至修改页面
	 * 
	 * @return
	 */
	@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";
	}
	
	
	/**
	 * 保存修改信息
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
		// 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
	/**
	 * 跳转添加页面
	 */
	@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);
		return "redirect:/yuangong/list.action";
	}

	/**
	 * 删除通过主键
	 * @return
	 */
	@RequestMapping(value = "/del.action")
	public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
		// 真正删除
		yuangongDao.deleteById(id);
		// 状态删除
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/155554
推荐阅读
相关标签
  

闽ICP备14008679号