Jelajahi Sumber

商家平台端门店装修

qrs 1 bulan lalu
induk
melakukan
d2962bb088

+ 11 - 3
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/StorePlatformRenovationController.java

@@ -24,11 +24,19 @@ public class StorePlatformRenovationController {
     private final StorePlatformRenovationService storePlatformRenovationService;
 
     @ApiOperation(value = "web端查询经营板块信息")
-    @ApiOperationSupport(order = 1)
+    @ApiOperationSupport(order = 6)
     @GetMapping("/getBusinessSection")
     public R<List<StoreDictionaryVo>> getBusinessSection() {
-        log.info("StorePlatformRenovationController.getBusinessSection");
-        return R.data(new ArrayList<>());
+        log.info("StoreInfoController.getBusinessSection");
+        return R.data(storePlatformRenovationService.getBusinessSection());
+    }
+
+    @ApiOperation(value = "web端查询经营板块的经营种类信息")
+    @ApiOperationSupport(order = 6)
+    @GetMapping("/getBusinessSectionTypes")
+    public R<List<StoreDictionaryVo>> getBusinessSectionTypes(@RequestParam("parentId") String parentId) {
+        log.info("StoreInfoController.getBusinessSectionTypes?parentId={}", parentId);
+        return R.data(storePlatformRenovationService.getBusinessSectionTypes(parentId));
     }
 
     @ApiOperation(value = "门店装修-详细信息")

+ 12 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/StorePlatformRenovationService.java

@@ -1,9 +1,21 @@
 package shop.alien.storeplatform.service;
 
+import shop.alien.entity.store.vo.StoreDictionaryVo;
 import shop.alien.entity.store.vo.StoreMainInfoVo;
 
+import java.util.List;
+
 public interface StorePlatformRenovationService {
 
+    /**
+     * web端查询经营板块信息
+     */
+    List<StoreDictionaryVo> getBusinessSection();
+
+    /**
+     * web端查询经营板块的经营种类信息
+     */
+    List<StoreDictionaryVo> getBusinessSectionTypes(String parentId);
     StoreMainInfoVo getDecorationDetail(Integer id);
 
 }

+ 29 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StorePlatformRenovationServiceImpl.java

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.stereotype.Service;
 import shop.alien.entity.store.*;
+import shop.alien.entity.store.vo.StoreDictionaryVo;
 import shop.alien.entity.store.vo.StoreMainInfoVo;
 import shop.alien.mapper.*;
 import shop.alien.storeplatform.service.StorePlatformRenovationService;
@@ -15,6 +17,7 @@ import java.text.SimpleDateFormat;
 import java.time.Duration;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -29,6 +32,32 @@ public class StorePlatformRenovationServiceImpl extends ServiceImpl<StoreInfoMap
     private final StoreLabelMapper storeLabelMapper;
     private final StoreBusinessInfoMapper storeBusinessInfoMapper;
     private final StoreImgMapper storeImgMapper;
+    private final StoreDictionaryMapper storeDictionaryMapper;
+
+    @Override
+    public List<StoreDictionaryVo> getBusinessSection() {
+        List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").ne(StoreDictionary::getDictId, 0));
+        List<StoreDictionaryVo> voList = new ArrayList<>();
+        for (StoreDictionary storeDictionary : businessSection) {
+            StoreDictionaryVo vo = new StoreDictionaryVo();
+            BeanUtils.copyProperties(storeDictionary, vo);
+            voList.add(vo);
+        }
+        return voList;
+    }
+
+    @Override
+    public List<StoreDictionaryVo> getBusinessSectionTypes(String parentId) {
+        StoreDictionary businessSection = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, parentId));
+        List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getParentId, businessSection.getId()));
+        List<StoreDictionaryVo> voList = new ArrayList<>();
+        for (StoreDictionary storeDictionary : storeDictionaries) {
+            StoreDictionaryVo vo = new StoreDictionaryVo();
+            BeanUtils.copyProperties(storeDictionary, vo);
+            voList.add(vo);
+        }
+        return voList;
+    }
 
     @Override
     public StoreMainInfoVo getDecorationDetail(Integer id) {