基于javaweb的SpringBoot前台后台玩具商城系统(java+ssm+springboot+html+thymeleaf+maven+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

550023262402

570023262402

580023262402

590023262402

000023272402

010023272402

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

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();
}

/**
* 文件上传返回code为200
* @param file
* @return
* @throws Exception
*/
@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());
//获取输入流 CommonsMultipartFile 中可以直接得到文件的流
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("欢迎下次光临");
}

/**
* 退货收货
*
* @param id
* @return
* @throws Exception
*/
@RequestMapping("tuihuo.do")
@ResponseBody
public Result tuihuo(String id) throws Exception {
orderService.deleteById(id);
return Result.success("下次再买 - -");
}

/**
* @param model
* @return
* @throws Exception
*/
@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";
}


/**
* 删除
* @param id
* @return
* @throws Exception
*/
@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("成功");
}

/**
* 添加到购物车
* @param shopId
* @return
* @throws Exception
*/
@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;




/**
* Created by Wsy
*/
@Controller
@RequestMapping("fileNoCos")
public class ImgController {
// //secretId
// public static final String secretId = "";
// //secretKey
// public static final String secretKey = "";
// //COS桶的根路径
// public static final String BASEURL = "";
// //桶的名称
// public static final String BUCKETNAME = "";
// //桶的key(文件夹名称)
// public static final String KEY = "";
// //你的REGION
// public static final String REGION = "";
// /**
// * MultipartFile-->File
// * @param multipartFile
// * @return
// */
// private static File transferToFile(MultipartFile multipartFile) {
// File file = null;
// try {
// String originalFilename = multipartFile.getOriginalFilename();
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;

/**
* 评价界面
*
* @param id
* @return
* @throws Exception
*/
@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());


项目链接:
https://javayms.github.io?id=011422312105200hj
https://javayms.pages.dev?id=011422312105200hj