Bläddra i källkod

Merge remote-tracking branch 'origin/ScrmStores' into ScrmStores

zhangqin 4 dagar sedan
förälder
incheckning
65fc530e69

+ 8 - 5
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -106,12 +106,15 @@ public interface FsStoreCartScrmMapper
     Integer selectFsStoreCartCountByUserId(long userId);
     @Select({"<script> " +
             "select ifnull(sum(c.cart_num),0) from fs_store_cart_scrm c  " +
-            "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 " +
-            "<if test = 'maps.userId != null     '> " +
-            "and c.user_id =#{maps.userId} " +
+            "inner join fs_store_product_scrm p on p.product_id = c.product_id " +
+            "inner join fs_store_product_attr_value_scrm v on v.id = c.product_attr_value_id " +
+            "left join fs_store_scrm s on v.store_id = s.store_id " +
+            "where c.is_pay = 0 and c.is_del = 0 and c.is_buy = 0 and p.is_show = 1 and p.is_del = 0 " +
+            "<if test='maps.userId != null'> " +
+            "and c.user_id = #{maps.userId} " +
             "</if>" +
-            "<if test = 'maps.productId != null    '> " +
-            "and c.product_id =#{maps.productId} " +
+            "<if test='maps.productId != null'> " +
+            "and c.product_id = #{maps.productId} " +
             "</if>" +
             "</script>"})
     Integer selectFsStoreCartCount(@Param("maps") FsStoreCartCountParam param);

+ 6 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -3908,6 +3908,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
         Integer totalNum = 0;
         BigDecimal integral = BigDecimal.ZERO;
+        String storeId = null;
         if (cartIds != null) {
             //获取购物车列表
             List<FsStoreCartScrmQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
@@ -3925,6 +3926,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                 if (cart.getCateId() != null && cart.getCateId().equals(176L)) {
                     meiruCount++;
                 }
+                if(StringUtils.isNotEmpty(cart.getStoreId())){
+                    storeId=cart.getStoreId();
+                }
             }
             //生成分布式唯一值
             String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
@@ -3958,8 +3962,8 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             storeOrder.setTotalPrice(dto.getTotalPrice());
             storeOrder.setTotalPostage(dto.getPayPostage());
 
-            if (param.getStoreId() != null) {
-                storeOrder.setStoreId(param.getStoreId());
+            if (storeId != null) {
+                storeOrder.setStoreId(Long.valueOf(storeId));
             }
 
             //优惠券处理