——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SpringBoot前台后台玩具商城系统(java+ssm+springboot+html+thymeleaf+maven+mysql)
一、项目简述本系统主要实现的功能有: 网上商城系统,前台+后台管理,用户注册,登录,商品展示,分组展示,搜索,收货地址管理,购物车管理,添加,购买,个人信息修改。订单查询等等,后台商品管理,分类管理,库存管理,订单管理,用户管理,信息修改等等。
二、项目运行 环境配置:
Jdk1.8 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Springboot+ SpringMVC + MyBatis + Html+ JavaScript + JQuery + Ajax + maven等等
——————————CodeStart——————————
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
| @Controller @RequestMapping("file") public class ImgControllerNoCos { public static final String FILE_PATH = "D:\\immersive_shopping\\"; static { File file = new File(FILE_PATH); file.mkdirs(); }
@PostMapping("/upload") @ResponseBody public Result uplaod(@RequestParam("file") MultipartFile file)throws Exception { String fileName = IdWorker.get32UUID() +file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); try { File file1 = new File(FILE_PATH+"\\"+fileName); file1.createNewFile(); OutputStream os=new FileOutputStream(file1.getPath()); InputStream is=file.getInputStream(); int temp; while((temp=is.read())!=(-1)) { os.write(temp); } os.flush(); os.close(); is.close(); InputStream inputStream = new FileInputStream(file1.getPath()); byte[] b = new byte[inputStream.available()]; inputStream.read(b);
|
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
| * @return * @throws Exception */ @RequestMapping("shouhuo.do") @ResponseBody public Result shouhuo(String id) throws Exception { OrderEntity orderEntity = orderService.selectById(id); orderEntity.setStatus(3); orderService.updateById(orderEntity); return Result.success("欢迎下次光临"); }
@RequestMapping("tuihuo.do") @ResponseBody public Result tuihuo(String id) throws Exception { orderService.deleteById(id); return Result.success("下次再买 - -"); }
@RequestMapping("list.do") public String list(Model model) throws Exception { CustomerEntity userEntity = Contants.getCustomer(); EntityWrapper wrapper = new EntityWrapper(); wrapper.eq(OrderTable.CUSTOMER_ID, userEntity.getId()).orderBy("time", false); List<OrderEntity> orders = orderService.selectList(wrapper); if (orders != null) { for (OrderEntity order : orders) { wrapper = new EntityWrapper(); wrapper.eq("order_id", order.getId()); List<OrderShopEntity> orderShops = orderShopService.selectList(wrapper); order.setOrderShops(orderShops); } } model.addAttribute("orders", orders); return "mobile/orderList"; }
|
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
| model.addAttribute("gats",gats); CustomerEntity customerEntity = customerService.selectById(userEntity.getId()); model.addAttribute("integral",customerEntity.getIntegral()); List<CustomerAddressEntity> customerAddressEntities = customerAddressService.selectList(entityWrapper); model.addAttribute("customerAddressEntities",customerAddressEntities); return "mobile/gat"; }
@RequestMapping("delete.do") @ResponseBody public Result delete(String id)throws Exception{ CustomerEntity userEntity = Contants.getCustomer(); if(StringUtils.isEmpty(id)){ EntityWrapper entityWrapper = new EntityWrapper(); entityWrapper.eq(ShoppingGatTable.CUSTOMER_ID,userEntity.getId()); shoppingGatService.delete(entityWrapper); }else{ shoppingGatService.deleteById(id); } return Result.success("成功"); }
@RequestMapping("add.do") @ResponseBody public Result add(String shopId,Integer num,String customerId)throws Exception{ CustomerEntity userEntity = Contants.getCustomer(); EntityWrapper entityWrapper = new EntityWrapper(); entityWrapper.eq(ShoppingGatTable.CUSTOMER_ID,userEntity.getId()) .eq(ShoppingGatTable.SHOP_ID,shopId); ShoppingGatEntity gatEntity = shoppingGatService.selectOne(entityWrapper); if(gatEntity!=null){ gatEntity.setNum(gatEntity.getNum()+num); shoppingGatService.updateById(gatEntity); }else{ gatEntity = new ShoppingGatEntity(); gatEntity.setId(IdWorker.get32UUID());
|
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
| } package com.wsy.controller.common;
@Controller @RequestMapping("fileNoCos") public class ImgController {
|
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
| @Autowired private ShopService shopService;
@Autowired private OrderShopService orderShopService;
@Autowired private OrderService orderService;
@Autowired private CustomerAddressService customerAddressService;
@Autowired private OrderShopDao orderShopDao; @Autowired private RoyaltyService royaltyService; @Autowired @Qualifier("alipayService") private AlipayService alipayService; @Autowired public Jedis jedis;
@RequestMapping("comment.do") public String comment(String id, Model model) throws Exception { OrderShopEntity orderShopEntity = orderShopService.selectById(id); model.addAttribute("entity", orderShopEntity); return "mobile/comment"; }
@RequestMapping("commentData.do") @ResponseBody public Result commentData(OrderShopEntity orderShopEntity) throws Exception { String content = orderShopEntity.getContent(); content = content.replace("操", "*"); content = content.replace("sb", "**"); content = content.replace("傻", "*"); orderShopEntity.setContent(content); orderShopService.updateById(orderShopEntity); orderShopEntity = orderShopService.selectById(orderShopEntity.getId()); Double num = orderShopDao.num(orderShopEntity.getShopId());
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=011422312105200hj
https://javayms.pages.dev?id=011422312105200hj