| | |
| | | package com.ruoyi.shop.service.impl.shop; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.shop.domain.dto.MyAppointmentListDto; |
| | | import com.ruoyi.shop.domain.dto.ShopAppointableTimeListDto; |
| | | import com.ruoyi.shop.domain.vo.MyAppointmentListVo; |
| | | import com.ruoyi.shop.domain.vo.ShopAppointableTimeListVo; |
| | | import com.ruoyi.shop.mapper.shop.ShopAppointableTimeMapper; |
| | | import com.ruoyi.shop.service.shop.ShopAppointableTimeService; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.domain.poji.shop.ShopAppointableTime; |
| | | import com.ruoyi.system.api.service.RemoteMemberService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class ShopAppointableTimeServiceImpl extends ServiceImpl<ShopAppointableTimeMapper, ShopAppointableTime> implements ShopAppointableTimeService { |
| | | |
| | | @Resource |
| | | private RemoteMemberService remoteMemberService; |
| | | |
| | | |
| | | /** |
| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | return this.baseMapper.pageMyAppointmentList(page, userId, dto.getStatus()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商户端获取预约列表 |
| | | * |
| | | * @param page |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ShopAppointableTimeListVo> getShopAppointableTimeList(Page<ShopAppointableTimeListVo> page, ShopAppointableTimeListDto dto) { |
| | | List<ShopAppointableTime> shopAppointableTimeList = this.baseMapper.getShopAppointableTimeList(page, dto); |
| | | List<ShopAppointableTimeListVo> list = new ArrayList<>(); |
| | | shopAppointableTimeList.forEach(shopAppointableTime -> { |
| | | ShopAppointableTimeListVo shopAppointableTimeListVo = new ShopAppointableTimeListVo(); |
| | | shopAppointableTimeListVo.setId(shopAppointableTime.getId()); |
| | | shopAppointableTimeListVo.setAppointableTime(shopAppointableTime.getAppointableTime()); |
| | | shopAppointableTimeListVo.setStatus(shopAppointableTime.getStatus()); |
| | | Member member = remoteMemberService.getMember(shopAppointableTime.getUserId()).getData(); |
| | | shopAppointableTimeListVo.setUserName(member.getRealName()); |
| | | shopAppointableTimeListVo.setMobile(member.getMobile()); |
| | | shopAppointableTimeListVo.setSex(member.getGender() == 1 ? "女" : member.getGender() == 0 ? "男" : "未知"); |
| | | list.add(shopAppointableTimeListVo); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务修改预约状态 |
| | | */ |
| | | @Override |
| | | public void taskUpdateStatus() { |
| | | this.baseMapper.taskUpdateStatus(); |
| | | } |
| | | } |