|
@@ -4,13 +4,16 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.leromro.common.core.domain.R;
|
|
|
+import com.leromro.core.domain.VolunteerInfo;
|
|
|
import com.leromro.core.domain.VolunteerReservationTime;
|
|
|
import com.leromro.core.domain.VolunteerWorkDate;
|
|
|
import com.leromro.core.domain.dto.AddReservationTimesDTO;
|
|
|
import com.leromro.core.domain.vo.VolunteerReservationTimeVO;
|
|
|
+import com.leromro.core.service.IVolunteerInfoService;
|
|
|
import com.leromro.core.service.IVolunteerReservationTimeService;
|
|
|
import com.leromro.core.service.IVolunteerWorkDateService;
|
|
|
import com.leromro.core.utils.DateTimeUtil;
|
|
|
+import com.leromro.system.service.impl.SysConfigServiceImpl;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -31,6 +34,10 @@ public class VolunteerWorkDateFacade {
|
|
|
|
|
|
private final IVolunteerReservationTimeService reservationTimeService;
|
|
|
|
|
|
+ private final IVolunteerInfoService volunteerInfoService;
|
|
|
+
|
|
|
+ private final SysConfigServiceImpl sysConfigService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 根据日期获取志愿者工作时间
|
|
@@ -38,6 +45,12 @@ public class VolunteerWorkDateFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public R<List<VolunteerReservationTimeVO>> getTimesByDate(Long volunteerId, LocalDate date) {
|
|
|
+ String isExample = volunteerInfoService.list(new LambdaQueryWrapper<VolunteerInfo>().eq(VolunteerInfo::getVolunteerId, volunteerId).select(VolunteerInfo::getIsExample)).get(0).getIsExample();
|
|
|
+ if (("1").equals(isExample)){
|
|
|
+ //如果是测试数据,我们直接排满
|
|
|
+ volunteerId = Long.valueOf(sysConfigService.selectConfigByKey("exampleWorkTimeVolunteerId"));
|
|
|
+ }
|
|
|
+
|
|
|
//判断志愿者当前日期是否排班
|
|
|
VolunteerWorkDate dateInfo = workDateService.getOne(new LambdaQueryWrapper<VolunteerWorkDate>()
|
|
|
.eq(VolunteerWorkDate::getVolunteerId, volunteerId)
|