资源简介

本系统采用JSP+Spring+Mybatis+mysql设计,功能模块完善,前台可以注册登录浏览商品,添加购物车付款,订单管理,个人中心,后台有完善的功能可以对商品和用户订单数据进行管理

资源截图

代码片段和文件信息

package com.controller;

import java.util.objects;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.entity.Admins;
import com.entity.Goods;
import com.entity.Tops;
import com.entity.Types;
import com.entity.Users;
import com.service.AdminService;
import com.service.GoodService;
import com.service.OrderService;
import com.service.TopService;
import com.service.TypeService;
import com.service.UserService;
import com.util.PageUtil;
import com.util.SafeUtil;
import com.util.UploadUtil;

/**
 * 后台相关接口
 */
@Controller
@RequestMapping(“/admin“)
public class AdminController {

private static final int rows = 10;

@Autowired
private AdminService adminService;
@Autowired
private OrderService orderService;
@Autowired
private UserService userService;
@Autowired
private GoodService goodService;
@Autowired
private TopService topService;
@Autowired
private TypeService typeService;

/**
 * 管理员登录
 * @return
 */
@RequestMapping(“/login“)
public String login(Admins admin HttpServletRequest request HttpSession session) {
if (adminService.checkUser(admin.getUsername() admin.getPassword())) {
session.setAttribute(“username“ admin.getUsername());
return “redirect:index“;
}
request.setAttribute(“msg“ “用户名或密码错误!“);
return “/admin/login.jsp“;
}

/**
 * 退出
 * @return
 */
@RequestMapping(“/logout“)
public String logout(HttpSession session) {
session.removeAttribute(“admin“);
return “/admin/login.jsp“;
}

/**
 * 后台首页
 * @return
 */
@RequestMapping(“/index“)
public String index(HttpServletRequest request) {
request.setAttribute(“msg“ “恭喜你! 登录成功了“);
return “/admin/index.jsp“;
}

/**
 * 订单列表
 * 
 * @return
 */
@RequestMapping(“/orderList“)
public String orderList(@RequestParam(required=false defaultValue=“0“)byte status HttpServletRequest request
@RequestParam(required=false defaultValue=“1“) int page) {
request.setAttribute(“flag“ 1);
request.setAttribute(“status“ status);
request.setAttribute(“orderList“ orderService.getList(status page rows));
request.setAttribute(“pageTool“ PageUtil.getPageTool(request orderService.getTotal(status) page rows));
return “/admin/order_list.jsp“;
}

/**
 * 订单发货
 * 
 * @return
 */
@RequestMapping(“/orderDispose“)
public String orderDispose(int id byte status
@RequestParam(required=false defaultValue=“1“) int page) {
orderService.dispose(id);
return “redirect:orderList?flag=1&status=“+status+“&page=“+page;
}

/**
 * 订单完成
 * 
 * @return
 */
@RequestMapping(“/orderFinish“)
public String orderFinish(int id byte status
@RequestP

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-30 21:07  Shop\
     文件         734  2018-12-27 18:40  Shop\.classpath
     文件        1037  2018-12-26 19:26  Shop\.project
     目录           0  2018-12-30 21:06  Shop\.settings\
     文件         503  2012-12-09 15:44  Shop\.settings\.jsdtscope
     文件          57  2017-05-08 18:08  Shop\.settings\org.eclipse.core.resources.prefs
     文件         364  2012-12-09 15:44  Shop\.settings\org.eclipse.jdt.core.prefs
     文件         464  2018-12-26 19:26  Shop\.settings\org.eclipse.wst.common.component
     文件         345  2015-04-30 09:44  Shop\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2012-12-09 15:44  Shop\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2012-12-09 15:44  Shop\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-12-30 21:06  Shop\build\
     目录           0  2018-12-30 21:06  Shop\build\classes\
     目录           0  2018-12-30 21:06  Shop\build\classes\com\
     目录           0  2018-12-30 21:06  Shop\build\classes\com\controller\
     文件       13882  2018-12-27 18:39  Shop\build\classes\com\controller\AdminController.class
     文件        1617  2018-12-27 18:39  Shop\build\classes\com\controller\AdminInterceptor.class
     文件        3592  2018-12-27 18:39  Shop\build\classes\com\controller\IndexController.class
     文件        9343  2018-12-27 18:39  Shop\build\classes\com\controller\UserController.class
     目录           0  2018-12-30 21:06  Shop\build\classes\com\dao\
     文件        1175  2018-12-27 18:39  Shop\build\classes\com\dao\AdminsDao.class
     文件        1630  2018-12-27 18:39  Shop\build\classes\com\dao\GoodsDao.class
     文件         583  2018-12-27 18:39  Shop\build\classes\com\dao\ItemsDao.class
     文件        1392  2018-12-27 18:39  Shop\build\classes\com\dao\OrdersDao.class
     文件        1317  2018-12-27 18:39  Shop\build\classes\com\dao\TopsDao.class
     文件         568  2018-12-27 18:39  Shop\build\classes\com\dao\TypesDao.class
     文件        1164  2018-12-27 18:39  Shop\build\classes\com\dao\UsersDao.class
     目录           0  2018-12-30 21:06  Shop\build\classes\com\entity\
     文件        1310  2018-12-27 18:39  Shop\build\classes\com\entity\Admins.class
     文件        3177  2018-12-27 18:39  Shop\build\classes\com\entity\Goods.class
     文件        1713  2018-12-27 18:39  Shop\build\classes\com\entity\Items.class
............此处省略207个文件信息

评论

共有 条评论