|
@@ -163,6 +163,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
@Value("${third-party-identification.base-url}")
|
|
@Value("${third-party-identification.base-url}")
|
|
|
private String identificationPath;
|
|
private String identificationPath;
|
|
|
|
|
|
|
|
|
|
+ @Value("${third-party-applications.base-url}")
|
|
|
|
|
+ private String applicationsPath;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 懒得查, 留着导出Excel
|
|
* 懒得查, 留着导出Excel
|
|
|
*/
|
|
*/
|
|
@@ -643,7 +646,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//处理分类信息
|
|
//处理分类信息
|
|
|
List<String> businessClassify = storeInfoDto.getBusinessClassify();
|
|
List<String> businessClassify = storeInfoDto.getBusinessClassify();
|
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
@@ -674,7 +677,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfo.setBusinessClassify(String.join(",", businessClassify));
|
|
storeInfo.setBusinessClassify(String.join(",", businessClassify));
|
|
|
storeInfo.setBusinessClassifyName(String.join(",", businessClassifyNames));
|
|
storeInfo.setBusinessClassifyName(String.join(",", businessClassifyNames));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//存入审批状态为待审批
|
|
//存入审批状态为待审批
|
|
|
storeInfo.setStoreApplicationStatus(0);
|
|
storeInfo.setStoreApplicationStatus(0);
|
|
|
//处理一下行政区域信息
|
|
//处理一下行政区域信息
|
|
@@ -880,7 +883,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//处理分类信息
|
|
//处理分类信息
|
|
|
List<String> businessClassify = storeInfoDto.getBusinessClassify();
|
|
List<String> businessClassify = storeInfoDto.getBusinessClassify();
|
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
@@ -911,7 +914,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfo.setBusinessClassify(String.join(",", businessClassify));
|
|
storeInfo.setBusinessClassify(String.join(",", businessClassify));
|
|
|
storeInfo.setBusinessClassifyName(String.join(",", businessClassifyNames));
|
|
storeInfo.setBusinessClassifyName(String.join(",", businessClassifyNames));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//处理一下行政区域信息
|
|
//处理一下行政区域信息
|
|
|
EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
|
|
EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
|
|
|
storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
@@ -2263,7 +2266,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理分类信息
|
|
// 处理分类信息
|
|
|
List<String> businessClassify = storeInfodto.getBusinessClassify();
|
|
List<String> businessClassify = storeInfodto.getBusinessClassify();
|
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
if (!CollectionUtils.isEmpty(businessClassify)) {
|
|
@@ -2578,10 +2581,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (dict == null || dict.getDeleteFlag() == 1) {
|
|
if (dict == null || dict.getDeleteFlag() == 1) {
|
|
|
throw new IllegalArgumentException("字典id不存在或已删除: " + dictId);
|
|
throw new IllegalArgumentException("字典id不存在或已删除: " + dictId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
String typeName = dict.getTypeName();
|
|
String typeName = dict.getTypeName();
|
|
|
String dictIdStr =dict.getDictId();
|
|
String dictIdStr =dict.getDictId();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if ("business_section".equals(typeName)) {
|
|
if ("business_section".equals(typeName)) {
|
|
|
// 如果是经营板块,直接匹配business_section
|
|
// 如果是经营板块,直接匹配business_section
|
|
|
try {
|
|
try {
|
|
@@ -2598,7 +2601,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (parentDict == null || !"business_section".equals(parentDict.getTypeName())) {
|
|
if (parentDict == null || !"business_section".equals(parentDict.getTypeName())) {
|
|
|
throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
|
|
throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
Integer sectionId = Integer.parseInt(parentDict.getDictId());
|
|
Integer sectionId = Integer.parseInt(parentDict.getDictId());
|
|
|
queryWrapper.eq("a.business_section", sectionId);
|
|
queryWrapper.eq("a.business_section", sectionId);
|
|
@@ -2616,12 +2619,12 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (parentDict == null || !"business_type".equals(parentDict.getTypeName())) {
|
|
if (parentDict == null || !"business_type".equals(parentDict.getTypeName())) {
|
|
|
throw new IllegalArgumentException("分类的父级不是经营种类,dictId: " + dictId);
|
|
throw new IllegalArgumentException("分类的父级不是经营种类,dictId: " + dictId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
StoreDictionary grandParentDict = storeDictionaryMapper.selectById(parentDict.getParentId());
|
|
StoreDictionary grandParentDict = storeDictionaryMapper.selectById(parentDict.getParentId());
|
|
|
if (grandParentDict == null || !"business_section".equals(grandParentDict.getTypeName())) {
|
|
if (grandParentDict == null || !"business_section".equals(grandParentDict.getTypeName())) {
|
|
|
throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
|
|
throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
Integer sectionId = Integer.parseInt(grandParentDict.getDictId());
|
|
Integer sectionId = Integer.parseInt(grandParentDict.getDictId());
|
|
|
queryWrapper.eq("a.business_section", sectionId);
|
|
queryWrapper.eq("a.business_section", sectionId);
|
|
@@ -3221,18 +3224,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public List<StoreInfoVo> getRecommendedStores(String businessSection, String businessTypes, String businessClassify, Double lon, Double lat) {
|
|
public List<StoreInfoVo> getRecommendedStores(String businessSection, String businessTypes, String businessClassify, Double lon, Double lat) {
|
|
|
- log.info("StoreInfoServiceImpl.getRecommendedStores?businessSection={},businessTypes={},businessClassify={},lon={},lat={}",
|
|
|
|
|
|
|
+ log.info("StoreInfoServiceImpl.getRecommendedStores?businessSection={},businessTypes={},businessClassify={},lon={},lat={}",
|
|
|
businessSection, businessTypes, businessClassify, lon, lat);
|
|
businessSection, businessTypes, businessClassify, lon, lat);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
|
// 基础条件:未删除、已启用
|
|
// 基础条件:未删除、已启用
|
|
|
queryWrapper.eq("a.delete_flag", 0)
|
|
queryWrapper.eq("a.delete_flag", 0)
|
|
|
.eq("b.delete_flag", 0)
|
|
.eq("b.delete_flag", 0)
|
|
|
.ne("a.business_status", 99) // 过滤永久关门的店铺
|
|
.ne("a.business_status", 99) // 过滤永久关门的店铺
|
|
|
.ne("a.store_status", 0); // 过滤禁用的店铺
|
|
.ne("a.store_status", 0); // 过滤禁用的店铺
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 按照三级->二级->一级的顺序筛选
|
|
// 按照三级->二级->一级的顺序筛选
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 1. 先按三级分类(business_classify)筛选
|
|
// 1. 先按三级分类(business_classify)筛选
|
|
|
if (StringUtils.isNotEmpty(businessClassify)) {
|
|
if (StringUtils.isNotEmpty(businessClassify)) {
|
|
|
// 解析businessClassify参数(格式:1,2,3)
|
|
// 解析businessClassify参数(格式:1,2,3)
|
|
@@ -3251,7 +3254,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 2. 然后按二级分类(business_types)筛选
|
|
// 2. 然后按二级分类(business_types)筛选
|
|
|
if (StringUtils.isNotEmpty(businessTypes)) {
|
|
if (StringUtils.isNotEmpty(businessTypes)) {
|
|
|
// business_types可能是逗号分隔的字符串,使用FIND_IN_SET处理
|
|
// business_types可能是逗号分隔的字符串,使用FIND_IN_SET处理
|
|
@@ -3269,7 +3272,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 3. 最后按一级分类(business_section)筛选
|
|
// 3. 最后按一级分类(business_section)筛选
|
|
|
if (StringUtils.isNotEmpty(businessSection)) {
|
|
if (StringUtils.isNotEmpty(businessSection)) {
|
|
|
try {
|
|
try {
|
|
@@ -3279,7 +3282,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
log.warn("一级分类参数格式错误: {}", businessSection);
|
|
log.warn("一级分类参数格式错误: {}", businessSection);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 查询店铺列表
|
|
// 查询店铺列表
|
|
|
List<StoreInfoVo> storeInfoVoList;
|
|
List<StoreInfoVo> storeInfoVoList;
|
|
|
if (lon != null && lat != null) {
|
|
if (lon != null && lat != null) {
|
|
@@ -3295,11 +3298,11 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
queryWrapper.orderByDesc("a.created_time");
|
|
queryWrapper.orderByDesc("a.created_time");
|
|
|
storeInfoVoList = storeInfoMapper.getStoreInfoVoList(queryWrapper);
|
|
storeInfoVoList = storeInfoMapper.getStoreInfoVoList(queryWrapper);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(storeInfoVoList)) {
|
|
if (CollectionUtils.isEmpty(storeInfoVoList)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理店铺信息,设置评分等
|
|
// 处理店铺信息,设置评分等
|
|
|
// 提前查询所有需要的字典数据
|
|
// 提前查询所有需要的字典数据
|
|
|
List<StoreInfoVo> collect = storeInfoVoList.stream()
|
|
List<StoreInfoVo> collect = storeInfoVoList.stream()
|
|
@@ -3309,7 +3312,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.map(StoreInfoVo::getStoreType)
|
|
.map(StoreInfoVo::getStoreType)
|
|
|
.flatMap(type -> Arrays.stream(type.split(",")))
|
|
.flatMap(type -> Arrays.stream(type.split(",")))
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(
|
|
List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(
|
|
|
new LambdaQueryWrapper<StoreDictionary>()
|
|
new LambdaQueryWrapper<StoreDictionary>()
|
|
|
.eq(StoreDictionary::getTypeName, "storeType")
|
|
.eq(StoreDictionary::getTypeName, "storeType")
|
|
@@ -3317,11 +3320,11 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.in(!allTypes.isEmpty(), StoreDictionary::getDictId, allTypes));
|
|
.in(!allTypes.isEmpty(), StoreDictionary::getDictId, allTypes));
|
|
|
Map<String, String> typeMap = storeDictionaries.stream()
|
|
Map<String, String> typeMap = storeDictionaries.stream()
|
|
|
.collect(Collectors.toMap(StoreDictionary::getDictId, StoreDictionary::getDictDetail));
|
|
.collect(Collectors.toMap(StoreDictionary::getDictId, StoreDictionary::getDictDetail));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 计算平均分和评价
|
|
// 计算平均分和评价
|
|
|
Map<String, List<Map<String, Object>>> avgScoreMap = new HashMap<>();
|
|
Map<String, List<Map<String, Object>>> avgScoreMap = new HashMap<>();
|
|
|
Map<Integer, List<StoreComment>> commentMap = new HashMap<>();
|
|
Map<Integer, List<StoreComment>> commentMap = new HashMap<>();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream()
|
|
avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream()
|
|
|
.collect(Collectors.groupingBy(o -> o.get("store_id").toString()));
|
|
.collect(Collectors.groupingBy(o -> o.get("store_id").toString()));
|
|
|
commentMap = storeCommentMapper.selectList(
|
|
commentMap = storeCommentMapper.selectList(
|
|
@@ -3330,7 +3333,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.eq("delete_flag", 0))
|
|
.eq("delete_flag", 0))
|
|
|
.stream()
|
|
.stream()
|
|
|
.collect(Collectors.groupingBy(StoreComment::getStoreId));
|
|
.collect(Collectors.groupingBy(StoreComment::getStoreId));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (StoreInfoVo record : storeInfoVoList) {
|
|
for (StoreInfoVo record : storeInfoVoList) {
|
|
|
// 处理类型
|
|
// 处理类型
|
|
|
if (StringUtils.isNotEmpty(record.getStoreType())) {
|
|
if (StringUtils.isNotEmpty(record.getStoreType())) {
|
|
@@ -3342,7 +3345,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
record.setStoreTypeStr(String.join(",", typeDetails));
|
|
record.setStoreTypeStr(String.join(",", typeDetails));
|
|
|
record.setStoreTypeList(Arrays.asList(types));
|
|
record.setStoreTypeList(Arrays.asList(types));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理经纬度
|
|
// 处理经纬度
|
|
|
if (StringUtils.isNotEmpty(record.getStorePosition())) {
|
|
if (StringUtils.isNotEmpty(record.getStorePosition())) {
|
|
|
String[] split = record.getStorePosition().split(",");
|
|
String[] split = record.getStorePosition().split(",");
|
|
@@ -3351,7 +3354,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
record.setStorePositionLatitude(split[1]);
|
|
record.setStorePositionLatitude(split[1]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果提供了经纬度,处理距离信息
|
|
// 如果提供了经纬度,处理距离信息
|
|
|
if (lon != null && lat != null && StringUtils.isNotEmpty(record.getStorePosition())) {
|
|
if (lon != null && lat != null && StringUtils.isNotEmpty(record.getStorePosition())) {
|
|
|
try {
|
|
try {
|
|
@@ -3368,7 +3371,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
log.warn("计算店铺距离失败,storeId={},error={}", record.getId(), e.getMessage());
|
|
log.warn("计算店铺距离失败,storeId={},error={}", record.getId(), e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理到期状态
|
|
// 处理到期状态
|
|
|
Date expirationTime = record.getExpirationTime();
|
|
Date expirationTime = record.getExpirationTime();
|
|
|
if (expirationTime != null) {
|
|
if (expirationTime != null) {
|
|
@@ -3377,17 +3380,17 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
Date nowCurrentDate = now.getTime();
|
|
Date nowCurrentDate = now.getTime();
|
|
|
now.add(Calendar.DAY_OF_YEAR, 30);
|
|
now.add(Calendar.DAY_OF_YEAR, 30);
|
|
|
Date thirtyDaysLater = now.getTime();
|
|
Date thirtyDaysLater = now.getTime();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (expirationTime.after(currentDate)) {
|
|
if (expirationTime.after(currentDate)) {
|
|
|
record.setExpiredState("0");
|
|
record.setExpiredState("0");
|
|
|
- if ((expirationTime.after(nowCurrentDate) || expirationTime.equals(nowCurrentDate))
|
|
|
|
|
|
|
+ if ((expirationTime.after(nowCurrentDate) || expirationTime.equals(nowCurrentDate))
|
|
|
&& expirationTime.before(thirtyDaysLater)) {
|
|
&& expirationTime.before(thirtyDaysLater)) {
|
|
|
record.setExpiredState("1");
|
|
record.setExpiredState("1");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
record.setExpiredState("2");
|
|
record.setExpiredState("2");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
LocalDate nowLocal = LocalDate.now();
|
|
LocalDate nowLocal = LocalDate.now();
|
|
|
LocalDate expDate = expirationTime.toInstant()
|
|
LocalDate expDate = expirationTime.toInstant()
|
|
|
.atZone(ZoneId.systemDefault())
|
|
.atZone(ZoneId.systemDefault())
|
|
@@ -3395,7 +3398,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
long daysToExpire = ChronoUnit.DAYS.between(nowLocal, expDate);
|
|
long daysToExpire = ChronoUnit.DAYS.between(nowLocal, expDate);
|
|
|
record.setDaysToExpire(daysToExpire);
|
|
record.setDaysToExpire(daysToExpire);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 设置店铺得分和总评论数
|
|
// 设置店铺得分和总评论数
|
|
|
if (avgScoreMap.containsKey(String.valueOf(record.getId()))) {
|
|
if (avgScoreMap.containsKey(String.valueOf(record.getId()))) {
|
|
|
record.setAvgScore(String.valueOf(
|
|
record.setAvgScore(String.valueOf(
|
|
@@ -3405,7 +3408,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
record.setTotalNum(String.valueOf(commentMap.get(record.getId()).size()));
|
|
record.setTotalNum(String.valueOf(commentMap.get(record.getId()).size()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return storeInfoVoList;
|
|
return storeInfoVoList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3975,7 +3978,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
);
|
|
);
|
|
|
if (firstLevelDict != null) {
|
|
if (firstLevelDict != null) {
|
|
|
allDicts.add(firstLevelDict);
|
|
allDicts.add(firstLevelDict);
|
|
|
- log.debug("查询到一级分类: id={}, dictId={}, dictDetail={}",
|
|
|
|
|
|
|
+ log.debug("查询到一级分类: id={}, dictId={}, dictDetail={}",
|
|
|
firstLevelDict.getId(), firstLevelDict.getDictId(), firstLevelDict.getDictDetail());
|
|
firstLevelDict.getId(), firstLevelDict.getDictId(), firstLevelDict.getDictDetail());
|
|
|
} else {
|
|
} else {
|
|
|
log.warn("未查询到一级分类,businessSection={}", businessSection);
|
|
log.warn("未查询到一级分类,businessSection={}", businessSection);
|
|
@@ -4009,7 +4012,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
allDicts.addAll(secondLevelDicts);
|
|
allDicts.addAll(secondLevelDicts);
|
|
|
log.debug("查询到二级分类数量: {}, dictIds={}", secondLevelDicts.size(), typeDictIdList);
|
|
log.debug("查询到二级分类数量: {}, dictIds={}", secondLevelDicts.size(), typeDictIdList);
|
|
|
} else {
|
|
} else {
|
|
|
- log.warn("无法查询二级分类: typeDictIdList为空或一级分类不存在, typeDictIdList={}, firstLevelDict={}",
|
|
|
|
|
|
|
+ log.warn("无法查询二级分类: typeDictIdList为空或一级分类不存在, typeDictIdList={}, firstLevelDict={}",
|
|
|
typeDictIdList, firstLevelDict != null ? firstLevelDict.getId() : null);
|
|
typeDictIdList, firstLevelDict != null ? firstLevelDict.getId() : null);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4043,10 +4046,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// .orderByAsc(StoreDictionary::getSortId)
|
|
// .orderByAsc(StoreDictionary::getSortId)
|
|
|
);
|
|
);
|
|
|
allDicts.addAll(thirdLevelDicts);
|
|
allDicts.addAll(thirdLevelDicts);
|
|
|
- log.debug("查询到三级分类数量: {}, dictIds={}, parentIds={}",
|
|
|
|
|
|
|
+ log.debug("查询到三级分类数量: {}, dictIds={}, parentIds={}",
|
|
|
thirdLevelDicts.size(), classifyDictIdList, secondLevelIds);
|
|
thirdLevelDicts.size(), classifyDictIdList, secondLevelIds);
|
|
|
} else {
|
|
} else {
|
|
|
- log.warn("无法查询三级分类: classifyDictIdList为空或二级分类为空, classifyDictIdList={}, secondLevelDicts.size={}",
|
|
|
|
|
|
|
+ log.warn("无法查询三级分类: classifyDictIdList为空或二级分类为空, classifyDictIdList={}, secondLevelDicts.size={}",
|
|
|
classifyDictIdList, secondLevelDicts.size());
|
|
classifyDictIdList, secondLevelDicts.size());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4059,8 +4062,46 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
vo.setStoreId(storeInfo.getId());
|
|
vo.setStoreId(storeInfo.getId());
|
|
|
vo.setStoreName(storeInfo.getStoreName());
|
|
vo.setStoreName(storeInfo.getStoreName());
|
|
|
vo.setThreeLevelStructure(treeStructure);
|
|
vo.setThreeLevelStructure(treeStructure);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return vo;
|
|
return vo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void aiApproveStoreInfo(AiApproveStoreInfo aiApproveStoreInfo) {
|
|
|
|
|
+ HttpHeaders aiHeaders = new HttpHeaders();
|
|
|
|
|
+ aiHeaders.setContentType(MediaType.APPLICATION_JSON);
|
|
|
|
|
+ aiHeaders.set("Authorization", "Bearer " + aiAuthTokenUtil.getAccessToken());
|
|
|
|
|
+
|
|
|
|
|
+ HttpEntity<AiApproveStoreInfo> request = new HttpEntity<>(aiApproveStoreInfo, aiHeaders);
|
|
|
|
|
+ ResponseEntity<String> response = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ response = restTemplate.postForEntity(applicationsPath, request, String.class);
|
|
|
|
|
+ if (response.getStatusCodeValue() != 200) {
|
|
|
|
|
+ throw new RuntimeException("AI门店审核接口调用失败 http状态:" + response.getStatusCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotEmpty(response.getBody())) {
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
|
|
|
|
+ if (jsonObject.getInteger("code") == 200) {
|
|
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
|
|
+ List<StoreInfo> storeInfos = storeInfoMapper.selectList(new LambdaQueryWrapper<StoreInfo>()
|
|
|
|
|
+ .eq(StoreInfo::getCreatedUserId, aiApproveStoreInfo.getUserId()).eq(StoreInfo::getStoreApplicationStatus, 0).eq(StoreInfo::getDeleteFlag, 0));
|
|
|
|
|
+ for (StoreInfo storeInfo : storeInfos) {
|
|
|
|
|
+ if ("approved".equals(data.getString("status"))) {
|
|
|
|
|
+ storeInfo.setStoreApplicationStatus(1);
|
|
|
|
|
+ } else if ("rejected".equals(data.getString("status"))) {
|
|
|
|
|
+ storeInfo.setStoreApplicationStatus(2);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ System.out.println("未知状态");
|
|
|
|
|
+ }
|
|
|
|
|
+ storeInfoMapper.updateById(storeInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new RuntimeException("AI门店审核接口调用失败 code:" + jsonObject.getInteger("code"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e){
|
|
|
|
|
+ throw new RuntimeException("调用门店审核接口异常", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|