zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    }
}