Ver Fonte

bug 营业时间

qinxuyang há 3 meses atrás
pai
commit
34c7d5f0bb

+ 38 - 22
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -5861,19 +5861,27 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                             );
 
                             boolean isInBusiness;
-                            // 处理跨天营业
-                            if (start.isBefore(end) || start.equals(end)) {
-                                // 同一天营业:包含边界值
-                                isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
-                                        && (currentTime.isBefore(end) || currentTime.equals(end));
+                            // 判断是否是全天营业(00:00到00:00)
+                            LocalTime midnight = LocalTime.of(0, 0);
+                            if (start.equals(midnight) && end.equals(midnight)) {
+                                // 全天营业
+                                isInBusiness = true;
+                                log.info("特殊日期营业时间判断 - 全天营业(00:00-00:00),当前时间: {},是否在营业时间内: true", currentTime);
                             } else {
-                                // 跨天营业:包含边界值
-                                isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
-                                        || (currentTime.isBefore(end) || currentTime.equals(end));
+                                // 处理跨天营业
+                                if (start.isBefore(end) || start.equals(end)) {
+                                    // 同一天营业:包含边界值
+                                    isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
+                                            && (currentTime.isBefore(end) || currentTime.equals(end));
+                                } else {
+                                    // 跨天营业:包含边界值
+                                    isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
+                                            || (currentTime.isBefore(end) || currentTime.equals(end));
+                                }
+                                log.info("特殊日期营业时间判断 - 开始时间: {}, 结束时间: {}, 当前时间: {}, 是否在营业时间内: {}",
+                                        start, end, currentTime, isInBusiness);
                             }
 
-                            log.info("特殊日期营业时间判断 - 开始时间: {}, 结束时间: {}, 当前时间: {}, 是否在营业时间内: {}",
-                                    start, end, currentTime, isInBusiness);
                             result.setYyFlag(isInBusiness ? 1 : 0);
                             isCurrentSpecialBusinessTime = isInBusiness;
                         } else {
@@ -5940,19 +5948,27 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                                     );
 
                                     boolean isInBusiness;
-                                    // 处理跨天营业
-                                    if (start.isBefore(end) || start.equals(end)) {
-                                        // 同一天营业:包含边界值
-                                        isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
-                                                && (currentTime.isBefore(end) || currentTime.equals(end));
+                                    // 判断是否是全天营业(00:00到00:00)
+                                    LocalTime midnight = LocalTime.of(0, 0);
+                                    if (start.equals(midnight) && end.equals(midnight)) {
+                                        // 全天营业
+                                        isInBusiness = true;
+                                        log.info("正常营业时间判断 - 全天营业(00:00-00:00),当前时间: {},是否在营业时间内: true", currentTime);
                                     } else {
-                                        // 跨天营业:包含边界值
-                                        isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
-                                                || (currentTime.isBefore(end) || currentTime.equals(end));
+                                        // 处理跨天营业
+                                        if (start.isBefore(end) || start.equals(end)) {
+                                            // 同一天营业:包含边界值
+                                            isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
+                                                    && (currentTime.isBefore(end) || currentTime.equals(end));
+                                        } else {
+                                            // 跨天营业:包含边界值
+                                            isInBusiness = (currentTime.isAfter(start) || currentTime.equals(start))
+                                                    || (currentTime.isBefore(end) || currentTime.equals(end));
+                                        }
+                                        log.info("正常营业时间判断 - 开始时间: {}, 结束时间: {}, 当前时间: {}, 是否在营业时间内: {}",
+                                                start, end, currentTime, isInBusiness);
                                     }
 
-                                    log.info("正常营业时间判断 - 开始时间: {}, 结束时间: {}, 当前时间: {}, 是否在营业时间内: {}",
-                                            start, end, currentTime, isInBusiness);
                                     result.setYyFlag(isInBusiness ? 1 : 0);
                                 } else {
                                     log.warn("正常营业时间格式错误 - 开始时间: {}, 结束时间: {}",
@@ -6406,7 +6422,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         storeInfo.setId(storeImg.getStoreId());
         storeInfo.setBusinessLicenseStatus(2); // 2-待审核
         storeInfo.setUpdateBusinessLicenseTime(new Date());
-
+        
         storeInfoMapper.updateById(storeInfo);
         
         // 异步调用证照审核AI接口并处理审核结果
@@ -6487,7 +6503,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         
         // 收集所有图片URL
         List<String> imgUrlList = new ArrayList<>();
-
+        
         // 插入新的其他资质证明图片(最多9张)
         for (int i = 0; i < maxCount; i++) {
             StoreImg storeImg = storeImgList.get(i);