fix: 修改判断用户是否被禁用
parent
13e8e64726
commit
c82b495ca5
|
@ -24,4 +24,5 @@ public interface ApiConfigApi {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
CommonResult<String> getConfigKey( String key);
|
CommonResult<String> getConfigKey( String key);
|
||||||
|
String getConfigKeyValue( String key);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,4 +50,16 @@ public class ApiConfigImpl implements ApiConfigApi{
|
||||||
}
|
}
|
||||||
return success(config.getValue());
|
return success(config.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getConfigKeyValue(String key) {
|
||||||
|
ConfigDO config = configService.getConfigByKey(key);
|
||||||
|
if (config == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!config.getVisible()) {
|
||||||
|
throw exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE);
|
||||||
|
}
|
||||||
|
return config.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,10 @@ public class CreateOrderRequest implements Serializable {
|
||||||
private Integer shippingType;
|
private Integer shippingType;
|
||||||
|
|
||||||
@Schema(description = "收货地址id")
|
@Schema(description = "收货地址id")
|
||||||
private Integer addressId;
|
private Long addressId;
|
||||||
|
|
||||||
@Schema(description = "优惠券编号")
|
@Schema(description = "优惠券编号")
|
||||||
private Integer couponId;
|
private Long couponId;
|
||||||
|
|
||||||
@Schema(description = "支付类型:weixin-微信支付,yue-余额支付,alipay-支付宝支付")
|
@Schema(description = "支付类型:weixin-微信支付,yue-余额支付,alipay-支付宝支付")
|
||||||
@NotBlank(message = "支付类型不能为空")
|
@NotBlank(message = "支付类型不能为空")
|
||||||
|
|
|
@ -32,10 +32,10 @@ public class OrderComputedPriceRequest {
|
||||||
private String preOrderNo;
|
private String preOrderNo;
|
||||||
|
|
||||||
@Schema(description = "地址id")
|
@Schema(description = "地址id")
|
||||||
private Integer addressId;
|
private Long addressId;
|
||||||
|
|
||||||
@Schema(description = "优惠券id")
|
@Schema(description = "优惠券id")
|
||||||
private Integer couponId;
|
private Long couponId;
|
||||||
|
|
||||||
@Schema(description = "快递类型: 1-快递配送,2-到店自提")
|
@Schema(description = "快递类型: 1-快递配送,2-到店自提")
|
||||||
@NotNull(message = "快递类型不能为空")
|
@NotNull(message = "快递类型不能为空")
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class StoreOrder implements Serializable {
|
||||||
private BigDecimal deductionPrice;
|
private BigDecimal deductionPrice;
|
||||||
|
|
||||||
@Schema(description = "优惠券id")
|
@Schema(description = "优惠券id")
|
||||||
private Integer couponId;
|
private Long couponId;
|
||||||
|
|
||||||
@Schema(description = "优惠券金额")
|
@Schema(description = "优惠券金额")
|
||||||
private BigDecimal couponPrice;
|
private BigDecimal couponPrice;
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ public class OrderServiceImpl implements OrderService {
|
||||||
storeOrder.setStoreId(orderRequest.getStoreId());
|
storeOrder.setStoreId(orderRequest.getStoreId());
|
||||||
}
|
}
|
||||||
storeOrder.setTotalNum(orderInfoVo.getOrderProNum());
|
storeOrder.setTotalNum(orderInfoVo.getOrderProNum());
|
||||||
storeOrder.setCouponId(Optional.ofNullable(orderRequest.getCouponId()).orElse(0));
|
storeOrder.setCouponId(Optional.ofNullable(orderRequest.getCouponId()).orElse(0L));
|
||||||
|
|
||||||
// 订单总价
|
// 订单总价
|
||||||
BigDecimal totalPrice = computedOrderPriceResponse.getProTotalFee().add(computedOrderPriceResponse.getFreightFee());
|
BigDecimal totalPrice = computedOrderPriceResponse.getProTotalFee().add(computedOrderPriceResponse.getFreightFee());
|
||||||
|
|
|
@ -106,13 +106,13 @@ public class OrderUtil {
|
||||||
payType = payType.toLowerCase();
|
payType = payType.toLowerCase();
|
||||||
switch (payType){
|
switch (payType){
|
||||||
case PayConstants.PAY_TYPE_WE_CHAT:
|
case PayConstants.PAY_TYPE_WE_CHAT:
|
||||||
result = apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_PAY_WEIXIN_OPEN).equals("1");
|
result = apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_PAY_WEIXIN_OPEN).equals("1");
|
||||||
break;
|
break;
|
||||||
case PayConstants.PAY_TYPE_YUE:
|
case PayConstants.PAY_TYPE_YUE:
|
||||||
result = (apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_YUE_PAY_STATUS).equals("1"));
|
result = (apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_YUE_PAY_STATUS).equals("1"));
|
||||||
break;
|
break;
|
||||||
case PayConstants.PAY_TYPE_ALI_PAY:
|
case PayConstants.PAY_TYPE_ALI_PAY:
|
||||||
result = (apiConfigApi.getConfigKey(SysConfigConstants.CONFIG_ALI_PAY_STATUS).equals("1"));
|
result = (apiConfigApi.getConfigKeyValue(SysConfigConstants.CONFIG_ALI_PAY_STATUS).equals("1"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface AddressApi {
|
||||||
AddressRespDTO getAddress(Long id, Long userId);
|
AddressRespDTO getAddress(Long id, Long userId);
|
||||||
|
|
||||||
|
|
||||||
AddressRespDTO getById(Integer addressId);
|
AddressRespDTO getById(Long addressId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取默认地址
|
* 获取默认地址
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class AddressApiImpl implements AddressApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AddressRespDTO getById(Integer addressId) {
|
public AddressRespDTO getById(Long addressId) {
|
||||||
LambdaQueryWrapper<AddressDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AddressDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(AddressDO::getId, addressId);
|
lambdaQueryWrapper.eq(AddressDO::getId, addressId);
|
||||||
return AddressConvert.INSTANCE.convert02(addressMapper.selectOne(lambdaQueryWrapper));
|
return AddressConvert.INSTANCE.convert02(addressMapper.selectOne(lambdaQueryWrapper));
|
||||||
|
|
Loading…
Reference in New Issue