|
@@ -1,7 +1,6 @@
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.chelvc.cloud.vehicle.api.dto.CartPromotionItemDTO;
|
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantCartItemDTO;
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantCartItemDTO;
|
|
import com.chelvc.cloud.vehicle.api.dto.OmsCartItemDTO;
|
|
import com.chelvc.cloud.vehicle.api.dto.OmsCartItemDTO;
|
|
import com.chelvc.cloud.vehicle.api.param.OmsCartItemModifyParam;
|
|
import com.chelvc.cloud.vehicle.api.param.OmsCartItemModifyParam;
|
|
@@ -18,7 +17,6 @@ import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -77,8 +75,7 @@ public class OmsCartItemServiceImpl extends ServiceImpl<OmsCartItemMapper, OmsCa
|
|
omsCartItem.setUserId(userId);
|
|
omsCartItem.setUserId(userId);
|
|
List<OmsCartItem> cartItemList = this.lambdaQuery()
|
|
List<OmsCartItem> cartItemList = this.lambdaQuery()
|
|
.eq(OmsCartItem::getUserId, userId).list();
|
|
.eq(OmsCartItem::getUserId, userId).list();
|
|
- List<OmsCartItemDTO> omsCartItemList = CartItemCopier.INSTANCE.copying(cartItemList);
|
|
|
|
- return omsCartItemList;
|
|
|
|
|
|
+ return CartItemCopier.INSTANCE.copying(cartItemList);
|
|
}
|
|
}
|
|
|
|
|
|
public List<OmsCartItemDTO> listCartItem(List<Long> cartIds) {
|
|
public List<OmsCartItemDTO> listCartItem(List<Long> cartIds) {
|
|
@@ -89,8 +86,7 @@ public class OmsCartItemServiceImpl extends ServiceImpl<OmsCartItemMapper, OmsCa
|
|
.eq(OmsCartItem::getUserId, userId)
|
|
.eq(OmsCartItem::getUserId, userId)
|
|
.eq(OmsCartItem::getDeleteStatus,0)
|
|
.eq(OmsCartItem::getDeleteStatus,0)
|
|
.in(OmsCartItem::getGoodsId,cartIds).list();
|
|
.in(OmsCartItem::getGoodsId,cartIds).list();
|
|
- List<OmsCartItemDTO> omsCartItemList = CartItemCopier.INSTANCE.copying(cartItemList);
|
|
|
|
- return omsCartItemList;
|
|
|
|
|
|
+ return CartItemCopier.INSTANCE.copying(cartItemList);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -98,13 +94,13 @@ public class OmsCartItemServiceImpl extends ServiceImpl<OmsCartItemMapper, OmsCa
|
|
if (CollectionUtils.isEmpty(cartIds)) {
|
|
if (CollectionUtils.isEmpty(cartIds)) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- List<OmsCartItemDTO> cartItemList = listCartItem(cartIds);
|
|
|
|
- List<CartPromotionItemDTO> cartPromotionItemList = new ArrayList<>();
|
|
|
|
- if (!CollectionUtils.isEmpty(cartItemList)) {
|
|
|
|
|
|
+ return listCartItem(cartIds);
|
|
|
|
+// List<CartPromotionItemDTO> cartPromotionItemList = new ArrayList<>();
|
|
|
|
+// if (!CollectionUtils.isEmpty(cartItemList)) {
|
|
// cartPromotionItemList.add(cartItemList);
|
|
// cartPromotionItemList.add(cartItemList);
|
|
// cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
|
|
// cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
|
|
- }
|
|
|
|
- return cartItemList;
|
|
|
|
|
|
+// }
|
|
|
|
+// return cartItemList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -122,16 +118,7 @@ public class OmsCartItemServiceImpl extends ServiceImpl<OmsCartItemMapper, OmsCa
|
|
@Override
|
|
@Override
|
|
public void delete(List<Long> ids) {
|
|
public void delete(List<Long> ids) {
|
|
Long userId = SessionContextHolder.getId();
|
|
Long userId = SessionContextHolder.getId();
|
|
- for (Long id : ids) {
|
|
|
|
- OmsCartItem cartItem = this.lambdaQuery()
|
|
|
|
- .eq(OmsCartItem::getUserId, userId).eq(
|
|
|
|
- OmsCartItem::getId, id
|
|
|
|
- ).one();
|
|
|
|
- if (cartItem != null){
|
|
|
|
- cartItem.setDeleteStatus(1);
|
|
|
|
- this.baseMapper.updateById(cartItem);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ delete(ids, userId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|