|
|
@@ -1312,16 +1312,29 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfoDraft.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
}
|
|
|
}
|
|
|
- if (storeInfoDraft.getBusinessLicenseUrl().isEmpty()) {
|
|
|
+ if (StringUtils.isEmpty(storeInfoDraft.getBusinessLicenseUrl())) {
|
|
|
storeInfoDraft.setBusinessLicenseUrl(null);
|
|
|
}
|
|
|
- if (storeInfoDraft.getContractUrl().isEmpty()) {
|
|
|
- storeInfoDraft.setContractUrl(null);
|
|
|
- }
|
|
|
-
|
|
|
- if (storeInfoDraft.getFoodLicenceUrl().isEmpty()) {
|
|
|
- storeInfoDraft.setFoodLicenceUrl(null);
|
|
|
+ // if (StringUtils.isEmpty(storeInfoDraft.getContractUrl())) {
|
|
|
+ // storeInfoDraft.setContractUrl(null);
|
|
|
+ // }
|
|
|
+ // if (StringUtils.isEmpty(storeInfoDraft.getFoodLicenceUrl())) {
|
|
|
+ // storeInfoDraft.setFoodLicenceUrl(null);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // 处理其他资质证明图片列表(最多9张),转换为逗号分隔的字符串
|
|
|
+ if (!CollectionUtils.isEmpty(storeInfoDraft.getOtherQualificationImages())) {
|
|
|
+ List<String> otherQualificationImages = storeInfoDraft.getOtherQualificationImages();
|
|
|
+ // 限制最多9张
|
|
|
+ int maxCount = Math.min(otherQualificationImages.size(), 9);
|
|
|
+ List<String> limitedImages = otherQualificationImages.subList(0, maxCount);
|
|
|
+ String otherLicensesStr = String.join(",", limitedImages);
|
|
|
+ storeInfoDraft.setOtherLicenses(otherLicensesStr);
|
|
|
+ } else if (storeInfoDraft.getOtherQualificationImages() != null) {
|
|
|
+ // 如果传入空列表,清空 otherLicenses
|
|
|
+ storeInfoDraft.setOtherLicenses(null);
|
|
|
}
|
|
|
+
|
|
|
return storeInfoDraftMapper.insert(storeInfoDraft);
|
|
|
}
|
|
|
|
|
|
@@ -1331,7 +1344,24 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
wrapper.eq(StoreInfoDraft::getStoreUserId, storeUserId);
|
|
|
wrapper.orderByDesc(StoreInfoDraft::getCreatedTime);
|
|
|
List<StoreInfoDraft> list = storeInfoDraftMapper.selectList(wrapper);
|
|
|
- return CollectionUtils.isEmpty(list) ? null : list.get(0);
|
|
|
+ StoreInfoDraft draft = CollectionUtils.isEmpty(list) ? null : list.get(0);
|
|
|
+
|
|
|
+ // 将 otherLicenses 字段(逗号分隔的字符串)转换为 otherQualificationImages 列表
|
|
|
+ if (draft != null && StringUtils.isNotEmpty(draft.getOtherLicenses())) {
|
|
|
+ String[] urls = draft.getOtherLicenses().split(",");
|
|
|
+ List<String> otherQualificationImages = new ArrayList<>();
|
|
|
+ for (String url : urls) {
|
|
|
+ if (StringUtils.isNotEmpty(url.trim())) {
|
|
|
+ otherQualificationImages.add(url.trim());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ draft.setOtherQualificationImages(otherQualificationImages);
|
|
|
+ } else if (draft != null) {
|
|
|
+ // 如果 otherLicenses 为空,设置空列表
|
|
|
+ draft.setOtherQualificationImages(new ArrayList<>());
|
|
|
+ }
|
|
|
+
|
|
|
+ return draft;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -6770,3 +6800,4 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|