| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopRelUser; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Comparator; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | |
| | | @Resource |
| | | private ShopCertificateService shopCertificateService; |
| | |
| | | @ApiOperation(value = "门店添加不可预约时间段【2.0】") |
| | | public R addShopNonAppointableTime(@RequestBody ShopNonAppointableTimeDto dto) { |
| | | ShopNonAppointableTime shopNonAppointableTime = new ShopNonAppointableTime(); |
| | | shopNonAppointableTime.setId(IdUtils.simpleUUID()); |
| | | shopNonAppointableTime.setShopId(dto.getShopId()); |
| | | shopNonAppointableTime.setNonAppointableStartTime(dto.getNonAppointableStartTime()); |
| | | shopNonAppointableTime.setNonAppointableEndTime(dto.getNonAppointableEndTime()); |
| | |
| | | shopAppointableTimeService.updateById(shopAppointableTime); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMyShopList", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取当前账户可切换的门店列表【2.0】") |
| | | public R<List<Shop>> getMyShopList() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId); |
| | | List<Shop> collect = shopRelUser.stream().map(e -> { |
| | | Shop shop = shopService.getById(e.getShopId()); |
| | | return shop; |
| | | }).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | |
| | | } |