eight
2025-04-15 01a81beea99c0298a3b6178c7796f4c27b30c6c7
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package cn.lihu.jh.module.ecg.controller.admin.callingscreen;
 
import cn.hutool.extra.servlet.ServletUtil;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.service.callingscreen.CallingScreenService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import static cn.lihu.jh.framework.common.pojo.CommonResult.error;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
 
@Tag(name = "叫号屏 ")
@RestController
@RequestMapping("/ecg/screen")
@Validated
@Slf4j
public class CallingScreenController {
 
    @Resource
    private CallingScreenService callingScreenService;
 
    @GetMapping("/display-col-info")
    @Operation(summary = "列上显示的检查类型名称")
    @PermitAll
    public CommonResult<Map<Integer, List<String>>> displayColInfo()
    {
        Map<Integer, List<String>> map = callingScreenService.getDisplayColInfo();
        return success( map );
    }
 
    @GetMapping("/big-screen-data")
    @Operation(summary = "大屏叫号数据")
    @PermitAll
    public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingData()
    {
        Map<Integer, List<QueueDO>> map = callingScreenService.getBigScreenPatient();
 
        Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>();
        map.keySet().forEach( displayCol -> {
            //log.info("dispayCol: " + displayCol);
            List<QueueDO> columnQueueDOList = map.get(displayCol);
            List<ScreenQueueRespVO> screenQueueRespVOList = BeanUtils.toBean(columnQueueDOList, ScreenQueueRespVO.class);
            mapVO.put(displayCol, screenQueueRespVOList);
        });
 
        return success( mapVO );
    }
 
    @GetMapping("/room-screen-data")
    @Operation(summary = "诊间屏数据")
    @PermitAll
    public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingDataRoom(HttpServletRequest request, @RequestParam(value = "roomId", required = false)Long roomId)
    {
        String reqIp = ServletUtil.getClientIP(request);
 
        List<QueueDO> queueDOList1 = callingScreenService.getRoomCheckRelatedPatient(reqIp, roomId);
        List<QueueDO> queueDOList2 = callingScreenService.getRoomInstallRelatedPatient(reqIp, roomId);
 
        Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>();
        mapVO.put(1, BeanUtils.toBean(queueDOList1, ScreenQueueRespVO.class));
        mapVO.put(2, BeanUtils.toBean(queueDOList2, ScreenQueueRespVO.class));
        return success( mapVO );
    }
 
}