Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
e7c94648
提交
e7c94648
authored
6月 13, 2019
作者:
wangtongzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单评论状态接口
上级
9b08c591
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
243 行增加
和
28 行删除
+243
-28
OrderCommentController.java
.../application/controller/users/OrderCommentController.java
+18
-4
OrderCommentService.java
...n/java/cn/iocoder/mall/order/api/OrderCommentService.java
+8
-0
OrderCommentCreateBO.java
...va/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java
+1
-0
OrderCommentInfoBO.java
...java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java
+3
-2
OrderCommentReplyPageBO.java
...cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java
+2
-1
OrderCommentStateInfoPageBO.java
...ocoder/mall/order/api/bo/OrderCommentStateInfoPageBO.java
+87
-0
OrderCommentCreateDTO.java
.../cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java
+0
-1
OrderCommentStateInfoPageDTO.java
...oder/mall/order/api/dto/OrderCommentStateInfoPageDTO.java
+38
-0
OrderCommentConvert.java
...n/iocoder/mall/order/biz/convert/OrderCommentConvert.java
+13
-4
OrderCommentReplyConvert.java
...oder/mall/order/biz/convert/OrderCommentReplyConvert.java
+0
-1
OrderCommentMapper.java
...ava/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java
+18
-3
OrderCommentDO.java
.../cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java
+6
-1
OrderCommentServiceImpl.java
...coder/mall/order/biz/service/OrderCommentServiceImpl.java
+20
-8
OrderCommentMapper.xml
...ice-impl/src/main/resources/mapper/OrderCommentMapper.xml
+29
-3
没有找到文件。
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderCommentController.java
浏览文件 @
e7c94648
...
...
@@ -7,8 +7,12 @@ 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.bo.OrderCommentStateInfoPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentPageDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO
;
import
cn.iocoder.mall.user.sdk.annotation.RequiresLogin
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.dubbo.config.annotation.Reference
;
...
...
@@ -39,20 +43,20 @@ public class OrderCommentController {
@PostMapping
(
"create_order_comment"
)
//@RequiresLogin
@ApiOperation
(
value
=
"创建订单"
)
public
CommonResult
<
OrderCommentCreateBO
>
createOrder
(
@RequestBody
@Validated
OrderCommentCreateDTO
orderCommentCreateDTO
)
{
@ApiOperation
(
value
=
"创建订单评论"
)
public
CommonResult
<
OrderCommentCreateBO
>
createOrderComment
(
@RequestBody
@Validated
OrderCommentCreateDTO
orderCommentCreateDTO
)
{
Integer
userId
=
UserSecurityContextHolder
.
getContext
().
getUserId
();
orderCommentCreateDTO
.
setUserId
(
userId
);
return
success
(
orderCommentService
.
createOrderComment
(
orderCommentCreateDTO
));
}
@GetMapping
(
"order_comment_page"
)
//@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
();
...
...
@@ -61,4 +65,14 @@ public class OrderCommentController {
return
success
(
orderCommentInfoAndMerchantReplyBO
);
}
@GetMapping
//@RequiresLogin
@ApiOperation
(
value
=
"获取订单评论状态分页"
)
public
CommonResult
<
OrderCommentStateInfoPageBO
>
getOrderCommentStateInfoPage
(
@Validated
OrderCommentStateInfoPageDTO
orderCommentStateInfoPageDTO
){
//Integer userId = UserSecurityContextHolder.getContext().getUserId();
//orderCommentStateInfoPageDTO.setUserId(userId);
return
success
(
orderCommentService
.
getOrderCommentStateInfoPage
(
orderCommentStateInfoPageDTO
));
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderCommentService.java
浏览文件 @
e7c94648
...
...
@@ -3,8 +3,10 @@ package cn.iocoder.mall.order.api;
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.bo.OrderCommentStateInfoPageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentPageDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO
;
/**
* 订单评论模块
...
...
@@ -39,6 +41,12 @@ public interface OrderCommentService {
OrderCommentInfoBO
getOrderCommentInfo
(
Integer
commentId
);
/**
* 获取订单评论状态详情
* @param orderCommentStateInfoPageDTO
* @return
*/
OrderCommentStateInfoPageBO
getOrderCommentStateInfoPage
(
OrderCommentStateInfoPageDTO
orderCommentStateInfoPageDTO
);
/**
* 订单评价超时自动好评
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentCreateBO.java
浏览文件 @
e7c94648
...
...
@@ -21,4 +21,5 @@ public class OrderCommentCreateBO implements Serializable {
* 订单评论 id
*/
private
Integer
id
;
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentInfoBO.java
浏览文件 @
e7c94648
...
...
@@ -4,6 +4,7 @@ package cn.iocoder.mall.order.api.bo;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
...
...
@@ -16,7 +17,7 @@ import java.util.Date;
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentInfoBO
{
public
class
OrderCommentInfoBO
implements
Serializable
{
/**
* 评论 id
...
...
@@ -52,7 +53,7 @@ public class OrderCommentInfoBO {
/**
* 点赞数
*/
private
Integer
collect
Count
;
private
Integer
like
Count
;
/**
* 创建时间
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentReplyPageBO.java
浏览文件 @
e7c94648
...
...
@@ -4,6 +4,7 @@ package cn.iocoder.mall.order.api.bo;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -17,7 +18,7 @@ import java.util.List;
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentReplyPageBO
{
public
class
OrderCommentReplyPageBO
implements
Serializable
{
/**
* 评论回复总数
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderCommentStateInfoPageBO.java
0 → 100644
浏览文件 @
e7c94648
package
cn
.
iocoder
.
mall
.
order
.
api
.
bo
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* 订单评论状态详情分页(这么设计因为这个接口需要登陆以后才能看到所以与订单分页接口分开)
*
* @author wtz
* @time 2019-06-07 10:39
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentStateInfoPageBO
implements
Serializable
{
/**
* (待/已)评论总数
*/
private
Integer
total
;
/**
* 评论状态
*/
private
List
<
OrderCommentStateInfoItem
>
orderCommentStateInfoItems
;
@Data
@Accessors
(
chain
=
true
)
public
static
class
OrderCommentStateInfoItem
{
/**
* 订单 id
*/
private
Integer
orderId
;
/**
* 订单编号
*/
private
String
orderNo
;
/**
* 商品 id
*/
private
Integer
productSpuId
;
/**
* 商品名称
*/
private
String
productSpuName
;
/**
* 商品 sku id
*/
private
Integer
productSkuId
;
/**
* 商品 sku 属性
*/
private
String
productSkuAttrs
;
/**
* 商品 sku 价格
*/
private
Integer
productSkuPrice
;
/**
* 商品 sku url
*/
private
String
productSkuPicUrl
;
/**
* 订单评论状态
*/
private
Integer
commentState
;
/**
* 创建时间
*/
private
Date
createTime
;
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentCreateDTO.java
浏览文件 @
e7c94648
...
...
@@ -55,7 +55,6 @@ public class OrderCommentCreateDTO implements Serializable {
private
String
productSkuPicUrl
;
@ApiModelProperty
(
value
=
"用户 id"
,
required
=
true
)
@NotNull
(
message
=
"用户 id 不能为空"
)
private
Integer
userId
;
@ApiModelProperty
(
value
=
"用户头像"
,
required
=
true
)
...
...
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCommentStateInfoPageDTO.java
0 → 100644
浏览文件 @
e7c94648
package
cn
.
iocoder
.
mall
.
order
.
api
.
dto
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
*
* 订单评论状态分页信息 query
*
* @author wtz
* @time 2019-06-07 10:45
*/
@Data
@Accessors
(
chain
=
true
)
public
class
OrderCommentStateInfoPageDTO
implements
Serializable
{
/**
* 用户 id
*/
private
Integer
userId
;
/**
* 评论状态
*/
private
Integer
commentState
;
/**
* 页码
*/
private
Integer
pageNo
;
/**
* 每页条数
*/
private
Integer
pageSize
;
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentConvert.java
浏览文件 @
e7c94648
...
...
@@ -2,7 +2,7 @@ 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.bo.OrderComment
StateInfo
PageBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderCommentDO
;
import
org.mapstruct.Mapper
;
...
...
@@ -12,10 +12,11 @@ import org.mapstruct.factory.Mappers;
import
java.util.List
;
/**
*
* 订单评论 convert
*
* @author wtz
* @time 2019-05-3
0
18:30
* @time 2019-05-3
1
18:30
*/
@Mapper
public
interface
OrderCommentConvert
{
...
...
@@ -23,12 +24,20 @@ public interface OrderCommentConvert {
OrderCommentConvert
INSTANCE
=
Mappers
.
getMapper
(
OrderCommentConvert
.
class
);
@Mappings
({})
OrderCommentDO
convert
(
OrderCommentCreateDTO
orderCommentCreateDTO
);
OrderCommentStateInfoPageBO
.
OrderCommentStateInfoItem
convertOrderCommentStateInfoItem
(
OrderCommentDO
orderCommentDO
);
@Mappings
({})
List
<
OrderCommentStateInfoPageBO
.
OrderCommentStateInfoItem
>
convertOrderCommentStateInfoItems
(
List
<
OrderCommentDO
>
orderCommentDOList
);
@Mappings
({})
OrderCommentCreateBO
convert
(
OrderCommentDO
orderCommentDO
);
OrderCommentDO
convertOrderCommentDO
(
OrderCommentCreateDTO
orderCommentCreateDTO
);
@Mappings
({})
OrderCommentCreateBO
convertOrderCommentCreateBO
(
OrderCommentDO
orderCommentDO
);
@Mappings
({})
OrderCommentInfoBO
convertOrderCommentInfoBO
(
OrderCommentDO
orderCommentDO
);
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/convert/OrderCommentReplyConvert.java
浏览文件 @
e7c94648
...
...
@@ -9,7 +9,6 @@ import org.mapstruct.Mapper;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
javax.validation.constraints.Max
;
import
java.util.List
;
/**
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderCommentMapper.java
浏览文件 @
e7c94648
package
cn
.
iocoder
.
mall
.
order
.
biz
.
dao
;
import
cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentPageDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCommentStateInfoPageDTO
;
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
;
...
...
@@ -53,5 +51,22 @@ public interface OrderCommentMapper{
OrderCommentDO
selectCommentInfoByCommentId
(
@Param
(
"id"
)
Integer
id
);
/**
* 订单评论状态信息详情
* @param orderCommentStateInfoPageDTO
* @return
*/
List
<
OrderCommentDO
>
selectOrderCommentStateInfoPage
(
OrderCommentStateInfoPageDTO
orderCommentStateInfoPageDTO
);
/**
* 订单评论状态总数
* @param userId,commentState
* @return
*/
int
selectOrderCommentStateInfoTotal
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"commentState"
)
Integer
commentState
);
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCommentDO.java
浏览文件 @
e7c94648
...
...
@@ -12,9 +12,9 @@ import lombok.experimental.Accessors;
* @time 2019-05-14 20:48
*
*/
@TableName
(
value
=
"order_comment"
)
@Data
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"order_comment"
)
public
class
OrderCommentDO
extends
BaseDO
{
/**
...
...
@@ -117,4 +117,9 @@ public class OrderCommentDO extends BaseDO {
*/
private
String
commentPics
;
/**
* 订单评论状态
*/
private
Integer
commentState
;
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderCommentServiceImpl.java
浏览文件 @
e7c94648
...
...
@@ -4,9 +4,11 @@ import cn.iocoder.mall.order.api.OrderCommentService;
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.bo.OrderCommentStateInfoPageBO
;
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.OrderCommentStateInfoPageDTO
;
import
cn.iocoder.mall.order.biz.convert.OrderCommentConvert
;
import
cn.iocoder.mall.order.biz.dao.OrderCommentMapper
;
import
cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper
;
...
...
@@ -37,19 +39,13 @@ public class OrderCommentServiceImpl implements OrderCommentService {
private
OrderCommentReplayMapper
orderCommentReplayMapper
;
@Autowired
private
OrderCommentService
orderCommentService
;
@Override
public
OrderCommentCreateBO
createOrderComment
(
OrderCommentCreateDTO
orderCommentCreateDTO
)
{
//首先判断订单状态是否处于待评价状态
//接下来就是入库
OrderCommentDO
orderCommentDO
=
OrderCommentConvert
.
INSTANCE
.
convert
(
orderCommentCreateDTO
);
OrderCommentDO
orderCommentDO
=
OrderCommentConvert
.
INSTANCE
.
convertOrderCommentDO
(
orderCommentCreateDTO
);
orderCommentDO
.
setCreateTime
(
new
Date
());
orderCommentDO
.
setUpdateTime
(
new
Date
());
orderCommentMapper
.
insert
(
orderCommentDO
);
return
OrderCommentConvert
.
INSTANCE
.
convert
(
orderCommentDO
);
return
OrderCommentConvert
.
INSTANCE
.
convert
OrderCommentCreateBO
(
orderCommentDO
);
}
@Override
...
...
@@ -84,6 +80,22 @@ public class OrderCommentServiceImpl implements OrderCommentService {
return
OrderCommentConvert
.
INSTANCE
.
convertOrderCommentInfoBO
(
orderCommentDO
);
}
@Override
public
OrderCommentStateInfoPageBO
getOrderCommentStateInfoPage
(
OrderCommentStateInfoPageDTO
orderCommentStateInfoPageDTO
)
{
OrderCommentStateInfoPageBO
orderCommentStateInfoPageBO
=
new
OrderCommentStateInfoPageBO
();
//总数
int
total
=
orderCommentMapper
.
selectOrderCommentStateInfoTotal
(
orderCommentStateInfoPageDTO
.
getUserId
(),
orderCommentStateInfoPageDTO
.
getCommentState
());
//查询评论状态详情
List
<
OrderCommentDO
>
orderCommentDOList
=
orderCommentMapper
.
selectOrderCommentStateInfoPage
(
orderCommentStateInfoPageDTO
);
//转化评论状态详情
List
<
OrderCommentStateInfoPageBO
.
OrderCommentStateInfoItem
>
orderCommentStateInfoItemList
=
OrderCommentConvert
.
INSTANCE
.
convertOrderCommentStateInfoItems
(
orderCommentDOList
);
orderCommentStateInfoPageBO
.
setTotal
(
total
);
orderCommentStateInfoPageBO
.
setOrderCommentStateInfoItems
(
orderCommentStateInfoItemList
);
return
orderCommentStateInfoPageBO
;
}
@Override
public
Boolean
OrderCommentTimeOutProductCommentTask
()
{
return
null
;
...
...
order/order-service-impl/src/main/resources/mapper/OrderCommentMapper.xml
浏览文件 @
e7c94648
...
...
@@ -5,17 +5,17 @@
<sql
id=
"FIELDS"
>
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
comment_pics,c
omment_state,c
reate_time,update_time
</sql>
<!--插入-->
<insert
id=
"insert"
parameterType=
"OrderCommentDO"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
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)
product_description_star,logistics_star,merchant_star,comment_content,comment_pics,c
omment_state,c
reate_time,update_time)
VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs},
#{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star},
#{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{createTime}, #{updateTime});
#{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{c
ommentState},#{c
reateTime}, #{updateTime});
</insert>
<!--根据 sku id 获取评论总数-->
...
...
@@ -47,4 +47,29 @@
id = #{id}
</select>
<!--分页获取订单评论状态信息详情-->
<select
id=
"selectOrderCommentStateInfoPage"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderCommentDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM order_comment
WHERE
user_id = #{userId}
AND
comment_state = #{commentState}
ORDER BY create_time DESC
LIMIT ${pageNo*pageSize},${pageSize}
</select>
<!--获取订单评论状态信息详情总数-->
<select
id=
"selectOrderCommentStateInfoTotal"
resultType=
"java.lang.Integer"
>
SELECT
COUNT(*)
FROM order_comment
WHERE
user_id = #{userId}
AND
comment_state = #{commentState}
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论