qxy пре 1 недеља
родитељ
комит
cae60a371a

+ 10 - 0
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -442,6 +442,16 @@ public class StoreInfoController {
         return R.data(storeDetail);
     }
 
+    @ApiOperation(value = "中台web端获取店铺明细详情")
+    @ApiOperationSupport(order = 21)
+    @GetMapping("/getNewStoreDetail")
+    @ResponseBody
+    public R getNewStoreDetail(@RequestParam("id") String id) {
+        log.info("StoreInfoController.getStoreDetail?id={}", id);
+        StoreInfoVo storeDetail = storeInfoService.getNewStoreDetail(id);
+        return R.data(storeDetail);
+    }
+
     @ApiOperation(value = "获取门店代金券明细")
     @ApiOperationSupport(order = 7)
     @GetMapping("/getStoreCouponList")

+ 5 - 0
alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java

@@ -177,6 +177,11 @@ public interface StoreInfoService extends IService<StoreInfo> {
     StoreInfoVo getStoreDetail(String storeId, String userId, String jingdu, String weidu);
 
     /**
+     * 中台web端查询门店明细
+     */
+    StoreInfoVo getNewStoreDetail(String storeId);
+
+    /**
      * web端审批结果
      */
     void approveStoreInfo(String storeId, Integer approvalStatus, String reason);

+ 125 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -1586,6 +1586,131 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     }
 
     @Override
+    public StoreInfoVo getNewStoreDetail(String storeId) {
+
+        StoreInfoVo result = new StoreInfoVo();
+        StoreInfo storeInfo = storeInfoMapper.selectById(storeId);
+        BeanUtils.copyProperties(storeInfo, result);
+        //将经营板块和种类拆分成集合
+        String businessTypes = storeInfo.getBusinessTypes();
+        if (StringUtils.isNotEmpty(businessTypes)) {
+            String[] split = businessTypes.split(",");
+            List<String> list = Arrays.asList(split);
+            result.setBusinessTypesList(list);
+        }
+        //存入用户账户
+        StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeId));
+        if (storeUser != null) {
+            result.setUserAccount(storeUser.getId().toString());
+            result.setStorePhone(storeUser.getPhone());
+            result.setStoreUserName(storeUser.getName());
+            result.setIdCard(storeUser.getIdCard());
+        }
+        //存入执照图片地址
+        List<StoreImg> storeImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 14));
+        List<String> storeImgPaths = new ArrayList<>();
+        for (StoreImg storeImg : storeImgs) {
+            storeImgPaths.add(storeImg.getImgUrl());
+        }
+        result.setBusinessLicenseAddress(storeImgPaths);
+        //存入合同图片地址
+        List<StoreImg> storeContractImageImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 15));
+        List<String> storeContractImagePathImgs = new ArrayList<>();
+        for (StoreImg storeImg : storeContractImageImgs) {
+            storeContractImagePathImgs.add(storeImg.getImgUrl());
+        }
+        result.setContractImageList(storeContractImagePathImgs);
+        //存入续签合同地址
+        List<StoreImg> renewContractImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 22));
+        List<String> renewContractImagePathImgs = new ArrayList<>();
+        for (StoreImg storeImg : renewContractImgs) {
+            renewContractImagePathImgs.add(storeImg.getImgUrl());
+        }
+        result.setRenewContractImageList(renewContractImagePathImgs);
+        //存入经营许可证通过地址
+        List<StoreImg> foodLicenceImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 25));
+        List<String> foodLicenceImgsPathImgs = new ArrayList<>();
+        for (StoreImg storeImg : foodLicenceImgs) {
+            foodLicenceImgsPathImgs.add(storeImg.getImgUrl());
+        }
+        result.setFoodLicenceImageList(foodLicenceImgsPathImgs);
+        //存入经营许可证未通过地址
+        List<StoreImg> notPassFoodLicenceImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 24));
+        List<String> notPassFoodLicenceList = new ArrayList<>();
+        for (StoreImg storeImg : notPassFoodLicenceImgs) {
+            notPassFoodLicenceList.add(storeImg.getImgUrl());
+        }
+        result.setNotPassFoodLicenceImageList(notPassFoodLicenceList);
+        // 存放商家入口图
+        List<StoreImg> storeEntranceImageImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 1));
+        if (!storeEntranceImageImgs.isEmpty()) {
+            result.setEntranceImage(storeEntranceImageImgs.get(0).getImgUrl());
+        } else {
+            result.setEntranceImage("null");
+        }
+        // 存放商家头像
+        List<StoreImg> storeImgs1 = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 10));
+        if (!storeImgs1.isEmpty()) {
+            result.setImgUrl(storeImgs1.get(0).getImgUrl());
+        } else {
+            result.setImgUrl("null");
+        }
+
+
+        // 店铺平均分
+        /*Map<Object, List<Map<String, Object>>> avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
+        if (avgScoreMap.containsKey(String.valueOf(result.getId()))) {
+            result.setScore(Double.parseDouble(avgScoreMap.get(String.valueOf(result.getId())).get(0).get("avg_score").toString()));
+        }*/
+
+//        Map<String, Object> commitCountAndScore = storeCommentService.getCommitCountAndScore(null, 5, Integer.parseInt(storeId), null, null);
+//        result.setScore(Double.parseDouble(commitCountAndScore.get("score").toString()));
+//        result.setCommitCount(commitCountAndScore.get("commitCount").toString());
+//
+
+
+        //营业时间
+        List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, storeId).eq(StoreBusinessInfo::getDeleteFlag, 0));
+        if (ObjectUtils.isNotEmpty(storeBusinessInfos)) {
+            result.setStoreBusinessInfo(storeBusinessInfos.get(0));
+            result.setStoreBusinessInfos(storeBusinessInfos);
+            //StoreBusinessInfo storeBusinessInfo = result.getStoreBusinessInfo();
+            StoreBusinessInfo storeBusinessInfo = result.getStoreBusinessInfos().stream().filter(item -> item.getBusinessType() == 1).findFirst().orElse(null);
+            if (ObjectUtils.isNotEmpty(storeBusinessInfo)) {
+
+                Calendar calendar = Calendar.getInstance(); // 获取Calendar实例
+                int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); // 获取星期几,注意Calendar中的DAY_OF_WEEK是从1(代表星期天)开始的
+                String[] days = {"7", "1", "2", "3", "4", "5", "6"};
+                String day = days[dayOfWeek - 1];
+                if (storeBusinessInfo.getBusinessDate().contains(day)) {
+                    if (StringUtils.isNotEmpty(storeBusinessInfo.getStartTime()) && StringUtils.isNotEmpty(storeBusinessInfo.getEndTime())) {
+                        LocalTime now = LocalTime.now();
+                        List<String> startList = Arrays.asList(storeBusinessInfo.getStartTime().split(":"));
+                        List<String> endList = Arrays.asList(storeBusinessInfo.getEndTime().split(":"));
+                        LocalTime start = LocalTime.of(Integer.parseInt(startList.get(0)), Integer.parseInt(startList.get(1)));
+                        LocalTime end = LocalTime.of(Integer.parseInt(endList.get(0)), Integer.parseInt(startList.get(1)));
+                        if (now.isAfter(start) && now.isBefore(end)) {
+                            result.setYyFlag(1);
+                        } else {
+                            result.setYyFlag(0);
+                        }
+                    }
+                } else {
+                    result.setYyFlag(0);
+                }
+            }
+        }
+        LambdaQueryWrapper<StoreDictionary> storeDictionaryLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        storeDictionaryLambdaQueryWrapper.eq(StoreDictionary::getTypeName, "businessStatus")
+                .eq(StringUtils.isNotEmpty(result.getBusinessStatus().toString()), StoreDictionary::getDictId, result.getBusinessStatus());
+        List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(storeDictionaryLambdaQueryWrapper);
+        if (!storeDictionaries.isEmpty()) {
+            result.setBusinessStatusStr(storeDictionaries.get(0).getDictDetail());
+        }
+        return result;
+    }
+
+    @Override
     public void approveStoreInfo(String storeId, Integer approvalStatus, String reason) {
         StoreInfo storeInfo = storeInfoMapper.selectById(storeId);
         storeInfo.setStoreApplicationStatus(approvalStatus);