master:下单后,删除用户进货车接口;
parent
f5dd315ca4
commit
ac1dcb9e20
|
|
@ -32,8 +32,6 @@ public class QuickFunctionController extends XktBaseController {
|
|||
final IQuickFunctionService quickFuncService;
|
||||
final ISysMenuService menuService;
|
||||
|
||||
private static final String MENU_TYPE_C = "C";
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,seller,agent,store')")
|
||||
@ApiOperation(value = "档口或电商卖家选择的快捷功能", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/selected")
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public interface IShoppingCartService {
|
|||
Integer delete(ShopCartDeleteDTO deleteDTO);
|
||||
|
||||
/**
|
||||
* 根据storeProdid获取进货车详情
|
||||
* 根据storeProdId获取进货车详情
|
||||
*
|
||||
* @param listDTO 档口商品ID列表
|
||||
* @return ShoppingCartDTO
|
||||
|
|
@ -75,4 +75,14 @@ public interface IShoppingCartService {
|
|||
* @return Integer
|
||||
*/
|
||||
Integer updateDetailQuantity(ShopCartDetailQuantityUpdateDTO updateQuantityDTO);
|
||||
|
||||
/**
|
||||
* 下单后,删除用户进货车商品
|
||||
*
|
||||
* @param storeProdId 档口商品ID
|
||||
* @param userId 用户ID
|
||||
* @return Integer
|
||||
*/
|
||||
Integer removeShoppingCart(Long storeProdId, Long userId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,6 +330,35 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
|
|||
return this.shopCartDetailMapper.updateById(detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下单后,删除用户进货车商品
|
||||
*
|
||||
* @param storeProdId 档口商品ID
|
||||
* @param userId 用户ID
|
||||
* @return Integer
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer removeShoppingCart(Long storeProdId, Long userId) {
|
||||
// 用户进货车是否存在该商品
|
||||
ShoppingCart shoppingCart = this.shopCartMapper.selectOne(new LambdaQueryWrapper<ShoppingCart>()
|
||||
.eq(ShoppingCart::getStoreProdId, storeProdId).eq(ShoppingCart::getUserId, userId)
|
||||
.eq(ShoppingCart::getDelFlag, Constants.UNDELETED));
|
||||
if (ObjectUtils.isEmpty(shoppingCart)) {
|
||||
return 0;
|
||||
}
|
||||
shoppingCart.setDelFlag(DELETED);
|
||||
int count = this.shopCartMapper.updateById(shoppingCart);
|
||||
// 找到进货车明细
|
||||
List<ShoppingCartDetail> detailList = this.shopCartDetailMapper.selectList(new LambdaQueryWrapper<ShoppingCartDetail>()
|
||||
.eq(ShoppingCartDetail::getShoppingCartId, shoppingCart.getId()).eq(ShoppingCartDetail::getDelFlag, Constants.UNDELETED));
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
detailList.forEach(detail -> detail.setDelFlag(DELETED));
|
||||
this.shopCartDetailMapper.updateById(detailList);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取档口商品颜色尺码的库存
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue