From 61eb0c71772553be99d55724fcb75809c0bfc692 Mon Sep 17 00:00:00 2001
From: sj <1304317391@qq.com>
Date: Tue, 20 Sep 2022 16:29:01 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F?=
=?UTF-8?q?=E7=AB=AF=E7=9A=84=E4=B8=93=E5=AE=B6=E5=92=8C=E5=93=81=E7=89=8C?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../expert/rest/AppStoreExpertController.java | 55 +++++++++++++++++
.../product/rest/AppStoreBrandController.java | 42 +++++++++++++
.../modules/expert/domain/YxStoreExpert.java | 8 +++
.../expert/service/YxStoreExpertService.java | 3 +
.../impl/YxStoreExpertServiceImpl.java | 20 ++++++
.../modules/store/domain/YxStoreBrand.java | 2 +-
.../store/service/YxStoreBrandService.java | 4 ++
.../service/impl/YxStoreBrandServiceImpl.java | 20 ++++++
.../co/yixiang/utils/location/BrandDTO.java | 33 ++++++++++
.../co/yixiang/utils/location/ExpertDTO.java | 61 +++++++++++++++++++
10 files changed, 247 insertions(+), 1 deletion(-)
create mode 100644 zsw-bxg/src/main/java/co/yixiang/app/modules/expert/rest/AppStoreExpertController.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/utils/location/BrandDTO.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/expert/rest/AppStoreExpertController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/expert/rest/AppStoreExpertController.java
new file mode 100644
index 00000000..19d2f348
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/expert/rest/AppStoreExpertController.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (C) 2018-2022
+ * All rights reserved, Designed By www.yixiang.co
+ * 注意:
+ * 本软件为www.yixiang.co开发研制,未经购买不得使用
+ * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
+ * 一经发现盗用、分享等行为,将追究法律责任,后果自负
+ */
+package co.yixiang.app.modules.expert.rest;
+
+import co.yixiang.annotation.AnonymousAccess;
+import cn.iocoder.yudao.framework.common.pojo.ApiResult;
+import co.yixiang.modules.expert.domain.YxStoreExpert;
+import co.yixiang.modules.expert.service.YxStoreExpertService;
+import co.yixiang.utils.CateDTO;
+import co.yixiang.utils.location.ExpertDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ *
+ * 专家前端控制器
+ *
+ *
+ * @author ssj
+ * @since 2022-9-20
+ */
+@Slf4j
+@RestController
+@Api(value = "店内专家", tags = "商城:专家")
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class AppStoreExpertController {
+
+ private final YxStoreExpertService yxStoreExpertService;
+
+
+ /**
+ * 商品分类列表
+ */
+ @AnonymousAccess
+ @GetMapping("/expert")
+ @ApiOperation(value = "专家列表",notes = "专家列表")
+ public ApiResult> getYxStoreExpertPageList(){
+ return ApiResult.ok(yxStoreExpertService.getList());
+ }
+
+}
+
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
new file mode 100644
index 00000000..12321567
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
@@ -0,0 +1,42 @@
+package co.yixiang.app.modules.product.rest;
+
+import cn.iocoder.yudao.framework.common.pojo.ApiResult;
+import co.yixiang.annotation.AnonymousAccess;
+import co.yixiang.modules.store.service.YxStoreBrandService;
+import co.yixiang.utils.location.BrandDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ *
+ * 商品品牌前端控制器
+ *
+ *
+ * @author ssj
+ * @since 2022-9-20
+ */
+@Slf4j
+@RestController
+@Api(value = "商品品牌", tags = "商城:商品品牌")
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class AppStoreBrandController {
+
+ private final YxStoreBrandService yxStoreBrandService;
+
+ /**
+ * 商品品牌列表
+ */
+ @AnonymousAccess
+ @GetMapping("/brand")
+ @ApiOperation(value = "商品品牌列表",notes = "商品品牌列表")
+ public ApiResult> getYxStoreBrandPageList(){
+ return ApiResult.ok(yxStoreBrandService.getList());
+ }
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java b/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java
index 85691552..3852ef07 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/expert/domain/YxStoreExpert.java
@@ -10,6 +10,7 @@ package co.yixiang.modules.expert.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import cn.hutool.core.bean.BeanUtil;
@@ -30,6 +31,13 @@ public class YxStoreExpert implements Serializable {
@TableId
private Long id;
+ /** 状态(0:显示,1:不显示) */
+ @ApiModelProperty(value = "状态(0:显示,1:隐藏)")
+ private Integer isShow;
+
+ /** 排序 */
+ @ApiModelProperty(value = "排序")
+ private Integer sort;
/** 商户Id(0为总后台管理员创建,不为0的时候是商户后台创建) */
private Integer merId;
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/YxStoreExpertService.java b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/YxStoreExpertService.java
index 5f9bb465..8cc27bb4 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/YxStoreExpertService.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/YxStoreExpertService.java
@@ -13,6 +13,7 @@ import co.yixiang.domain.PageResult;
import co.yixiang.modules.expert.domain.YxStoreExpert;
import co.yixiang.modules.expert.service.dto.YxStoreExpertDto;
import co.yixiang.modules.expert.service.dto.YxStoreExpertQueryCriteria;
+import co.yixiang.utils.location.ExpertDTO;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
@@ -24,6 +25,8 @@ import java.util.List;
*/
public interface YxStoreExpertService extends BaseService {
+ List getList();
+
/**
* 查询数据分页
* @param criteria 条件
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java
index a13baca4..d20f59e4 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/expert/service/impl/YxStoreExpertServiceImpl.java
@@ -12,12 +12,18 @@ 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.ShopCommonEnum;
+import co.yixiang.modules.category.domain.YxStoreCategory;
import co.yixiang.modules.expert.domain.YxStoreExpert;
import co.yixiang.modules.expert.service.YxStoreExpertService;
import co.yixiang.modules.expert.service.dto.YxStoreExpertDto;
import co.yixiang.modules.expert.service.dto.YxStoreExpertQueryCriteria;
import co.yixiang.modules.expert.service.mapper.YxStoreExpertMapper;
+import co.yixiang.utils.CateDTO;
import co.yixiang.utils.FileUtil;
+import co.yixiang.utils.TreeUtil;
+import co.yixiang.utils.location.ExpertDTO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@@ -51,6 +57,20 @@ public class YxStoreExpertServiceImpl extends BaseServiceImpl getList() {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(YxStoreExpert::getIsShow, ShopCommonEnum.SHOW_1.getValue())
+ .orderByAsc(YxStoreExpert::getSort);
+ List list = generator.convert(baseMapper.selectList(wrapper),ExpertDTO.class);
+// return TreeUtil.list2TreeConverter(list,0);
+ return list;
+ }
+
@Override
//@Cacheable
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java
index b7d25bc7..49584cc3 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java
@@ -46,7 +46,7 @@ public class YxStoreBrand implements Serializable {
private String pic;
- /** 是否推荐 */
+ /** 是否展示 */
private Integer isShow;
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/YxStoreBrandService.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/YxStoreBrandService.java
index 635e7bbb..62c12dfd 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/YxStoreBrandService.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/YxStoreBrandService.java
@@ -12,6 +12,8 @@ import co.yixiang.domain.PageResult;
import co.yixiang.modules.store.domain.YxStoreBrand;
import co.yixiang.modules.store.service.dto.YxStoreBrandDto;
import co.yixiang.modules.store.service.dto.YxStoreBrandQueryCriteria;
+import co.yixiang.utils.CateDTO;
+import co.yixiang.utils.location.BrandDTO;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
@@ -23,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
*/
public interface YxStoreBrandService extends BaseService {
+ List getList();
+
/**
* 查询数据分页
* @param criteria 条件
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/impl/YxStoreBrandServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/impl/YxStoreBrandServiceImpl.java
index 7d001bc0..b194e251 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/impl/YxStoreBrandServiceImpl.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/impl/YxStoreBrandServiceImpl.java
@@ -12,9 +12,14 @@ 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.ShopCommonEnum;
+import co.yixiang.modules.expert.domain.YxStoreExpert;
import co.yixiang.modules.store.domain.YxStoreBrand;
import co.yixiang.modules.store.service.vo.YxStoreBrandVO;
import co.yixiang.utils.FileUtil;
+import co.yixiang.utils.location.BrandDTO;
+import co.yixiang.utils.location.ExpertDTO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import com.github.pagehelper.PageInfo;
import co.yixiang.modules.store.service.YxStoreBrandService;
@@ -48,6 +53,21 @@ public class YxStoreBrandServiceImpl extends BaseServiceImpl getList() {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(YxStoreBrand::getIsShow, ShopCommonEnum.SHOW_1.getValue())
+ .orderByAsc(YxStoreBrand::getSort);
+ List list = generator.convert(baseMapper.selectList(wrapper),BrandDTO.class);
+// return TreeUtil.list2TreeConverter(list,0);
+ return list;
+ }
+
@Override
//@Cacheable
public PageResult queryAll(YxStoreBrandQueryCriteria criteria, Pageable pageable) {
diff --git a/zsw-bxg/src/main/java/co/yixiang/utils/location/BrandDTO.java b/zsw-bxg/src/main/java/co/yixiang/utils/location/BrandDTO.java
new file mode 100644
index 00000000..505585ce
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/utils/location/BrandDTO.java
@@ -0,0 +1,33 @@
+package co.yixiang.utils.location;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * 商城品牌分类
+ *
+ *
+ * @author ssj
+ * @since 2022-9-20
+ */
+public class BrandDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ private Long id;
+
+ /**
+ * 商品分类名称
+ */
+ private String brandName;
+
+ /**
+ * 缩略图url
+ */
+ private String pic;
+
+ private List children = new ArrayList<>();
+
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java b/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java
new file mode 100644
index 00000000..02fc9e96
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/utils/location/ExpertDTO.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (C) 2018-2022
+ * All rights reserved, Designed By www.yixiang.co
+
+ */
+package co.yixiang.utils.location;
+
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ * 商城商品分类
+ *
+ *
+ * @author hupeng
+ * @since 2019-09-08
+ */
+@Data
+public class ExpertDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ private Long id;
+
+ /**
+ * 专家名称
+ */
+ private String expertName;
+
+ /**
+ * 专家简介
+ */
+ private String expertInfo;
+
+ /**
+ * 专家的职级
+ */
+ private String expertStatus;
+
+ /**
+ * 专家所属单位
+ */
+ private String expertUnit;
+
+
+
+ /**
+ * 专家人像大图
+ */
+ private String image;
+
+ private List children = new ArrayList<>();
+
+}