From 437a8ae4bcca79e8886662a40c11f499fea1a25e Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期四, 20 四月 2023 18:43:37 +0800
Subject: [PATCH] 小程序首页

---
 hrt-modules/hrt-system/src/main/java/com/hrt/system/service/impl/ShopServiceImpl.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/hrt-modules/hrt-system/src/main/java/com/hrt/system/service/impl/ShopServiceImpl.java b/hrt-modules/hrt-system/src/main/java/com/hrt/system/service/impl/ShopServiceImpl.java
index f5b753b..2aade65 100644
--- a/hrt-modules/hrt-system/src/main/java/com/hrt/system/service/impl/ShopServiceImpl.java
+++ b/hrt-modules/hrt-system/src/main/java/com/hrt/system/service/impl/ShopServiceImpl.java
@@ -1,10 +1,23 @@
 package com.hrt.system.service.impl;
 
 import com.hrt.system.domain.poji.shop.Shop;
+import com.hrt.system.domain.poji.shop.ShopCertificate;
+import com.hrt.system.domain.poji.shop.ShopFile;
+import com.hrt.system.domain.poji.shop.ShopRelTag;
+import com.hrt.system.domain.vo.AppShopInfoVo;
 import com.hrt.system.mapper.shop.ShopMapper;
+import com.hrt.system.service.shop.ShopCertificateService;
+import com.hrt.system.service.shop.ShopFileService;
+import com.hrt.system.service.shop.ShopRelTagService;
 import com.hrt.system.service.shop.ShopService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
+import org.springframework.context.annotation.Bean;
 import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.StringJoiner;
 
 /**
  * <p>
@@ -17,4 +30,47 @@
 @Service
 public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService {
 
+    @Resource
+    private ShopMapper shopMapper;
+
+    @Resource
+    private ShopFileService shopFileService;
+
+    @Resource
+    private ShopCertificateService shopCertificateService;
+
+    /**
+     * 获取商户详情
+     * @param shopId
+     * @return
+     */
+    @Override
+    public AppShopInfoVo getShopInfo(Long shopId){
+        AppShopInfoVo appShopInfoVo = new AppShopInfoVo();
+        Shop shop = this.getById(shopId);
+        BeanUtils.copyProperties(shop,appShopInfoVo);
+        //商户地址
+        appShopInfoVo.setShopAddress(shop.getShopAreaName()+shop.getShopAddress());
+        //商品图片
+        List<ShopFile> shopFileList = shopFileService.listShopFileByShopId(shopId);
+        String shopPicture = null;
+        StringJoiner shopBanners = new StringJoiner(",");
+        if(shopFileList!=null&&!shopFileList.isEmpty()){
+            for(ShopFile shopFile : shopFileList){
+                if(shopFile.getFileType()==1){
+                    shopPicture = shopFile.getFileUrl();
+                }else{
+                    shopBanners.add(shopFile.getFileUrl());
+                }
+            }
+        }
+        appShopInfoVo.setShopPicture(shopPicture);
+        appShopInfoVo.setShopBanners(shopBanners.toString());
+        //商户证书
+        List<ShopCertificate> shopCertificateList = shopCertificateService.listShopCertificateByShopId(shopId);
+        if(shopCertificateList!=null&&!shopCertificateList.isEmpty()){
+            appShopInfoVo.setShopCertificateList(shopCertificateList);
+        }
+        return appShopInfoVo;
+    }
 }

--
Gitblit v1.7.1