diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CommentController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CommentController.java
index 2bbe1414..d01c7e63 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CommentController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CommentController.java
@@ -32,6 +32,7 @@ import cc.hiver.mall.service.ShopService;
import cc.hiver.mall.utils.CommentCacheUtil;
import cc.hiver.mall.utils.WorkerRedisCacheUtil;
import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -80,6 +81,22 @@ public class CommentController {
@ApiOperation("ä¿å˜")
public Result save( @RequestBody List
comment) {
comment.forEach(e -> {
+ if(e.getScore() == null || e.getScore().compareTo(BigDecimal.ZERO) == 0){
+ e.setScore(BigDecimal.valueOf(5));
+ }
+ if(StringUtils.isEmpty(e.getRemark())){
+ if(e.getScore().equals(5)){
+ e.setRemark("该用户觉得很好,给出了5星好评");
+ }else if(e.getScore().equals(4)){
+ e.setRemark("该用户觉得还å¯ä»¥ï¼Œç»™å‡ºäº†4星评价");
+ }else if(e.getScore().equals(3)){
+ e.setRemark("该用户觉得一般,给出了3星评价");
+ }else if(e.getScore().equals(2)){
+ e.setRemark("该用户觉得ä¸å¥½ï¼Œç»™å‡ºäº†2星评价");
+ }else{
+ e.setRemark("该用户觉得很ä¸å¥½ï¼Œç»™å‡ºäº†1星差评");
+ }
+ }
e.setCreateTime(new Date());
if(StringUtils.isEmpty(e.getParentId())){
e.setLevel(ShopConstant.SHOP_STATUS_LOCK);
@@ -175,6 +192,16 @@ public class CommentController {
return ResultUtil.success("åˆ é™¤æˆåŠŸ");
}
+ @RequestMapping(value = "/getByOrderId", method = RequestMethod.POST)
+ @ApiOperation("æ ¹æ®è®¢å•id获å–评论")
+ public Result> getByOrderId( @RequestParam String orderId) {
+ List comments = commentService.list(new LambdaQueryWrapper()
+ .eq(Comment::getOrderId, orderId)
+ .eq(Comment::getLevel, ShopConstant.SHOP_STATUS_LOCK)
+ .orderByDesc(Comment::getCreateTime));
+ return ResultUtil.data(comments);
+ }
+
@RequestMapping(value = "/getCommentList", method = RequestMethod.POST)
@ApiOperation("获å–店铺评论")
public Result> getCommentList( @RequestBody CommentQuery commentQuery) {
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
index e8b5b107..6970d64f 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/MallCouponController.java
@@ -61,6 +61,14 @@ public class MallCouponController {
private String couponId;
}
+ @Data
+ public static class UserCouponPageReq {
+ private String userId;
+ private String regionId;
+ private Integer pageNum = 1;
+ private Integer pageSize = 10;
+ }
+
@PostMapping("/add")
@ApiOperation(value = "æ·»åŠ /å‘è¡Œä¼˜æƒ åˆ¸")
public Result