|
@@ -1,7 +1,7 @@
|
|
package com.caimei.www.service.impl;
|
|
package com.caimei.www.service.impl;
|
|
|
|
|
|
import com.caimei.www.mapper.ShoppingDao;
|
|
import com.caimei.www.mapper.ShoppingDao;
|
|
-import com.caimei.www.mapper.UserDao;
|
|
|
|
|
|
+import com.caimei.www.mapper.AccountDao;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
import com.caimei.www.pojo.JsonModel;
|
|
import com.caimei.www.pojo.order.CartItem;
|
|
import com.caimei.www.pojo.order.CartItem;
|
|
import com.caimei.www.pojo.order.CartSupplier;
|
|
import com.caimei.www.pojo.order.CartSupplier;
|
|
@@ -31,13 +31,9 @@ public class ShoppingServiceImpl implements ShoppingService {
|
|
@Resource
|
|
@Resource
|
|
private ShoppingDao shoppingDao;
|
|
private ShoppingDao shoppingDao;
|
|
@Resource
|
|
@Resource
|
|
- private UserDao userDao;
|
|
|
|
|
|
+ private AccountDao accountDao;
|
|
@Resource
|
|
@Resource
|
|
private CommonServiceUtil commonServiceUtil;
|
|
private CommonServiceUtil commonServiceUtil;
|
|
- /*@Autowired
|
|
|
|
- public void setCommonServiceUtil(CommonServiceUtil commonServiceUtil) {
|
|
|
|
- this.commonServiceUtil = commonServiceUtil;
|
|
|
|
- }*/
|
|
|
|
/**
|
|
/**
|
|
* 顶部购物车数据
|
|
* 顶部购物车数据
|
|
*
|
|
*
|
|
@@ -62,7 +58,7 @@ public class ShoppingServiceImpl implements ShoppingService {
|
|
if (userId == null || userId == 0) { return JsonModel.error("参数异常", null);}
|
|
if (userId == null || userId == 0) { return JsonModel.error("参数异常", null);}
|
|
List<CartSupplier> cartSuppliers = shoppingDao.getCartSuppliers(userId);
|
|
List<CartSupplier> cartSuppliers = shoppingDao.getCartSuppliers(userId);
|
|
List<CartItem> invalidCarts = new ArrayList<>();
|
|
List<CartItem> invalidCarts = new ArrayList<>();
|
|
- Account account = userDao.getUserById(userId);
|
|
|
|
|
|
+ Account account = accountDao.getUserById(userId);
|
|
cartSuppliers.forEach(supplier -> {
|
|
cartSuppliers.forEach(supplier -> {
|
|
List<CartItem> cartItems = shoppingDao.getShoppingCartBySupplierId(supplier.getId(), userId);
|
|
List<CartItem> cartItems = shoppingDao.getShoppingCartBySupplierId(supplier.getId(), userId);
|
|
AtomicReference<Double> supplierPrice = new AtomicReference<>(0d);
|
|
AtomicReference<Double> supplierPrice = new AtomicReference<>(0d);
|