|
|
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.geo.Point;
|
|
|
import org.springframework.http.*;
|
|
|
@@ -42,6 +43,7 @@ import shop.alien.store.util.CommonConstant;
|
|
|
import shop.alien.store.util.FileUploadUtil;
|
|
|
import shop.alien.store.util.GroupConstant;
|
|
|
import shop.alien.store.util.ai.AiAuthTokenUtil;
|
|
|
+import shop.alien.store.util.ali.AliApi;
|
|
|
import shop.alien.util.ali.AliOSSUtil;
|
|
|
import shop.alien.util.common.DistanceUtil;
|
|
|
import shop.alien.util.common.constant.CouponStatusEnum;
|
|
|
@@ -59,6 +61,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.time.*;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.time.format.DateTimeFormatterBuilder;
|
|
|
+import java.time.format.SignStyle;
|
|
|
import java.time.temporal.ChronoField;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
@@ -71,13 +74,13 @@ import java.util.stream.Collectors;
|
|
|
* @author ssk
|
|
|
* @since 2024-12-05
|
|
|
*/
|
|
|
-@Service
|
|
|
@Slf4j
|
|
|
+@Service
|
|
|
@RequiredArgsConstructor
|
|
|
@Transactional
|
|
|
public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements StoreInfoService {
|
|
|
- private static final int DEFAULT_DISTANCE_METER = 1000;
|
|
|
|
|
|
+ private static final int DEFAULT_DISTANCE_METER = 1000;
|
|
|
|
|
|
private final String DEFAULT_PASSWORD = "123456";
|
|
|
|
|
|
@@ -880,7 +883,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
tagStoreRelationLambdaQueryWrapper.eq(TagStoreRelation::getStoreId, storeInfo.getId());
|
|
|
tagStoreRelationLambdaQueryWrapper.eq(TagStoreRelation::getDeleteFlag, 0);
|
|
|
int tagStoreCount = tagStoreRelationMapper.selectCount(tagStoreRelationLambdaQueryWrapper);
|
|
|
- if(tagStoreCount == 0){
|
|
|
+ if (tagStoreCount == 0) {
|
|
|
TagStoreRelation tagStoreRelation = new TagStoreRelation();
|
|
|
tagStoreRelation.setStoreId(storeInfo.getId());
|
|
|
tagStoreRelation.setDeleteFlag(0);
|
|
|
@@ -1540,9 +1543,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = new com.alibaba.fastjson2.JSONObject();
|
|
|
if (2 == approvalStatus) {
|
|
|
- jsonObject.put("message", "您在"+createDate+"提交的入驻店铺申请,审核失败。失败原因:"+reason+"。");
|
|
|
+ jsonObject.put("message", "您在" + createDate + "提交的入驻店铺申请,审核失败。失败原因:" + reason + "。");
|
|
|
} else {
|
|
|
- jsonObject.put("message", "您在"+createDate+"提交的入驻店铺申请,已通过审核,欢迎您的加入。");
|
|
|
+ jsonObject.put("message", "您在" + createDate + "提交的入驻店铺申请,已通过审核,欢迎您的加入。");
|
|
|
}
|
|
|
lifeNotice.setContext(jsonObject.toJSONString());
|
|
|
lifeNotice.setNoticeType(1); // 系统通知
|
|
|
@@ -2723,14 +2726,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (lon == null || lat == null) {
|
|
|
throw new IllegalArgumentException("经纬度参数不能为空");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 智能检测:如果参数可能传反了(lat超出范围但lon在范围内),给出提示
|
|
|
if (Math.abs(lat) > 90 && Math.abs(lon) <= 90) {
|
|
|
throw new IllegalArgumentException(
|
|
|
String.format("参数可能传反了!当前值: lon=%s, lat=%s。经度范围: [-180, 180],纬度范围: [-90, 90]。请检查参数顺序。", lon, lat)
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 校验经纬度范围:经度 [-180, 180],纬度 [-90, 90]
|
|
|
if (lon < -180 || lon > 180) {
|
|
|
throw new IllegalArgumentException("经度参数超出有效范围 [-180, 180],当前值: " + lon);
|
|
|
@@ -2908,7 +2911,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
// 提取所有门店ID
|
|
|
List<Integer> storeIds = storeInfoVoList.stream().map(StoreInfoVo::getId).collect(Collectors.toList());
|
|
|
-
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(storeIds)) {
|
|
|
// 如果没有符合条件的店铺,返回空结果
|
|
|
IPage<StoreInfoVo> emptyPage = new Page<>(pageNum, pageSize);
|
|
|
@@ -3169,18 +3172,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (StringUtils.isNotEmpty(likeKeyword)) {
|
|
|
wrapper.like(OcrImageUpload::getOcrResult, likeKeyword);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
OcrImageUpload ocrImageUpload = ocrImageUploadMapper.selectOne(wrapper);
|
|
|
-
|
|
|
+
|
|
|
if (ocrImageUpload == null || StringUtils.isEmpty(ocrImageUpload.getOcrResult())) {
|
|
|
return new com.alibaba.fastjson2.JSONObject();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
com.alibaba.fastjson2.JSONObject jsonObject = com.alibaba.fastjson2.JSONObject.parseObject(ocrImageUpload.getOcrResult());
|
|
|
if (includeImageUrl && StringUtils.isNotEmpty(ocrImageUpload.getImageUrl())) {
|
|
|
jsonObject.put("imageUrl", ocrImageUpload.getImageUrl());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|