|
|
|
@ -14,21 +14,30 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
|
|
|
|
|
import co.yixiang.common.utils.QueryHelpPlus; |
|
|
|
|
import co.yixiang.domain.PageResult; |
|
|
|
|
import co.yixiang.dozer.service.IGenerator; |
|
|
|
|
import co.yixiang.enums.CommonEnum; |
|
|
|
|
import co.yixiang.enums.ShopCommonEnum; |
|
|
|
|
import co.yixiang.exception.ErrorRequestException; |
|
|
|
|
import co.yixiang.modules.entry.domain.YxStoreEntry; |
|
|
|
|
import co.yixiang.modules.evaluation.domain.YxEvaluation; |
|
|
|
|
import co.yixiang.modules.evaluation.service.YxEvaluationService; |
|
|
|
|
import co.yixiang.modules.evaluation.service.dto.YxEvaluationDto; |
|
|
|
|
import co.yixiang.modules.evaluation.service.dto.YxEvaluationQueryCriteria; |
|
|
|
|
import co.yixiang.modules.evaluation.service.mapper.YxEvaluationMapper; |
|
|
|
|
import co.yixiang.modules.evaluation.vo.YxEvaluationQueryVo; |
|
|
|
|
import co.yixiang.modules.product.domain.YxStoreProduct; |
|
|
|
|
import co.yixiang.modules.product.service.YxStoreProductService; |
|
|
|
|
import co.yixiang.modules.product.service.mapper.StoreProductMapper; |
|
|
|
|
import co.yixiang.modules.product.vo.ProductVo; |
|
|
|
|
import co.yixiang.modules.product.vo.YxStoreProductQueryVo; |
|
|
|
|
import co.yixiang.utils.EntryDTO; |
|
|
|
|
import co.yixiang.utils.FileUtil; |
|
|
|
|
import co.yixiang.utils.EvaluationDTO; |
|
|
|
|
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.github.pagehelper.PageInfo; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
@ -53,6 +62,7 @@ import java.util.Map;
|
|
|
|
|
public class YxEvaluationServiceImpl extends BaseServiceImpl<YxEvaluationMapper, YxEvaluation> implements YxEvaluationService { |
|
|
|
|
|
|
|
|
|
private final IGenerator generator; |
|
|
|
|
private YxEvaluationMapper yxEvaluationMapper; |
|
|
|
|
private StoreProductMapper storeProductMapper; |
|
|
|
|
private final YxStoreProductService yxStoreProductService; |
|
|
|
|
|
|
|
|
@ -111,7 +121,7 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl<YxEvaluationMapper,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* app获取评测列表 |
|
|
|
|
* 商户后台获取评测列表 |
|
|
|
|
* @return List |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -126,4 +136,34 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl<YxEvaluationMapper,
|
|
|
|
|
}); |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* app首页评测列表 |
|
|
|
|
* @return List |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<YxEvaluationQueryVo> getList(int page,int limit){ |
|
|
|
|
LambdaQueryWrapper<YxEvaluation> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(YxEvaluation::getIsShow, ShopCommonEnum.SHOW_1.getValue()) |
|
|
|
|
.orderByAsc(YxEvaluation::getSort); |
|
|
|
|
Page<YxEvaluation> pageModel = new Page<>(page, limit); |
|
|
|
|
IPage<YxEvaluation> pageList = yxEvaluationMapper.selectPage(pageModel, wrapper); |
|
|
|
|
return generator.convert(pageList.getRecords(), YxEvaluationQueryVo.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* app查询评测 |
|
|
|
|
* @return List |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "id", value = "词条ID", paramType = "query", dataType = "int",dataTypeClass = Integer.class) |
|
|
|
|
}) |
|
|
|
|
public EvaluationDTO getEvaluationById(int id) { |
|
|
|
|
EvaluationDTO evaluationDTO=generator.convert(this.baseMapper.selectById(id), EvaluationDTO.class); |
|
|
|
|
YxStoreProduct yxStoreProduct = yxStoreProductService.getProductInfo(Long.valueOf(evaluationDTO.getProduct())); |
|
|
|
|
evaluationDTO.setProductInfo(yxStoreProduct); |
|
|
|
|
return evaluationDTO; |
|
|
|
|
// return generator.convert(this.baseMapper.selectById(id), EvaluationDTO.class);
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|