|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ylx.massage.domain.Product;
|
|
import com.ylx.massage.domain.Product;
|
|
|
-import com.ylx.massage.domain.TXiangmu;
|
|
|
|
|
import com.ylx.massage.domain.dto.OptionDTO;
|
|
import com.ylx.massage.domain.dto.OptionDTO;
|
|
|
import com.ylx.massage.domain.dto.ServiceOptionDTO;
|
|
import com.ylx.massage.domain.dto.ServiceOptionDTO;
|
|
|
import com.ylx.massage.domain.vo.ProductOptionVO;
|
|
import com.ylx.massage.domain.vo.ProductOptionVO;
|
|
@@ -13,11 +12,11 @@ import com.ylx.massage.domain.vo.ProductServiceOptionVO;
|
|
|
import com.ylx.massage.enums.ProductTypeEnum;
|
|
import com.ylx.massage.enums.ProductTypeEnum;
|
|
|
import com.ylx.massage.service.ProductSelectionService;
|
|
import com.ylx.massage.service.ProductSelectionService;
|
|
|
import com.ylx.massage.service.ProductService;
|
|
import com.ylx.massage.service.ProductService;
|
|
|
-import com.ylx.massage.service.TXiangmuService;
|
|
|
|
|
|
|
+import com.ylx.project.domain.Project;
|
|
|
|
|
+import com.ylx.project.service.ProjectService;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -25,7 +24,7 @@ import java.util.stream.Collectors;
|
|
|
public class ProductSelectionServiceImpl implements ProductSelectionService {
|
|
public class ProductSelectionServiceImpl implements ProductSelectionService {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- private TXiangmuService xiangmuService; // 项目服务
|
|
|
|
|
|
|
+ private ProjectService projectService;
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private ProductService productService; // 积分商品服务
|
|
private ProductService productService; // 积分商品服务
|
|
@@ -51,7 +50,7 @@ public class ProductSelectionServiceImpl implements ProductSelectionService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Page<ProductServiceOptionVO> serviceOptionsPage(ServiceOptionDTO dto) {
|
|
public Page<ProductServiceOptionVO> serviceOptionsPage(ServiceOptionDTO dto) {
|
|
|
- Page<ProductServiceOptionVO> resultPage = xiangmuService.selectServiceOptionsPage(new Page(dto.getCurrent(), dto.getSize()), dto);
|
|
|
|
|
|
|
+ Page<ProductServiceOptionVO> resultPage = projectService.selectServiceOptionsPage(new Page(dto.getCurrent(), dto.getSize()), dto);
|
|
|
return resultPage;
|
|
return resultPage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -85,19 +84,19 @@ public class ProductSelectionServiceImpl implements ProductSelectionService {
|
|
|
*/
|
|
*/
|
|
|
private Page<ProductOptionVO> queryProjectProducts(Page page, OptionDTO dto) {
|
|
private Page<ProductOptionVO> queryProjectProducts(Page page, OptionDTO dto) {
|
|
|
// 构建查询条件
|
|
// 构建查询条件
|
|
|
- LambdaQueryWrapper<TXiangmu> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- wrapper.eq(TXiangmu::getIsDelete, 0);
|
|
|
|
|
|
|
+ LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ wrapper.eq(Project::getIsDelete, 0);
|
|
|
if (StrUtil.isNotEmpty(dto.getTitle())) {
|
|
if (StrUtil.isNotEmpty(dto.getTitle())) {
|
|
|
- wrapper.like(TXiangmu::getcTitle, dto.getTitle());
|
|
|
|
|
|
|
+ wrapper.like(Project::getCTitle, dto.getTitle());
|
|
|
}
|
|
}
|
|
|
// 执行分页查询
|
|
// 执行分页查询
|
|
|
- Page<TXiangmu> xiangmuPage = xiangmuService.page(page, wrapper);
|
|
|
|
|
|
|
+ Page<Project> xiangmuPage = this.projectService.page(page, wrapper);
|
|
|
|
|
|
|
|
// 转换 VO
|
|
// 转换 VO
|
|
|
return convertToVOPage(xiangmuPage, x -> {
|
|
return convertToVOPage(xiangmuPage, x -> {
|
|
|
ProductOptionVO vo = new ProductOptionVO();
|
|
ProductOptionVO vo = new ProductOptionVO();
|
|
|
- vo.setId(x.getcId()); // String 直接赋值
|
|
|
|
|
- vo.setTitle(x.getcTitle());
|
|
|
|
|
|
|
+ vo.setId(x.getId().toString()); // String 直接赋值
|
|
|
|
|
+ vo.setTitle(x.getCTitle());
|
|
|
vo.setProductType(0); // 设置商品类型
|
|
vo.setProductType(0); // 设置商品类型
|
|
|
return vo;
|
|
return vo;
|
|
|
});
|
|
});
|
|
@@ -113,7 +112,7 @@ public class ProductSelectionServiceImpl implements ProductSelectionService {
|
|
|
*/
|
|
*/
|
|
|
private Page<ProductOptionVO> queryAllProductsUnion(Page page, OptionDTO dto) {
|
|
private Page<ProductOptionVO> queryAllProductsUnion(Page page, OptionDTO dto) {
|
|
|
// 调用自定义 SQL
|
|
// 调用自定义 SQL
|
|
|
- IPage<ProductOptionVO> resultPage = xiangmuService.selectOptionUnionPage(page, dto);
|
|
|
|
|
|
|
+ IPage<ProductOptionVO> resultPage = this.projectService.selectOptionUnionPage(page, dto);
|
|
|
|
|
|
|
|
// 将 IPage 转为具体的 Page 实现类返回(如果需要)
|
|
// 将 IPage 转为具体的 Page 实现类返回(如果需要)
|
|
|
Page<ProductOptionVO> returnPage = new Page<>(page.getCurrent(), page.getSize());
|
|
Page<ProductOptionVO> returnPage = new Page<>(page.getCurrent(), page.getSize());
|