Python 官方文档:入门教程 => 点击学习
一、项目简述 功能包括: 在线点餐,评论,购物车,下单,支付,管理员,店家多 商家管理,后台评论管理,订单管理,商品管理等等。 二、项目运行 环境配置: jdk1.8 + Tomca
功能包括: 在线点餐,评论,购物车,下单,支付,管理员,店家多 商家管理,后台评论管理,订单管理,商品管理等等。
环境配置: jdk1.8 + Tomcat8.5 + Mysql + Eclispe (IntelliJ idea,Eclispe,MyEclispe,Sts 都支持) 项目技术: jsP +spring + springMVC + mybatis + html+ CSS + javascript + Jquery + ajax + layui+ Maven等等。
@Controller
@RequestMapping("/customer")
public class CustomerController {
@Autowired
private CustomerService customerService;
@RequestMapping("/list")
public String list(Model model, Page page)
{
PageHelper.offsetPage(page.getStart(),page.getCount());//分页查询
List<Customer> list= customerService.list();
int total = (int) new PageInfo<>(list).getTotal();//总条数
page.setTotal(total);
model.addAttribute("list",list);
model.addAttribute("totals",total);
return "cstpage/cst-list";
}
@RequestMapping("/shezhihuiyuan")
@ResponseBody
public String shezhihuiyuan(int id){
customerService.shezhihuiyuan(id);
return "success";
}
@RequestMapping("/del")
public String del(int id)
{
customerService.del(id);
return "redirect:list";
}
}
@Controller
@RequestMapping("")
public class LoginController {
@Autowired
UserService userService;
@RequestMapping(value="/login",method=RequestMethod.POST)
public String login(Model model, String name, String passWord){//throws ParseException
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken token = new UsernamePasswordToken(name,password);
try {
subject.login(token);
User us = userService.getByName(name);
String lastLoginTime = "";
if(us!=null){
SimpleDateFORMat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//上次时间
Date time = us.getLasttime();
lastLoginTime = sdf.format(time);
//新时间
String format = sdf.format(new Date());
//string转date 不处理时间格式会不理想
ParsePosition pos = new ParsePosition(0);
Date strtodate = sdf.parse(format, pos);
us.setLasttime(strtodate);
userService.update(us);
}
if (us.getStatus()==1){
Session session=subject.getSession();
session.setAttribute("subject", subject);
session.setAttribute("lastLoginTime",lastLoginTime);
return "redirect:index";
}else {
model.addAttribute("error", "账号已被停用!");
return "/login";
}
} catch (AuthenticationException e) {
model.addAttribute("error", "验证失败!");
return "/login";
}
}
}
@Controller
@RequestMapping("/review")
public class ReviewController {
@Autowired
private ReviewService reviewService;
@Autowired
private ProductService productService;
@RequestMapping("/list")
public String list(Model model, Page page){
PageHelper.offsetPage(page.getStart(),page.getCount());//分页查询
List<Review> list= reviewService.list();
int total = (int) new PageInfo<>(list).getTotal();//总条数
page.setTotal(total);
model.addAttribute("totals",list.size());
model.addAttribute("list",list);
return "pinglunpage/pinglun";
}
@RequestMapping("/del")
public String del(int id){
reviewService.del(id);
return "redirect:list";
}
}
@Controller
@RequestMapping("/config")
public class PermissionController {
@Autowired
PermissionService permissionService;
@RequestMapping("/adminPerAddUI")
public String addUI(){
return "syspage/admin-permission-add";
}
@RequestMapping("/listPermission")
public String list(Model model, Page page){
PageHelper.offsetPage(page.getStart(),page.getCount());//分页查询
List<Permission> ps= permissionService.list();
int total = (int) new PageInfo<>(ps).getTotal();//总条数
page.setTotal(total);
model.addAttribute("ps", ps);
model.addAttribute("perCount",ps.size());
return "syspage/admin-permission";
}
@RequestMapping("/editPermission")
public String list(Model model,long id){
Permission permission =permissionService.get(id);
model.addAttribute("permission", permission);
return "syspage/admin-permission-edit";
}
@RequestMapping("/updatePermission")
public String update(Permission permission){
permissionService.update(permission);
return "redirect:listPermission";
}
@RequestMapping("/addPermission")
public String list(Model model,Permission permission){
permissionService.add(permission);
return "redirect:listPermission";
}
@RequestMapping("/deletePermission")
public String delete(Model model,long id){
permissionService.delete(id);
return "redirect:listPermission";
}
}
以上就是Java 实战项目之在线点餐系统的实现流程的详细内容,更多关于Java 在线点餐系统的资料请关注编程网其它相关文章!
--结束END--
本文标题: Java 实战项目之在线点餐系统的实现流程
本文链接: https://lsjlt.com/news/157365.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0