Java Code Examples for com.macro.mall.model.OmsCartItem#setQuantity()
The following examples show how to use
com.macro.mall.model.OmsCartItem#setQuantity() .
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 |
@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 |
@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 |
@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 |
@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 |
@Override public int updateQuantity(Long id, Long memberId, Integer quantity) { OmsCartItem cartItem = new OmsCartItem(); cartItem.setQuantity(quantity); OmsCartItemExample example = new OmsCartItemExample(); example.createCriteria().andDeleteStatusEqualTo(0) .andIdEqualTo(id).andMemberIdEqualTo(memberId); return cartItemMapper.updateByExampleSelective(cartItem, example); }
Example 6
Source File: OmsCartItemServiceImpl.java From macrozheng with Apache License 2.0 | 5 votes |
@Override public int updateQuantity(Long id, Long memberId, Integer quantity) { OmsCartItem cartItem = new OmsCartItem(); cartItem.setQuantity(quantity); OmsCartItemExample example = new OmsCartItemExample(); example.createCriteria().andDeleteStatusEqualTo(0) .andIdEqualTo(id).andMemberIdEqualTo(memberId); return cartItemMapper.updateByExampleSelective(cartItem, example); }
Example 7
Source File: OmsCartItemServiceImpl.java From mall with Apache License 2.0 | 5 votes |
@Override public int updateQuantity(Long id, Long memberId, Integer quantity) { OmsCartItem cartItem = new OmsCartItem(); cartItem.setQuantity(quantity); OmsCartItemExample example = new OmsCartItemExample(); example.createCriteria().andDeleteStatusEqualTo(0) .andIdEqualTo(id).andMemberIdEqualTo(memberId); return cartItemMapper.updateByExampleSelective(cartItem, example); }
Example 8
Source File: OmsCartItemServiceImpl.java From macrozheng-mall with MIT License | 5 votes |
@Override public int updateQuantity(Long id, Long memberId, Integer quantity) { OmsCartItem cartItem = new OmsCartItem(); cartItem.setQuantity(quantity); OmsCartItemExample example = new OmsCartItemExample(); example.createCriteria().andDeleteStatusEqualTo(0) .andIdEqualTo(id).andMemberIdEqualTo(memberId); return cartItemMapper.updateByExampleSelective(cartItem, example); }