|
|
@@ -736,18 +736,18 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Override
|
|
|
public FsStoreOrderComputeDTO computedOrder(long uid, FsStoreOrderComputedParam param) {
|
|
|
logger.info("computedOrder param:{},uid:{}", param,uid);
|
|
|
- String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
|
|
|
+ String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey(), String.class);
|
|
|
if (ObjectUtil.isNull(cartIds)) {
|
|
|
throw new CustomException("订单已过期", 501);
|
|
|
}
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + param.getOrderKey(), FsStoreCartQueryVO.class);
|
|
|
BigDecimal payPrice = getOrderSumPrice(carts, "truePrice");
|
|
|
if (StringUtils.isNotEmpty(param.getCreateOrderKey())) {
|
|
|
- Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey());
|
|
|
+ Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey(), Integer.class);
|
|
|
if (payType != null && payType == 3) {
|
|
|
- payPrice = redisCache.getCacheObject("createOrderAmount:" + param.getCreateOrderKey());
|
|
|
+ payPrice = redisCache.getCacheObject("createOrderAmount:" + param.getCreateOrderKey(), BigDecimal.class);
|
|
|
} else {
|
|
|
- BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey());
|
|
|
+ BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey(), BigDecimal.class);
|
|
|
if (money != null) {
|
|
|
payPrice = money;
|
|
|
}
|
|
|
@@ -859,8 +859,8 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
|
throw e;
|
|
|
}
|
|
|
- String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
|
|
|
- Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey());
|
|
|
+ String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey(), String.class);
|
|
|
+ Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey(), Integer.class);
|
|
|
if (payType != null) {
|
|
|
param.setPayType(payType.toString());
|
|
|
}
|
|
|
@@ -868,7 +868,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
BigDecimal integral = BigDecimal.ZERO;
|
|
|
if (cartIds != null) {
|
|
|
//获取购物车列表
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + param.getOrderKey(), FsStoreCartQueryVO.class);
|
|
|
//获取地址
|
|
|
FsUserAddressScrm address = userAddressMapper.selectFsUserAddressById(param.getAddressId());
|
|
|
//生成分布式唯一值
|
|
|
@@ -993,7 +993,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
//全款支付
|
|
|
storeOrder.setStatus(0);
|
|
|
if("广州郑多燕".equals(cloudHostProper.getCompanyName())){
|
|
|
- BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + param.getCreateOrderKey());
|
|
|
+ BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + param.getCreateOrderKey(), BigDecimal.class);
|
|
|
storeOrder.setPayDelivery(amount != null ? amount : BigDecimal.ZERO);
|
|
|
}
|
|
|
} else if (param.getPayType().equals("2")) {
|
|
|
@@ -1032,7 +1032,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (storeOrder.getCustomerId() == null) {
|
|
|
storeOrder.setCustomerId(param.getCustomerId());//6.13 添加客户id
|
|
|
}
|
|
|
- FsStoreOrderScrm tempOrder = redisCache.getCacheObject("orderInfo:" + param.getCreateOrderKey());
|
|
|
+ FsStoreOrderScrm tempOrder = redisCache.getCacheObject("orderInfo:" + param.getCreateOrderKey(), FsStoreOrderScrm.class);
|
|
|
if (tempOrder != null) {
|
|
|
storeOrder.setOrderType(tempOrder.getOrderType());
|
|
|
storeOrder.setOrderMedium(tempOrder.getOrderMedium());
|
|
|
@@ -1130,7 +1130,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
//删除推荐订单KEY
|
|
|
String createOrderKey = param.getCreateOrderKey();
|
|
|
if("鸿森堂".equals(cloudHostProper.getCompanyName())){
|
|
|
- BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + createOrderKey);
|
|
|
+ BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + createOrderKey, BigDecimal.class);
|
|
|
redisCache.setCacheObject("orderAmount:" + storeOrder.getId(), amount, 24, TimeUnit.HOURS);//物流代收自定义金额
|
|
|
}else {
|
|
|
if (StringUtils.isNotEmpty(createOrderKey)) {
|
|
|
@@ -1141,7 +1141,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
|
|
|
|
//货到付款自定义金额 key改为id存储
|
|
|
- BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + createOrderKey);
|
|
|
+ BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + createOrderKey, BigDecimal.class);
|
|
|
redisCache.deleteObject("createOrderAmount:" + createOrderKey);
|
|
|
}
|
|
|
}
|
|
|
@@ -1622,7 +1622,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
} else {
|
|
|
// 套餐制单
|
|
|
uuid = param.getCreateOrderKey();
|
|
|
- totalMoney = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey());
|
|
|
+ totalMoney = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey(), BigDecimal.class);
|
|
|
}
|
|
|
|
|
|
if (param.getCouponUserId() != null) {
|
|
|
@@ -1642,7 +1642,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Transactional
|
|
|
public R createPackageOrder(long uid, FsStorePackageOrderCreateParam param) {
|
|
|
//计算金额
|
|
|
- String packageId = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
|
|
|
+ String packageId = redisCache.getCacheObject("orderKey:" + param.getOrderKey(), String.class);
|
|
|
if (packageId != null) {
|
|
|
FsStoreProductPackageScrm storeProductPackage = productPackageService.selectFsStoreProductPackageById(param.getPackageId());
|
|
|
if (storeProductPackage.getStatus().equals(0)) {
|
|
|
@@ -1675,7 +1675,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
List<StorePackageProductDTO> goodsList = JSONUtil.toList(jsonArray, StorePackageProductDTO.class);
|
|
|
//检测库存
|
|
|
Integer totalNum = 0;
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + param.getOrderKey(), FsStoreCartQueryVO.class);
|
|
|
String joinCartIds = null;
|
|
|
if(carts == null || carts.isEmpty()){
|
|
|
carts = new ArrayList<>();
|
|
|
@@ -1725,7 +1725,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
|
BigDecimal totalMoney;
|
|
|
if(param.getIsPackage() != null && param.getIsPackage() == 1){
|
|
|
- totalMoney = redisCache.getCacheObject("createOrderMoney:" + param.getOrderKey());
|
|
|
+ totalMoney = redisCache.getCacheObject("createOrderMoney:" + param.getOrderKey(), BigDecimal.class);
|
|
|
} else {
|
|
|
totalMoney = storeProductPackage.getPayMoney();
|
|
|
}
|
|
|
@@ -1773,7 +1773,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
storeOrder.setPayType(storeProductPackage.getPayType().toString());
|
|
|
storeOrder.setPayPrice(totalMoney);
|
|
|
if("广州郑多燕".equals(cloudHostProper.getCompanyName())){
|
|
|
- BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + param.getOrderKey());
|
|
|
+ BigDecimal amount = redisCache.getCacheObject("createOrderAmount:" + param.getOrderKey(), BigDecimal.class);
|
|
|
storeOrder.setPayDelivery(amount != null ? amount : BigDecimal.ZERO);
|
|
|
}
|
|
|
storeOrder.setIsPackage(1);
|
|
|
@@ -2722,13 +2722,13 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
|
|
|
@Override
|
|
|
public R getSalesOrder(String createOrderKey) {
|
|
|
- String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey);
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
|
|
|
- BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + createOrderKey);
|
|
|
- Integer payType = redisCache.getCacheObject("createOrderPayType:" + createOrderKey);
|
|
|
+ String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey, String.class);
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + createOrderKey, FsStoreCartQueryVO.class);
|
|
|
+ BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + createOrderKey, BigDecimal.class);
|
|
|
+ Integer payType = redisCache.getCacheObject("createOrderPayType:" + createOrderKey, Integer.class);
|
|
|
//展示代收金额
|
|
|
if (payType != null && payType == 3) {
|
|
|
- money = redisCache.getCacheObject("createOrderAmount:" + createOrderKey);
|
|
|
+ money = redisCache.getCacheObject("createOrderAmount:" + createOrderKey, BigDecimal.class);
|
|
|
}
|
|
|
if (StringUtils.isEmpty(key)) {
|
|
|
throw new CustomException("订单已过期", 501);
|
|
|
@@ -2739,8 +2739,8 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public R addUserCart(long userId, String createOrderKey) {
|
|
|
- String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey);
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
|
|
|
+ String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey, String.class);
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + createOrderKey, FsStoreCartQueryVO.class);
|
|
|
if (StringUtils.isEmpty(key)) {
|
|
|
throw new CustomException("订单已过期", 501);
|
|
|
}
|
|
|
@@ -2787,11 +2787,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
// if(money.compareTo(BigDecimal.ZERO)<=0){
|
|
|
// return R.error("价格应大于0");
|
|
|
// }
|
|
|
- String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey);
|
|
|
+ String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey, String.class);
|
|
|
if (StringUtils.isEmpty(key)) {
|
|
|
throw new CustomException("订单已过期", 501);
|
|
|
}
|
|
|
- List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
|
|
|
+ List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + createOrderKey, FsStoreCartQueryVO.class);
|
|
|
BigDecimal totalMoney = BigDecimal.ZERO;
|
|
|
if(isPackage == 0){
|
|
|
for (FsStoreCartQueryVO vo : carts) {
|
|
|
@@ -2799,7 +2799,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
|
} else {
|
|
|
//套餐制单,这个金额是套餐的金额
|
|
|
- totalMoney = redisCache.getCacheObject("createOrderMoney:" + createOrderKey);
|
|
|
+ totalMoney = redisCache.getCacheObject("createOrderMoney:" + createOrderKey, BigDecimal.class);
|
|
|
}
|
|
|
if (money.compareTo(totalMoney) == 1) {
|
|
|
throw new CustomException("价格不能大于商品总价", 501);
|
|
|
@@ -3514,11 +3514,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
|
|
|
|
String createOrderKey = param.getCreateOrderKey();
|
|
|
- String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey);
|
|
|
+ String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey, String.class);
|
|
|
if (StringUtils.isEmpty(key)) {
|
|
|
throw new CustomException("订单已过期", 501);
|
|
|
}
|
|
|
-// List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
|
|
|
+// List<FsStoreCartQueryVO> carts = redisCache.getCacheObjectList("orderCarts:" + createOrderKey, FsStoreCartQueryVO.class);
|
|
|
List<FsStoreCartQueryVO> carts = param.getCarts();
|
|
|
if (carts.isEmpty()) {
|
|
|
return R.error("购物车不能为空");
|
|
|
@@ -4225,7 +4225,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if(order.getStatus()!= OrderInfoEnum.STATUS_0.getValue()){
|
|
|
return R.error("订单状态不正确");
|
|
|
}
|
|
|
- String orderId=redisCache.getCacheObject("isPaying:"+param.getOrderId());
|
|
|
+ String orderId=redisCache.getCacheObject("isPaying:"+param.getOrderId(), String.class);
|
|
|
if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
|
|
|
return R.error("正在支付中...");
|
|
|
}
|
|
|
@@ -4261,7 +4261,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
else if(param.getPayType().equals(3)){
|
|
|
//货到付款
|
|
|
order.setPayType("3");
|
|
|
- BigDecimal amount=redisCache.getCacheObject("orderAmount:"+order.getId());
|
|
|
+ BigDecimal amount=redisCache.getCacheObject("orderAmount:"+order.getId(), BigDecimal.class);
|
|
|
BigDecimal payMoney = BigDecimal.ZERO;
|
|
|
if (amount != null){
|
|
|
payMoney=amount;
|
|
|
@@ -4558,7 +4558,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
return R.error("此订单没有可支付的金额");
|
|
|
}
|
|
|
|
|
|
- String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
|
|
|
+ String orderId=redisCache.getCacheObject("isPaying:"+order.getId(), String.class);
|
|
|
if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
|
|
|
return R.error("正在支付中...");
|
|
|
}
|
|
|
@@ -4775,7 +4775,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if(!Objects.equals(order.getStatus(), OrderInfoEnum.STATUS_0.getValue())){
|
|
|
return R.error("订单状态不正确");
|
|
|
}
|
|
|
- String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
|
|
|
+ String orderId=redisCache.getCacheObject("isPaying:"+order.getId(), String.class);
|
|
|
if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
|
|
|
return R.error("正在支付中...");
|
|
|
}
|
|
|
@@ -4820,7 +4820,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
else if(param.getPayType().equals(3)){
|
|
|
//货到付款
|
|
|
order.setPayType("3");
|
|
|
- BigDecimal amount=redisCache.getCacheObject("orderAmount:"+order.getId());
|
|
|
+ BigDecimal amount=redisCache.getCacheObject("orderAmount:"+order.getId(), BigDecimal.class);
|
|
|
BigDecimal payMoney = BigDecimal.ZERO;
|
|
|
if (amount != null){
|
|
|
payMoney=amount;
|