Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
2c57d294
提交
2c57d294
authored
6月 03, 2019
作者:
wangtongzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成评论回复列表和评论商家详情列表,用户验证暂时等下次增加点赞接口以后加上
上级
3a7291a3
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
225 行增加
和
118 行删除
+225
-118
OrderCommentController.java
.../application/controller/users/OrderCommentController.java
+16
-1
OrderCommentReplyController.java
...ication/controller/users/OrderCommentReplyController.java
+12
-7
OrderCommentReplyService.java
...a/cn/iocoder/mall/order/api/OrderCommentReplyService.java
+13
-1
OrderCommentService.java
...n/java/cn/iocoder/mall/order/api/OrderCommentService.java
+3
-3
OrderCommentInfoAndMerchantReplyBO.java
...mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java
+8
-78
OrderCommentInfoBO.java
...java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java
+83
-0
OrderCommentMerchantReplyBO.java
...ocoder/mall/order/api/bo/OrderCommentMerchantReplyBO.java
+21
-0
OrderCommentReplyPageBO.java
...cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java
+7
-2
OrderCommentConvert.java
...n/iocoder/mall/order/biz/convert/OrderCommentConvert.java
+4
-0
OrderCommentReplyConvert.java
...oder/mall/order/biz/convert/OrderCommentReplyConvert.java
+11
-0
OrderCommentMapper.java
...ava/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java
+3
-7
OrderCommentReplayMapper.java
.../iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java
+3
-3
OrderCommentReplyServiceImpl.java
.../mall/order/biz/service/OrderCommentReplyServiceImpl.java
+30
-2
OrderCommentServiceImpl.java
...coder/mall/order/biz/service/OrderCommentServiceImpl.java
+7
-7
OrderCommentMapper.xml
...ice-impl/src/main/resources/mapper/OrderCommentMapper.xml
+1
-4
OrderCommentReplayMapper.xml
...pl/src/main/resources/mapper/OrderCommentReplayMapper.xml
+3
-3
没有找到文件。
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java
浏览文件 @
2c57d294
...
...
@@ -2,8 +2,10 @@ package cn.iocoder.mall.order.application.controller.users;
import
cn.iocoder.common.framework.constant.MallConstants
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.OrderCommentReplyService
;
import
cn.iocoder.mall.order.api.OrderCommentService
;
import
cn.iocoder.mall.order.api.bo.OrderCommentCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfoAndMerchantReplyBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentPageDTO
;
...
...
@@ -31,6 +33,9 @@ public class OrderCommentController {
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.OrderCommentService.version}"
)
private
OrderCommentService
orderCommentService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.OrderCommentReplyService.version}"
)
private
OrderCommentReplyService
orderCommentReplyService
;
@PostMapping
(
"create_order_comment"
)
//@RequiresLogin
...
...
@@ -39,11 +44,21 @@ public class OrderCommentController {
return
success
(
orderCommentService
.
createOrderComment
(
orderCommentCreateDTO
));
}
@GetMapping
(
"
getOrderCommentP
age"
)
@GetMapping
(
"
order_comment_p
age"
)
//@RequiresLogin
@ApiOperation
(
value
=
"获取评论分页"
)
public
CommonResult
<
OrderCommentPageBO
>
getOrderCommentPage
(
@Validated
OrderCommentPageDTO
orderCommentPageDTO
){
return
success
(
orderCommentService
.
getOrderCommentPage
(
orderCommentPageDTO
));
}
@GetMapping
(
"order_comment_info_merchant_reply"
)
//@RequiresLogin
@ApiOperation
(
value
=
"获取评论和商家回复"
)
public
CommonResult
<
OrderCommentInfoAndMerchantReplyBO
>
geOrderCommentInfoAndMerchantReply
(
@RequestParam
(
"commentId"
)
Integer
commentId
){
OrderCommentInfoAndMerchantReplyBO
orderCommentInfoAndMerchantReplyBO
=
new
OrderCommentInfoAndMerchantReplyBO
();
orderCommentInfoAndMerchantReplyBO
.
setOrderCommentInfoBO
(
orderCommentService
.
getOrderCommentInfo
(
commentId
));
orderCommentInfoAndMerchantReplyBO
.
setOrderCommentMerchantReplyBOS
(
orderCommentReplyService
.
getOrderCommentMerchantReply
(
commentId
));
return
success
(
orderCommentInfoAndMerchantReplyBO
);
}
}
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentReplyController.java
浏览文件 @
2c57d294
...
...
@@ -3,17 +3,15 @@ package cn.iocoder.mall.order.application.controller.users;
import
cn.iocoder.common.framework.constant.MallConstants
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.order.api.OrderCommentReplyService
;
import
cn.iocoder.mall.order.api.bo.OrderCommentCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
...
...
@@ -33,10 +31,17 @@ public class OrderCommentReplyController {
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.provider.OrderCommentService.version}"
)
private
OrderCommentReplyService
orderCommentReplyService
;
@PostMapping
(
"create_order_comment"
)
@PostMapping
(
"create_order_comment
_reply
"
)
//@RequiresLogin
@ApiOperation
(
value
=
"创建订单"
)
@ApiOperation
(
value
=
"创建订单
回复
"
)
public
CommonResult
<
OrderCommentReplyCreateBO
>
createOrderCommentReply
(
@RequestBody
@Validated
OrderCommentReplyCreateDTO
orderCommentReplyCreateDTO
){
return
success
(
orderCommentReplyService
.
createOrderCommentReply
(
orderCommentReplyCreateDTO
));
}
@GetMapping
(
"order_comment_reply_page"
)
//@RequiresLogin
@ApiOperation
(
value
=
"分页获取评论回复"
)
public
CommonResult
<
OrderCommentReplyPageBO
>
getOrderCommentReplyPage
(
@Validated
OrderCommentReplyPageDTO
orderCommentReplyCreateDTO
){
return
success
(
orderCommentReplyService
.
getOrderCommentReplyPage
(
orderCommentReplyCreateDTO
));
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentReplyService.java
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
api
;
import
cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO
;
...
...
@@ -22,7 +23,7 @@ public interface OrderCommentReplyService {
* @param orderCommentReplyPageDTO
* @return
*/
List
<
OrderCommentReplyPageBO
>
getOrderCommentReplyPage
(
OrderCommentReplyPageDTO
orderCommentReplyPageDTO
);
OrderCommentReplyPageBO
getOrderCommentReplyPage
(
OrderCommentReplyPageDTO
orderCommentReplyPageDTO
);
/**
...
...
@@ -31,4 +32,15 @@ public interface OrderCommentReplyService {
* @return
*/
OrderCommentReplyCreateBO
createOrderCommentReply
(
OrderCommentReplyCreateDTO
orderCommentReplyCreateDTO
);
/**
* 获取商家评论回复
* @param commentId
* @return
*/
List
<
OrderCommentMerchantReplyBO
>
getOrderCommentMerchantReply
(
Integer
commentId
);
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
api
;
import
cn.iocoder.mall.order.api.bo.OrderCommentCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfo
AndMerchantReply
BO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentPageDTO
;
...
...
@@ -32,11 +32,11 @@ public interface OrderCommentService {
/**
* 获取评论详情
和商家回复
* 获取评论详情
* @param commentId
* @return
*/
OrderCommentInfo
AndMerchantReplyBO
getOrderCommentInfo
(
Integer
commentId
,
Integer
userType
);
OrderCommentInfo
BO
getOrderCommentInfo
(
Integer
commentId
);
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoAndMerchantReplyBO.java
浏览文件 @
2c57d294
...
...
@@ -3,97 +3,27 @@ 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
*
* @time 2019-06-03 20:30
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentInfoAndMerchantReplyBO
{
/**
* 评论 id
*/
private
Integer
id
;
/**
* 用户头像
* 评论详情
*/
private
String
userAvatar
;
private
OrderCommentInfoBO
orderCommentInfoBO
;
/**
*
用户昵称
*
商家评论回复
*/
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
<
OrderCommentReplayMerchantItem
>
orderCommentReplayMerchantItems
;
@Data
@Accessors
(
chain
=
true
)
public
static
class
OrderCommentReplayMerchantItem
{
/**
* 回复的内容
*/
private
String
replyContent
;
}
private
List
<
OrderCommentMerchantReplyBO
>
orderCommentMerchantReplyBOS
;
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java
0 → 100644
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
*
* 订单回复评价详情
*
* @author wtz
* @time 2019-05-16 18:40
*
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentInfoBO
{
/**
* 评论 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
;
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentMerchantReplyBO.java
0 → 100644
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
*
* 商家评论回复
*
* @author wtz
* @time 2019-06-03 19:30
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentMerchantReplyBO
{
/**
* 商家评论回复
*/
private
String
replyContent
;
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java
浏览文件 @
2c57d294
...
...
@@ -15,19 +15,24 @@ import java.util.List;
* @time 2019-05-19 14:19
*
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentReplyPageBO
{
/**
* 评论回复总数
*/
private
Integer
total
;
/**
* 用户回复
*/
List
<
OrderCommentReplay
UserItem
>
orderCommentReplayUser
Items
;
List
<
OrderCommentReplay
Item
>
orderCommentReplay
Items
;
@Data
@Accessors
(
chain
=
true
)
p
rivate
static
class
OrderCommentReplayUser
Item
{
p
ublic
static
class
OrderCommentReplay
Item
{
/**
* 回复 id
*/
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
import
cn.iocoder.mall.order.api.bo.OrderCommentCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderCommentDO
;
...
...
@@ -27,4 +28,7 @@ public interface OrderCommentConvert {
@Mappings
({})
OrderCommentCreateBO
convert
(
OrderCommentDO
orderCommentDO
);
@Mappings
({})
OrderCommentInfoBO
convertOrderCommentInfoBO
(
OrderCommentDO
orderCommentDO
);
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
biz
.
convert
;
import
cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
javax.validation.constraints.Max
;
import
java.util.List
;
/**
*
* 评论回复 convert
...
...
@@ -24,4 +29,10 @@ public interface OrderCommentReplyConvert {
@Mappings
({})
OrderCommentReplyCreateBO
convert
(
OrderCommentReplyDO
orderCommentReplyDO
);
@Mappings
({})
List
<
OrderCommentMerchantReplyBO
>
convert
(
List
<
OrderCommentReplyDO
>
orderCommentReplyDOList
);
@Mappings
({})
List
<
OrderCommentReplyPageBO
.
OrderCommentReplayItem
>
convertOrderCommentReplayItem
(
List
<
OrderCommentReplyDO
>
orderCommentReplyDOList
);
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java
浏览文件 @
2c57d294
...
...
@@ -38,15 +38,11 @@ public interface OrderCommentMapper{
/**
* 根据 sku id 分页查询评论
* @param productSkuId
* @param offset
* @param limit
* 分页获取评论
* @param orderCommentPageDTO
* @return
*/
List
<
OrderCommentDO
>
selectCommentPage
(
@Param
(
"productSkuId"
)
Integer
productSkuId
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
List
<
OrderCommentDO
>
selectCommentPage
(
OrderCommentPageDTO
orderCommentPageDTO
);
/**
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentReplayMapper.java
浏览文件 @
2c57d294
...
...
@@ -31,12 +31,12 @@ public interface OrderCommentReplayMapper {
* @param commentId,userType
* @return
*/
List
<
OrderCommentReplyDO
>
selectCommentMerchantReplyByCommentId
(
@Param
(
"commentId"
)
Integer
commentId
,
@Param
(
"userType"
)
Integer
userType
);
List
<
OrderCommentReplyDO
>
selectCommentMerchantReplyByCommentId
AndUserType
(
@Param
(
"commentId"
)
Integer
commentId
,
@Param
(
"userType"
)
Integer
userType
);
/**
*
评论回复分页
*
分页获取评论回复
* @param orderCommentReplyPageDTO
* @return
*/
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentReplyServiceImpl.java
浏览文件 @
2c57d294
package
cn
.
iocoder
.
mall
.
order
.
biz
.
service
;
import
cn.iocoder.mall.order.api.OrderCommentReplyService
;
import
cn.iocoder.mall.order.api.bo.OrderCommentMerchantReplyBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyPageBO
;
import
cn.iocoder.mall.order.api.constant.OrderCommentRelpyTypeEnum
;
import
cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentReplyPageDTO
;
import
cn.iocoder.mall.order.biz.convert.OrderCommentReplyConvert
;
...
...
@@ -12,6 +14,7 @@ import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -29,9 +32,22 @@ public class OrderCommentReplyServiceImpl implements OrderCommentReplyService {
@Autowired
private
OrderCommentReplayMapper
orderCommentReplayMapper
;
/**
* 分页获取评论回复
* @param orderCommentReplyPageDTO
* @return
*/
@Override
public
List
<
OrderCommentReplyPageBO
>
getOrderCommentReplyPage
(
OrderCommentReplyPageDTO
orderCommentReplyPageDTO
)
{
return
null
;
public
OrderCommentReplyPageBO
getOrderCommentReplyPage
(
OrderCommentReplyPageDTO
orderCommentReplyPageDTO
)
{
OrderCommentReplyPageBO
orderCommentReplyPageBO
=
new
OrderCommentReplyPageBO
();
//评论回复总数
Integer
totalCount
=
orderCommentReplayMapper
.
selectCommentReplyTotalCountByCommentId
(
orderCommentReplyPageDTO
.
getCommentId
(),
orderCommentReplyPageDTO
.
getUserType
());
//分页获取评论回复
List
<
OrderCommentReplyDO
>
orderCommentReplyDOList
=
orderCommentReplayMapper
.
selectCommentReplyPage
(
orderCommentReplyPageDTO
);
orderCommentReplyPageBO
.
setTotal
(
totalCount
);
orderCommentReplyPageBO
.
setOrderCommentReplayItems
(
OrderCommentReplyConvert
.
INSTANCE
.
convertOrderCommentReplayItem
(
orderCommentReplyDOList
));
return
orderCommentReplyPageBO
;
}
...
...
@@ -55,4 +71,16 @@ public class OrderCommentReplyServiceImpl implements OrderCommentReplyService {
return
OrderCommentReplyConvert
.
INSTANCE
.
convert
(
orderCommentReplyDO
);
}
/**
* 获取商家评论回复
* @param commentId
* @return
*/
@Override
public
List
<
OrderCommentMerchantReplyBO
>
getOrderCommentMerchantReply
(
Integer
commentId
)
{
List
<
OrderCommentReplyDO
>
orderCommentReplyDOList
=
orderCommentReplayMapper
.
selectCommentMerchantReplyByCommentIdAndUserType
(
commentId
,
OrderReplyUserTypeEnum
.
MERCHANT
.
getValue
());
return
OrderCommentReplyConvert
.
INSTANCE
.
convert
(
orderCommentReplyDOList
);
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java
浏览文件 @
2c57d294
...
...
@@ -2,7 +2,7 @@ package cn.iocoder.mall.order.biz.service;
import
cn.iocoder.mall.order.api.OrderCommentService
;
import
cn.iocoder.mall.order.api.bo.OrderCommentCreateBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfo
AndMerchantReply
BO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentInfoBO
;
import
cn.iocoder.mall.order.api.bo.OrderCommentPageBO
;
import
cn.iocoder.mall.order.api.constant.OrderReplyUserTypeEnum
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
...
...
@@ -15,7 +15,6 @@ import cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -57,9 +56,7 @@ public class OrderCommentServiceImpl implements OrderCommentService {
public
OrderCommentPageBO
getOrderCommentPage
(
OrderCommentPageDTO
orderCommentPageDTO
)
{
OrderCommentPageBO
orderCommentPageBO
=
new
OrderCommentPageBO
();
//分页内容
int
offset
=
(
orderCommentPageDTO
.
getPageNo
()
-
1
)
*
orderCommentPageDTO
.
getPageSize
();
List
<
OrderCommentDO
>
orderCommentDOList
=
orderCommentMapper
.
selectCommentPage
(
orderCommentPageDTO
.
getProductSkuId
(),
offset
,
orderCommentPageDTO
.
getPageSize
());
List
<
OrderCommentDO
>
orderCommentDOList
=
orderCommentMapper
.
selectCommentPage
(
orderCommentPageDTO
);
//分页评论的 id
List
<
Integer
>
commentIds
=
orderCommentDOList
.
stream
().
map
(
x
->
x
.
getId
()).
collect
(
Collectors
.
toList
());
//获取商家最新的评论回复
...
...
@@ -79,9 +76,12 @@ public class OrderCommentServiceImpl implements OrderCommentService {
return
orderCommentPageBO
;
}
@Override
public
OrderCommentInfoAndMerchantReplyBO
getOrderCommentInfo
(
Integer
commentId
,
Integer
userType
)
{
return
null
;
public
OrderCommentInfoBO
getOrderCommentInfo
(
Integer
commentId
)
{
//查询评论详情
OrderCommentDO
orderCommentDO
=
orderCommentMapper
.
selectCommentInfoByCommentId
(
commentId
);
return
OrderCommentConvert
.
INSTANCE
.
convertOrderCommentInfoBO
(
orderCommentDO
);
}
@Override
...
...
order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml
浏览文件 @
2c57d294
...
...
@@ -35,7 +35,7 @@
WHERE
product_sku_id = #{productSkuId}
ORDER BY create_time DESC
LIMIT
#{offset}, #{limit
}
LIMIT
${pageNo*pageSize},${pageSize
}
</select>
<!--根据评论 id 获取用户详情-->
...
...
@@ -45,8 +45,6 @@
FROM order_comment
WHERE
id = #{id}
ORDER BY create_time DESC
LIMIT ${ pageNo * pageSize },${ pageSize }
</select>
</mapper>
\ No newline at end of file
order/order-service-impl/src/main/resources/mapper/OrderCommentReplayMapper.xml
浏览文件 @
2c57d294
...
...
@@ -16,7 +16,7 @@
</insert>
<!--根据评论 id 和用户类型获取商家回复列表-->
<select
id=
"selectCommentMerchantReplyByCommentId"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO"
>
<select
id=
"selectCommentMerchantReplyByCommentId
AndUserType
"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM order_comment_replay
...
...
@@ -30,7 +30,7 @@
<!--根据评论 id 和用户类型获取评论总数-->
<select
id=
"selectCommentReplyTotalCountByCommentId"
parameterType=
"Integer"
resultType=
"java.lang.Integer"
>
SELECT
COUNT
(*)
COUNT(*)
FROM order_comment_replay
WHERE
comment_id = #{commentId}
...
...
@@ -48,7 +48,7 @@
AND
user_type = #{userType}
ORDER BY create_time DESC
LIMIT ${pageNo
* pageSize},
${pageSize}
LIMIT ${pageNo
*pageSize},
${pageSize}
</select>
<!--根据评论 id 查询商家最新的评论列表-->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论