Java实战项目之在线点餐系统的实现流程
短信预约 -IT技能 免费直播动态提醒
一、项目简述
功能包括: 前台实现:用户浏览菜单、菜品分类筛选、查看菜单详 情、添加购物车、购物车结算、会员券、个人订单查询等 等。 后台实现:餐系管理、菜品管理、订单管理、系统管理、 酉己备员管理等。 系统分为:高或管理员、顾客、厨师、配送员等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
后台用户信息控制层:
@RestController
@RequestMapping("/backstage/user")
public class UserManageController {
@Autowired
private UserService userService;
@RequestMapping("/list")
public String findUserListByPage(UserVo vo){
LayuiTableDataResult userListByPage = userService.findUserListByPage(vo);
return JSON.toJSONString(userListByPage);
}
@RequestMapping("/add")
public String addUser(UserVo vo){
Map<String, Object> map = userService.addUser(vo);
return JSON.toJSONString(map);
}
@RequestMapping("/modify")
public String modifyUserBackstage(UserVo vo){
Map<String, Object> map = userService.modifyUserBackstage(vo);
return JSON.toJSONString(map);
}
@RequestMapping("/resetPassword")
public String resetPassword(Long userId){
Map<String, Object> map = userService.resetPassword(userId);
return JSON.toJSONString(map);
}
@RequestMapping("/findRole")
public String findRoleListByUserId(Long userId){
LayuiTableDataResult roleListByUserId = userService.findRoleListByUserId(userId);
return JSON.toJSONString(roleListByUserId);
}
@RequestMapping("/grantRole")
public String grantRole(String roleIds, Long userId){
Map<String, Object> map = userService.grantRole(roleIds, userId);
return JSON.toJSONString(map);
}
@RequestMapping("/delete")
public String deleteUser(Long userId){
Map<String, Object> map = userService.deleteUser(userId);
return JSON.toJSONString(map);
}
}
用户地址管理控制器:
@RestController
@RequestMapping("/address")
public class AddressController {
@Autowired
private AddressService addressService;
@RequestMapping("/list")
public String findAddressListByUserId(AddressVo vo, HttpSession session){
vo.setUserId(((UserEntity) session.getAttribute("userLogin")).getUserId());
LayuiTableDataResult addressListByUserId = addressService.findAddressListByUserId(vo);
return JSON.toJSONString(addressListByUserId);
}
@RequestMapping("/listByUser")
public String findAddressListByUser(HttpSession session){
Map<String, Object> map = addressService.findAddressListByUser(session);
return JSON.toJSONString(map);
}
@RequestMapping("/add")
public String addAddress(AddressVo vo, HttpSession session){
Map<String, Object> map = addressService.addAddress(vo, session);
return JSON.toJSONString(map);
}
@RequestMapping("/modify")
public String modifyAddress(AddressVo vo, HttpSession session){
Map<String, Object> map = addressService.modifyAddress(vo, session);
return JSON.toJSONString(map);
}
@RequestMapping("/delete")
public String deleteAddress(Long addressId){
Map<String, Object> map = addressService.deleteAddress(addressId);
return JSON.toJSONString(map);
}
}
前台用户信息控制层:
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@ResponseBody
@RequestMapping("/login")
public String login(String username, String password, HttpSession session){
Map<String, Object> map = userService.login(username, password, session);
return JSON.toJSONString(map);
}
@RequestMapping("/exit")
public String exit(HttpSession session){
userService.exit(session);
return "redirect:/login.html";
}
@ResponseBody
@RequestMapping("/checkUsername")
public String checkUsername(String username){
Map<String, Object> map = userService.checkUsername(username);
return JSON.toJSONString(map);
}
@ResponseBody
@RequestMapping("/register")
public String register(UserVo vo, HttpSession session){
Map<String, Object> register = userService.register(vo, session);
return JSON.toJSONString(register);
}
@ResponseBody
@RequestMapping("/findUserByUserId")
public String findUserByUserId(HttpSession session){
Long userId = ((UserEntity) session.getAttribute(SystemConstant.USERLOGIN)).getUserId();
Map<String, Object> userByUserId = userService.findUserByUserId(userId);
return JSON.toJSONString(userByUserId);
}
@ResponseBody
@RequestMapping("/modifyUserInfo")
public String modifyUserInfo(UserVo vo, HttpSession session){
Map<String, Object> map = userService.modifyUserReception(vo, session);
return JSON.toJSONString(map);
}
@ResponseBody
@RequestMapping("/modifyPassword")
public String modifyPassword(String oldPassword, String newPassword, HttpSession session){
Map<String, Object> map = userService.modifyPassword(oldPassword, newPassword, session);
return JSON.toJSONString(map);
}
}
优惠券商城控制器:
@RestController
@RequestMapping("/reception/ticket")
public class TicketController {
@Autowired
private TicketService ticketService;
@RequestMapping("/findAll")
public String findAllTicketOnShelf(){
Map<String, Object> map = ticketService.findAllTicketOnShelf();
return JSON.toJSONString(map);
}
@RequestMapping("/receiveTicket")
public String receiveTicket(Long ticketTypeId, HttpSession session){
Map<String, Object> map = ticketService.receiveTicket(ticketTypeId, session);
return JSON.toJSONString(map);
}
@RequestMapping("/findByUser")
public String findByUser(HttpSession session){
Map<String, Object> map = ticketService.findByUser(session);
return JSON.toJSONString(map);
}
@RequestMapping("/findByUserUnuse")
public String findByUserUnuse(HttpSession session){
Map<String, Object> map = ticketService.findByUserUnuse(session);
return JSON.toJSONString(map);
}
@RequestMapping("/findTicketById")
public String findTicketById(Long ticketId){
Map<String, Object> map = ticketService.findTicketById(ticketId);
return JSON.toJSONString(map);
}
}
购物车控制器:
@RestController
@RequestMapping("/reception/shopcart")
public class ShopcartController {
@Autowired
private ShopcartService shopcartService;
@RequestMapping("/add")
public String addShopcart(Long skuId, Integer numCount, HttpSession session){
Map<String, Object> map = shopcartService.addShopcart(skuId, numCount, session);
return JSON.toJSONString(map);
}
@RequestMapping("/findByUserId")
public String findAllShopcartByUserId(HttpSession session){
Map<String, Object> map = shopcartService.findAllShopcartByUserId(session);
return JSON.toJSONString(map);
}
@RequestMapping("/addNumCountOne")
public String addNumCountOne(Long shopcartId){
Map<String, Object> map = shopcartService.addNumCountOne(shopcartId);
return JSON.toJSONString(map);
}
@RequestMapping("/reduceNumCountOne")
public String reduceNumCountOne(Long shopcartId){
Map<String, Object> map = shopcartService.reduceNumCountOne(shopcartId);
return JSON.toJSONString(map);
}
@RequestMapping("/delete")
public String deleteShopcart(Long shopcartId){
Map<String, Object> map = shopcartService.deleteShopcart(shopcartId);
return JSON.toJSONString(map);
}
}
到此这篇关于Java 实战项目之在线点餐系统的实现流程的文章就介绍到这了,更多相关Java 在线点餐系统内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341