com.macro.mall.model.UmsMemberReceiveAddress Java Examples

The following examples show how to use com.macro.mall.model.UmsMemberReceiveAddress. 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: UmsMemberReceiveAddressServiceImpl.java    From mall with Apache License 2.0 6 votes vote down vote up
@Override
public int update(Long id, UmsMemberReceiveAddress address) {
    address.setId(null);
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    if(address.getDefaultStatus()==1){
        //先将原来的默认地址去除
        UmsMemberReceiveAddress record= new UmsMemberReceiveAddress();
        record.setDefaultStatus(0);
        UmsMemberReceiveAddressExample updateExample = new UmsMemberReceiveAddressExample();
        updateExample.createCriteria()
                .andMemberIdEqualTo(currentMember.getId())
                .andDefaultStatusEqualTo(1);
        addressMapper.updateByExampleSelective(record,updateExample);
    }
    return addressMapper.updateByExampleSelective(address,example);
}
 
Example #2
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public List<UmsMemberReceiveAddress> list() {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId());
    return addressMapper.selectByExample(example);
}
 
Example #3
Source File: UmsMemberReceiveAddressController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("修改收货地址")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable Long id,@RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.update(id,address);
    if(count>0){
        return new CommonResult().success(count);
    }
    return new CommonResult().failed();
}
 
Example #4
Source File: UmsMemberReceiveAddressController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("添加收货地址")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Object add(@RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.add(address);
    if(count>0){
        return new CommonResult().success(count);
    }
    return new CommonResult().failed();
}
 
Example #5
Source File: UmsMemberReceiveAddressController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list() {
    List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list();
    return new CommonResult().success(addressList);
}
 
Example #6
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMemberReceiveAddress getItem(Long id) {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
    if(!CollectionUtils.isEmpty(addressList)){
        return addressList.get(0);
    }
    return null;
}
 
Example #7
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public List<UmsMemberReceiveAddress> list() {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId());
    return addressMapper.selectByExample(example);
}
 
Example #8
Source File: UmsMemberReceiveAddressController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("添加收货地址")
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public CommonResult add(@RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.add(address);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #9
Source File: UmsMemberReceiveAddressController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改收货地址")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.update(id, address);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #10
Source File: UmsMemberReceiveAddressController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsMemberReceiveAddress>> list() {
    List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list();
    return CommonResult.success(addressList);
}
 
Example #11
Source File: UmsMemberReceiveAddressController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<UmsMemberReceiveAddress> getItem(@PathVariable Long id) {
    UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id);
    return CommonResult.success(address);
}
 
Example #12
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public UmsMemberReceiveAddress getItem(Long id) {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
    if(!CollectionUtils.isEmpty(addressList)){
        return addressList.get(0);
    }
    return null;
}
 
Example #13
Source File: UmsMemberReceiveAddressController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object getItem(@PathVariable Long id) {
    UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id);
    return new CommonResult().success(address);
}
 
Example #14
Source File: UmsMemberReceiveAddressServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMemberReceiveAddress getItem(Long id) {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
    if(!CollectionUtils.isEmpty(addressList)){
        return addressList.get(0);
    }
    return null;
}
 
Example #15
Source File: UmsMemberReceiveAddressServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int update(Long id, UmsMemberReceiveAddress address) {
    address.setId(null);
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    return addressMapper.updateByExampleSelective(address,example);
}
 
Example #16
Source File: UmsMemberReceiveAddressServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public List<UmsMemberReceiveAddress> list() {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId());
    return addressMapper.selectByExample(example);
}
 
Example #17
Source File: UmsMemberReceiveAddressServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public UmsMemberReceiveAddress getItem(Long id) {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
    if(!CollectionUtils.isEmpty(addressList)){
        return addressList.get(0);
    }
    return null;
}
 
Example #18
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int update(Long id, UmsMemberReceiveAddress address) {
    address.setId(null);
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
    return addressMapper.updateByExampleSelective(address,example);
}
 
Example #19
Source File: UmsMemberReceiveAddressController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改收货地址")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.update(id, address);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #20
Source File: UmsMemberReceiveAddressServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public List<UmsMemberReceiveAddress> list() {
    UmsMember currentMember = memberService.getCurrentMember();
    UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
    example.createCriteria().andMemberIdEqualTo(currentMember.getId());
    return addressMapper.selectByExample(example);
}
 
Example #21
Source File: UmsMemberReceiveAddressController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<UmsMemberReceiveAddress> getItem(@PathVariable Long id) {
    UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id);
    return CommonResult.success(address);
}
 
Example #22
Source File: UmsMemberReceiveAddressController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsMemberReceiveAddress>> list() {
    List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list();
    return CommonResult.success(addressList);
}
 
Example #23
Source File: UmsMemberReceiveAddressController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("修改收货地址")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsMemberReceiveAddress address) {
    int count = memberReceiveAddressService.update(id, address);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #24
Source File: UmsMemberReceiveAddressController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("显示所有收货地址")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsMemberReceiveAddress>> list() {
    List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list();
    return CommonResult.success(addressList);
}
 
Example #25
Source File: UmsMemberReceiveAddressController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("获取收货地址详情")
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public CommonResult<UmsMemberReceiveAddress> getItem(@PathVariable Long id) {
    UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id);
    return CommonResult.success(address);
}
 
Example #26
Source File: ConfirmOrderResult.java    From mall-swarm with Apache License 2.0 4 votes vote down vote up
public void setMemberReceiveAddressList(List<UmsMemberReceiveAddress> memberReceiveAddressList) {
    this.memberReceiveAddressList = memberReceiveAddressList;
}
 
Example #27
Source File: ConfirmOrderResult.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
public void setMemberReceiveAddressList(List<UmsMemberReceiveAddress> memberReceiveAddressList) {
    this.memberReceiveAddressList = memberReceiveAddressList;
}
 
Example #28
Source File: ConfirmOrderResult.java    From macrozheng-mall with MIT License 4 votes vote down vote up
public List<UmsMemberReceiveAddress> getMemberReceiveAddressList() {
    return memberReceiveAddressList;
}
 
Example #29
Source File: UmsMemberReceiveAddressServiceImpl.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
@Override
public int add(UmsMemberReceiveAddress address) {
    UmsMember currentMember = memberService.getCurrentMember();
    address.setMemberId(currentMember.getId());
    return addressMapper.insert(address);
}
 
Example #30
Source File: ConfirmOrderResult.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
public List<UmsMemberReceiveAddress> getMemberReceiveAddressList() {
    return memberReceiveAddressList;
}