|
@@ -34,10 +34,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.support.TransactionTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -140,6 +137,21 @@ public class CartServiceImpl extends ServiceImpl<CartDao, Cart> implements CartS
|
|
|
lqw.in(CartShare::getId, ids);
|
|
|
lqw.orderByDesc(CartShare::getId);
|
|
|
List<CartShare> cartList = cartShareDao.selectList(lqw);
|
|
|
+ for (CartShare cartShare : cartList) {
|
|
|
+ Date endTime = cartShare.getEndTime();
|
|
|
+ Date date = new Date();
|
|
|
+ if (date.after(endTime)){
|
|
|
+ cartShare.setIsInvalid(0);
|
|
|
+ }else {
|
|
|
+ cartShare.setIsInvalid(1);
|
|
|
+ }
|
|
|
+ cartShareDao.updateById(cartShare);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (CollUtil.isEmpty(cartList)) {
|
|
|
return CollUtil.newArrayList();
|
|
|
}
|
|
@@ -150,6 +162,13 @@ public class CartServiceImpl extends ServiceImpl<CartDao, Cart> implements CartS
|
|
|
merIdList.forEach(merId -> {
|
|
|
CartMerchantResponse merchantResponse = new CartMerchantResponse();
|
|
|
merchantResponse.setMerId(merId);
|
|
|
+ merchantResponse.setIsInvalid(1);
|
|
|
+ for (CartShare cartShare : cartList) {
|
|
|
+ if (0==cartShare.getIsInvalid()){
|
|
|
+ merchantResponse.setIsInvalid(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
merchantResponse.setMerName(merchantMap.get(merId).getName());
|
|
|
List<CartShare> merCartList = cartList.stream().filter(e -> e.getMerId().equals(merId)).collect(Collectors.toList());
|
|
|
List<CartInfoResponse> infoResponseList = merCartList.stream().map(storeCart -> {
|