package org.jeecg.modules.lims.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import org.apache.commons.lang3.StringUtils;
|
import org.jeecg.common.util.DateUtils;
|
import org.jeecg.modules.lims.entity.LimsAppointment;
|
import org.jeecg.modules.lims.mapper.LimsAppointmentMapper;
|
import org.jeecg.modules.lims.service.ILimsAppointmentService;
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import java.util.*;
|
import java.util.stream.Collectors;
|
|
/**
|
* @Description: 预约
|
* @Author: jeecg-boot
|
* @Date: 2022-11-07
|
* @Version: V1.0
|
*/
|
@Service
|
public class LimsAppointmentServiceImpl extends ServiceImpl<LimsAppointmentMapper, LimsAppointment> implements ILimsAppointmentService {
|
|
@Override
|
public Map<String, LimsAppointment> listInsAppByDate(String id, Date date) {
|
Map<String, LimsAppointment> map = new HashMap<>();
|
// 获取第二天预约信息
|
LambdaQueryWrapper<LimsAppointment> qw = new LambdaQueryWrapper<>();
|
qw.ge(LimsAppointment::getStime, DateUtils.getDayStartTime(date));
|
qw.le(LimsAppointment::getEtime, DateUtils.getDayEndTime(date));
|
qw.eq(LimsAppointment::getInstrument,id);
|
qw.in(LimsAppointment::getStatus,0,5);
|
List<LimsAppointment> appointments = baseMapper.selectList(qw);
|
appointments.stream().forEach(item -> {
|
String[] ids = item.getOptionid().split(",");
|
for (String str: ids) {
|
if (StringUtils.isNotBlank(str)){
|
map.put(str,item);
|
}
|
}
|
});
|
|
return map;
|
}
|
}
|