From 4c8e29840b92ecb7bc173dc46a0083ecccd29299 Mon Sep 17 00:00:00 2001 From: yj <1966540576@qq.com> Date: Sat, 21 Dec 2024 16:43:20 +0800 Subject: [PATCH] 12.21 --- .../src/main/resources/application.yml | 1 + .../system/controller/CommentController.java | 116 +++++++++++++ .../controller/CommodityController.java | 107 ++++++++++++ .../system/controller/FavoriteController.java | 116 +++++++++++++ .../system/controller/OrderController.java | 40 +++-- .../system/controller/PersonController.java | 5 +- .../java/com/ruoyi/system/domain/Comment.java | 97 +++++++++++ .../com/ruoyi/system/domain/Commodity.java | 153 ++++++++++++++++ .../com/ruoyi/system/domain/Favorite.java | 164 ++++++++++++++++++ .../java/com/ruoyi/system/domain/Order.java | 146 ++++++++++------ .../java/com/ruoyi/system/domain/Person.java | 97 +++++------ .../ruoyi/system/mapper/CommentMapper.java | 63 +++++++ .../ruoyi/system/mapper/CommodityMapper.java | 61 +++++++ .../ruoyi/system/mapper/FavoriteMapper.java | 63 +++++++ .../com/ruoyi/system/mapper/OrderMapper.java | 31 ++-- .../com/ruoyi/system/mapper/PersonMapper.java | 26 --- .../ruoyi/system/service/ICommentService.java | 63 +++++++ .../system/service/ICommodityService.java | 61 +++++++ .../system/service/IFavoriteService.java | 63 +++++++ .../ruoyi/system/service/IOrderService.java | 34 ++-- .../service/impl/CommentServiceImpl.java | 99 +++++++++++ .../service/impl/CommodityServiceImpl.java | 93 ++++++++++ .../service/impl/FavoriteServiceImpl.java | 98 +++++++++++ .../system/service/impl/OrderServiceImpl.java | 37 ++-- .../service/impl/PersonServiceImpl.java | 40 +---- .../resources/mapper/system/CommentMapper.xml | 81 +++++++++ .../mapper/system/CommodityMapper.xml | 91 ++++++++++ .../mapper/system/FavoriteMapper.xml | 84 +++++++++ .../resources/mapper/system/OrderMapper.xml | 87 +++++----- .../resources/mapper/system/PersonMapper.xml | 86 +++------ 30 files changed, 1965 insertions(+), 338 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/CommentController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/CommodityController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Comment.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Commodity.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommodityMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/ICommodityService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommodityServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/CommentMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/CommodityMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 1801235..6284da9 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -109,6 +109,7 @@ mybatis: # PageHelper分页插件 pagehelper: helperDialect: mysql + supportMethodsArguments: true params: count=countSql diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommentController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommentController.java new file mode 100644 index 0000000..921167e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommentController.java @@ -0,0 +1,116 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Comment; +import com.ruoyi.system.service.ICommentService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 评论信息Controller + * + * @author ruoyi + * @date 2024-12-21 + */ +@RestController +@RequestMapping("/system/comment") +public class CommentController extends BaseController +{ + @Autowired + private ICommentService commentService; + + /** + * 查询评论信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:comment:list')") + @GetMapping("/list") + public TableDataInfo list(Comment comment) + { + startPage(); + List list = commentService.selectCommentList(comment); + return getDataTable(list); + } + + /** + * 导出评论信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:comment:export')") + @Log(title = "评论信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Comment comment) + { + List list = commentService.selectCommentList(comment); + ExcelUtil util = new ExcelUtil(Comment.class); + util.exportExcel(response, list, "评论信息数据"); + } + + /** + * 获取评论信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:comment:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(commentService.selectCommentById(id)); + } + + /** + * 新增评论信息 + */ + @PreAuthorize("@ss.hasPermi('system:comment:add')") + @Log(title = "评论信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Comment comment) + { + return toAjax(commentService.insertComment(comment)); + } + + /** + * 修改评论信息 + */ + @PreAuthorize("@ss.hasPermi('system:comment:edit')") + @Log(title = "评论信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Comment comment) + { + return toAjax(commentService.updateComment(comment)); + } + + /** + * 删除评论信息 + */ + @PreAuthorize("@ss.hasPermi('system:comment:remove')") + @Log(title = "评论信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(commentService.deleteCommentByIds(ids)); + } + +// @PreAuthorize("@ss.hasPermi('system:comment:list2')") + @Anonymous + @GetMapping("/list2") + public TableDataInfo list2(Comment comment) + { + startPage(); + List list = commentService.selectCommentList2(comment); + return getDataTable(list); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommodityController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommodityController.java new file mode 100644 index 0000000..ef183d6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CommodityController.java @@ -0,0 +1,107 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Commodity; +import com.ruoyi.system.service.ICommodityService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 商品信息Controller + * + * @author ruoyi + * @date 2024-12-20 + */ +@RestController +@RequestMapping("/system/commodity") +public class CommodityController extends BaseController +{ + @Autowired + private ICommodityService commodityService; + + /** + * 查询商品信息列表 + */ +// @PreAuthorize("@ss.hasPermi('system:commodity:list')") + @Anonymous + @GetMapping("/list") + public TableDataInfo list(Commodity commodity) + { + startPage(); + List list = commodityService.selectCommodityList(commodity); + return getDataTable(list); + } + + /** + * 导出商品信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:commodity:export')") + @Log(title = "商品信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Commodity commodity) + { + List list = commodityService.selectCommodityList(commodity); + ExcelUtil util = new ExcelUtil(Commodity.class); + util.exportExcel(response, list, "商品信息数据"); + } + + /** + * 获取商品信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:commodity:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(commodityService.selectCommodityById(id)); + } + + /** + * 新增商品信息 + */ + @PreAuthorize("@ss.hasPermi('system:commodity:add')") + @Log(title = "商品信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Commodity commodity) + { + return toAjax(commodityService.insertCommodity(commodity)); + } + + /** + * 修改商品信息 + */ + @PreAuthorize("@ss.hasPermi('system:commodity:edit')") + @Log(title = "商品信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Commodity commodity) + { + return toAjax(commodityService.updateCommodity(commodity)); + } + + /** + * 删除商品信息 + */ + @PreAuthorize("@ss.hasPermi('system:commodity:remove')") + @Log(title = "商品信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(commodityService.deleteCommodityByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java new file mode 100644 index 0000000..902b806 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/FavoriteController.java @@ -0,0 +1,116 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Favorite; +import com.ruoyi.system.service.IFavoriteService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 收藏信息Controller + * + * @author ruoyi + * @date 2024-12-20 + */ +@RestController +@RequestMapping("/system/favorite") +public class FavoriteController extends BaseController +{ + @Autowired + private IFavoriteService favoriteService; + + /** + * 查询收藏信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:list')") + @GetMapping("/list") + public TableDataInfo list(Favorite favorite) + { + startPage(); + List list = favoriteService.selectFavoriteList(favorite); + return getDataTable(list); + } + + /** + * 导出收藏信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:export')") + @Log(title = "收藏信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Favorite favorite) + { + List list = favoriteService.selectFavoriteList(favorite); + ExcelUtil util = new ExcelUtil(Favorite.class); + util.exportExcel(response, list, "收藏信息数据"); + } + + /** + * 获取收藏信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(favoriteService.selectFavoriteById(id)); + } + + /** + * 新增收藏信息 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:add')") + @Log(title = "收藏信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Favorite favorite) + { + return toAjax(favoriteService.insertFavorite(favorite)); + } + + /** + * 修改收藏信息 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:edit')") + @Log(title = "收藏信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Favorite favorite) + { + return toAjax(favoriteService.updateFavorite(favorite)); + } + + /** + * 删除收藏信息 + */ + @PreAuthorize("@ss.hasPermi('system:favorite:remove')") + @Log(title = "收藏信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(favoriteService.deleteFavoriteByIds(ids)); + } + +// @PreAuthorize("@ss.hasPermi('system:favorite:list2')") + @Anonymous + @GetMapping("/list2") + public TableDataInfo list2(Favorite favorite) + { + startPage(); + List list = favoriteService.selectFavoriteList2(favorite); + return getDataTable(list); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java index 0c4a389..b29566d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java @@ -2,6 +2,8 @@ package com.ruoyi.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -22,10 +24,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** - * 订单Controller + * 订单信息Controller * * @author ruoyi - * @date 2024-12-18 + * @date 2024-12-20 */ @RestController @RequestMapping("/system/order") @@ -35,7 +37,7 @@ public class OrderController extends BaseController private IOrderService orderService; /** - * 查询订单列表 + * 查询订单信息列表 */ @PreAuthorize("@ss.hasPermi('system:order:list')") @GetMapping("/list") @@ -47,20 +49,20 @@ public class OrderController extends BaseController } /** - * 导出订单列表 + * 导出订单信息列表 */ @PreAuthorize("@ss.hasPermi('system:order:export')") - @Log(title = "订单", businessType = BusinessType.EXPORT) + @Log(title = "订单信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, Order order) { List list = orderService.selectOrderList(order); ExcelUtil util = new ExcelUtil(Order.class); - util.exportExcel(response, list, "订单数据"); + util.exportExcel(response, list, "订单信息数据"); } /** - * 获取订单详细信息 + * 获取订单信息详细信息 */ @PreAuthorize("@ss.hasPermi('system:order:query')") @GetMapping(value = "/{id}") @@ -70,10 +72,10 @@ public class OrderController extends BaseController } /** - * 新增订单 + * 新增订单信息 */ @PreAuthorize("@ss.hasPermi('system:order:add')") - @Log(title = "订单", businessType = BusinessType.INSERT) + @Log(title = "订单信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Order order) { @@ -81,10 +83,10 @@ public class OrderController extends BaseController } /** - * 修改订单 + * 修改订单信息 */ @PreAuthorize("@ss.hasPermi('system:order:edit')") - @Log(title = "订单", businessType = BusinessType.UPDATE) + @Log(title = "订单信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Order order) { @@ -92,21 +94,23 @@ public class OrderController extends BaseController } /** - * 删除订单 + * 删除订单信息 */ @PreAuthorize("@ss.hasPermi('system:order:remove')") - @Log(title = "订单", businessType = BusinessType.DELETE) + @Log(title = "订单信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(orderService.deleteOrderByIds(ids)); } - @PreAuthorize("@ss.hasPermi('system:order:edit')") - @Log(title = "订单", businessType = BusinessType.UPDATE) - @PutMapping("/updateStatus") - public AjaxResult updateStatus(@RequestBody Order order) +// @PreAuthorize("@ss.hasPermi('system:order:list2')") + @Anonymous + @GetMapping("/list2") + public TableDataInfo list2(Order order) { - return toAjax(orderService.updateOrder(order)); + startPage(); + List list = orderService.selectOrderList2(order); + return getDataTable(list); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java index 17706b4..c36be20 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PersonController.java @@ -2,6 +2,8 @@ package com.ruoyi.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -37,7 +39,8 @@ public class PersonController extends BaseController /** * 查询用户信息列表 */ - @PreAuthorize("@ss.hasPermi('system:person:list')") +// @PreAuthorize("@ss.hasPermi('system:person:list')") + @Anonymous @GetMapping("/list") public TableDataInfo list(Person person) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Comment.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Comment.java new file mode 100644 index 0000000..9bb5967 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Comment.java @@ -0,0 +1,97 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 评论信息对象 comment + * + * @author ruoyi + * @date 2024-12-21 + */ +public class Comment extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 用户id */ + @Excel(name = "用户id") + private Long personid; + + private String name; + + private String picture; + + /** 评论内容 */ + @Excel(name = "评论内容") + private String content; + + /** 评论时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "评论时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date time; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPersonid() { + return personid; + } + + public void setPersonid(Long personid) { + this.personid = personid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("personid", getPersonid()) + .append("content", getContent()) + .append("time", getTime()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Commodity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Commodity.java new file mode 100644 index 0000000..9c24134 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Commodity.java @@ -0,0 +1,153 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 商品信息对象 commodity + * + * @author ruoyi + * @date 2024-12-20 + */ +public class Commodity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 张三 */ + @Excel(name = "张三") + private String name; + + /** 卖家id */ + @Excel(name = "卖家id") + private Long sellerid; + + /** 价格 */ + @Excel(name = "价格") + private BigDecimal price; + + /** 分类 */ + @Excel(name = "分类") + private String classification; + + /** 描述 */ + @Excel(name = "描述") + private String description; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 状态 */ + @Excel(name = "状态") + private String state; + + /** 上架时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上架时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date time; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setSellerid(Long sellerid) + { + this.sellerid = sellerid; + } + + public Long getSellerid() + { + return sellerid; + } + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public BigDecimal getPrice() + { + return price; + } + public void setClassification(String classification) + { + this.classification = classification; + } + + public String getClassification() + { + return classification; + } + public void setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setState(String state) + { + this.state = state; + } + + public String getState() + { + return state; + } + public void setTime(Date time) + { + this.time = time; + } + + public Date getTime() + { + return time; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("sellerid", getSellerid()) + .append("price", getPrice()) + .append("classification", getClassification()) + .append("description", getDescription()) + .append("picture", getPicture()) + .append("state", getState()) + .append("time", getTime()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java new file mode 100644 index 0000000..57b73be --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Favorite.java @@ -0,0 +1,164 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 收藏信息对象 favorite + * + * @author ruoyi + * @date 2024-12-20 + */ +public class Favorite extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 用户id */ + @Excel(name = "用户id") + private Long personid; + + private String personname; + + private String personpicture; + + /** 商品id */ + @Excel(name = "商品id") + private Long commodityid; + + private String commodityname; + + private String commoditypicture; + + private Long sellerid; + + private BigDecimal price; + + private String classification; + + private String description; + + private String state; + + private Date time; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPersonid() { + return personid; + } + + public void setPersonid(Long personid) { + this.personid = personid; + } + + public String getPersonname() { + return personname; + } + + public void setPersonname(String personname) { + this.personname = personname; + } + + public String getPersonpicture() { + return personpicture; + } + + public void setPersonpicture(String personpicture) { + this.personpicture = personpicture; + } + + public Long getCommodityid() { + return commodityid; + } + + public void setCommodityid(Long commodityid) { + this.commodityid = commodityid; + } + + public String getCommodityname() { + return commodityname; + } + + public void setCommodityname(String commodityname) { + this.commodityname = commodityname; + } + + public String getCommoditypicture() { + return commoditypicture; + } + + public void setCommoditypicture(String commoditypicture) { + this.commoditypicture = commoditypicture; + } + + public Long getSellerid() { + return sellerid; + } + + public void setSellerid(Long sellerid) { + this.sellerid = sellerid; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("personid", getPersonid()) + .append("commodityid", getCommodityid()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java index 34af215..45448f5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java @@ -8,94 +8,134 @@ import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; /** - * 订单对象 order + * 订单信息对象 order * * @author ruoyi - * @date 2024-12-18 + * @date 2024-12-20 */ + public class Order extends BaseEntity { private static final long serialVersionUID = 1L; - private Person person; - private Shangpin shangpin; + /** id */ private Long id; /** 商品id */ @Excel(name = "商品id") - private Long shangpinid; + private Long commodityid; + private String commodityname; + + private String commoditypicture; + + private String price; /** 买家id */ @Excel(name = "买家id") - private Long personid; + private Long buyerid; - /** 购买日期 */ + private String buyername; + + private String buyerpicture; + + /** 购买时间 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "购买日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date purchasedate; + @Excel(name = "购买时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date time; - public Person getPerson() { - return person; + /** 状态 */ + @Excel(name = "状态") + private String status; + + public Long getId() { + return id; } - public Shangpin getShangpin() { - return shangpin; - } - - public void setPerson(Person person) { - this.person = person; - } - - public void setShangpin(Shangpin shangpin) { - this.shangpin = shangpin; - } - - - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { - return id; - } - public void setShangpinid(Long shangpinid) - { - this.shangpinid = shangpinid; + public Long getCommodityid() { + return commodityid; } - public Long getShangpinid() - { - return shangpinid; - } - public void setPersonid(Long personid) - { - this.personid = personid; + public void setCommodityid(Long commodityid) { + this.commodityid = commodityid; } - public Long getPersonid() - { - return personid; - } - public void setPurchasedate(Date purchasedate) - { - this.purchasedate = purchasedate; + public String getCommodityname() { + return commodityname; } - public Date getPurchasedate() - { - return purchasedate; + public void setCommodityname(String commodityname) { + this.commodityname = commodityname; + } + + public String getCommoditypicture() { + return commoditypicture; + } + + public void setCommoditypicture(String commoditypicture) { + this.commoditypicture = commoditypicture; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public Long getBuyerid() { + return buyerid; + } + + public void setBuyerid(Long buyerid) { + this.buyerid = buyerid; + } + + public String getBuyername() { + return buyername; + } + + public void setBuyername(String buyername) { + this.buyername = buyername; + } + + public String getBuyerpicture() { + return buyerpicture; + } + + public void setBuyerpicture(String buyerpicture) { + this.buyerpicture = buyerpicture; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) - .append("shangpinid", getShangpinid()) - .append("personid", getPersonid()) - .append("purchasedate", getPurchasedate()) + .append("commodityid", getCommodityid()) + .append("buyerid", getBuyerid()) + .append("time", getTime()) + .append("status", getStatus()) .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java index 9f49311..b823df1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Person.java @@ -1,6 +1,5 @@ package com.ruoyi.system.domain; -import java.util.List; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -19,36 +18,37 @@ public class Person extends BaseEntity /** id */ private Long id; + /** 张三 */ + @Excel(name = "张三") + private String name; + /** 图片 */ @Excel(name = "图片") - private String image; - - /** 昵称 */ - @Excel(name = "昵称") - private String name; + private String picture; /** 性别 */ @Excel(name = "性别") - private String xingbie; + private String gender; /** 年龄 */ @Excel(name = "年龄") private Long age; - /** 电话 */ - @Excel(name = "电话") + /** 手机号 */ + @Excel(name = "手机号") private String phone; - /** 学院 */ - @Excel(name = "学院") - private String xueyuan; + /** 密码 */ + @Excel(name = "密码") + private String password; + + /** 地址 */ + @Excel(name = "地址") + private String address; /** 专业 */ @Excel(name = "专业") - private String zhuanye; - - /** 用户地址信息 */ - private List
addressList; + private String major; public void setId(Long id) { @@ -59,15 +59,6 @@ public class Person extends BaseEntity { return id; } - public void setImage(String image) - { - this.image = image; - } - - public String getImage() - { - return image; - } public void setName(String name) { this.name = name; @@ -77,14 +68,23 @@ public class Person extends BaseEntity { return name; } - public void setXingbie(String xingbie) + public void setPicture(String picture) { - this.xingbie = xingbie; + this.picture = picture; } - public String getXingbie() + public String getPicture() { - return xingbie; + return picture; + } + public void setGender(String gender) + { + this.gender = gender; + } + + public String getGender() + { + return gender; } public void setAge(Long age) { @@ -104,47 +104,46 @@ public class Person extends BaseEntity { return phone; } - public void setXueyuan(String xueyuan) + public void setPassword(String password) { - this.xueyuan = xueyuan; + this.password = password; } - public String getXueyuan() + public String getPassword() { - return xueyuan; + return password; } - public void setZhuanye(String zhuanye) + public void setAddress(String address) { - this.zhuanye = zhuanye; + this.address = address; } - public String getZhuanye() + public String getAddress() { - return zhuanye; + return address; + } + public void setMajor(String major) + { + this.major = major; } - public List
getAddressList() + public String getMajor() { - return addressList; - } - - public void setAddressList(List
addressList) - { - this.addressList = addressList; + return major; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) - .append("image", getImage()) .append("name", getName()) - .append("xingbie", getXingbie()) + .append("picture", getPicture()) + .append("gender", getGender()) .append("age", getAge()) .append("phone", getPhone()) - .append("xueyuan", getXueyuan()) - .append("zhuanye", getZhuanye()) - .append("addressList", getAddressList()) + .append("password", getPassword()) + .append("address", getAddress()) + .append("major", getMajor()) .toString(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentMapper.java new file mode 100644 index 0000000..d43d03a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommentMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Comment; + +/** + * 评论信息Mapper接口 + * + * @author ruoyi + * @date 2024-12-21 + */ +public interface CommentMapper +{ + /** + * 查询评论信息 + * + * @param id 评论信息主键 + * @return 评论信息 + */ + public Comment selectCommentById(Long id); + + /** + * 查询评论信息列表 + * + * @param comment 评论信息 + * @return 评论信息集合 + */ + public List selectCommentList(Comment comment); + + /** + * 新增评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + public int insertComment(Comment comment); + + /** + * 修改评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + public int updateComment(Comment comment); + + /** + * 删除评论信息 + * + * @param id 评论信息主键 + * @return 结果 + */ + public int deleteCommentById(Long id); + + /** + * 批量删除评论信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCommentByIds(Long[] ids); + + public List selectCommentList2(Comment comment); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommodityMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommodityMapper.java new file mode 100644 index 0000000..f44df90 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CommodityMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Commodity; + +/** + * 商品信息Mapper接口 + * + * @author ruoyi + * @date 2024-12-20 + */ +public interface CommodityMapper +{ + /** + * 查询商品信息 + * + * @param id 商品信息主键 + * @return 商品信息 + */ + public Commodity selectCommodityById(Long id); + + /** + * 查询商品信息列表 + * + * @param commodity 商品信息 + * @return 商品信息集合 + */ + public List selectCommodityList(Commodity commodity); + + /** + * 新增商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + public int insertCommodity(Commodity commodity); + + /** + * 修改商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + public int updateCommodity(Commodity commodity); + + /** + * 删除商品信息 + * + * @param id 商品信息主键 + * @return 结果 + */ + public int deleteCommodityById(Long id); + + /** + * 批量删除商品信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCommodityByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java new file mode 100644 index 0000000..a46a2e6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FavoriteMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Favorite; + +/** + * 收藏信息Mapper接口 + * + * @author ruoyi + * @date 2024-12-20 + */ +public interface FavoriteMapper +{ + /** + * 查询收藏信息 + * + * @param id 收藏信息主键 + * @return 收藏信息 + */ + public Favorite selectFavoriteById(Long id); + + /** + * 查询收藏信息列表 + * + * @param favorite 收藏信息 + * @return 收藏信息集合 + */ + public List selectFavoriteList(Favorite favorite); + + /** + * 新增收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + public int insertFavorite(Favorite favorite); + + /** + * 修改收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + public int updateFavorite(Favorite favorite); + + /** + * 删除收藏信息 + * + * @param id 收藏信息主键 + * @return 结果 + */ + public int deleteFavoriteById(Long id); + + /** + * 批量删除收藏信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteFavoriteByIds(Long[] ids); + + public List selectFavoriteList2(Favorite favorite); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java index 203a8d9..62921de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java @@ -4,59 +4,60 @@ import java.util.List; import com.ruoyi.system.domain.Order; /** - * 订单Mapper接口 + * 订单信息Mapper接口 * * @author ruoyi - * @date 2024-12-18 + * @date 2024-12-20 */ public interface OrderMapper { /** - * 查询订单 + * 查询订单信息 * - * @param id 订单主键 - * @return 订单 + * @param id 订单信息主键 + * @return 订单信息 */ public Order selectOrderById(Long id); /** - * 查询订单列表 + * 查询订单信息列表 * - * @param order 订单 - * @return 订单集合 + * @param order 订单信息 + * @return 订单信息集合 */ public List selectOrderList(Order order); /** - * 新增订单 + * 新增订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ public int insertOrder(Order order); /** - * 修改订单 + * 修改订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ public int updateOrder(Order order); /** - * 删除订单 + * 删除订单信息 * - * @param id 订单主键 + * @param id 订单信息主键 * @return 结果 */ public int deleteOrderById(Long id); /** - * 批量删除订单 + * 批量删除订单信息 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteOrderByIds(Long[] ids); + public List selectOrderList2(Order order); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PersonMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PersonMapper.java index 136d894..81935ec 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PersonMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/PersonMapper.java @@ -2,7 +2,6 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.Person; -import com.ruoyi.system.domain.Address; /** * 用户信息Mapper接口 @@ -59,29 +58,4 @@ public interface PersonMapper * @return 结果 */ public int deletePersonByIds(Long[] ids); - - /** - * 批量删除用户地址 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAddressByPersonids(Long[] ids); - - /** - * 批量新增用户地址 - * - * @param addressList 用户地址列表 - * @return 结果 - */ - public int batchAddress(List
addressList); - - - /** - * 通过用户信息主键删除用户地址信息 - * - * @param id 用户信息ID - * @return 结果 - */ - public int deleteAddressByPersonid(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentService.java new file mode 100644 index 0000000..bc5b793 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommentService.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Comment; + +/** + * 评论信息Service接口 + * + * @author ruoyi + * @date 2024-12-21 + */ +public interface ICommentService +{ + /** + * 查询评论信息 + * + * @param id 评论信息主键 + * @return 评论信息 + */ + public Comment selectCommentById(Long id); + + /** + * 查询评论信息列表 + * + * @param comment 评论信息 + * @return 评论信息集合 + */ + public List selectCommentList(Comment comment); + + /** + * 新增评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + public int insertComment(Comment comment); + + /** + * 修改评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + public int updateComment(Comment comment); + + /** + * 批量删除评论信息 + * + * @param ids 需要删除的评论信息主键集合 + * @return 结果 + */ + public int deleteCommentByIds(Long[] ids); + + /** + * 删除评论信息信息 + * + * @param id 评论信息主键 + * @return 结果 + */ + public int deleteCommentById(Long id); + + public List selectCommentList2(Comment comment); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommodityService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommodityService.java new file mode 100644 index 0000000..c5c737a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ICommodityService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Commodity; + +/** + * 商品信息Service接口 + * + * @author ruoyi + * @date 2024-12-20 + */ +public interface ICommodityService +{ + /** + * 查询商品信息 + * + * @param id 商品信息主键 + * @return 商品信息 + */ + public Commodity selectCommodityById(Long id); + + /** + * 查询商品信息列表 + * + * @param commodity 商品信息 + * @return 商品信息集合 + */ + public List selectCommodityList(Commodity commodity); + + /** + * 新增商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + public int insertCommodity(Commodity commodity); + + /** + * 修改商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + public int updateCommodity(Commodity commodity); + + /** + * 批量删除商品信息 + * + * @param ids 需要删除的商品信息主键集合 + * @return 结果 + */ + public int deleteCommodityByIds(Long[] ids); + + /** + * 删除商品信息信息 + * + * @param id 商品信息主键 + * @return 结果 + */ + public int deleteCommodityById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java new file mode 100644 index 0000000..d6d8127 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFavoriteService.java @@ -0,0 +1,63 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Favorite; + +/** + * 收藏信息Service接口 + * + * @author ruoyi + * @date 2024-12-20 + */ +public interface IFavoriteService +{ + /** + * 查询收藏信息 + * + * @param id 收藏信息主键 + * @return 收藏信息 + */ + public Favorite selectFavoriteById(Long id); + + /** + * 查询收藏信息列表 + * + * @param favorite 收藏信息 + * @return 收藏信息集合 + */ + public List selectFavoriteList(Favorite favorite); + + /** + * 新增收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + public int insertFavorite(Favorite favorite); + + /** + * 修改收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + public int updateFavorite(Favorite favorite); + + /** + * 批量删除收藏信息 + * + * @param ids 需要删除的收藏信息主键集合 + * @return 结果 + */ + public int deleteFavoriteByIds(Long[] ids); + + /** + * 删除收藏信息信息 + * + * @param id 收藏信息主键 + * @return 结果 + */ + public int deleteFavoriteById(Long id); + + public List selectFavoriteList2(Favorite favorite); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java index f2caba7..f09f225 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java @@ -4,58 +4,60 @@ import java.util.List; import com.ruoyi.system.domain.Order; /** - * 订单Service接口 + * 订单信息Service接口 * * @author ruoyi - * @date 2024-12-18 + * @date 2024-12-20 */ public interface IOrderService { /** - * 查询订单 + * 查询订单信息 * - * @param id 订单主键 - * @return 订单 + * @param id 订单信息主键 + * @return 订单信息 */ public Order selectOrderById(Long id); /** - * 查询订单列表 + * 查询订单信息列表 * - * @param order 订单 - * @return 订单集合 + * @param order 订单信息 + * @return 订单信息集合 */ public List selectOrderList(Order order); /** - * 新增订单 + * 新增订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ public int insertOrder(Order order); /** - * 修改订单 + * 修改订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ public int updateOrder(Order order); /** - * 批量删除订单 + * 批量删除订单信息 * - * @param ids 需要删除的订单主键集合 + * @param ids 需要删除的订单信息主键集合 * @return 结果 */ public int deleteOrderByIds(Long[] ids); /** - * 删除订单信息 + * 删除订单信息信息 * - * @param id 订单主键 + * @param id 订单信息主键 * @return 结果 */ public int deleteOrderById(Long id); + + public List selectOrderList2(Order order); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentServiceImpl.java new file mode 100644 index 0000000..f88175c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommentServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.CommentMapper; +import com.ruoyi.system.domain.Comment; +import com.ruoyi.system.service.ICommentService; + +/** + * 评论信息Service业务层处理 + * + * @author ruoyi + * @date 2024-12-21 + */ +@Service +public class CommentServiceImpl implements ICommentService +{ + @Autowired + private CommentMapper commentMapper; + + /** + * 查询评论信息 + * + * @param id 评论信息主键 + * @return 评论信息 + */ + @Override + public Comment selectCommentById(Long id) + { + return commentMapper.selectCommentById(id); + } + + /** + * 查询评论信息列表 + * + * @param comment 评论信息 + * @return 评论信息 + */ + @Override + public List selectCommentList(Comment comment) + { + return commentMapper.selectCommentList(comment); + } + + /** + * 新增评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + @Override + public int insertComment(Comment comment) + { + return commentMapper.insertComment(comment); + } + + /** + * 修改评论信息 + * + * @param comment 评论信息 + * @return 结果 + */ + @Override + public int updateComment(Comment comment) + { + return commentMapper.updateComment(comment); + } + + /** + * 批量删除评论信息 + * + * @param ids 需要删除的评论信息主键 + * @return 结果 + */ + @Override + public int deleteCommentByIds(Long[] ids) + { + return commentMapper.deleteCommentByIds(ids); + } + + /** + * 删除评论信息信息 + * + * @param id 评论信息主键 + * @return 结果 + */ + @Override + public int deleteCommentById(Long id) + { + return commentMapper.deleteCommentById(id); + } + + @Override + public List selectCommentList2(Comment comment) + { + return commentMapper.selectCommentList2(comment); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommodityServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommodityServiceImpl.java new file mode 100644 index 0000000..487cff2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommodityServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.CommodityMapper; +import com.ruoyi.system.domain.Commodity; +import com.ruoyi.system.service.ICommodityService; + +/** + * 商品信息Service业务层处理 + * + * @author ruoyi + * @date 2024-12-20 + */ +@Service +public class CommodityServiceImpl implements ICommodityService +{ + @Autowired + private CommodityMapper commodityMapper; + + /** + * 查询商品信息 + * + * @param id 商品信息主键 + * @return 商品信息 + */ + @Override + public Commodity selectCommodityById(Long id) + { + return commodityMapper.selectCommodityById(id); + } + + /** + * 查询商品信息列表 + * + * @param commodity 商品信息 + * @return 商品信息 + */ + @Override + public List selectCommodityList(Commodity commodity) + { + return commodityMapper.selectCommodityList(commodity); + } + + /** + * 新增商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + @Override + public int insertCommodity(Commodity commodity) + { + return commodityMapper.insertCommodity(commodity); + } + + /** + * 修改商品信息 + * + * @param commodity 商品信息 + * @return 结果 + */ + @Override + public int updateCommodity(Commodity commodity) + { + return commodityMapper.updateCommodity(commodity); + } + + /** + * 批量删除商品信息 + * + * @param ids 需要删除的商品信息主键 + * @return 结果 + */ + @Override + public int deleteCommodityByIds(Long[] ids) + { + return commodityMapper.deleteCommodityByIds(ids); + } + + /** + * 删除商品信息信息 + * + * @param id 商品信息主键 + * @return 结果 + */ + @Override + public int deleteCommodityById(Long id) + { + return commodityMapper.deleteCommodityById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java new file mode 100644 index 0000000..6914d9e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FavoriteServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.FavoriteMapper; +import com.ruoyi.system.domain.Favorite; +import com.ruoyi.system.service.IFavoriteService; + +/** + * 收藏信息Service业务层处理 + * + * @author ruoyi + * @date 2024-12-20 + */ +@Service +public class FavoriteServiceImpl implements IFavoriteService +{ + @Autowired + private FavoriteMapper favoriteMapper; + + /** + * 查询收藏信息 + * + * @param id 收藏信息主键 + * @return 收藏信息 + */ + @Override + public Favorite selectFavoriteById(Long id) + { + return favoriteMapper.selectFavoriteById(id); + } + + /** + * 查询收藏信息列表 + * + * @param favorite 收藏信息 + * @return 收藏信息 + */ + @Override + public List selectFavoriteList(Favorite favorite) + { + return favoriteMapper.selectFavoriteList(favorite); + } + + /** + * 新增收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + @Override + public int insertFavorite(Favorite favorite) + { + return favoriteMapper.insertFavorite(favorite); + } + + /** + * 修改收藏信息 + * + * @param favorite 收藏信息 + * @return 结果 + */ + @Override + public int updateFavorite(Favorite favorite) + { + return favoriteMapper.updateFavorite(favorite); + } + + /** + * 批量删除收藏信息 + * + * @param ids 需要删除的收藏信息主键 + * @return 结果 + */ + @Override + public int deleteFavoriteByIds(Long[] ids) + { + return favoriteMapper.deleteFavoriteByIds(ids); + } + + /** + * 删除收藏信息信息 + * + * @param id 收藏信息主键 + * @return 结果 + */ + @Override + public int deleteFavoriteById(Long id) + { + return favoriteMapper.deleteFavoriteById(id); + } + + @Override + public List selectFavoriteList2(Favorite favorite){ + return favoriteMapper.selectFavoriteList2(favorite); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java index 0d53907..ec76fc5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java @@ -8,10 +8,10 @@ import com.ruoyi.system.domain.Order; import com.ruoyi.system.service.IOrderService; /** - * 订单Service业务层处理 + * 订单信息Service业务层处理 * * @author ruoyi - * @date 2024-12-18 + * @date 2024-12-20 */ @Service public class OrderServiceImpl implements IOrderService @@ -20,10 +20,10 @@ public class OrderServiceImpl implements IOrderService private OrderMapper orderMapper; /** - * 查询订单 + * 查询订单信息 * - * @param id 订单主键 - * @return 订单 + * @param id 订单信息主键 + * @return 订单信息 */ @Override public Order selectOrderById(Long id) @@ -32,10 +32,10 @@ public class OrderServiceImpl implements IOrderService } /** - * 查询订单列表 + * 查询订单信息列表 * - * @param order 订单 - * @return 订单 + * @param order 订单信息 + * @return 订单信息 */ @Override public List selectOrderList(Order order) @@ -44,9 +44,9 @@ public class OrderServiceImpl implements IOrderService } /** - * 新增订单 + * 新增订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ @Override @@ -56,9 +56,9 @@ public class OrderServiceImpl implements IOrderService } /** - * 修改订单 + * 修改订单信息 * - * @param order 订单 + * @param order 订单信息 * @return 结果 */ @Override @@ -68,9 +68,9 @@ public class OrderServiceImpl implements IOrderService } /** - * 批量删除订单 + * 批量删除订单信息 * - * @param ids 需要删除的订单主键 + * @param ids 需要删除的订单信息主键 * @return 结果 */ @Override @@ -80,9 +80,9 @@ public class OrderServiceImpl implements IOrderService } /** - * 删除订单信息 + * 删除订单信息信息 * - * @param id 订单主键 + * @param id 订单信息主键 * @return 结果 */ @Override @@ -90,4 +90,9 @@ public class OrderServiceImpl implements IOrderService { return orderMapper.deleteOrderById(id); } + + @Override + public List selectOrderList2(Order order){ + return orderMapper.selectOrderList2(order); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java index 871ec43..0af8bdc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PersonServiceImpl.java @@ -3,10 +3,6 @@ package com.ruoyi.system.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import com.ruoyi.system.domain.Address; import com.ruoyi.system.mapper.PersonMapper; import com.ruoyi.system.domain.Person; import com.ruoyi.system.service.IPersonService; @@ -53,13 +49,10 @@ public class PersonServiceImpl implements IPersonService * @param person 用户信息 * @return 结果 */ - @Transactional @Override public int insertPerson(Person person) { - int rows = personMapper.insertPerson(person); - insertAddress(person); - return rows; + return personMapper.insertPerson(person); } /** @@ -68,12 +61,9 @@ public class PersonServiceImpl implements IPersonService * @param person 用户信息 * @return 结果 */ - @Transactional @Override public int updatePerson(Person person) { - personMapper.deleteAddressByPersonid(person.getId()); - insertAddress(person); return personMapper.updatePerson(person); } @@ -83,11 +73,9 @@ public class PersonServiceImpl implements IPersonService * @param ids 需要删除的用户信息主键 * @return 结果 */ - @Transactional @Override public int deletePersonByIds(Long[] ids) { - personMapper.deleteAddressByPersonids(ids); return personMapper.deletePersonByIds(ids); } @@ -97,35 +85,9 @@ public class PersonServiceImpl implements IPersonService * @param id 用户信息主键 * @return 结果 */ - @Transactional @Override public int deletePersonById(Long id) { - personMapper.deleteAddressByPersonid(id); return personMapper.deletePersonById(id); } - - /** - * 新增用户地址信息 - * - * @param person 用户信息对象 - */ - public void insertAddress(Person person) - { - List
addressList = person.getAddressList(); - Long id = person.getId(); - if (StringUtils.isNotNull(addressList)) - { - List
list = new ArrayList
(); - for (Address address : addressList) - { - address.setPersonid(id); - list.add(address); - } - if (list.size() > 0) - { - personMapper.batchAddress(list); - } - } - } } diff --git a/ruoyi-system/src/main/resources/mapper/system/CommentMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CommentMapper.xml new file mode 100644 index 0000000..89cada3 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/CommentMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + select id, personid, content, time from comment + + + + + + + + insert into comment + + personid, + content, + time, + + + #{personid}, + #{content}, + #{time}, + + + + + update comment + + personid = #{personid}, + content = #{content}, + time = #{time}, + + where id = #{id} + + + + delete from comment where id = #{id} + + + + delete from comment where id in + + #{id} + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/CommodityMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CommodityMapper.xml new file mode 100644 index 0000000..6e88b71 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/CommodityMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, name, sellerid, price, classification, description, picture, state, time from commodity + + + + + + + + insert into commodity + + name, + sellerid, + price, + classification, + description, + picture, + state, + time, + + + #{name}, + #{sellerid}, + #{price}, + #{classification}, + #{description}, + #{picture}, + #{state}, + #{time}, + + + + + update commodity + + name = #{name}, + sellerid = #{sellerid}, + price = #{price}, + classification = #{classification}, + description = #{description}, + picture = #{picture}, + state = #{state}, + time = #{time}, + + where id = #{id} + + + + delete from commodity where id = #{id} + + + + delete from commodity where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml b/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml new file mode 100644 index 0000000..4120b35 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/FavoriteMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + select id, personid, commodityid from favorite + + + + + + + + insert into favorite + + personid, + commodityid, + + + #{personid}, + #{commodityid}, + + + + + update favorite + + personid = #{personid}, + commodityid = #{commodityid}, + + where id = #{id} + + + + delete from favorite where id = #{id} + + + + delete from favorite where id in + + #{id} + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml index 652dd09..d5a5dd7 100644 --- a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml @@ -6,51 +6,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - + + + + - - SELECT - o.id, - p.image, - p.name username, - s.productimage, - s.name, - s.price, - o.purchasedate, - o.orderzhuangtai - FROM - `person` p - -- 使用 INNER JOIN 关联 order 表 - INNER JOIN - `order` o ON p.id = o.personid - -- 再使用 INNER JOIN 关联 shangpin 表 - INNER JOIN - `shangpin` s ON o.shangpinid = s.id; - + select id, commodityid, buyerid, time, status from `order` - + + SELECT + `order`.id AS id, + person.`name` AS buyername, + person.picture AS buyerpicture, + commodity.`name` AS commodityname, + commodity.picture AS commoditypicture, + commodity.price AS price, + `order`.time AS time + FROM + `order`, + person, + commodity + WHERE + `order`.buyerid = person.id + AND `order`.commodityid = commodity.id + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/PersonMapper.xml b/ruoyi-system/src/main/resources/mapper/system/PersonMapper.xml index ba2fda2..d9fc86d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/PersonMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/PersonMapper.xml @@ -6,86 +6,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + - - - - - - - - - - - - + + + - select id, image, name, xingbie, age, phone, xueyuan, zhuanye from person + select id, name, picture, gender, age, phone, password, address, major from person - + where id = #{id} - - insert into person - image, name, - xingbie, + picture, + gender, age, phone, - xueyuan, - zhuanye, + password, + address, + major, - #{image}, #{name}, - #{xingbie}, + #{picture}, + #{gender}, #{age}, #{phone}, - #{xueyuan}, - #{zhuanye}, + #{password}, + #{address}, + #{major}, update person - image = #{image}, name = #{name}, - xingbie = #{xingbie}, + picture = #{picture}, + gender = #{gender}, age = #{age}, phone = #{phone}, - xueyuan = #{xueyuan}, - zhuanye = #{zhuanye}, + password = #{password}, + address = #{address}, + major = #{major}, where id = #{id} @@ -100,22 +88,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} - - - delete from address where personid in - - #{personid} - - - - - delete from address where personid = #{personid} - - - - insert into address( id, personid, place) values - - ( #{item.id}, #{item.personid}, #{item.place}) - - \ No newline at end of file