|
@@ -22,10 +22,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.multipart.MultipartRequest;
|
|
import org.springframework.web.multipart.MultipartRequest;
|
|
|
-import shop.alien.entity.result.R;
|
|
|
|
|
import shop.alien.entity.store.*;
|
|
import shop.alien.entity.store.*;
|
|
|
import shop.alien.entity.store.dto.NearMeDto;
|
|
import shop.alien.entity.store.dto.NearMeDto;
|
|
|
import shop.alien.entity.store.dto.StoreInfoDto;
|
|
import shop.alien.entity.store.dto.StoreInfoDto;
|
|
|
|
|
+import shop.alien.entity.store.excelVo.StoreActivityExcelVo;
|
|
|
import shop.alien.entity.store.excelVo.StoreInfoExcelVo;
|
|
import shop.alien.entity.store.excelVo.StoreInfoExcelVo;
|
|
|
import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
|
|
import shop.alien.entity.store.excelVo.StoreInfoExpiredRecordsExcelVo;
|
|
|
import shop.alien.entity.store.excelVo.util.ExcelExporter;
|
|
import shop.alien.entity.store.excelVo.util.ExcelExporter;
|
|
@@ -39,15 +39,16 @@ import shop.alien.store.service.StoreClockInService;
|
|
|
import shop.alien.store.service.StoreInfoService;
|
|
import shop.alien.store.service.StoreInfoService;
|
|
|
import shop.alien.store.util.FileUploadUtil;
|
|
import shop.alien.store.util.FileUploadUtil;
|
|
|
import shop.alien.store.util.GroupConstant;
|
|
import shop.alien.store.util.GroupConstant;
|
|
|
|
|
+import shop.alien.util.ali.AliOSSUtil;
|
|
|
import shop.alien.util.common.DistanceUtil;
|
|
import shop.alien.util.common.DistanceUtil;
|
|
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.*;
|
|
import java.time.*;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.time.format.DateTimeFormatterBuilder;
|
|
import java.time.format.DateTimeFormatterBuilder;
|
|
|
-import java.time.format.TextStyle;
|
|
|
|
|
import java.time.temporal.ChronoField;
|
|
import java.time.temporal.ChronoField;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -114,15 +115,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
private final StoreClockInService storeClockInService;
|
|
private final StoreClockInService storeClockInService;
|
|
|
|
|
|
|
|
|
|
+ private final AliOSSUtil aliOSSUtil;
|
|
|
|
|
+
|
|
|
@Value("${spring.web.resources.excel-path}")
|
|
@Value("${spring.web.resources.excel-path}")
|
|
|
private String excelPath;
|
|
private String excelPath;
|
|
|
|
|
|
|
|
@Value("${spring.web.resources.excel-generate-path}")
|
|
@Value("${spring.web.resources.excel-generate-path}")
|
|
|
private String excelGeneratePath;
|
|
private String excelGeneratePath;
|
|
|
|
|
|
|
|
- @Value("${spring.web.resources.url}")
|
|
|
|
|
- private String fileUrl;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 懒得查, 留着导出Excel
|
|
* 懒得查, 留着导出Excel
|
|
|
*/
|
|
*/
|
|
@@ -168,7 +168,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
for (StoreUser storeUser : storeUsers) {
|
|
for (StoreUser storeUser : storeUsers) {
|
|
|
storeMainInfoVo.setLogoutFlagUser(storeUser.getLogoutFlag());
|
|
storeMainInfoVo.setLogoutFlagUser(storeUser.getLogoutFlag());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 计算店铺到最近地铁站的距离
|
|
// 计算店铺到最近地铁站的距离
|
|
|
JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(storeMainInfoVo.getStorePosition().split(",")[0], storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(storeMainInfoVo.getStorePosition().split(",")[0], storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
|
// 地铁名
|
|
// 地铁名
|
|
@@ -177,7 +176,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 地铁站经纬度
|
|
// 地铁站经纬度
|
|
|
String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
|
|
String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
|
|
|
String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
|
|
String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
|
|
|
-
|
|
|
|
|
if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
|
|
if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
|
|
|
double storeJing = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[0]);
|
|
double storeJing = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[0]);
|
|
|
double storeWei = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
double storeWei = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
@@ -186,7 +184,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
} else {
|
|
} else {
|
|
|
storeMainInfoVo.setDistance2(0);
|
|
storeMainInfoVo.setDistance2(0);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return storeMainInfoVo;
|
|
return storeMainInfoVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -201,7 +198,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (storeMainInfoVo.getRenewContractStatus() == 1) {
|
|
if (storeMainInfoVo.getRenewContractStatus() == 1) {
|
|
|
storeMainInfoVo.setRenewContractStatus(0);
|
|
storeMainInfoVo.setRenewContractStatus(0);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (storeMainInfoVo.getStoreStatus() == -1) {
|
|
if (storeMainInfoVo.getStoreStatus() == -1) {
|
|
|
LocalDateTime localDateTime = storeMainInfoVo.getLogoutTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
LocalDateTime localDateTime = storeMainInfoVo.getLogoutTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
LocalDateTime future = localDateTime.plusDays(7);
|
|
LocalDateTime future = localDateTime.plusDays(7);
|
|
@@ -259,9 +255,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
@Override
|
|
@Override
|
|
|
public List<StoreInfoVo> getStoreInfoVo(String storeName, Integer id) {
|
|
public List<StoreInfoVo> getStoreInfoVo(String storeName, Integer id) {
|
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq(null != id, "a.id", id)
|
|
|
|
|
- .like(!storeName.isEmpty(), "a.store_name", storeName)
|
|
|
|
|
- .eq("a.delete_flag", 0);
|
|
|
|
|
|
|
+ queryWrapper.eq(null != id, "a.id", id).like(!storeName.isEmpty(), "a.store_name", storeName).eq("a.delete_flag", 0);
|
|
|
return storeInfoMapper.getStoreInfoVoList(queryWrapper);
|
|
return storeInfoMapper.getStoreInfoVoList(queryWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -281,18 +275,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
checkAndUpdateExpiredRecords();
|
|
checkAndUpdateExpiredRecords();
|
|
|
IPage<StoreInfoVo> iPage = new Page<>(page, size);
|
|
IPage<StoreInfoVo> iPage = new Page<>(page, size);
|
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.like(storeName != null && !storeName.isEmpty(), "a.store_name", storeName)
|
|
|
|
|
- .like(storeContact != null && !storeContact.isEmpty(), "b.name", storeContact)
|
|
|
|
|
- .like(storePhone != null && !storePhone.isEmpty(), "b.phone", storePhone)
|
|
|
|
|
- .like(storeType != null && !storeType.isEmpty(), "a.store_type", storeType)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(storeApplicationStatus), "a.store_application_status", storeApplicationStatus)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(storeStatus), "a.store_status", storeStatus)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(renewContractStatus),"a.renew_contract_status",renewContractStatus)
|
|
|
|
|
- .like(StringUtils.isNotEmpty(id), "a.id", id)
|
|
|
|
|
- .eq("a.delete_flag", 0)
|
|
|
|
|
- .eq("b.delete_flag", 0)
|
|
|
|
|
- .orderByDesc("a.created_time");
|
|
|
|
|
|
|
+ queryWrapper.like(storeName != null && !storeName.isEmpty(), "a.store_name", storeName).like(storeContact != null && !storeContact.isEmpty(), "b.name", storeContact).like(storePhone != null && !storePhone.isEmpty(), "b.phone", storePhone).like(storeType != null && !storeType.isEmpty(), "a.store_type", storeType).eq(StringUtils.isNotEmpty(storeApplicationStatus), "a.store_application_status", storeApplicationStatus).eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection).eq(StringUtils.isNotEmpty(storeStatus), "a.store_status", storeStatus).eq(StringUtils.isNotEmpty(renewContractStatus), "a.renew_contract_status", renewContractStatus).like(StringUtils.isNotEmpty(id), "a.id", id).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time");
|
|
|
//如果查询未过期
|
|
//如果查询未过期
|
|
|
// 获取当前时刻
|
|
// 获取当前时刻
|
|
|
Date currentDate = new Date();
|
|
Date currentDate = new Date();
|
|
@@ -320,22 +303,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (!records.isEmpty()) {
|
|
if (!records.isEmpty()) {
|
|
|
// 提前查询所有需要的字典数据
|
|
// 提前查询所有需要的字典数据
|
|
|
List<StoreInfoVo> collect = records.stream().filter(record -> StringUtils.isNotEmpty(record.getStoreType())).collect(Collectors.toList());
|
|
List<StoreInfoVo> collect = records.stream().filter(record -> StringUtils.isNotEmpty(record.getStoreType())).collect(Collectors.toList());
|
|
|
- Set<String> allTypes = collect.stream()
|
|
|
|
|
- .map(StoreInfoVo::getStoreType)
|
|
|
|
|
- .flatMap(type -> Arrays.stream(type.split(",")))
|
|
|
|
|
- .collect(Collectors.toSet());
|
|
|
|
|
-
|
|
|
|
|
- List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getTypeName, "storeType")
|
|
|
|
|
- .isNull(StoreDictionary::getParentId)
|
|
|
|
|
- .in(allTypes.size() > 0, StoreDictionary::getDictId, allTypes)
|
|
|
|
|
- );
|
|
|
|
|
- Map<String, String> typeMap = storeDictionaries.stream()
|
|
|
|
|
- .collect(Collectors.toMap(
|
|
|
|
|
- StoreDictionary::getDictId,
|
|
|
|
|
- StoreDictionary::getDictDetail
|
|
|
|
|
- ));
|
|
|
|
|
|
|
+ Set<String> allTypes = collect.stream().map(StoreInfoVo::getStoreType).flatMap(type -> Arrays.stream(type.split(","))).collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "storeType").isNull(StoreDictionary::getParentId).in(!allTypes.isEmpty(), StoreDictionary::getDictId, allTypes));
|
|
|
|
|
+ Map<String, String> typeMap = storeDictionaries.stream().collect(Collectors.toMap(StoreDictionary::getDictId, StoreDictionary::getDictDetail));
|
|
|
|
|
|
|
|
Map<String, List<LifeCoupon>> quanListByStoreId = new HashMap<>();
|
|
Map<String, List<LifeCoupon>> quanListByStoreId = new HashMap<>();
|
|
|
Map<Object, List<Map<String, Object>>> avgScoreMap = new HashMap<>();
|
|
Map<Object, List<Map<String, Object>>> avgScoreMap = new HashMap<>();
|
|
@@ -345,27 +316,20 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (StringUtils.isNotEmpty(businessSection) && businessSection.equals("1")) {
|
|
if (StringUtils.isNotEmpty(businessSection) && businessSection.equals("1")) {
|
|
|
List<Integer> storeIds = records.stream().map(StoreInfoVo::getId).collect(Collectors.toList());
|
|
List<Integer> storeIds = records.stream().map(StoreInfoVo::getId).collect(Collectors.toList());
|
|
|
LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
|
- quanWrapper.in(LifeCoupon::getStoreId, storeIds)
|
|
|
|
|
- .eq(LifeCoupon::getStatus, 1)
|
|
|
|
|
- .orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
|
|
|
|
+ quanWrapper.in(LifeCoupon::getStoreId, storeIds).eq(LifeCoupon::getStatus, 1).orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
|
|
List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
|
|
|
quanListByStoreId = quanList.stream().collect(Collectors.groupingBy(LifeCoupon::getStoreId));
|
|
quanListByStoreId = quanList.stream().collect(Collectors.groupingBy(LifeCoupon::getStoreId));
|
|
|
// 获取全部店铺的评分与平均花销
|
|
// 获取全部店铺的评分与平均花销
|
|
|
// TODO sotre_comment 没有花销 怎么算平均花销
|
|
// TODO sotre_comment 没有花销 怎么算平均花销
|
|
|
avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
|
|
avgScoreMap = storeEvaluationMapper.allStoreAvgScore().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
|
|
|
- commentMap = storeCommentMapper.selectList(new QueryWrapper<StoreComment>().eq("business_type", "5")
|
|
|
|
|
- .eq("delete_flag", 0)).stream().collect(Collectors.groupingBy(StoreComment::getStoreId));
|
|
|
|
|
|
|
+ commentMap = storeCommentMapper.selectList(new QueryWrapper<StoreComment>().eq("business_type", "5").eq("delete_flag", 0)).stream().collect(Collectors.groupingBy(StoreComment::getStoreId));
|
|
|
avgPriceMap = lifeUserOrderMapper.allStoreAvgPrice().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
|
|
avgPriceMap = lifeUserOrderMapper.allStoreAvgPrice().stream().collect(Collectors.groupingBy(o -> o.get("store_id")));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
for (StoreInfoVo record : records) {
|
|
for (StoreInfoVo record : records) {
|
|
|
//处理类型
|
|
//处理类型
|
|
|
if (StringUtils.isNotEmpty(record.getStoreType())) {
|
|
if (StringUtils.isNotEmpty(record.getStoreType())) {
|
|
|
String[] types = record.getStoreType().split(",");
|
|
String[] types = record.getStoreType().split(",");
|
|
|
- List<String> typeDetails = Arrays.stream(types)
|
|
|
|
|
- .map(typeMap::get)
|
|
|
|
|
- .filter(Objects::nonNull)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<String> typeDetails = Arrays.stream(types).map(typeMap::get).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
record.setStoreTypeStr(String.join(",", typeDetails));
|
|
record.setStoreTypeStr(String.join(",", typeDetails));
|
|
|
record.setStoreTypeList(Arrays.asList(types));
|
|
record.setStoreTypeList(Arrays.asList(types));
|
|
|
}
|
|
}
|
|
@@ -379,7 +343,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 获取当前时间
|
|
// 获取当前时间
|
|
|
Calendar now = Calendar.getInstance();
|
|
Calendar now = Calendar.getInstance();
|
|
|
Date nowCurrentDate = now.getTime();
|
|
Date nowCurrentDate = now.getTime();
|
|
|
-
|
|
|
|
|
// 计算 30 天后的时间
|
|
// 计算 30 天后的时间
|
|
|
now.add(Calendar.DAY_OF_YEAR, 30);
|
|
now.add(Calendar.DAY_OF_YEAR, 30);
|
|
|
Date thirtyDaysLater = now.getTime();
|
|
Date thirtyDaysLater = now.getTime();
|
|
@@ -470,9 +433,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
@Override
|
|
@Override
|
|
|
public boolean setStoreState(String storeId, Integer businessStatus) {
|
|
public boolean setStoreState(String storeId, Integer businessStatus) {
|
|
|
LambdaUpdateWrapper<StoreInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<StoreInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper
|
|
|
|
|
- .eq(StoreInfo::getId, storeId)
|
|
|
|
|
- .set(StoreInfo::getBusinessStatus, businessStatus);
|
|
|
|
|
|
|
+ updateWrapper.eq(StoreInfo::getId, storeId).set(StoreInfo::getBusinessStatus, businessStatus);
|
|
|
return this.update(null, updateWrapper);
|
|
return this.update(null, updateWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -538,7 +499,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public StoreInfoVo saveStoreInfo(StoreInfoDto storeInfoDto) throws Exception {
|
|
public StoreInfoVo saveStoreInfo(StoreInfoDto storeInfoDto) throws Exception {
|
|
|
-
|
|
|
|
|
//获取经营板块id
|
|
//获取经营板块id
|
|
|
Integer businessSection = storeInfoDto.getBusinessSection();
|
|
Integer businessSection = storeInfoDto.getBusinessSection();
|
|
|
//查询经营板块名称
|
|
//查询经营板块名称
|
|
@@ -548,11 +508,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<String> businessTypeNames = new ArrayList<>();
|
|
List<String> businessTypeNames = new ArrayList<>();
|
|
|
//获取经营种类名称
|
|
//获取经营种类名称
|
|
|
for (String businessType : businessTypes) {
|
|
for (String businessType : businessTypes) {
|
|
|
- StoreDictionary storeDictionary =
|
|
|
|
|
- storeDictionaryMapper
|
|
|
|
|
- .selectOne(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
|
|
|
|
+ StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
businessTypeNames.add(storeDictionary.getDictDetail());
|
|
businessTypeNames.add(storeDictionary.getDictDetail());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -583,22 +539,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//存入审批状态为待审批
|
|
//存入审批状态为待审批
|
|
|
storeInfo.setStoreApplicationStatus(0);
|
|
storeInfo.setStoreApplicationStatus(0);
|
|
|
//处理一下行政区域信息
|
|
//处理一下行政区域信息
|
|
|
- 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());
|
|
|
- EssentialCityCode essentialCityCode2 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
|
- EssentialCityCode essentialCityCode3 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
if (null == storeInfo.getCommissionRate()) {
|
|
if (null == storeInfo.getCommissionRate()) {
|
|
|
storeInfo.setCommissionRate("3");
|
|
storeInfo.setCommissionRate("3");
|
|
|
}
|
|
}
|
|
|
storeInfoMapper.insert(storeInfo);
|
|
storeInfoMapper.insert(storeInfo);
|
|
|
result.setId(storeInfo.getId());
|
|
result.setId(storeInfo.getId());
|
|
|
- nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()),
|
|
|
|
|
- Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
|
|
|
|
+ nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()), Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
//修改门店店铺用户绑定关系
|
|
//修改门店店铺用户绑定关系
|
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
|
StoreUser storeUser = storeUserMapper.selectById(userAccount);
|
|
StoreUser storeUser = storeUserMapper.selectById(userAccount);
|
|
@@ -615,7 +567,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeImg.setImgUrl(licenseAddress);
|
|
storeImg.setImgUrl(licenseAddress);
|
|
|
storeImgMapper.insert(storeImg);
|
|
storeImgMapper.insert(storeImg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
//存入店铺合同图片
|
|
//存入店铺合同图片
|
|
|
List<String> contractImageList = storeInfoDto.getContractImageList();
|
|
List<String> contractImageList = storeInfoDto.getContractImageList();
|
|
|
for (String licenseAddress : contractImageList) {
|
|
for (String licenseAddress : contractImageList) {
|
|
@@ -627,7 +578,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeImg.setImgUrl(licenseAddress);
|
|
storeImg.setImgUrl(licenseAddress);
|
|
|
storeImgMapper.insert(storeImg);
|
|
storeImgMapper.insert(storeImg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -635,22 +585,19 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
public int saveStoreInfoDraft(StoreInfoDraft storeInfoDraft) {
|
|
public int saveStoreInfoDraft(StoreInfoDraft storeInfoDraft) {
|
|
|
//处理一下行政区域信息
|
|
//处理一下行政区域信息
|
|
|
if (storeInfoDraft.getAdministrativeRegionProvinceAdcode() != null) {
|
|
if (storeInfoDraft.getAdministrativeRegionProvinceAdcode() != null) {
|
|
|
- EssentialCityCode essentialCityCode1 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionProvinceAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionProvinceAdcode()));
|
|
|
if (null != essentialCityCode1) {
|
|
if (null != essentialCityCode1) {
|
|
|
storeInfoDraft.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
storeInfoDraft.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (storeInfoDraft.getAdministrativeRegionCityAdcode() != null) {
|
|
if (storeInfoDraft.getAdministrativeRegionCityAdcode() != null) {
|
|
|
- EssentialCityCode essentialCityCode2 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionCityAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionCityAdcode()));
|
|
|
if (null != essentialCityCode2) {
|
|
if (null != essentialCityCode2) {
|
|
|
storeInfoDraft.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
storeInfoDraft.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (storeInfoDraft.getAdministrativeRegionDistrictAdcode() != null) {
|
|
if (storeInfoDraft.getAdministrativeRegionDistrictAdcode() != null) {
|
|
|
- EssentialCityCode essentialCityCode3 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionDistrictAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfoDraft.getAdministrativeRegionDistrictAdcode()));
|
|
|
if (null != essentialCityCode3) {
|
|
if (null != essentialCityCode3) {
|
|
|
storeInfoDraft.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
storeInfoDraft.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
}
|
|
}
|
|
@@ -683,8 +630,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//如果更换了用户,则原有用户绑定门店删除
|
|
//如果更换了用户,则原有用户绑定门店删除
|
|
|
if (!userAccountId.equals(storeUserEntity.getId().toString())) {
|
|
if (!userAccountId.equals(storeUserEntity.getId().toString())) {
|
|
|
LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null)
|
|
|
|
|
- .eq(StoreUser::getId, storeUserEntity.getId());
|
|
|
|
|
|
|
+ storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null).eq(StoreUser::getId, storeUserEntity.getId());
|
|
|
storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
|
|
storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
|
|
|
}
|
|
}
|
|
|
//获取经营板块id
|
|
//获取经营板块id
|
|
@@ -696,11 +642,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<String> businessTypeNames = new ArrayList<>();
|
|
List<String> businessTypeNames = new ArrayList<>();
|
|
|
//获取经营种类名称
|
|
//获取经营种类名称
|
|
|
for (String businessType : businessTypes) {
|
|
for (String businessType : businessTypes) {
|
|
|
- StoreDictionary storeDictionary =
|
|
|
|
|
- storeDictionaryMapper
|
|
|
|
|
- .selectOne(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
|
|
|
|
+ StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
businessTypeNames.add(storeDictionary.getDictDetail());
|
|
businessTypeNames.add(storeDictionary.getDictDetail());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -729,18 +671,14 @@ 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));
|
|
|
//处理一下行政区域信息
|
|
//处理一下行政区域信息
|
|
|
- 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());
|
|
|
- EssentialCityCode essentialCityCode2 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
|
- EssentialCityCode essentialCityCode3 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
|
|
|
|
+ EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
storeInfoMapper.updateById(storeInfo);
|
|
storeInfoMapper.updateById(storeInfo);
|
|
|
- nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()),
|
|
|
|
|
- Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
|
|
|
|
+ nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfoDto.getStorePositionLongitude()), Double.parseDouble(storeInfoDto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
|
|
|
|
|
//修改门店店铺用户绑定关系
|
|
//修改门店店铺用户绑定关系
|
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
@@ -777,8 +715,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String deleteStoreInfo(StoreInfoDto storeInfoDto) {
|
|
public String deleteStoreInfo(StoreInfoDto storeInfoDto) {
|
|
|
- StoreUser storeUser = storeUserMapper
|
|
|
|
|
- .selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
|
|
|
|
|
|
|
+ StoreUser storeUser = storeUserMapper.selectOne(new LambdaQueryWrapper<StoreUser>().eq(StoreUser::getStoreId, storeInfoDto.getId()));
|
|
|
//判断是否有未完成的订单
|
|
//判断是否有未完成的订单
|
|
|
List<LifeUserOrder> lifeUserOrders = lifeUserOrderMapper.selectList(new LambdaQueryWrapper<LifeUserOrder>().in(LifeUserOrder::getStatus, 0, 3).eq(ObjectUtils.isNotEmpty(storeUser), LifeUserOrder::getUserId, storeUser.getId()).eq(LifeUserOrder::getDeleteFlag, 0));
|
|
List<LifeUserOrder> lifeUserOrders = lifeUserOrderMapper.selectList(new LambdaQueryWrapper<LifeUserOrder>().in(LifeUserOrder::getStatus, 0, 3).eq(ObjectUtils.isNotEmpty(storeUser), LifeUserOrder::getUserId, storeUser.getId()).eq(LifeUserOrder::getDeleteFlag, 0));
|
|
|
if (ObjectUtils.isNotEmpty(lifeUserOrders)) {
|
|
if (ObjectUtils.isNotEmpty(lifeUserOrders)) {
|
|
@@ -787,8 +724,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//判断是否修改变更过的用户账户
|
|
//判断是否修改变更过的用户账户
|
|
|
if (storeUser != null) {
|
|
if (storeUser != null) {
|
|
|
LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<StoreUser> storeUserLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null)
|
|
|
|
|
- .eq(StoreUser::getId, storeUser.getId());
|
|
|
|
|
|
|
+ storeUserLambdaUpdateWrapper.set(StoreUser::getStoreId, null).eq(StoreUser::getId, storeUser.getId());
|
|
|
storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
|
|
storeUserMapper.update(null, storeUserLambdaUpdateWrapper);
|
|
|
}
|
|
}
|
|
|
//删除商铺信息
|
|
//删除商铺信息
|
|
@@ -811,9 +747,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<StoreDictionaryVo> getBusinessSection() {
|
|
public List<StoreDictionaryVo> getBusinessSection() {
|
|
|
- List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getTypeName, "business_section").ne(StoreDictionary::getDictId, 0));
|
|
|
|
|
|
|
+ List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").ne(StoreDictionary::getDictId, 0));
|
|
|
List<StoreDictionaryVo> voList = new ArrayList<>();
|
|
List<StoreDictionaryVo> voList = new ArrayList<>();
|
|
|
for (StoreDictionary storeDictionary : businessSection) {
|
|
for (StoreDictionary storeDictionary : businessSection) {
|
|
|
StoreDictionaryVo vo = new StoreDictionaryVo();
|
|
StoreDictionaryVo vo = new StoreDictionaryVo();
|
|
@@ -825,9 +759,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<StoreDictionaryVo> getBusinessSectionTypes(String parentId) {
|
|
public List<StoreDictionaryVo> getBusinessSectionTypes(String parentId) {
|
|
|
- StoreDictionary businessSection = storeDictionaryMapper.selectOne(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, parentId));
|
|
|
|
|
|
|
+ StoreDictionary businessSection = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, parentId));
|
|
|
List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getParentId, businessSection.getId()));
|
|
List<StoreDictionary> storeDictionaries = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getParentId, businessSection.getId()));
|
|
|
List<StoreDictionaryVo> voList = new ArrayList<>();
|
|
List<StoreDictionaryVo> voList = new ArrayList<>();
|
|
|
for (StoreDictionary storeDictionary : storeDictionaries) {
|
|
for (StoreDictionary storeDictionary : storeDictionaries) {
|
|
@@ -840,10 +772,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<StoreUserVo> getUnboundAccountList(String id) {
|
|
public List<StoreUserVo> getUnboundAccountList(String id) {
|
|
|
-
|
|
|
|
|
List<StoreUserVo> storeUserVoList = new ArrayList<>();
|
|
List<StoreUserVo> storeUserVoList = new ArrayList<>();
|
|
|
- List<StoreUser> storeUsers =
|
|
|
|
|
- storeUserMapper.selectList(new LambdaQueryWrapper<StoreUser>().isNull(StoreUser::getStoreId));
|
|
|
|
|
|
|
+ List<StoreUser> storeUsers = storeUserMapper.selectList(new LambdaQueryWrapper<StoreUser>().isNull(StoreUser::getStoreId));
|
|
|
for (StoreUser storeUser : storeUsers) {
|
|
for (StoreUser storeUser : storeUsers) {
|
|
|
StoreUserVo vo = new StoreUserVo();
|
|
StoreUserVo vo = new StoreUserVo();
|
|
|
BeanUtils.copyProperties(storeUser, vo);
|
|
BeanUtils.copyProperties(storeUser, vo);
|
|
@@ -866,13 +796,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void addBusinessSectionAndTypes(StoreInfoDto storeInfoDto) {
|
|
public void addBusinessSectionAndTypes(StoreInfoDto storeInfoDto) {
|
|
|
- StoreDictionary businessSectionParent = storeDictionaryMapper.selectOne(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, 0));
|
|
|
|
|
|
|
+ StoreDictionary businessSectionParent = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section").eq(StoreDictionary::getDictId, 0));
|
|
|
//查看当前最大id
|
|
//查看当前最大id
|
|
|
- List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getTypeName, "business_section"));
|
|
|
|
|
|
|
+ List<StoreDictionary> businessSection = storeDictionaryMapper.selectList(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getTypeName, "business_section"));
|
|
|
Integer maxId = 0;
|
|
Integer maxId = 0;
|
|
|
for (StoreDictionary storeDictionary : businessSection) {
|
|
for (StoreDictionary storeDictionary : businessSection) {
|
|
|
if (Integer.parseInt(storeDictionary.getDictId()) > maxId) {
|
|
if (Integer.parseInt(storeDictionary.getDictId()) > maxId) {
|
|
@@ -935,7 +861,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
result.setBusinessLicenseAddress(storeImgPaths);
|
|
result.setBusinessLicenseAddress(storeImgPaths);
|
|
|
result.setContractImageList(storeContractImagePathImgs);
|
|
result.setContractImageList(storeContractImagePathImgs);
|
|
|
-
|
|
|
|
|
//存入续签合同地址
|
|
//存入续签合同地址
|
|
|
List<StoreImg> renewContractImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 22));
|
|
List<StoreImg> renewContractImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 22));
|
|
|
List<String> renewContractImagePathImgs = new ArrayList<>();
|
|
List<String> renewContractImagePathImgs = new ArrayList<>();
|
|
@@ -950,7 +875,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
} else {
|
|
} else {
|
|
|
result.setEntranceImage("null");
|
|
result.setEntranceImage("null");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 存放商家头像
|
|
// 存放商家头像
|
|
|
List<StoreImg> storeImgs1 = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 10));
|
|
List<StoreImg> storeImgs1 = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().eq(StoreImg::getStoreId, storeId).eq(StoreImg::getImgType, 10));
|
|
|
if (!storeImgs1.isEmpty()) {
|
|
if (!storeImgs1.isEmpty()) {
|
|
@@ -961,7 +885,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 设置经纬度
|
|
// 设置经纬度
|
|
|
result.setStorePositionLongitude(result.getStorePosition().split(",")[0]);
|
|
result.setStorePositionLongitude(result.getStorePosition().split(",")[0]);
|
|
|
result.setStorePositionLatitude(result.getStorePosition().split(",")[1]);
|
|
result.setStorePositionLatitude(result.getStorePosition().split(",")[1]);
|
|
|
-
|
|
|
|
|
// 设置距离
|
|
// 设置距离
|
|
|
if ((jingdu != null && !jingdu.isEmpty()) && (weidu != null && !weidu.isEmpty())) {
|
|
if ((jingdu != null && !jingdu.isEmpty()) && (weidu != null && !weidu.isEmpty())) {
|
|
|
double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
|
|
double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
|
|
@@ -969,7 +892,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
double storeDistance = DistanceUtil.haversineCalculateDistance(Double.parseDouble(jingdu), Double.parseDouble(weidu), storeJing, storeWei);
|
|
double storeDistance = DistanceUtil.haversineCalculateDistance(Double.parseDouble(jingdu), Double.parseDouble(weidu), storeJing, storeWei);
|
|
|
result.setDistance(storeDistance);
|
|
result.setDistance(storeDistance);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 计算店铺到最近地铁站的距离
|
|
// 计算店铺到最近地铁站的距离
|
|
|
JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(result.getStorePosition().split(",")[0], result.getStorePosition().split(",")[1]);
|
|
JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(result.getStorePosition().split(",")[0], result.getStorePosition().split(",")[1]);
|
|
|
// 地铁名
|
|
// 地铁名
|
|
@@ -978,7 +900,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 地铁站经纬度
|
|
// 地铁站经纬度
|
|
|
String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
|
|
String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
|
|
|
String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
|
|
String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
|
|
|
-
|
|
|
|
|
if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
|
|
if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
|
|
|
double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
|
|
double storeJing = Double.parseDouble(result.getStorePosition().split(",")[0]);
|
|
|
double storeWei = Double.parseDouble(result.getStorePosition().split(",")[1]);
|
|
double storeWei = Double.parseDouble(result.getStorePosition().split(",")[1]);
|
|
@@ -987,23 +908,18 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
} else {
|
|
} else {
|
|
|
result.setDistance2(0);
|
|
result.setDistance2(0);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 当前登录用户是否收藏
|
|
// 当前登录用户是否收藏
|
|
|
LambdaUpdateWrapper<LifeCollect> shouCangWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<LifeCollect> shouCangWrapper = new LambdaUpdateWrapper<>();
|
|
|
- shouCangWrapper.eq(LifeCollect::getUserId, userId)
|
|
|
|
|
- .eq(LifeCollect::getStoreId, storeId);
|
|
|
|
|
|
|
+ shouCangWrapper.eq(LifeCollect::getUserId, userId).eq(LifeCollect::getStoreId, storeId);
|
|
|
LifeCollect shouCang = lifeCollectMapper.selectOne(shouCangWrapper);
|
|
LifeCollect shouCang = lifeCollectMapper.selectOne(shouCangWrapper);
|
|
|
if (null == shouCang) {
|
|
if (null == shouCang) {
|
|
|
result.setCollection(0);
|
|
result.setCollection(0);
|
|
|
} else {
|
|
} else {
|
|
|
result.setCollection(1);
|
|
result.setCollection(1);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 获取店铺优惠券列表
|
|
// 获取店铺优惠券列表
|
|
|
LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<LifeCoupon> quanWrapper = new LambdaUpdateWrapper<>();
|
|
|
- quanWrapper.eq(LifeCoupon::getStoreId, storeId)
|
|
|
|
|
- .eq(LifeCoupon::getStatus, 1)
|
|
|
|
|
- .eq(LifeCoupon::getType, 1);
|
|
|
|
|
|
|
+ quanWrapper.eq(LifeCoupon::getStoreId, storeId).eq(LifeCoupon::getStatus, 1).eq(LifeCoupon::getType, 1);
|
|
|
List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
|
|
List<LifeCoupon> quanList = lifeCouponMapper.selectList(quanWrapper);
|
|
|
List<LifeCouponVo> quanVoList = new ArrayList<>();
|
|
List<LifeCouponVo> quanVoList = new ArrayList<>();
|
|
|
List<String> collect = quanList.stream().map(LifeCoupon::getId).collect(Collectors.toList());
|
|
List<String> collect = quanList.stream().map(LifeCoupon::getId).collect(Collectors.toList());
|
|
@@ -1024,23 +940,17 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
// 获取店铺团购
|
|
// 获取店铺团购
|
|
|
LambdaUpdateWrapper<LifeCoupon> tuangouWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<LifeCoupon> tuangouWrapper = new LambdaUpdateWrapper<>();
|
|
|
- tuangouWrapper.eq(LifeCoupon::getStoreId, storeId)
|
|
|
|
|
- .eq(LifeCoupon::getStatus, 1)
|
|
|
|
|
- .eq(LifeCoupon::getType, 2).orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
|
|
|
|
+ tuangouWrapper.eq(LifeCoupon::getStoreId, storeId).eq(LifeCoupon::getStatus, 1).eq(LifeCoupon::getType, 2).orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
List<LifeCoupon> tuangouList = lifeCouponMapper.selectList(tuangouWrapper);
|
|
List<LifeCoupon> tuangouList = lifeCouponMapper.selectList(tuangouWrapper);
|
|
|
List<LifeCouponVo> tuangouVOList = new ArrayList<>();
|
|
List<LifeCouponVo> tuangouVOList = new ArrayList<>();
|
|
|
for (LifeCoupon lifeCoupon : tuangouList) {
|
|
for (LifeCoupon lifeCoupon : tuangouList) {
|
|
|
LifeCouponVo lifeCouponVo = new LifeCouponVo();
|
|
LifeCouponVo lifeCouponVo = new LifeCouponVo();
|
|
|
BeanUtils.copyProperties(lifeCoupon, lifeCouponVo);
|
|
BeanUtils.copyProperties(lifeCoupon, lifeCouponVo);
|
|
|
if (StringUtils.isNotEmpty(lifeCoupon.getImagePath())) {
|
|
if (StringUtils.isNotEmpty(lifeCoupon.getImagePath())) {
|
|
|
- List<String> ids = Arrays.stream(lifeCoupon.getImagePath().split(","))
|
|
|
|
|
- .map(String::trim)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<String> ids = Arrays.stream(lifeCoupon.getImagePath().split(",")).map(String::trim).collect(Collectors.toList());
|
|
|
List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, ids));
|
|
List<StoreImg> imgList = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, ids));
|
|
|
if (imgList != null) {
|
|
if (imgList != null) {
|
|
|
- String imgs = imgList.stream()
|
|
|
|
|
- .map(StoreImg::getImgUrl)
|
|
|
|
|
- .collect(Collectors.joining(","));
|
|
|
|
|
|
|
+ String imgs = imgList.stream().map(StoreImg::getImgUrl).collect(Collectors.joining(","));
|
|
|
lifeCouponVo.setImgs(imgs);
|
|
lifeCouponVo.setImgs(imgs);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1090,8 +1000,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
// 获取店铺动态列表
|
|
// 获取店铺动态列表
|
|
|
QueryWrapper<LifeUserDynamics> dynamicsWrapper = new QueryWrapper<>();
|
|
QueryWrapper<LifeUserDynamics> dynamicsWrapper = new QueryWrapper<>();
|
|
|
- dynamicsWrapper.eq("phone_id", "store_" + result.getStorePhone())
|
|
|
|
|
- .orderByDesc("lud.created_time");
|
|
|
|
|
|
|
+ dynamicsWrapper.eq("phone_id", "store_" + result.getStorePhone()).orderByDesc("lud.created_time");
|
|
|
List<LifeUserDynamicsVo> storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, dynamicsWrapper);
|
|
List<LifeUserDynamicsVo> storeDynamicslist = lifeUserDynamicsMapper.getStoreDynamicslist(userId, dynamicsWrapper);
|
|
|
List<LifeUserDynamicsVo> storeDynamicslist2 = storeDynamicslist.stream().limit(10).collect(Collectors.toList());
|
|
List<LifeUserDynamicsVo> storeDynamicslist2 = storeDynamicslist.stream().limit(10).collect(Collectors.toList());
|
|
|
result.setDynamicsList(storeDynamicslist2);
|
|
result.setDynamicsList(storeDynamicslist2);
|
|
@@ -1159,16 +1068,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 定义格式化模式
|
|
// 定义格式化模式
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
// 先将 Date 转换为 Instant
|
|
// 先将 Date 转换为 Instant
|
|
|
- List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(
|
|
|
|
|
- new QueryWrapper<StoreInfoVo>()
|
|
|
|
|
- .like(StringUtils.isNotEmpty(id), "a.id", id)
|
|
|
|
|
- .like(StringUtils.isNotEmpty(storePhone), "b.phone", storePhone)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(storeApplicationStatusStr), "a.store_application_status", storeApplicationStatusStr)
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection)
|
|
|
|
|
- .eq("a.delete_flag", 0)
|
|
|
|
|
- .eq("b.delete_flag", 0)
|
|
|
|
|
- .orderByDesc("a.created_time"));
|
|
|
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
|
|
+ List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(new QueryWrapper<StoreInfoVo>().like(StringUtils.isNotEmpty(id), "a.id", id).like(StringUtils.isNotEmpty(storePhone), "b.phone", storePhone).eq(StringUtils.isNotEmpty(storeApplicationStatusStr), "a.store_application_status", storeApplicationStatusStr).eq(StringUtils.isNotEmpty(businessSection), "a.business_section", businessSection).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time"));
|
|
|
List<StoreInfoExcelVo> storeInfoExcelVos = new ArrayList<>();
|
|
List<StoreInfoExcelVo> storeInfoExcelVos = new ArrayList<>();
|
|
|
int serialNumber = 0;
|
|
int serialNumber = 0;
|
|
|
for (StoreInfoVo storeInfoVo : storeInfoVos) {
|
|
for (StoreInfoVo storeInfoVo : storeInfoVos) {
|
|
@@ -1200,8 +1100,9 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//存入创建时间
|
|
//存入创建时间
|
|
|
storeInfoExcelVos.add(storeInfoExcelVo);
|
|
storeInfoExcelVos.add(storeInfoExcelVo);
|
|
|
}
|
|
}
|
|
|
- ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreInfoExcelVo.class);
|
|
|
|
|
- return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
|
|
|
|
|
|
|
+ String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
+ String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExcelVos, StoreInfoExcelVo.class);
|
|
|
|
|
+ return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1211,13 +1112,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 定义格式化模式
|
|
// 定义格式化模式
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
// 先将 Date 转换为 Instant
|
|
// 先将 Date 转换为 Instant
|
|
|
- List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(
|
|
|
|
|
- new QueryWrapper<StoreInfoVo>()
|
|
|
|
|
- .like(StringUtils.isNotEmpty(id), "a.id", id)
|
|
|
|
|
- .eq("a.delete_flag", 0)
|
|
|
|
|
- .eq("b.delete_flag", 0)
|
|
|
|
|
- .orderByDesc("a.created_time"));
|
|
|
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
|
|
+ List<StoreInfoVo> storeInfoVos = storeInfoMapper.getStoreInfoVo(new QueryWrapper<StoreInfoVo>().like(StringUtils.isNotEmpty(id), "a.id", id).eq("a.delete_flag", 0).eq("b.delete_flag", 0).orderByDesc("a.created_time"));
|
|
|
List<StoreInfoExpiredRecordsExcelVo> storeInfoExpiredRecordsExcelVos = new ArrayList<>();
|
|
List<StoreInfoExpiredRecordsExcelVo> storeInfoExpiredRecordsExcelVos = new ArrayList<>();
|
|
|
int serialNumber = 0;
|
|
int serialNumber = 0;
|
|
|
for (StoreInfoVo storeInfoVo : storeInfoVos) {
|
|
for (StoreInfoVo storeInfoVo : storeInfoVos) {
|
|
@@ -1273,10 +1168,12 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfoExpiredRecordsExcelVos.add(storeInfoExpiredRecordsExcelVo);
|
|
storeInfoExpiredRecordsExcelVos.add(storeInfoExpiredRecordsExcelVo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
- ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExpiredRecordsExcelVos, StoreInfoExpiredRecordsExcelVo.class);
|
|
|
|
|
- return fileUrl + "excel" + excelGeneratePath + fileName + ".xlsx";
|
|
|
|
|
|
|
+ String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
+ String filePath = ExcelGenerator.generateExcel(excelPath + excelGeneratePath + fileName + ".xlsx", storeInfoExpiredRecordsExcelVos, StoreInfoExpiredRecordsExcelVo.class);
|
|
|
|
|
+ String url = aliOSSUtil.uploadFile(new File(filePath), "/excel/" + fileName + ".xlsx");
|
|
|
|
|
+ new File(filePath).delete();
|
|
|
|
|
+ return url;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1316,9 +1213,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (lat != null && lon != null && distance != null) {
|
|
if (lat != null && lon != null && distance != null) {
|
|
|
List<NearMeDto> nearMeDtos = nearMeService.nearbyMerchants(lon, lat, distance, flag);
|
|
List<NearMeDto> nearMeDtos = nearMeService.nearbyMerchants(lon, lat, distance, flag);
|
|
|
if (nearMeDtos != null && !nearMeDtos.isEmpty()) {
|
|
if (nearMeDtos != null && !nearMeDtos.isEmpty()) {
|
|
|
- storeId = nearMeDtos.stream()
|
|
|
|
|
- .map(item -> String.valueOf(item.getConent()))
|
|
|
|
|
- .collect(Collectors.joining(","));
|
|
|
|
|
|
|
+ storeId = nearMeDtos.stream().map(item -> String.valueOf(item.getConent())).collect(Collectors.joining(","));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1344,42 +1239,28 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<String> storeIds = Arrays.asList(storeId.split(","));
|
|
List<String> storeIds = Arrays.asList(storeId.split(","));
|
|
|
if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
|
|
if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
|
|
|
List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
|
|
List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
|
|
|
- DateTimeFormatter formatter = new DateTimeFormatterBuilder()
|
|
|
|
|
- .appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE)
|
|
|
|
|
- .appendLiteral(':')
|
|
|
|
|
- .appendValue(ChronoField.MINUTE_OF_HOUR, 2)
|
|
|
|
|
- .toFormatter();
|
|
|
|
|
- List<StoreBusinessInfo> list = storeBusinessInfos.stream()
|
|
|
|
|
- .filter(item -> {
|
|
|
|
|
- // 商家开门时间
|
|
|
|
|
- LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
- // 商家关门时间
|
|
|
|
|
- LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
- // 开始时间
|
|
|
|
|
- LocalTime time1 = LocalTime.parse(startTime);
|
|
|
|
|
- // 结束时间
|
|
|
|
|
- LocalTime time2 = LocalTime.parse(endTime);
|
|
|
|
|
- return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
|
|
|
|
|
- })
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
-
|
|
|
|
|
- storeIds = list.stream()
|
|
|
|
|
- .map(item -> String.valueOf(item.getStoreId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).toFormatter();
|
|
|
|
|
+ List<StoreBusinessInfo> list = storeBusinessInfos.stream().filter(item -> {
|
|
|
|
|
+ // 商家开门时间
|
|
|
|
|
+ LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
+ // 商家关门时间
|
|
|
|
|
+ LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
+ // 开始时间
|
|
|
|
|
+ LocalTime time1 = LocalTime.parse(startTime);
|
|
|
|
|
+ // 结束时间
|
|
|
|
|
+ LocalTime time2 = LocalTime.parse(endTime);
|
|
|
|
|
+ return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
- storeIds.stream()
|
|
|
|
|
- .filter(Objects::nonNull) // 确保 storeId 不为 null
|
|
|
|
|
|
|
+ storeIds.stream().filter(Objects::nonNull) // 确保 storeId 不为 null
|
|
|
.distinct() // 去重
|
|
.distinct() // 去重
|
|
|
- .map(String::valueOf)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ .map(String::valueOf).collect(Collectors.toList());
|
|
|
if (priceStr != null && priceEnd != null) {
|
|
if (priceStr != null && priceEnd != null) {
|
|
|
List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
|
|
List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
|
|
|
- List<LifeCoupon> list = lifeCoupons.stream()
|
|
|
|
|
- .filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
- storeIds = list.stream()
|
|
|
|
|
- .map(item -> String.valueOf(item.getStoreId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<LifeCoupon> list = lifeCoupons.stream().filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd).collect(Collectors.toList());
|
|
|
|
|
+ storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(storeIds)) {
|
|
if (!CollectionUtils.isEmpty(storeIds)) {
|
|
|
LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -1438,50 +1319,36 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<String> storeIds = Arrays.asList(storeId.split(","));
|
|
List<String> storeIds = Arrays.asList(storeId.split(","));
|
|
|
if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
|
|
if (StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)) {
|
|
|
List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
|
|
List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().in(StoreBusinessInfo::getStoreId, storeIds));
|
|
|
- DateTimeFormatter formatter = new DateTimeFormatterBuilder()
|
|
|
|
|
- .appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE)
|
|
|
|
|
- .appendLiteral(':')
|
|
|
|
|
- .appendValue(ChronoField.MINUTE_OF_HOUR, 2)
|
|
|
|
|
- .toFormatter();
|
|
|
|
|
- List<StoreBusinessInfo> list = storeBusinessInfos.stream()
|
|
|
|
|
- .filter(item -> {
|
|
|
|
|
- // 商家开门时间
|
|
|
|
|
- LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
- // 商家关门时间
|
|
|
|
|
- LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
- // 开始时间
|
|
|
|
|
- LocalTime time1 = LocalTime.parse(startTime);
|
|
|
|
|
- // 结束时间
|
|
|
|
|
- LocalTime time2 = LocalTime.parse(endTime);
|
|
|
|
|
- return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
|
|
|
|
|
- })
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
-
|
|
|
|
|
- storeIds = list.stream()
|
|
|
|
|
- .map(item -> String.valueOf(item.getStoreId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendValue(ChronoField.HOUR_OF_DAY, 1, 2, java.time.format.SignStyle.NOT_NEGATIVE).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).toFormatter();
|
|
|
|
|
+ List<StoreBusinessInfo> list = storeBusinessInfos.stream().filter(item -> {
|
|
|
|
|
+ // 商家开门时间
|
|
|
|
|
+ LocalTime timeStart = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
+ // 商家关门时间
|
|
|
|
|
+ LocalTime timeEnd = LocalTime.parse(item.getEndTime(), formatter);
|
|
|
|
|
+ // 开始时间
|
|
|
|
|
+ LocalTime time1 = LocalTime.parse(startTime);
|
|
|
|
|
+ // 结束时间
|
|
|
|
|
+ LocalTime time2 = LocalTime.parse(endTime);
|
|
|
|
|
+ return !time1.isBefore(timeStart) && !time2.isAfter(timeEnd);
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
- storeIds.stream()
|
|
|
|
|
- .filter(Objects::nonNull) // 确保 storeId 不为 null
|
|
|
|
|
|
|
+ storeIds.stream().filter(Objects::nonNull) // 确保 storeId 不为 null
|
|
|
.distinct() // 去重
|
|
.distinct() // 去重
|
|
|
- .map(String::valueOf)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ .map(String::valueOf).collect(Collectors.toList());
|
|
|
if (priceStr != null && priceEnd != null) {
|
|
if (priceStr != null && priceEnd != null) {
|
|
|
List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
|
|
List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStoreId, storeIds));
|
|
|
- List<LifeCoupon> list = lifeCoupons.stream()
|
|
|
|
|
- .filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd)
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
- storeIds = list.stream()
|
|
|
|
|
- .map(item -> String.valueOf(item.getStoreId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<LifeCoupon> list = lifeCoupons.stream().filter(item -> Double.parseDouble(item.getPrice()) >= priceStr && Double.parseDouble(item.getPrice()) < priceEnd).collect(Collectors.toList());
|
|
|
|
|
+ storeIds = list.stream().map(item -> String.valueOf(item.getStoreId())).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(storeIds)) {
|
|
if (!CollectionUtils.isEmpty(storeIds)) {
|
|
|
queryWrapper.in("a.id", storeIds);
|
|
queryWrapper.in("a.id", storeIds);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- queryWrapper.eq("a.delete_flag",0);
|
|
|
|
|
- queryWrapper.eq("a.logout_flag",0);
|
|
|
|
|
|
|
+ queryWrapper.eq("a.delete_flag", 0);
|
|
|
|
|
+ queryWrapper.eq("a.logout_flag", 0);
|
|
|
queryWrapper.like(StringUtils.isNotEmpty(vo.getFoodType()), "a.business_types_name", vo.getFoodType());
|
|
queryWrapper.like(StringUtils.isNotEmpty(vo.getFoodType()), "a.business_types_name", vo.getFoodType());
|
|
|
queryWrapper.like(StringUtils.isNotEmpty(vo.getStoreName()), "a.store_name", vo.getStoreName());
|
|
queryWrapper.like(StringUtils.isNotEmpty(vo.getStoreName()), "a.store_name", vo.getStoreName());
|
|
|
|
|
|
|
@@ -1491,7 +1358,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
queryWrapper.orderByAsc("dist");
|
|
queryWrapper.orderByAsc("dist");
|
|
|
- storeInfoIPage = storeInfoMapper.getPageForDistance(page,lon + "," + lat, queryWrapper);
|
|
|
|
|
|
|
+ storeInfoIPage = storeInfoMapper.getPageForDistance(page, lon + "," + lat, queryWrapper);
|
|
|
List<StoreInfoVo> storeInfoVoList = storeInfoIPage.getRecords();
|
|
List<StoreInfoVo> storeInfoVoList = storeInfoIPage.getRecords();
|
|
|
|
|
|
|
|
// 提取所有符合条件的门店ID
|
|
// 提取所有符合条件的门店ID
|
|
@@ -1515,7 +1382,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 遍历所有门店信息,构造返回结果
|
|
// 遍历所有门店信息,构造返回结果
|
|
|
for (StoreInfoVo store : storeInfoVoList) {
|
|
for (StoreInfoVo store : storeInfoVoList) {
|
|
|
Map<String, Object> storeMap = new HashMap<>();
|
|
Map<String, Object> storeMap = new HashMap<>();
|
|
|
- storeMap.put("dist",store.getDist());
|
|
|
|
|
|
|
+ storeMap.put("dist", store.getDist());
|
|
|
// 添加门店的业务状态及其描述
|
|
// 添加门店的业务状态及其描述
|
|
|
storeMap.put("businessStatus", store.getBusinessStatus());
|
|
storeMap.put("businessStatus", store.getBusinessStatus());
|
|
|
storeMap.put("businessStatusStr", store.getBusinessStatusStr());
|
|
storeMap.put("businessStatusStr", store.getBusinessStatusStr());
|
|
@@ -1605,9 +1472,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
List<StoreInfo> infos = storeInfoMapper.selectList(queryWrapper);
|
|
List<StoreInfo> infos = storeInfoMapper.selectList(queryWrapper);
|
|
|
storeInfos.addAll(infos);
|
|
storeInfos.addAll(infos);
|
|
|
}
|
|
}
|
|
|
- return new ArrayList<>(storeInfos.stream()
|
|
|
|
|
- .collect(Collectors.toMap(StoreInfo::getId, info -> info, (existing, replacement) -> existing))
|
|
|
|
|
- .values());
|
|
|
|
|
|
|
+ return new ArrayList<>(storeInfos.stream().collect(Collectors.toMap(StoreInfo::getId, info -> info, (existing, replacement) -> existing)).values());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static String findCommon(String... strings) {
|
|
public static String findCommon(String... strings) {
|
|
@@ -1631,46 +1496,41 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
*/
|
|
*/
|
|
|
public void checkAndUpdateExpiredRecords() {
|
|
public void checkAndUpdateExpiredRecords() {
|
|
|
LambdaUpdateWrapper<StoreInfo> queryWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<StoreInfo> queryWrapper = new LambdaUpdateWrapper<>();
|
|
|
- queryWrapper.isNotNull(StoreInfo::getExpirationTime)
|
|
|
|
|
- .lt(StoreInfo::getExpirationTime, LocalDateTime.now())
|
|
|
|
|
- .eq(StoreInfo::getBusinessStatus, 0)
|
|
|
|
|
- .set(StoreInfo::getBusinessStatus, 99);
|
|
|
|
|
|
|
+ queryWrapper.isNotNull(StoreInfo::getExpirationTime).lt(StoreInfo::getExpirationTime, LocalDateTime.now()).eq(StoreInfo::getBusinessStatus, 0).set(StoreInfo::getBusinessStatus, 99);
|
|
|
this.update(queryWrapper);
|
|
this.update(queryWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void logoutStore(StoreInfoVo storeInfo) {
|
|
public void logoutStore(StoreInfoVo storeInfo) {
|
|
|
- // 通过id获取当前店铺信息
|
|
|
|
|
- LambdaQueryWrapper<StoreInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- lambdaQueryWrapper.eq(StoreInfo::getId, storeInfo.getId());
|
|
|
|
|
- StoreInfo storeIn = storeInfoMapper.selectOne(lambdaQueryWrapper);
|
|
|
|
|
- if (storeIn != null) {
|
|
|
|
|
- // 添加注销原因
|
|
|
|
|
- storeIn.setLogoutReason(storeInfo.getLogoutReason());
|
|
|
|
|
- // 添加注销code
|
|
|
|
|
- storeIn.setLogoutCode(storeInfo.getLogoutCode());
|
|
|
|
|
- // 注销中状态
|
|
|
|
|
- storeIn.setStoreStatus(-1);
|
|
|
|
|
- // 添加注销申请时间
|
|
|
|
|
- storeIn.setLogoutTime(new Date());
|
|
|
|
|
- // 更新logout_flag状态为1
|
|
|
|
|
- storeIn.setLogoutFlag(1);
|
|
|
|
|
- int num = storeInfoMapper.updateById(storeIn);
|
|
|
|
|
- if (num > 0) {
|
|
|
|
|
- // 发送通知
|
|
|
|
|
- LifeNotice lifeMessage = new LifeNotice();
|
|
|
|
|
- lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
|
|
|
|
|
- String text = "您提交的店铺注销申请已成功提交, 系统将按流程进行处理. 注销申请提交后, 将进入7天的冷静期. 期间您可以随时在" +
|
|
|
|
|
- "[门店装修]-[操作]中撤回申请. 冷静期结束后, 系统将正式开始注销操作. 店铺内所有数据将被永久清除, 且无法恢复." +
|
|
|
|
|
- "如有疑问, 可联系客服咨询. 感谢您使用我们的服务.";
|
|
|
|
|
- lifeMessage.setContext(text);
|
|
|
|
|
- lifeMessage.setTitle("注销店铺通知");
|
|
|
|
|
- lifeMessage.setSenderId("system");
|
|
|
|
|
- lifeMessage.setIsRead(0);
|
|
|
|
|
- lifeMessage.setNoticeType(1);
|
|
|
|
|
- lifeNoticeMapper.insert(lifeMessage);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 通过id获取当前店铺信息
|
|
|
|
|
+ LambdaQueryWrapper<StoreInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lambdaQueryWrapper.eq(StoreInfo::getId, storeInfo.getId());
|
|
|
|
|
+ StoreInfo storeIn = storeInfoMapper.selectOne(lambdaQueryWrapper);
|
|
|
|
|
+ if (storeIn != null) {
|
|
|
|
|
+ // 添加注销原因
|
|
|
|
|
+ storeIn.setLogoutReason(storeInfo.getLogoutReason());
|
|
|
|
|
+ // 添加注销code
|
|
|
|
|
+ storeIn.setLogoutCode(storeInfo.getLogoutCode());
|
|
|
|
|
+ // 注销中状态
|
|
|
|
|
+ storeIn.setStoreStatus(-1);
|
|
|
|
|
+ // 添加注销申请时间
|
|
|
|
|
+ storeIn.setLogoutTime(new Date());
|
|
|
|
|
+ // 更新logout_flag状态为1
|
|
|
|
|
+ storeIn.setLogoutFlag(1);
|
|
|
|
|
+ int num = storeInfoMapper.updateById(storeIn);
|
|
|
|
|
+ if (num > 0) {
|
|
|
|
|
+ // 发送通知
|
|
|
|
|
+ LifeNotice lifeMessage = new LifeNotice();
|
|
|
|
|
+ lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
|
|
|
|
|
+ String text = "您提交的店铺注销申请已成功提交, 系统将按流程进行处理. 注销申请提交后, 将进入7天的冷静期. 期间您可以随时在" + "[门店装修]-[操作]中撤回申请. 冷静期结束后, 系统将正式开始注销操作. 店铺内所有数据将被永久清除, 且无法恢复." + "如有疑问, 可联系客服咨询. 感谢您使用我们的服务.";
|
|
|
|
|
+ lifeMessage.setContext(text);
|
|
|
|
|
+ lifeMessage.setTitle("注销店铺通知");
|
|
|
|
|
+ lifeMessage.setSenderId("system");
|
|
|
|
|
+ lifeMessage.setIsRead(0);
|
|
|
|
|
+ lifeMessage.setNoticeType(1);
|
|
|
|
|
+ lifeNoticeMapper.insert(lifeMessage);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1696,10 +1556,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
|
|
lifeMessage.setReceiverId("store_" + storeInfo.getStorePhone());
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String storeDate = simpleDateFormat.format(new DateTime());
|
|
String storeDate = simpleDateFormat.format(new DateTime());
|
|
|
- String text = "处理结果:已撤回注销申请" +
|
|
|
|
|
- "处理时间:" + storeDate +
|
|
|
|
|
- "当前店铺状态已恢复正常. 您可以继续使用该店铺登录并享受各项服务, 所有店铺数据均已妥善保留." +
|
|
|
|
|
- "若您后续仍有注销需求, 可随时通过门店装修页面重新提交申请. 感谢您的理解与支持!";
|
|
|
|
|
|
|
+ String text = "处理结果:已撤回注销申请" + "处理时间:" + storeDate + "当前店铺状态已恢复正常. 您可以继续使用该店铺登录并享受各项服务, 所有店铺数据均已妥善保留." + "若您后续仍有注销需求, 可随时通过门店装修页面重新提交申请. 感谢您的理解与支持!";
|
|
|
lifeMessage.setContext(text);
|
|
lifeMessage.setContext(text);
|
|
|
lifeMessage.setTitle("撤销店铺注销通知");
|
|
lifeMessage.setTitle("撤销店铺注销通知");
|
|
|
lifeMessage.setSenderId("system");
|
|
lifeMessage.setSenderId("system");
|
|
@@ -1726,75 +1583,67 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public int saveOrUpdateStoreInfo(StoreInfoDto storeInfodto) {
|
|
public int saveOrUpdateStoreInfo(StoreInfoDto storeInfodto) {
|
|
|
- if (storeInfodto.getId() != null) {
|
|
|
|
|
- //效验当前店铺存在未完成的订单及正在销售的商品
|
|
|
|
|
- verificationStoreInfoStatus(storeInfodto);
|
|
|
|
|
-
|
|
|
|
|
- //获取经营板块id
|
|
|
|
|
- Integer businessSection = storeInfodto.getBusinessSection();
|
|
|
|
|
- //查询经营板块名称
|
|
|
|
|
- StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
|
|
|
|
|
- //查询经营种类
|
|
|
|
|
- List<String> businessTypeNames = new ArrayList<>();
|
|
|
|
|
- List<String> businessTypes = storeInfodto.getBusinessTypes();
|
|
|
|
|
- if (!CollectionUtils.isEmpty(businessTypes)) {
|
|
|
|
|
- //获取经营种类名称
|
|
|
|
|
- for (String businessType : businessTypes) {
|
|
|
|
|
- StoreDictionary storeDictionary =
|
|
|
|
|
- storeDictionaryMapper
|
|
|
|
|
- .selectOne(
|
|
|
|
|
- new LambdaQueryWrapper<StoreDictionary>()
|
|
|
|
|
- .eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
|
|
- businessTypeNames.add(storeDictionary.getDictDetail());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- StoreInfo storeInfo = new StoreInfo();
|
|
|
|
|
- BeanUtils.copyProperties(storeInfodto, storeInfo);
|
|
|
|
|
-
|
|
|
|
|
- //存入经纬度
|
|
|
|
|
- if(StringUtils.isEmpty(storeInfodto.getStorePositionLongitude())||StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())){
|
|
|
|
|
- StoreInfo storeIn = storeInfoMapper.selectById(storeInfodto.getId());
|
|
|
|
|
- storeInfo.setStorePosition(storeIn.getStorePosition());
|
|
|
|
|
- }else{
|
|
|
|
|
- storeInfo.setStorePosition(storeInfodto.getStorePositionLongitude() + "," + storeInfodto.getStorePositionLatitude());
|
|
|
|
|
|
|
+ if (storeInfodto.getId() != null) {
|
|
|
|
|
+ //效验当前店铺存在未完成的订单及正在销售的商品
|
|
|
|
|
+ verificationStoreInfoStatus(storeInfodto);
|
|
|
|
|
+
|
|
|
|
|
+ //获取经营板块id
|
|
|
|
|
+ Integer businessSection = storeInfodto.getBusinessSection();
|
|
|
|
|
+ //查询经营板块名称
|
|
|
|
|
+ StoreDictionary businessSectionName = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessSection).eq(StoreDictionary::getTypeName, "business_section"));
|
|
|
|
|
+ //查询经营种类
|
|
|
|
|
+ List<String> businessTypeNames = new ArrayList<>();
|
|
|
|
|
+ List<String> businessTypes = storeInfodto.getBusinessTypes();
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(businessTypes)) {
|
|
|
|
|
+ //获取经营种类名称
|
|
|
|
|
+ for (String businessType : businessTypes) {
|
|
|
|
|
+ StoreDictionary storeDictionary = storeDictionaryMapper.selectOne(new LambdaQueryWrapper<StoreDictionary>().eq(StoreDictionary::getDictId, businessType).eq(StoreDictionary::getParentId, businessSectionName.getId()));
|
|
|
|
|
+ businessTypeNames.add(storeDictionary.getDictDetail());
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ StoreInfo storeInfo = new StoreInfo();
|
|
|
|
|
+ BeanUtils.copyProperties(storeInfodto, storeInfo);
|
|
|
|
|
|
|
|
- //存入门店状态
|
|
|
|
|
- storeInfo.setStoreStatus(storeInfodto.getStoreStatus());
|
|
|
|
|
- //板块及类型
|
|
|
|
|
- storeInfo.setBusinessSection(businessSection);
|
|
|
|
|
- storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
|
|
|
- if (!CollectionUtils.isEmpty(businessTypes) && !CollectionUtils.isEmpty(businessTypeNames)) {
|
|
|
|
|
- storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
|
|
- storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
|
|
- }
|
|
|
|
|
- //处理一下行政区域信息
|
|
|
|
|
- EssentialCityCode essentialCityCode1 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
|
|
|
|
|
- storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
|
|
|
- EssentialCityCode essentialCityCode2 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
|
|
- storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
|
|
|
- EssentialCityCode essentialCityCode3 =
|
|
|
|
|
- essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
|
|
- storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
|
|
- int num = storeInfoMapper.updateById(storeInfo);
|
|
|
|
|
- if(!StringUtils.isEmpty(storeInfodto.getStorePositionLongitude())&&!StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())){
|
|
|
|
|
- nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfodto.getStorePositionLongitude()),
|
|
|
|
|
- Double.parseDouble(storeInfodto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
|
|
- }
|
|
|
|
|
- return num;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //存入经纬度
|
|
|
|
|
+ if (StringUtils.isEmpty(storeInfodto.getStorePositionLongitude()) || StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())) {
|
|
|
|
|
+ StoreInfo storeIn = storeInfoMapper.selectById(storeInfodto.getId());
|
|
|
|
|
+ storeInfo.setStorePosition(storeIn.getStorePosition());
|
|
|
} else {
|
|
} else {
|
|
|
- StoreInfo storeInfo = new StoreInfo();
|
|
|
|
|
- BeanUtils.copyProperties(storeInfodto, storeInfo);
|
|
|
|
|
- int num = storeInfoMapper.insert(storeInfo);
|
|
|
|
|
- return num;
|
|
|
|
|
|
|
+ storeInfo.setStorePosition(storeInfodto.getStorePositionLongitude() + "," + storeInfodto.getStorePositionLatitude());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //存入门店状态
|
|
|
|
|
+ storeInfo.setStoreStatus(storeInfodto.getStoreStatus());
|
|
|
|
|
+ //板块及类型
|
|
|
|
|
+ storeInfo.setBusinessSection(businessSection);
|
|
|
|
|
+ storeInfo.setBusinessSectionName(businessSectionName.getDictDetail());
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(businessTypes) && !CollectionUtils.isEmpty(businessTypeNames)) {
|
|
|
|
|
+ storeInfo.setBusinessTypes(String.join(",", businessTypes));
|
|
|
|
|
+ storeInfo.setBusinessTypesName(String.join(",", businessTypeNames));
|
|
|
}
|
|
}
|
|
|
|
|
+ //处理一下行政区域信息
|
|
|
|
|
+ EssentialCityCode essentialCityCode1 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionProvinceAdcode()));
|
|
|
|
|
+ storeInfo.setAdministrativeRegionProvinceName(essentialCityCode1.getAreaName());
|
|
|
|
|
+ EssentialCityCode essentialCityCode2 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionCityAdcode()));
|
|
|
|
|
+ storeInfo.setAdministrativeRegionCityName(essentialCityCode2.getAreaName());
|
|
|
|
|
+ EssentialCityCode essentialCityCode3 = essentialCityCodeMapper.selectOne(new LambdaQueryWrapper<EssentialCityCode>().eq(EssentialCityCode::getAreaCode, storeInfo.getAdministrativeRegionDistrictAdcode()));
|
|
|
|
|
+ storeInfo.setAdministrativeRegionDistrictName(essentialCityCode3.getAreaName());
|
|
|
|
|
+ int num = storeInfoMapper.updateById(storeInfo);
|
|
|
|
|
+ if (!StringUtils.isEmpty(storeInfodto.getStorePositionLongitude()) && !StringUtils.isEmpty(storeInfodto.getStorePositionLatitude())) {
|
|
|
|
|
+ nearMeService.inGeolocation(new Point(Double.parseDouble(storeInfodto.getStorePositionLongitude()), Double.parseDouble(storeInfodto.getStorePositionLatitude())), storeInfo.getId().toString(), Boolean.TRUE);
|
|
|
|
|
+ }
|
|
|
|
|
+ return num;
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ StoreInfo storeInfo = new StoreInfo();
|
|
|
|
|
+ BeanUtils.copyProperties(storeInfodto, storeInfo);
|
|
|
|
|
+ int num = storeInfoMapper.insert(storeInfo);
|
|
|
|
|
+ return num;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Map<String, String> storeInfoVerification(int id) {
|
|
|
|
|
|
|
+ public Map<String, String> storeInfoVerification(int id) {
|
|
|
Map<String, String> storeInfoMap = new HashMap<>();
|
|
Map<String, String> storeInfoMap = new HashMap<>();
|
|
|
LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StoreInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(StoreInfo::getId, id);
|
|
queryWrapper.eq(StoreInfo::getId, id);
|
|
@@ -1815,9 +1664,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
storeInfoMap.put("storeOrderStatus", "1");
|
|
storeInfoMap.put("storeOrderStatus", "1");
|
|
|
}
|
|
}
|
|
|
//判断店铺存在正在售卖的商品 0:未通过 1:通过
|
|
//判断店铺存在正在售卖的商品 0:未通过 1:通过
|
|
|
- List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,id).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
|
|
|
|
|
- List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
|
|
|
|
|
- .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
|
|
|
|
|
|
|
+ List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId, id).eq(LifeGroupBuyMain::getStatus, 5).eq(LifeGroupBuyMain::getDeleteFlag, 0));
|
|
|
|
|
+ List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1).and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, id).eq(LifeCoupon::getType, 1).eq(LifeCoupon::getDeleteFlag, 0));
|
|
|
if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
|
|
if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
|
|
|
storeInfoMap.put("storeGoodsStatus", "0");
|
|
storeInfoMap.put("storeGoodsStatus", "0");
|
|
|
} else {
|
|
} else {
|
|
@@ -1911,9 +1759,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
throw new RuntimeException("店铺有未完成的订单");
|
|
throw new RuntimeException("店铺有未完成的订单");
|
|
|
}
|
|
}
|
|
|
//判断店铺有正在售卖的商品
|
|
//判断店铺有正在售卖的商品
|
|
|
- List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId,storeInfo.getId()).eq(LifeGroupBuyMain::getStatus,5).eq(LifeGroupBuyMain::getDeleteFlag,0));
|
|
|
|
|
- List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1)
|
|
|
|
|
- .and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getType,1).eq(LifeCoupon::getDeleteFlag, 0));
|
|
|
|
|
|
|
+ List<LifeGroupBuyMain> lifeGroupBuyMainList = lifeGroupBuyMainMapper.selectList(new LambdaQueryWrapper<LifeGroupBuyMain>().eq(LifeGroupBuyMain::getStoreId, storeInfo.getId()).eq(LifeGroupBuyMain::getStatus, 5).eq(LifeGroupBuyMain::getDeleteFlag, 0));
|
|
|
|
|
+ List<LifeCoupon> lifeCoupons = lifeCouponMapper.selectList(new LambdaQueryWrapper<LifeCoupon>().in(LifeCoupon::getStatus, 0, 1).and(qw -> qw.gt(LifeCoupon::getStockQty, 0).or().gt(LifeCoupon::getSingleQty, 0)).eq(LifeCoupon::getStoreId, storeInfo.getId()).eq(LifeCoupon::getType, 1).eq(LifeCoupon::getDeleteFlag, 0));
|
|
|
if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
|
|
if (!CollectionUtils.isEmpty(lifeCoupons) || !CollectionUtils.isEmpty(lifeGroupBuyMainList)) {
|
|
|
throw new RuntimeException("店铺有正在销售的商品");
|
|
throw new RuntimeException("店铺有正在销售的商品");
|
|
|
}
|
|
}
|