| | |
| | | |
| | | @RequestMapping(value = "/getByPage", method = RequestMethod.GET) |
| | | @ApiOperation(value = "分页获取") |
| | | public Result<IPage<CustomerReceive>> getByPage(PageVo page) { |
| | | |
| | | IPage<CustomerReceive> data = iCustomerReceiveService.page(PageUtil.initMpPage(page)); |
| | | public Result<IPage<CustomerReceive>> getByPage(String name,PageVo page) { |
| | | QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>(); |
| | | if (!StrUtil.isEmpty(name)) |
| | | wrapper.like("b.name","%"+name+"%"); |
| | | IPage<CustomerReceive> data = iCustomerReceiveService.page2(PageUtil.initMpPage(page),wrapper); |
| | | return new ResultUtil<IPage<CustomerReceive>>().setData(data); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "编辑或更新数据") |
| | | public Result<CustomerReceive> saveOrUpdate(CustomerReceive customerReceive) { |
| | | |
| | | if(StrUtil.isEmpty(customerReceive.getCustomerId())){ |
| | | return ResultUtil.error("商户id为空,请重新登陆或联系管理员"); |
| | | } |
| | | if (iCustomerReceiveService.saveOrUpdate(customerReceive)) { |
| | | return new ResultUtil<CustomerReceive>().setData(customerReceive); |
| | | } |
| | | return new ResultUtil<CustomerReceive>().setErrorMsg("操作失败"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| | | @ApiOperation(value = "修改头像") |
| | | public Result<CustomerReceive> update(String id,String imgUrl) { |
| | | CustomerReceive customerReceive = iCustomerReceiveService.getById(id); |
| | | customerReceive.setImg(imgUrl); |
| | | if (iCustomerReceiveService.saveOrUpdate(customerReceive)) { |
| | | return new ResultUtil<CustomerReceive>().setData(customerReceive); |
| | | } |