From 304c436e494d37ffb03d924134d507833ce5b38a Mon Sep 17 00:00:00 2001 From: wangtongzhou Date: Sun, 19 May 2019 16:00:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=84=E4=BB=B7=E5=92=8C?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E4=BB=A5?= =?UTF-8?q?=E5=8F=8Amapper=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/api/OrderCommentReplyService.java | 24 +++ .../mall/order/api/OrderCommentService.java | 28 ++-- ...rderCommentBo.java => OrderCommentBO.java} | 4 +- .../order/api/bo/OrderCommentCreateBO.java | 23 --- .../OrderCommentInfoAndMerchantReplyBO.java | 99 +++++++++++ .../mall/order/api/bo/OrderCommentInfoBO.java | 158 ------------------ .../mall/order/api/bo/OrderCommentPageBO.java | 2 +- .../api/bo/OrderCommentReplyCreateBO.java | 16 -- .../order/api/bo/OrderCommentReplyPageBO.java | 77 +++++++++ .../api/constant/OrderReplyUserTypeEnum.java | 36 ++++ .../order/api/dto/OrderCommentCreateDTO.java | 21 ++- .../order/api/dto/OrderCommentPageDTO.java | 30 ++++ .../api/dto/OrderCommentReplyCreateDTO.java | 15 +- .../api/dto/OrderCommentReplyPageDTO.java | 40 +++++ .../order/biz/dao/OrderCommentMapper.java | 56 +++++++ .../biz/dao/OrderCommentReplayMapper.java | 51 ++++++ .../order/biz/dataobject/OrderCommentDO.java | 18 +- ...ReplayDO.java => OrderCommentReplyDO.java} | 16 +- .../resources/mapper/OrderCommentMapper.xml | 52 ++++++ .../mapper/OrderCommentReplayMapper.xml | 54 ++++++ .../mapper/OrderLogisticsDetailMapper.xml | 3 +- 21 files changed, 581 insertions(+), 242 deletions(-) create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java rename order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/{OrderCommentBo.java => OrderCommentBO.java} (94%) delete mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java delete mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java delete mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java rename order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/{OrderCommentReplayDO.java => OrderCommentReplyDO.java} (86%) create mode 100644 order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml create mode 100644 order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java new file mode 100644 index 000000000..6cb72086a --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java @@ -0,0 +1,24 @@ +package cn.iocoder.mall.order.api; + +import cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; + +import java.util.List; + +/** + * + * 订单评论回复模块 + * + * @author wtz + * @time 2019-05-29 14:30 + * + */ +public interface OrderCommentReplyService { + + /** + * 分页获取评论回复 + * @param orderCommentReplyPageDTO + * @return + */ + List getOrderCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO); +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java index b1836d136..0a72cf65b 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java @@ -1,11 +1,10 @@ package cn.iocoder.mall.order.api; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO; -import cn.iocoder.mall.order.api.bo.OrderCommentInfoBO; +import cn.iocoder.mall.order.api.bo.OrderCommentInfoAndMerchantReplyBO; import cn.iocoder.mall.order.api.bo.OrderCommentPageBO; -import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO; +import cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum; import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; +import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; /** @@ -21,7 +20,7 @@ public interface OrderCommentService { * @param orderCommentCreateDTO * @return */ - CommonResult createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO); + Boolean createOrderComment(OrderCommentCreateDTO orderCommentCreateDTO); /** @@ -29,22 +28,31 @@ public interface OrderCommentService { * @param orderCommentReplyCreateDTO * @return */ - CommonResult createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); + Boolean createOrderCommentReply(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); /** * 获取评论列表的分页 - * @param productSpuId + * @param orderCommentPageDTO * @return */ - CommonResult getOrderCommentPage(Integer productSpuId); + OrderCommentPageBO getOrderCommentPage(OrderCommentPageDTO orderCommentPageDTO); /** - * 获取评论详情 + * 获取评论详情和商家回复 * @param commentId * @return */ - CommonResult getOrderCommentInfo(Integer commentId); + OrderCommentInfoAndMerchantReplyBO getOrderCommentInfo(Integer commentId, Integer userType); + + + + /** + * 订单评价超时自动好评 + * 采用任务的形式执行 + * @return + */ + Boolean OrderCommentTimeOutProductCommentTask(); diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBo.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java similarity index 94% rename from order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBo.java rename to order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java index 466a12808..a5790b506 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBo.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentBO.java @@ -16,7 +16,7 @@ import java.util.List; */ @Data @Accessors(chain = true) -public class OrderCommentBo implements Serializable { +public class OrderCommentBO implements Serializable { /** * 总条数 @@ -39,7 +39,7 @@ public class OrderCommentBo implements Serializable { private Integer negativeTotal; /** - * 评论id + * 评论 id */ private Integer id; diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java deleted file mode 100644 index 0f02a2837..000000000 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - - -/** - * - * 订单评论创建 - * - * @author wtz - * @time 2019-05-15 20:35 - * - */ -@Data -@Accessors(chain = true) -public class OrderCommentCreateBO { - - /** - * 评论id - */ - private Integer id; -} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java new file mode 100644 index 000000000..9d63fe692 --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java @@ -0,0 +1,99 @@ +package cn.iocoder.mall.order.api.bo; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +/** + * + * 订单回复评价详情和商加回复 + * + * @author wtz + * @time 2019-05-16 18:40 + * + */ +public class OrderCommentInfoAndMerchantReplyBO { + + /** + * 评论 id + */ + private Integer id; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 用户昵称 + */ + private String userNickName; + + /** + * 评价星 + */ + private Integer star; + + /** + * 评论的内容 + */ + private String commentContent; + + /** + * 评论的图片地址 + */ + private String commentPics; + + + /** + * 点赞数 + */ + private Integer collectCount; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 商品 sku id + */ + private int productSkuId; + + /** + * 商品 sku 属性 + */ + private String productSkuAttrs; + + /** + * 商品 sku 价格 + */ + private String productSkuPrice; + + /** + * 商品 sku 地址 + */ + private String productSkuPicUrl; + + + /** + * 商家回复 + */ + List orderCommentReplayMerchantItems; + + + @Data + @Accessors(chain = true) + private static class OrderCommentReplayMerchantItem{ + /** + * 回复的内容 + */ + private String replyContent; + } + + + + +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java deleted file mode 100644 index 5069def1f..000000000 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java +++ /dev/null @@ -1,158 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -/** - * - * 订单回复评价详情 - * - * @author wtz - * @time 2019-05-16 18:40 - * - */ -public class OrderCommentInfoBO { - - /** - * 评论id - */ - private Integer id; - - /** - * 用户头像 - */ - private String userAvatar; - - /** - * 用户的真实姓名 - */ - private String userNickName; - - /** - * 评价星 - */ - private Integer star; - - /** - * 评论的内容 - */ - private String commentContent; - - /** - * 评论的图片地址 - */ - private String commentPics; - - /** - * 回复条数 - */ - private Integer replayCount; - - /** - * 点赞数 - */ - private Integer collectCount; - - /** - * 创建时间 - */ - private Date createTime; - - /** - * 商品SKUid - */ - private int productSkuId; - - /** - * 商品SKU属性 - */ - private String productSkuAttrs; - - /** - * 商品SKU价格 - */ - private String productSkuPrice; - - /** - * 商品SKU地址 - */ - private String productSkuPicUrl; - - - /** - * 商家回复 - */ - List orderCommentReplayMerchantItems; - - /** - * 用户回复 - */ - List orderCommentReplayUserItems; - - @Data - @Accessors(chain = true) - private static class OrderCommentReplayMerchantItem{ - /** - * 回复的内容 - */ - private String replyContent; - } - - - - @Data - @Accessors(chain = true) - private static class OrderCommentReplayUserItem{ - /** - * 回复id - */ - private Integer id; - - /** - * 回复的类型 - */ - private Integer replyType; - - /** - * 回复的内容 - */ - private String replyContent; - - /** - * 回复的用户id - */ - private int replyUserId; - - /** - * 回复用户的真实姓名 - */ - private String replyUserNickName; - - /** - * 回复用户的头像 - */ - private String replyUserAvatar; - - /** - * 回复的点赞数 - */ - private int replyCollectCount; - - /** - * 回复目标用户昵称 - */ - private String parentUserNickName; - - /** - * 创建时间 - */ - private Date createTime; - - } - - - -} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java index b7b090251..1d6dbf40f 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentPageBO.java @@ -49,7 +49,7 @@ public class OrderCommentPageBO implements Serializable { @Accessors(chain = true) private static class OrderCommentItem{ /** - * 评论id + * 评论 id */ private Integer id; diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java deleted file mode 100644 index 506d10c47..000000000 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyCreateBO.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -/** - * - * 评论回复创建 - * - * @author wtz - * @time 2019-05-16 18:00:00 - */ -public class OrderCommentReplyCreateBO { - - /** - * 评论回复的id - */ - private Integer id; -} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java new file mode 100644 index 000000000..ee04d2be8 --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java @@ -0,0 +1,77 @@ +package cn.iocoder.mall.order.api.bo; + + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +/** + * + * 评论回复分页展示 + * + * @author wtz + * @time 2019-05-19 14:19 + * + */ +public class OrderCommentReplyPageBO { + + private Integer total; + + /** + * 用户回复 + */ + List orderCommentReplayUserItems; + + + @Data + @Accessors(chain = true) + private static class OrderCommentReplayUserItem{ + /** + * 回复 id + */ + private Integer id; + + /** + * 回复的类型 + */ + private Integer replyType; + + /** + * 回复的内容 + */ + private String replyContent; + + /** + * 回复的用户 id + */ + private int replyUserId; + + /** + * 回复用户的真实姓名 + */ + private String replyUserNickName; + + /** + * 回复用户的头像 + */ + private String replyUserAvatar; + + /** + * 回复的点赞数 + */ + private int replyCollectCount; + + /** + * 回复目标用户昵称 + */ + private String parentUserNickName; + + /** + * 创建时间 + */ + private Date createTime; + + } +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java new file mode 100644 index 000000000..5d6865486 --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReplyUserTypeEnum.java @@ -0,0 +1,36 @@ +package cn.iocoder.mall.order.api.constant; + +/** + * + * 评论回复 - 回复的用户的类型 + * + * @author wtz + * @time 2019-05-19 15:19 + */ +public enum OrderReplyUserTypeEnum { + + USER(1, "普通用户"), + MERCHANT(2, "商家"); + /** + * 状态值 + */ + private Integer value; + /** + * 状态名 + */ + private String name; + + OrderReplyUserTypeEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public String getName() { + return name; + } + +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java index c69dcb576..9e021d59b 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java @@ -17,7 +17,7 @@ import java.io.Serializable; public class OrderCommentCreateDTO implements Serializable { /** - * 订单id + * 订单 id */ private int orderId; @@ -27,37 +27,37 @@ public class OrderCommentCreateDTO implements Serializable { private String orderNo; /** - * 商品SPU id + * 商品 spu id */ private int productSpuId; /** - * 商品SPU 名字 SPU 这两个属性待考量我认为加入进去以后后期一些分析可能好做一些 + * 商品 spu 名字 spu 这两个属性待考量我认为加入进去以后后期一些分析可能好做一些 */ private String productSpuName; /** - * 商品SKU id + * 商品 sku id */ private int productSkuId; /** - * 商品SKU属性 + * 商品 sku 属性 */ private String productSkuAttrs; /** - * 商品SKU价格 + * 商品 sku 价格 */ private int productSkuPrice; /** - * 商品SKU地址 + * 商品 sku 地址 */ private String productSkuPicUrl; /** - * 用户id + * 用户 id */ private Integer userId; @@ -95,4 +95,9 @@ public class OrderCommentCreateDTO implements Serializable { * 评论内容 */ private String commentContent; + + /** + * 评论图片 + */ + private String commentPics; } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java new file mode 100644 index 000000000..f26ea071b --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentPageDTO.java @@ -0,0 +1,30 @@ +package cn.iocoder.mall.order.api.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * + * 订单评论 query + * + */ +@Data +@Accessors(chain = true) +public class OrderCommentPageDTO { + + /** + * 商品 sku id + */ + private Integer productSkuId; + + /** + * 页码 + */ + private Integer pageNo; + + /** + * 每页条数 + */ + private Integer pageSize; + +} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java index 6200f2d50..a986b262d 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyCreateDTO.java @@ -1,5 +1,8 @@ package cn.iocoder.mall.order.api.dto; +import lombok.Data; +import lombok.experimental.Accessors; + import java.io.Serializable; /** @@ -10,20 +13,22 @@ import java.io.Serializable; * @time 2019-05-16 19:07 * */ +@Data +@Accessors(chain = true) public class OrderCommentReplyCreateDTO implements Serializable { /** - * 评论id + * 评论 id */ private Integer commentId; /** - * 评论目标对象id + * 评论目标对象 id */ private Integer parentId; /** - * 评论目标用户id + * 评论目标用户 id */ private Integer parentUserId; @@ -43,7 +48,7 @@ public class OrderCommentReplyCreateDTO implements Serializable { private String replyContent; /** - * 回复用户id + * 回复用户 id */ private Integer replyUserId; @@ -60,6 +65,6 @@ public class OrderCommentReplyCreateDTO implements Serializable { /** * 回复用户类型 */ - private Integer replyUserType; + private Integer userType; } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java new file mode 100644 index 000000000..ecdf05d78 --- /dev/null +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentReplyPageDTO.java @@ -0,0 +1,40 @@ +package cn.iocoder.mall.order.api.dto; + + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * + * 订单评论信息详情 query + * + * @author wtz + * @time 2019-05-19 10:16 + */ +@Data +@Accessors(chain = true) +public class OrderCommentReplyPageDTO { + + /** + * 评论 id + */ + private Integer commentId; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 页码 + */ + private Integer pageNo; + + /** + * 每页条数 + */ + private Integer pageSize; + +} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java new file mode 100644 index 000000000..b3f1f7f9c --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java @@ -0,0 +1,56 @@ +package cn.iocoder.mall.order.biz.dao; + +import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO; +import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO; +import cn.iocoder.mall.order.biz.dataobject.OrderCommentDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * 订单评论 mapper + * + * @author wtz + * @time 2019-05-16 20:52 + */ +@Repository +public interface OrderCommentMapper extends BaseMapper { + + + /** + * 插入订单评论 + * @param orderCommentCreateDTO + * @return + */ + int insert(OrderCommentCreateDTO orderCommentCreateDTO); + + + /** + * 根据 sku id 查询评论总条数 + * @param productSkuId + * @return + */ + int selectCommentTotalCountByProductSkuId(@Param("productSkuId") Integer productSkuId); + + + /** + * 根据 sku id 分页查询评论 + * @param orderCommentPageDTO + * @return + */ + List selectCommentPage(OrderCommentPageDTO orderCommentPageDTO); + + + /** + * 根据评论 id 查询评论详情 + * @param id + * @return + */ + OrderCommentDO selectCommentInfoByCommentId(@Param("id") Integer id); + + + +} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java new file mode 100644 index 000000000..4a328f9e9 --- /dev/null +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java @@ -0,0 +1,51 @@ +package cn.iocoder.mall.order.biz.dao; + +import cn.iocoder.mall.order.api.bo.OrderCommentBO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO; +import cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO; +import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 订单评论回复 mapper + * + * @author wtz + * @time 2019-05-16 21:33 + */ +public interface OrderCommentReplayMapper { + + /** + * 插入订单评论回复 + * @param orderCommentReplyCreateDTO + * @return + */ + int insert(OrderCommentReplyCreateDTO orderCommentReplyCreateDTO); + + /** + * 根据评论 id 和用户类型获取商家回复 + * @param commentId,userType + * @return + */ + List selectCommentMerchantReplyByCommentId(@Param("commentId") Integer commentId, + @Param("userType") Integer userType); + + + /** + * 评论回复分页 + * @param orderCommentReplyPageDTO + * @return + */ + List selectCommentReplyPage(OrderCommentReplyPageDTO orderCommentReplyPageDTO); + + + /** + * 根据评论 id 和用户类型获取评论回复总数 + * @param commentId,userType + * @return + */ + int selectCommentReplyTotalCountByCommentId(@Param("commentId") Integer commentId, + @Param("userType") Integer userType); + +} diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java index 85b1932e1..3a9ac5014 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java @@ -8,7 +8,7 @@ import lombok.experimental.Accessors; /** * 订单评论表 * - * @author wtz + * @author wtz * @time 2019-05-14 20:48 * */ @@ -18,12 +18,12 @@ import lombok.experimental.Accessors; public class OrderCommentDO extends BaseDO { /** - * 评论id // TODO FROM 芋艿 TO wtz 中英文之间,要有空格 + * 评论 id // TODO FROM 芋艿 TO wtz 中英文之间,要有空格 */ private Integer id; /** - * 订单id + * 订单 id */ private Integer orderId; @@ -33,7 +33,7 @@ public class OrderCommentDO extends BaseDO { private String orderNo; /** - * 商品id + * 商品 id */ private Integer productSpuId; @@ -43,22 +43,22 @@ public class OrderCommentDO extends BaseDO { private String productSpuName; /** - * 商品SKUid + * 商品 sku id */ private Integer productSkuId; /** - * 商品SKU属性 + * 商品 sku 属性 */ private String productSkuAttrs; /** - * 商品SKU价格 + * 商品 sku 价格 */ private Integer productSkuPrice; /** - * 商品SKU URL + * 商品 sku url */ private String productSkuPicUrl; @@ -105,7 +105,7 @@ public class OrderCommentDO extends BaseDO { /** * 点赞数 // TODO FROM 芋艿 TO wtz collect 是收藏的意思,最好换个单词噢。 */ - private Integer collectCount; + private Integer likeCount; /** * 评论的内容 diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplayDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java similarity index 86% rename from order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplayDO.java rename to order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java index 5145b41ec..a581efaef 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplayDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentReplyDO.java @@ -17,15 +17,15 @@ import lombok.experimental.Accessors; @Data @Accessors(chain = true) @TableName(value = "order_comment_replay") -public class OrderCommentReplayDO extends BaseDO { +public class OrderCommentReplyDO extends BaseDO { /** - * 回复id + * 回复 id */ private Integer id; /** - * 评论id + * 评论 id */ private Integer commentId; @@ -35,12 +35,12 @@ public class OrderCommentReplayDO extends BaseDO { private Integer replyType; /** - * 父id + * 父 id */ private Integer parentId; /** - * 回复目标用户id + * 回复目标用户 id */ private Integer parentUserId; @@ -60,7 +60,7 @@ public class OrderCommentReplayDO extends BaseDO { private String replyContent; /** - * 回复用户id + * 回复用户 id */ private Integer replyUserId; @@ -77,11 +77,11 @@ public class OrderCommentReplayDO extends BaseDO { /** * 回复用户身份 // TODO FROM 芋艿 TO wtz 【提示】userType 和 UserTypeEnum 记录保持一致。 */ - private Integer replyUserType; + private Integer userType; /** * 回复点赞数 */ - private Integer replyCollectCount; + private Integer replyLikeCount; } diff --git a/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml new file mode 100644 index 000000000..f1b274aec --- /dev/null +++ b/order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml @@ -0,0 +1,52 @@ + + + + + + id,order_id,order_no,product_spu_id,product_spu_name,product_sku_id,product_sku_attrs,product_sku_price,product_sku_pic_url, + user_id,user_avatar,user_nick_name,star,product_description_star,logistics_star,merchant_star,replay_count,like_count,comment_content, + comment_pics,create_time,update_time + + + + + INSERT INTO order_comment(order_id,order_no,product_spu_id,product_spu_name,product_sku_id, + product_sku_attrs,product_sku_price,product_sku_pic_url,user_id,user_avatar,user_nick_name,star, + product_description_star,logistics_star,merchant_star,comment_content,comment_pics,create_time,update_time) + VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs}, + #{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star}, + #{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{createTime}, #{updateTime}); + + + + + + + + + + + + \ No newline at end of file diff --git a/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml new file mode 100644 index 000000000..325439262 --- /dev/null +++ b/order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml @@ -0,0 +1,54 @@ + + + + + + id,comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content, + reply_user_id,reply_user_nick_name,reply_user_avatar,user_type,reply_like_count,create_time,update_time + + + + + INSERT INTO `order_comment_replay`(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id + reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time) + VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId}, + #{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime}) + + + + + + + + + + + + diff --git a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml index 83dbfed4b..34db79843 100644 --- a/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml +++ b/order/order-service-impl/src/main/resources/mapper/OrderLogisticsDetailMapper.xml @@ -3,8 +3,7 @@ - id - , + id, order_logistics_id, logistics_time, logistics_information,