|
@@ -453,14 +453,14 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
.orderByAsc(StoreBusinessInfo::getBusinessType) // 先按类型排序:1-正常时间,2-特殊时间
|
|
.orderByAsc(StoreBusinessInfo::getBusinessType) // 先按类型排序:1-正常时间,2-特殊时间
|
|
|
.orderByAsc(StoreBusinessInfo::getBusinessDate) // 再按日期排序
|
|
.orderByAsc(StoreBusinessInfo::getBusinessDate) // 再按日期排序
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 转换为 VO 并关联节假日信息
|
|
// 转换为 VO 并关联节假日信息
|
|
|
List<StoreBusinessInfoVo> resultList = new ArrayList<>();
|
|
List<StoreBusinessInfoVo> resultList = new ArrayList<>();
|
|
|
for (StoreBusinessInfo businessInfo : storeBusinessInfoList) {
|
|
for (StoreBusinessInfo businessInfo : storeBusinessInfoList) {
|
|
|
StoreBusinessInfoVo vo = new StoreBusinessInfoVo();
|
|
StoreBusinessInfoVo vo = new StoreBusinessInfoVo();
|
|
|
// 复制基本信息
|
|
// 复制基本信息
|
|
|
BeanUtils.copyProperties(businessInfo, vo);
|
|
BeanUtils.copyProperties(businessInfo, vo);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果有关联的节假日ID,查询节假日信息
|
|
// 如果有关联的节假日ID,查询节假日信息
|
|
|
if (businessInfo.getEssentialId() != null && !businessInfo.getEssentialId().trim().isEmpty()) {
|
|
if (businessInfo.getEssentialId() != null && !businessInfo.getEssentialId().trim().isEmpty()) {
|
|
|
try {
|
|
try {
|
|
@@ -473,10 +473,10 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
log.warn("门店营业时间关联的节假日ID格式错误,storeId={}, essentialId={}", id, businessInfo.getEssentialId());
|
|
log.warn("门店营业时间关联的节假日ID格式错误,storeId={}, essentialId={}", id, businessInfo.getEssentialId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
resultList.add(vo);
|
|
resultList.add(vo);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return resultList;
|
|
return resultList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1295,14 +1295,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
//修改门店店铺用户绑定关系
|
|
//修改门店店铺用户绑定关系
|
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
String userAccount = storeInfoDto.getUserAccount();
|
|
|
StoreUser storeUser = storeUserMapper.selectById(userAccount);
|
|
StoreUser storeUser = storeUserMapper.selectById(userAccount);
|
|
|
-
|
|
|
|
|
- // 通过store_user_id查询支付配置并更新绑定store_id
|
|
|
|
|
- StorePaymentConfig paymentConfig = storePaymentConfigService.getByStoreUserId(storeUser.getId());
|
|
|
|
|
- if (paymentConfig != null) {
|
|
|
|
|
- paymentConfig.setStoreId(storeInfo.getId());
|
|
|
|
|
- storePaymentConfigService.updateById(paymentConfig);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
storeUser.setStoreId(storeInfo.getId());
|
|
storeUser.setStoreId(storeInfo.getId());
|
|
|
if (StringUtils.isNotEmpty(storeInfoDto.getStoreContact())) {
|
|
if (StringUtils.isNotEmpty(storeInfoDto.getStoreContact())) {
|
|
|
storeUser.setName(storeInfoDto.getStoreContact());
|
|
storeUser.setName(storeInfoDto.getStoreContact());
|
|
@@ -6105,13 +6097,13 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// // 获取店铺动态总数
|
|
// // 获取店铺动态总数
|
|
|
// result.setTotalDynamicsNum(storeDynamicslist.size());
|
|
// result.setTotalDynamicsNum(storeDynamicslist.size());
|
|
|
|
|
|
|
|
- //营业时间(通过 getStoreInfoBusinessHours 方法获取,包含节假日信息)
|
|
|
|
|
- List<StoreBusinessInfoVo> storeBusinessInfoVos = this.getStoreInfoBusinessHours(Integer.parseInt(storeId));
|
|
|
|
|
- // 设置包含节假日信息的营业时间列表
|
|
|
|
|
- result.setStoreBusinessInfoVos(storeBusinessInfoVos);
|
|
|
|
|
- // 转换为 List<StoreBusinessInfo> 用于后续判断(StoreBusinessInfoVo 继承自 StoreBusinessInfo)
|
|
|
|
|
- List<StoreBusinessInfo> storeBusinessInfos = new ArrayList<>(storeBusinessInfoVos);
|
|
|
|
|
- // 回显所有营业时间信息(特殊营业时间和正常营业时间,包含节假日信息)
|
|
|
|
|
|
|
+ //营业时间
|
|
|
|
|
+ List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(
|
|
|
|
|
+ new LambdaQueryWrapper<StoreBusinessInfo>()
|
|
|
|
|
+ .eq(StoreBusinessInfo::getStoreId, storeId)
|
|
|
|
|
+ .eq(StoreBusinessInfo::getDeleteFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ // 回显所有营业时间信息(特殊营业时间和正常营业时间)
|
|
|
if (ObjectUtils.isNotEmpty(storeBusinessInfos)) {
|
|
if (ObjectUtils.isNotEmpty(storeBusinessInfos)) {
|
|
|
result.setStoreBusinessInfo(storeBusinessInfos.get(0));
|
|
result.setStoreBusinessInfo(storeBusinessInfos.get(0));
|
|
|
result.setStoreBusinessInfos(storeBusinessInfos);
|
|
result.setStoreBusinessInfos(storeBusinessInfos);
|
|
@@ -6163,62 +6155,6 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public StoreInfoVo getStoreInfoVoWithDistanceFields(Integer storeId, String jingdu, String weidu) {
|
|
|
|
|
- if (storeId == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- StoreInfo storeInfo = storeInfoMapper.selectById(storeId);
|
|
|
|
|
- if (storeInfo == null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- StoreInfoVo result = new StoreInfoVo();
|
|
|
|
|
- BeanUtils.copyProperties(storeInfo, result);
|
|
|
|
|
- String storePosition = result.getStorePosition();
|
|
|
|
|
- if (StringUtils.isNotEmpty(storePosition) && storePosition.contains(",")) {
|
|
|
|
|
- String[] pos = storePosition.split(",");
|
|
|
|
|
- result.setStorePositionLongitude(pos[0]);
|
|
|
|
|
- result.setStorePositionLatitude(pos[1]);
|
|
|
|
|
- result.setLongitude(pos[0]);
|
|
|
|
|
- result.setLatitude(pos[1]);
|
|
|
|
|
- }
|
|
|
|
|
- // 用户经纬度存在时设置与用户距离(与 getClientStoreDetail 一致)
|
|
|
|
|
- if ((jingdu != null && !jingdu.isEmpty()) && (weidu != null && !weidu.isEmpty())) {
|
|
|
|
|
- Double distance = storeInfoMapper.getStoreDistance(jingdu + "," + weidu, result.getId());
|
|
|
|
|
- result.setDistance(distance != null ? distance : 0);
|
|
|
|
|
- }
|
|
|
|
|
- // 店铺到最近地铁站距离及地铁名(与 getClientStoreDetail 一致)
|
|
|
|
|
- if (StringUtils.isNotEmpty(storePosition) && storePosition.contains(",")) {
|
|
|
|
|
- String[] pos = storePosition.split(",");
|
|
|
|
|
- JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(pos[0], pos[1]);
|
|
|
|
|
- String subWayName = nearbySubway != null ? nearbySubway.getString("name") : null;
|
|
|
|
|
- result.setSubwayName(subWayName);
|
|
|
|
|
- String subWayJing = null;
|
|
|
|
|
- String subWayWei = null;
|
|
|
|
|
- if (nearbySubway != null && nearbySubway.getString("location") != null) {
|
|
|
|
|
- String[] loc = nearbySubway.getString("location").split(",");
|
|
|
|
|
- if (loc.length >= 2) {
|
|
|
|
|
- subWayJing = loc[0];
|
|
|
|
|
- subWayWei = loc[1];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (subWayJing != null && !subWayJing.isEmpty() && subWayWei != null && !subWayWei.isEmpty()) {
|
|
|
|
|
- double storeJing = Double.parseDouble(pos[0]);
|
|
|
|
|
- double storeWei = Double.parseDouble(pos[1]);
|
|
|
|
|
- double storeDistance2 = DistanceUtil.haversineCalculateDistance(Double.parseDouble(subWayJing), Double.parseDouble(subWayWei), storeJing, storeWei);
|
|
|
|
|
- result.setDistance2(storeDistance2);
|
|
|
|
|
- } else {
|
|
|
|
|
- result.setDistance2(0);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- result.setSubwayName(null);
|
|
|
|
|
- result.setDistance2(0);
|
|
|
|
|
- }
|
|
|
|
|
- // 门店位置/地址(与 getClientStoreDetail 及 LifeUserStoreService 一致)
|
|
|
|
|
- result.setStoreLocation(result.getStoreAddress());
|
|
|
|
|
- return result;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
public StoreBusinessStatusVo getStoreBusinessStatus(String storeId) {
|
|
public StoreBusinessStatusVo getStoreBusinessStatus(String storeId) {
|
|
|
log.info("StoreInfoServiceImpl.getStoreBusinessStatus?storeId={}", storeId);
|
|
log.info("StoreInfoServiceImpl.getStoreBusinessStatus?storeId={}", storeId);
|
|
|
StoreBusinessStatusVo result = new StoreBusinessStatusVo();
|
|
StoreBusinessStatusVo result = new StoreBusinessStatusVo();
|