新增单品评价

This commit is contained in:
LIONCITYS\lioncity
2020-10-20 11:27:19 +08:00
parent 9ea1aaafdd
commit 6d06393ca4
2 changed files with 12 additions and 7 deletions

View File

@ -71,7 +71,7 @@ public class YxStoreCartQueryVo implements Serializable {
@ApiModelProperty(value = "唯一id")
private String unique;
@ApiModelProperty(value = "是否回复")
@ApiModelProperty(value = "是否评价")
private Integer isReply;
}

View File

@ -618,12 +618,17 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
.build();
productReplyService.save(storeProductReply);
//获取评价商品数量
int replyCount = productReplyService.count(new LambdaQueryWrapper<YxStoreProductReply>().eq(YxStoreProductReply::getOid, orderCartInfo.getOid()));
//购买商品数量
int cartCount = storeOrderCartInfoService.count(new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid, orderCartInfo.getOid()));
if(replyCount==cartCount){
YxStoreOrder storeOrder = new YxStoreOrder();
storeOrder.setStatus(OrderInfoEnum.STATUS_3.getValue());
storeOrder.setId(orderCartInfo.getOid());
yxStoreOrderMapper.updateById(storeOrder);
}
//增加状态
orderStatusService.create(orderCartInfo.getOid(),
OrderLogEnum.EVAL_ORDER.getValue(),
@ -1321,7 +1326,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
.map(cart -> {
YxStoreCartQueryVo cartQueryVo = JSON.parseObject(cart.getCartInfo(),YxStoreCartQueryVo.class);
cartQueryVo.setUnique(cart.getUnique());
//cartQueryVo.setIsReply(storeProductReplyService.replyCount(cart.getUnique()));
cartQueryVo.setIsReply(productReplyService.replyCount(cart.getUnique()));
return cartQueryVo;
})
.collect(Collectors.toList());