|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
*/ |
|
|
|
|
package co.yixiang.modules.evaluation.rest; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import co.yixiang.domain.PageResult; |
|
|
|
|
import co.yixiang.dozer.service.IGenerator; |
|
|
|
|
import co.yixiang.logging.aop.log.Log; |
|
|
|
@ -15,11 +16,13 @@ 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.expert.service.dto.YxStoreExpertDto; |
|
|
|
|
import co.yixiang.modules.expert.service.dto.YxStoreExpertQueryCriteria; |
|
|
|
|
import co.yixiang.modules.product.domain.YxStoreProduct; |
|
|
|
|
import co.yixiang.modules.product.service.YxStoreProductService; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
@ -29,6 +32,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author ssj |
|
|
|
|
* @date 2022-09-21 |
|
|
|
@ -37,11 +43,14 @@ import java.util.Arrays;
|
|
|
|
|
@Api(tags = " Evaluation管理") |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/api/yxEvaluation") |
|
|
|
|
@Slf4j |
|
|
|
|
public class YxEvaluationController { |
|
|
|
|
|
|
|
|
|
private final YxEvaluationService yxEvaluationService; |
|
|
|
|
private final IGenerator generator; |
|
|
|
|
|
|
|
|
|
private final YxStoreProductService productService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log("导出数据") |
|
|
|
|
@ApiOperation("导出数据") |
|
|
|
@ -56,6 +65,14 @@ public class YxEvaluationController {
|
|
|
|
|
@ApiOperation("查询 评测") |
|
|
|
|
// @PreAuthorize("@ss.hasAnyPermissions('admin','yxEvaluation:list')")
|
|
|
|
|
public ResponseEntity<PageResult<YxEvaluationDto>> getYxEvaluations(YxEvaluationQueryCriteria criteria, Pageable pageable){ |
|
|
|
|
if (ObjectUtil.isNotEmpty(criteria.getExpertName())){ |
|
|
|
|
List<YxStoreProduct> pList = productService.list(Wrappers.<YxStoreProduct>lambdaQuery() |
|
|
|
|
.like(YxStoreProduct::getStoreName, criteria.getExpertName())); |
|
|
|
|
if (ObjectUtil.isNotEmpty(pList)){ |
|
|
|
|
List<String> ids = pList.stream().map(p-> String.valueOf(p.getId())).collect(Collectors.toList()); |
|
|
|
|
criteria.setProduct(ids); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return new ResponseEntity<>(yxEvaluationService.queryAll(criteria,pageable),HttpStatus.OK); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|