Преглед изворни кода

去掉缓存和骑手额外配送费的判断条件

liu пре 8 месеци
родитељ
комит
5c894dbbe7

+ 6 - 6
src/main/java/com/sqx/modules/goods/service/impl/GoodsServiceImpl.java

@@ -518,13 +518,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsDao, Goods> implements Go
         }
 
         // 构建缓存键
-        String cacheKey = buildShopCacheKey(queryDTO, lat, lng);
+//        String cacheKey = buildShopCacheKey(queryDTO, lat, lng);
 
         // 尝试从缓存获取数据
-        PageUtils cachedResult = (PageUtils) redisUtils.get(cacheKey);
-        if (cachedResult != null) {
-            return Result.success().put("data", cachedResult);
-        }
+//        PageUtils cachedResult = (PageUtils) redisUtils.get(cacheKey);
+//        if (cachedResult != null) {
+//            return Result.success().put("data", cachedResult);
+//        }
 
         Page<GoodsShop> pages = new Page<>(queryDTO.getPage(), queryDTO.getLimit());
 
@@ -575,7 +575,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsDao, Goods> implements Go
         PageUtils pageUtils = new PageUtils(goodsShopIPage);
 
         // 存入缓存,过期时间为1分钟(60秒)
-        redisUtils.set(cacheKey, pageUtils, 60);
+//        redisUtils.set(cacheKey, pageUtils, 60);
 
         return Result.success().put("data", pageUtils);
     }

+ 12 - 12
src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java

@@ -1034,7 +1034,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         if (ObjectUtils.isNotEmpty(order.getOrderTypeExtra())&&order.getOrderTypeExtra()==2) {
             //        获取骑手额外配送费
             //        配送费大于等于1.5就不需要骑手额外配送费
-            if (order.getErrandMoney().doubleValue()<1.5) {
+//            if (order.getErrandMoney().doubleValue()<1.5) {
                 CommonInfo commonInfo = commonInfoService.findOne(443);
                 if (ObjectUtils.isNotEmpty(commonInfo)) {
                     rider =rider.add(new BigDecimal(commonInfo.getValue()));
@@ -1043,11 +1043,11 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
                 order.setShopIncomeMoney(shopMoney.setScale(2, BigDecimal.ROUND_DOWN));
                 log.info("preOrder==>[{}],订单计算店铺预计收益,商家佣金比例[{}],本单用户应付金额[{}],本单店铺预计收益[{}],骑手额外配送费[{}]",
                         order.getOrderId(), shopRate, sumMoney, order.getShopIncomeMoney(),rider);
-            }else {
-                order.setShopIncomeMoney(shopMoney.setScale(2, BigDecimal.ROUND_DOWN));
-                log.info("preOrder==>[{}],订单计算店铺预计收益,商家佣金比例[{}],本单用户应付金额[{}],本单店铺预计收益[{}]",
-                        order.getOrderId(), shopRate, sumMoney, order.getShopIncomeMoney());
-            }
+//            }else {
+//                order.setShopIncomeMoney(shopMoney.setScale(2, BigDecimal.ROUND_DOWN));
+//                log.info("preOrder==>[{}],订单计算店铺预计收益,商家佣金比例[{}],本单用户应付金额[{}],本单店铺预计收益[{}]",
+//                        order.getOrderId(), shopRate, sumMoney, order.getShopIncomeMoney());
+//            }
 
         }else {
             order.setShopIncomeMoney(shopMoney.setScale(2, BigDecimal.ROUND_DOWN));
@@ -1813,13 +1813,13 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             if (ObjectUtils.isNotEmpty(order.getOrderTypeExtra())&&order.getOrderTypeExtra()==2) {
                 //        获取骑手额外配送费
                 //        配送费大于等于1.5就不需要骑手额外配送费
-                if (order.getErrandMoney().doubleValue()<1.5) {
+//                if (order.getErrandMoney().doubleValue()<1.5) {
                     CommonInfo commonInfo = commonInfoService.findOne(443);
                     if (ObjectUtils.isNotEmpty(commonInfo)) {
                         rider =rider.add(new BigDecimal(commonInfo.getValue()));
                         shopMoney=shopMoney.subtract(rider);
                     }
-                }
+//                }
 
             }
 
@@ -2187,13 +2187,13 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         if (ObjectUtils.isNotEmpty(tbOrder.getOrderTypeExtra())&&tbOrder.getOrderTypeExtra()==2) {
             //        获取骑手额外配送费
             //        配送费大于等于1.5就不需要骑手额外配送费
-            if (tbOrder.getErrandMoney().doubleValue()<1.5) {
+//            if (tbOrder.getErrandMoney().doubleValue()<1.5) {
                 CommonInfo commonInfo = commonInfoService.findOne(443);
                 if (ObjectUtils.isNotEmpty(commonInfo)) {
                     rider = rider.add(new BigDecimal(commonInfo.getValue()));
                     shopMoney = shopMoney.subtract(rider);
                 }
-            }
+//            }
             log.info("订单id【{}】,骑手额外配送费【{}】", orderId,rider);
         }
 
@@ -2229,9 +2229,9 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         contentBuffer.append("短信服务费:").append(smsSendMoney.setScale(2, BigDecimal.ROUND_DOWN)).append(",");
         if (ObjectUtils.isNotEmpty(tbOrder.getOrderTypeExtra())&&tbOrder.getOrderTypeExtra()==2) {
             //        配送费大于等于1.5就不需要骑手额外配送费
-            if (tbOrder.getErrandMoney().doubleValue()<1.5) {
+//            if (tbOrder.getErrandMoney().doubleValue()<1.5) {
                 contentBuffer.append("骑手额外配送费:").append(rider.setScale(2, BigDecimal.ROUND_DOWN)).append(",");
-            }
+//            }
         }
         contentBuffer.append("到账金额:").append(shopMoney.setScale(2, BigDecimal.ROUND_DOWN));