Java Code Examples for com.macro.mall.model.OmsCartItem#setDeleteStatus()

The following examples show how to use com.macro.mall.model.OmsCartItem#setDeleteStatus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 6 votes vote down vote up
@Override
public int add(OmsCartItem cartItem) {
    int count;
    UmsMember currentMember =memberService.getCurrentMember();
    cartItem.setMemberId(currentMember.getId());
    cartItem.setMemberNickname(currentMember.getNickname());
    cartItem.setDeleteStatus(0);
    OmsCartItem existCartItem = getCartItem(cartItem);
    if (existCartItem == null) {
        cartItem.setCreateDate(new Date());
        count = cartItemMapper.insert(cartItem);
    } else {
        cartItem.setModifyDate(new Date());
        existCartItem.setQuantity(existCartItem.getQuantity() + cartItem.getQuantity());
        count = cartItemMapper.updateByPrimaryKey(existCartItem);
    }
    return count;
}
 
Example 2
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 6 votes vote down vote up
@Override
public int add(OmsCartItem cartItem) {
    int count;
    UmsMember currentMember =memberService.getCurrentMember();
    cartItem.setMemberId(currentMember.getId());
    cartItem.setMemberNickname(currentMember.getNickname());
    cartItem.setDeleteStatus(0);
    OmsCartItem existCartItem = getCartItem(cartItem);
    if (existCartItem == null) {
        cartItem.setCreateDate(new Date());
        count = cartItemMapper.insert(cartItem);
    } else {
        cartItem.setModifyDate(new Date());
        existCartItem.setQuantity(existCartItem.getQuantity() + cartItem.getQuantity());
        count = cartItemMapper.updateByPrimaryKey(existCartItem);
    }
    return count;
}
 
Example 3
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 6 votes vote down vote up
@Override
public int add(OmsCartItem cartItem) {
    int count;
    UmsMember currentMember =memberService.getCurrentMember();
    cartItem.setMemberId(currentMember.getId());
    cartItem.setMemberNickname(currentMember.getNickname());
    cartItem.setDeleteStatus(0);
    OmsCartItem existCartItem = getCartItem(cartItem);
    if (existCartItem == null) {
        cartItem.setCreateDate(new Date());
        count = cartItemMapper.insert(cartItem);
    } else {
        cartItem.setModifyDate(new Date());
        existCartItem.setQuantity(existCartItem.getQuantity() + cartItem.getQuantity());
        count = cartItemMapper.updateByPrimaryKey(existCartItem);
    }
    return count;
}
 
Example 4
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 6 votes vote down vote up
@Override
public int add(OmsCartItem cartItem) {
    int count;
    UmsMember currentMember =memberService.getCurrentMember();
    cartItem.setMemberId(currentMember.getId());
    cartItem.setMemberNickname(currentMember.getNickname());
    cartItem.setDeleteStatus(0);
    OmsCartItem existCartItem = getCartItem(cartItem);
    if (existCartItem == null) {
        cartItem.setCreateDate(new Date());
        count = cartItemMapper.insert(cartItem);
    } else {
        cartItem.setModifyDate(new Date());
        existCartItem.setQuantity(existCartItem.getQuantity() + cartItem.getQuantity());
        count = cartItemMapper.updateByPrimaryKey(existCartItem);
    }
    return count;
}
 
Example 5
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example 6
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int updateAttr(OmsCartItem cartItem) {
    //删除原购物车信息
    OmsCartItem updateCart = new OmsCartItem();
    updateCart.setId(cartItem.getId());
    updateCart.setModifyDate(new Date());
    updateCart.setDeleteStatus(1);
    cartItemMapper.updateByPrimaryKeySelective(updateCart);
    cartItem.setId(null);
    add(cartItem);
    return 1;
}
 
Example 7
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example 8
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example 9
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int updateAttr(OmsCartItem cartItem) {
    //删除原购物车信息
    OmsCartItem updateCart = new OmsCartItem();
    updateCart.setId(cartItem.getId());
    updateCart.setModifyDate(new Date());
    updateCart.setDeleteStatus(1);
    cartItemMapper.updateByPrimaryKeySelective(updateCart);
    cartItem.setId(null);
    add(cartItem);
    return 1;
}
 
Example 10
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example 11
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example 12
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int updateAttr(OmsCartItem cartItem) {
    //删除原购物车信息
    OmsCartItem updateCart = new OmsCartItem();
    updateCart.setId(cartItem.getId());
    updateCart.setModifyDate(new Date());
    updateCart.setDeleteStatus(1);
    cartItemMapper.updateByPrimaryKeySelective(updateCart);
    cartItem.setId(null);
    add(cartItem);
    return 1;
}
 
Example 13
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example 14
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example 15
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int updateAttr(OmsCartItem cartItem) {
    //删除原购物车信息
    OmsCartItem updateCart = new OmsCartItem();
    updateCart.setId(cartItem.getId());
    updateCart.setModifyDate(new Date());
    updateCart.setDeleteStatus(1);
    cartItemMapper.updateByPrimaryKeySelective(updateCart);
    cartItem.setId(null);
    add(cartItem);
    return 1;
}
 
Example 16
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}