| | |
| | | @ApiOperation(value = "验光师列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TOptometristVO>> pageList(@RequestBody TOptometristQuery query) { |
| | | PageInfo<TOptometristVO> optometristVOPageInfo = optometristService.pageList(query); |
| | | PageInfo<TOptometristVO> optometristVOPageInfo = optometristService.pageList1(query); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | |
| | |
| | | .eq(TOptometrist::getStoreId,storeId)); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师详情") |
| | | @GetMapping(value = "/detail") |
| | | public ApiResult<TOptometrist> detail(Integer id) { |
| | | return ApiResult.success(optometristService.getById(id)); |
| | | } |
| | | @ApiOperation(value = "验光师添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TOptometrist dto) { |
| | | TOptometrist one = optometristService.lambdaQuery().eq(TOptometrist::getPhone, dto.getPhone()) |
| | | .eq(TOptometrist::getStatus, 1).one(); |
| | | if (one!=null){ |
| | | return ApiResult.failed("当前号码已存在"); |
| | | } |
| | | optometristService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | |
| | | @ApiOperation(value = "验光师编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TOptometrist dto) { |
| | | TOptometrist one = optometristService.lambdaQuery().eq(TOptometrist::getPhone, dto.getPhone()) |
| | | .ne(TOptometrist::getId,dto.getId()) |
| | | .eq(TOptometrist::getStatus, 1).one(); |
| | | if (one!=null){ |
| | | return ApiResult.failed("当前号码已存在"); |
| | | } |
| | | optometristService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |