|
@@ -70,6 +70,13 @@ public class OrderController {
|
|
|
private IHBOrderService hbOrderService;
|
|
private IHBOrderService hbOrderService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ShopSkuMapper shopSkuMapper;
|
|
private ShopSkuMapper shopSkuMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 弹窗开关配置key
|
|
|
|
|
+ */
|
|
|
|
|
+ private static final String POPUP_SWITCH = "POPUP_SWITCH";
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 生成订单
|
|
* 生成订单
|
|
@@ -77,6 +84,12 @@ public class OrderController {
|
|
|
@PostMapping("/confirm")
|
|
@PostMapping("/confirm")
|
|
|
@ApiOperation(value = "结算,生成订单信息", notes = "传入下单所需要的参数进行下单")
|
|
@ApiOperation(value = "结算,生成订单信息", notes = "传入下单所需要的参数进行下单")
|
|
|
public ResponseEntity<ShopCartOrderMergerDto> confirm(@Valid @RequestBody OrderParam orderParam) {
|
|
public ResponseEntity<ShopCartOrderMergerDto> confirm(@Valid @RequestBody OrderParam orderParam) {
|
|
|
|
|
+ // 检查弹窗开关,如果开启则暂停下单
|
|
|
|
|
+ String popupSwitch = sysConfigService.getValue(POPUP_SWITCH);
|
|
|
|
|
+ if ("true".equalsIgnoreCase(popupSwitch)) {
|
|
|
|
|
+ throw new GlobalException("春节期间暂停下单,感谢您的理解!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (orderParam.getShopId() == null) {
|
|
if (orderParam.getShopId() == null) {
|
|
|
// orderParam.setShopId(1L);
|
|
// orderParam.setShopId(1L);
|
|
|
throw new GlobalException("请选择店铺!");
|
|
throw new GlobalException("请选择店铺!");
|