|
|
@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.google.gson.internal.LinkedTreeMap;
|
|
|
import com.yami.shop.bean.app.dto.ProdCommDataDto;
|
|
|
import com.yami.shop.bean.app.dto.ProdCommDto;
|
|
|
import com.yami.shop.bean.app.param.ProdCommParam;
|
|
|
@@ -35,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
@@ -127,8 +129,8 @@ public class ProdCommServiceImpl extends ServiceImpl<ProdCommMapper, ProdComm> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage<ProdComm> commList(PageParam<ProdComm> page, Long skuId,Integer commStatus) {
|
|
|
- IPage<ProdComm> commList = prodCommMapper.commList(page, skuId,commStatus);
|
|
|
+ public IPage<ProdComm> commList(PageParam<ProdComm> page, Long skuId,Long shopId,Integer commStatus) {
|
|
|
+ IPage<ProdComm> commList = prodCommMapper.commList(page, skuId,shopId,commStatus);
|
|
|
List<ProdComm> records = commList.getRecords();
|
|
|
if (!records.isEmpty()){
|
|
|
records.forEach(c->
|
|
|
@@ -137,4 +139,16 @@ public class ProdCommServiceImpl extends ServiceImpl<ProdCommMapper, ProdComm> i
|
|
|
}
|
|
|
return commList;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> commentCount(Long skuId, Long shopId) {
|
|
|
+ Map<String, Object> map = new LinkedTreeMap<>();
|
|
|
+ map.put("all", prodCommMapper.commentCount(skuId, shopId,null));
|
|
|
+ map.put("goodCount", prodCommMapper.commentCount(skuId, shopId,0));
|
|
|
+ map.put("middleCount", prodCommMapper.commentCount(skuId, shopId,1));
|
|
|
+ map.put("badCount", prodCommMapper.commentCount(skuId, shopId,2));
|
|
|
+ map.put("picCount", prodCommMapper.picCount(skuId, shopId));
|
|
|
+ map.put("goodRate", prodCommMapper.goodRate(skuId, shopId));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|