| | |
| | | @RequestMapping(value = "/cancelReservation", method = RequestMethod.POST) |
| | | @ApiOperation(value = "商户取消预约【2.0】") |
| | | public R cancelReservation(@RequestBody CancelReservationDto dto) { |
| | | TShopAppointableTime shopAppointableTime = shopAppointableTimeService.getById(dto.getId()); |
| | | TShopAppointableTime shopAppointableTime = shopAppointableTimeService.getById(dto.getAppointmentId()); |
| | | if (null == shopAppointableTime) { |
| | | return R.fail("预约不存在"); |
| | | } |
| | |
| | | return R.fail("不能重复操作"); |
| | | } |
| | | shopAppointableTime.setStatus(0); |
| | | shopAppointableTime.setReason(dto.getReason()); |
| | | shopAppointableTime.setReason(dto.getCancelReason()); |
| | | shopAppointableTimeService.updateById(shopAppointableTime); |
| | | return R.ok(); |
| | | } |
| | |
| | | List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId); |
| | | List<Shop> collect = shopRelUser.stream().map(e -> { |
| | | Shop shop = shopService.getById(e.getShopId()); |
| | | if (e.getIsDefault()==1){ |
| | | shop.setIsDefault(true); |
| | | } |
| | | return shop; |
| | | }).collect(Collectors.toList()); |
| | | return R.ok(collect); |