|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
@@ -76,6 +77,8 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
|
|
|
|
|
|
private final TagsSynonymMapper tagsSynonymMapper;
|
|
|
|
|
|
+ private final LifeUserOrderMapper lifeUserOrderMapper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private TextModerationUtil textModerationUtil;
|
|
|
@Autowired
|
|
|
@@ -639,8 +642,15 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
|
|
|
}
|
|
|
}
|
|
|
storeComment.setCreatedUserId(storeComment.getUserId());
|
|
|
-
|
|
|
int i = this.save(storeComment) ? 0 : 1;
|
|
|
+
|
|
|
+ //判断类型如果为5是评价 更新订单表orderAppraise为1 订单已评价
|
|
|
+ if(businessType == 5){
|
|
|
+ LambdaUpdateWrapper<LifeUserOrder> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ lambdaUpdateWrapper.eq(LifeUserOrder :: getId, businessId );
|
|
|
+ lambdaUpdateWrapper.set(LifeUserOrder :: getOrderAppraise, 1);
|
|
|
+ lifeUserOrderMapper.update(null,lambdaUpdateWrapper);
|
|
|
+ }
|
|
|
StoreInfoScoreVo storeInfoScoreVo = storeCommentMapper.getCommentCountAndScoreInfo(storeId);
|
|
|
double total = storeInfoScoreVo.getTotal();
|
|
|
double scoreAvg = (total == 0 ? 0 : storeInfoScoreVo.getScore() / total);
|