店铺营业状态增加 开业活动筹备中 字段
This commit is contained in:
parent
85294f332a
commit
fa80c2fca3
@ -127,4 +127,13 @@ public class CommonConstant {
|
|||||||
|
|
||||||
// 预约下单从当前时间延迟的最小分钟数(单位分钟),不能低于35分钟
|
// 预约下单从当前时间延迟的最小分钟数(单位分钟),不能低于35分钟
|
||||||
public final static Integer MIN_DELAY_MINUTES_FOR_BOOKING_ORDER = 50;
|
public final static Integer MIN_DELAY_MINUTES_FOR_BOOKING_ORDER = 50;
|
||||||
|
|
||||||
|
|
||||||
|
// 店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
|
//1-营业中;
|
||||||
|
public final static Integer Store_Biz_State_Opening = 1;
|
||||||
|
//2-已打烊;
|
||||||
|
public final static Integer Store_Biz_State_Closed = 2;
|
||||||
|
//3-开业(活动)筹备中;
|
||||||
|
public final static Integer Store_Biz_State_PreActivity = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,7 @@ public class ShopStoreBase implements Serializable {
|
|||||||
@ApiModelProperty(value = "店铃声开关:1-开启;2-关闭;")
|
@ApiModelProperty(value = "店铃声开关:1-开启;2-关闭;")
|
||||||
private Integer ringtone_is_enable;
|
private Integer ringtone_is_enable;
|
||||||
|
|
||||||
@ApiModelProperty(value = "店铺营业状态:1-营业中;2-已打烊;")
|
@ApiModelProperty(value = "店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;")
|
||||||
private Integer store_biz_state;
|
private Integer store_biz_state;
|
||||||
|
|
||||||
@ApiModelProperty(value = "上级店铺编号:创建店铺决定,所属分销商-不可更改! 佣金公平性考虑")
|
@ApiModelProperty(value = "上级店铺编号:创建店铺决定,所属分销商-不可更改! 佣金公平性考虑")
|
||||||
|
|||||||
@ -487,7 +487,7 @@ public class ShopProductItemServiceImpl extends BaseServiceImpl<ShopProductItemM
|
|||||||
data.put("product_analytics", analytics_row);
|
data.put("product_analytics", analytics_row);
|
||||||
|
|
||||||
// 营业时间段,直接影响到 营业状态字段
|
// 营业时间段,直接影响到 营业状态字段
|
||||||
// store_biz_state 店铺营业状态:1-营业中;2-已打烊;
|
// store_biz_state 店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
baseMap.put("store_biz_state", shopStoreBaseService.getStoreBizState(shopStoreBase, shopStoreInfo));
|
baseMap.put("store_biz_state", shopStoreBaseService.getStoreBizState(shopStoreBase, shopStoreInfo));
|
||||||
|
|
||||||
data.put("store_info", baseMap);
|
data.put("store_info", baseMap);
|
||||||
|
|||||||
@ -253,8 +253,8 @@ public class StoreController extends BaseControllerImpl {
|
|||||||
@ApiOperation(value = "获取附近店铺列表", notes = "获取附近店铺列表")
|
@ApiOperation(value = "获取附近店铺列表", notes = "获取附近店铺列表")
|
||||||
@RequestMapping(value = "/near/list", method = RequestMethod.GET)
|
@RequestMapping(value = "/near/list", method = RequestMethod.GET)
|
||||||
public CommonResult nearStoreList(@RequestParam(value = "provinceId", required = false) String provinceId,
|
public CommonResult nearStoreList(@RequestParam(value = "provinceId", required = false) String provinceId,
|
||||||
@RequestParam("cityId") String cityId,
|
@RequestParam(value = "cityId", required = false) String cityId,
|
||||||
@RequestParam("countyId") String countyId,
|
@RequestParam(value = "countyId", required = false) String countyId,
|
||||||
@RequestParam("userLng") String userLng,
|
@RequestParam("userLng") String userLng,
|
||||||
@RequestParam("userLat") String userLat,
|
@RequestParam("userLat") String userLat,
|
||||||
@RequestParam(value = "storeCategoryId", required = false) Integer storeCategoryId,
|
@RequestParam(value = "storeCategoryId", required = false) Integer storeCategoryId,
|
||||||
|
|||||||
@ -204,7 +204,7 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
|||||||
* 修改店铺的营业状态
|
* 修改店铺的营业状态
|
||||||
*
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param bizState 营业状态 1-营业;2-打烊
|
* @param bizState 店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean updateStoreBizState(Integer storeId, Integer bizState);
|
Boolean updateStoreBizState(Integer storeId, Integer bizState);
|
||||||
@ -233,7 +233,7 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
|||||||
*
|
*
|
||||||
* @param shopStoreBase 店铺基础信息
|
* @param shopStoreBase 店铺基础信息
|
||||||
* @param shopStoreInfo 店铺详细信息
|
* @param shopStoreInfo 店铺详细信息
|
||||||
* @return 店铺营业状态:1-营业中;2-已打烊;
|
* @return 店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
*/
|
*/
|
||||||
Integer getStoreBizState(ShopStoreBase shopStoreBase, ShopStoreInfo shopStoreInfo);
|
Integer getStoreBizState(ShopStoreBase shopStoreBase, ShopStoreInfo shopStoreInfo);
|
||||||
|
|
||||||
|
|||||||
@ -4199,13 +4199,13 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
*
|
*
|
||||||
* @param shopStoreBase 店铺基础信息
|
* @param shopStoreBase 店铺基础信息
|
||||||
* @param shopStoreInfo 店铺详细信息
|
* @param shopStoreInfo 店铺详细信息
|
||||||
* @return 店铺营业状态:1-营业中;2-已打烊;
|
* @return 店铺营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Integer getStoreBizState(ShopStoreBase shopStoreBase, ShopStoreInfo shopStoreInfo) {
|
public Integer getStoreBizState(ShopStoreBase shopStoreBase, ShopStoreInfo shopStoreInfo) {
|
||||||
// 参数校验
|
// 参数校验
|
||||||
if (shopStoreBase == null || shopStoreInfo == null) {
|
if (shopStoreBase == null || shopStoreInfo == null) {
|
||||||
log.warn("店铺基础信息或详细信息为空,无法确定营业状态");
|
log.warn("店铺信息为空,未知营业状态");
|
||||||
return CommonConstant.Disable2;
|
return CommonConstant.Disable2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4239,21 +4239,21 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
* 根据店铺ID获取营业状态
|
* 根据店铺ID获取营业状态
|
||||||
*
|
*
|
||||||
* @param storeId 店铺ID
|
* @param storeId 店铺ID
|
||||||
* @return 营业状态:1-营业中;2-已打烊;
|
* @return 营业状态:1-营业中;2-已打烊;3-开业(活动)筹备中;
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Pair<Integer, String> getStoreBizState(Integer storeId) {
|
public Pair<Integer, String> getStoreBizState(Integer storeId) {
|
||||||
// 参数校验
|
// 参数校验
|
||||||
if (CheckUtil.isEmpty(storeId)) {
|
if (CheckUtil.isEmpty(storeId)) {
|
||||||
log.warn("店铺ID为空,无法确定营业状态");
|
log.warn("店铺ID为空,无法确定营业状态");
|
||||||
return Pair.of(CommonConstant.Disable2, "店铺营业状态有误");
|
return Pair.of(CommonConstant.Store_Biz_State_Closed, "店铺营业状态有误");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
StoreBizTimeInfoDTO storeBizTimeInfo = baseMapper.getStoreBizTimeInfo(storeId);
|
StoreBizTimeInfoDTO storeBizTimeInfo = baseMapper.getStoreBizTimeInfo(storeId);
|
||||||
if (storeBizTimeInfo == null) {
|
if (storeBizTimeInfo == null) {
|
||||||
log.warn("未找到店铺营业时间信息,storeId: {}", storeId);
|
log.warn("未找到店铺营业时间信息,storeId: {}", storeId);
|
||||||
return Pair.of(CommonConstant.Disable2, "店铺营业状态有误");
|
return Pair.of(CommonConstant.Store_Biz_State_Closed, "店铺营业状态有误");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer storeBizState = storeBizTimeInfo.getStore_biz_state();
|
Integer storeBizState = storeBizTimeInfo.getStore_biz_state();
|
||||||
@ -4261,7 +4261,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
String closingHours = storeBizTimeInfo.getStore_close_hours();
|
String closingHours = storeBizTimeInfo.getStore_close_hours();
|
||||||
|
|
||||||
// 检查店铺是否营业中且营业时间已设置
|
// 检查店铺是否营业中且营业时间已设置
|
||||||
if (CommonConstant.Enable.equals(storeBizState)
|
if (CommonConstant.Store_Biz_State_Opening.equals(storeBizState)
|
||||||
&& StrUtil.isNotBlank(openingHours)
|
&& StrUtil.isNotBlank(openingHours)
|
||||||
&& StrUtil.isNotBlank(closingHours)) {
|
&& StrUtil.isNotBlank(closingHours)) {
|
||||||
// 检查当前时间是否在营业时间内
|
// 检查当前时间是否在营业时间内
|
||||||
@ -4269,25 +4269,27 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
// 不在营业时间内,返回已打烊状态
|
// 不在营业时间内,返回已打烊状态
|
||||||
log.debug("店铺当前不在营业时间内,storeId: {}, openingHours: {}, closingHours: {}",
|
log.debug("店铺当前不在营业时间内,storeId: {}, openingHours: {}, closingHours: {}",
|
||||||
storeId, openingHours, closingHours);
|
storeId, openingHours, closingHours);
|
||||||
return Pair.of(CommonConstant.Disable2, String.format("%s营业时间段%s-%s", storeBizTimeInfo.getStore_name(),
|
return Pair.of(CommonConstant.Store_Biz_State_Closed, String.format("%s营业时间%s-%s", storeBizTimeInfo.getStore_name(),
|
||||||
openingHours, closingHours));
|
openingHours, closingHours));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Pair.of(CommonConstant.Enable, "");
|
return Pair.of(CommonConstant.Store_Biz_State_Opening, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回原始营业状态(处理null情况)
|
// 返回原始营业状态(处理null情况)
|
||||||
Integer resultState = storeBizState != null ? storeBizState : CommonConstant.Disable2;
|
Integer resultState = storeBizState != null ? storeBizState : CommonConstant.Store_Biz_State_Closed;
|
||||||
log.debug("返回店铺营业状态,storeId: {}, state: {}", storeId, resultState);
|
log.debug("返回店铺营业状态,storeId: {}, state: {}", storeId, resultState);
|
||||||
if (resultState == CommonConstant.Disable2) {
|
if (resultState == CommonConstant.Store_Biz_State_Closed) {
|
||||||
return Pair.of(resultState, String.format("%s打烊中", storeBizTimeInfo.getStore_name()));
|
return Pair.of(resultState, String.format("%s打烊中", storeBizTimeInfo.getStore_name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 返回原始营业状态
|
||||||
return Pair.of(resultState, "");
|
return Pair.of(resultState, "");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 处理异常,避免影响主流程
|
// 处理异常,避免影响主流程
|
||||||
log.error("检查店铺营业状态发生异常,storeId: {}", storeId, e);
|
log.error("检查店铺营业状态发生异常,storeId: {}", storeId, e);
|
||||||
return Pair.of(CommonConstant.Disable2, "无法获取店铺营业状态");
|
return Pair.of(CommonConstant.Store_Biz_State_Closed, "无法获取店铺营业状态");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,6 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.data.util.Pair;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -1052,11 +1051,12 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl<ShopUserCartMapper,
|
|||||||
|
|
||||||
// 店铺Id
|
// 店铺Id
|
||||||
Integer storeId = Convert.toInt(product_row.get("store_id"));
|
Integer storeId = Convert.toInt(product_row.get("store_id"));
|
||||||
// 判断店铺是否打烊?打烊不能放入购物车
|
|
||||||
Pair<Integer, String> storeBizState = shopStoreBaseService.getStoreBizState(storeId);
|
// 判断店铺是否打烊?打烊不能放入购物车 RMK 已移至统一放到下单支付的时候校验
|
||||||
if (storeBizState != null && CommonConstant.Disable2.equals(storeBizState.getFirst())) {
|
// Pair<Integer, String> storeBizState = shopStoreBaseService.getStoreBizState(storeId);
|
||||||
throw new ApiException(I18nUtil._(storeBizState.getSecond() + ",无法加购商品。"));
|
// if (storeBizState != null && CommonConstant.Disable2.equals(storeBizState.getFirst())) {
|
||||||
}
|
// throw new ApiException(I18nUtil._(storeBizState.getSecond() + ",无法加购商品。"));
|
||||||
|
// }
|
||||||
|
|
||||||
Integer cart_type = Convert.toInt(data.get("cart_type"));
|
Integer cart_type = Convert.toInt(data.get("cart_type"));
|
||||||
// 判断是新增还是更新
|
// 判断是新增还是更新
|
||||||
|
|||||||
@ -20809,7 +20809,7 @@
|
|||||||
c();
|
c();
|
||||||
}, s, o, r));
|
}, s, o, r));
|
||||||
}) : 17 == i[_x41903[4420]] && $[_x41903[39]](i[_x41903[4617]][_x41903[473]], function(e, t) {
|
}) : 17 == i[_x41903[4420]] && $[_x41903[39]](i[_x41903[4617]][_x41903[473]], function(e, t) {
|
||||||
t[_x41903[124]] == a && (s = r = o = 100, publicFun[_x41903[4586]]($(n[_x41903[476]])[_x41903[217]](_x41903[124]), function(e) {
|
t[_x41903[124]] == a && (s = r = o = 10240, publicFun[_x41903[4586]]($(n[_x41903[476]])[_x41903[217]](_x41903[124]), function(e) {
|
||||||
250 == e[_x41903[686]] && $[_x41903[2030]][_x41903[4089]](e[_x41903[4587]] || __(_x41903[4618])),
|
250 == e[_x41903[686]] && $[_x41903[2030]][_x41903[4089]](e[_x41903[4587]] || __(_x41903[4618])),
|
||||||
t[_x41903[2345]] = e[_x41903[473]][_x41903[688]],
|
t[_x41903[2345]] = e[_x41903[473]][_x41903[688]],
|
||||||
c();
|
c();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user