eight
2024-08-14 5f7a61e50bcf82f368272e29518b2bd3a85e4782
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
@@ -1,13 +1,19 @@
package cn.lihu.jh.module.ecg.controller.admin.appointment;
import cn.hutool.core.bean.BeanUtil;
import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO;
import cn.lihu.jh.module.ecg.feign.RemoteDataService;
import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo;
import cn.lihu.jh.module.ecg.feign.RestApiResult;
import cn.lihu.jh.module.ecg.feign.dto.AppointmentExternal;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import cn.lihu.jh.module.ecg.service.room.RoomService;
import cn.lihu.jh.module.system.api.dept.DeptApi;
import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@@ -23,6 +29,7 @@
import java.time.format.ResolverStyle;
import java.util.*;
import java.io.IOException;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import cn.lihu.jh.framework.common.pojo.PageParam;
@@ -59,7 +66,13 @@
    private QueueService queueService;
    @Resource
    private RoomService roomService;
    @Resource
    private RemoteDataService remoteDataService;
    @Resource
    private DeptApi deptApi;
    @PostMapping("/create")
    @Operation(summary = "创建预约")
@@ -174,6 +187,41 @@
        queueService.createqueue(queueSaveReqVO);
        // 获取候诊准备的配置人数  , 营业的诊室
/*
        List<DeptDO> list = deptService.getDeptList(
                new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
        return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
*/
        List<DeptRespDTO> deptRespDTOList = deptApi.getSimpleDeptList();
        Optional<DeptRespDTO> ecgDept = deptRespDTOList.stream()
                .filter(a -> a.getName().equals("ECG"))
                .findAny();
        if (ecgDept.isPresent()){
            System.out.println(ecgDept.get().getName());
            List<DeptRespDTO> list2 = deptRespDTOList.stream()
                    .filter(a -> Objects.equals(a.getParentId(), ecgDept.get().getId()))
                    .toList();
            list2.forEach(System.out::println);
            list2.size();
        }
        // 获取 每个营业的诊室 候诊准备的当前人数  就诊中的当前人数
        // queueService.get
        List<RoomStatisticsDO> roomStatisticsList = roomService.roomStatistics();
        roomStatisticsList.size();
        List statusList = new ArrayList<Byte>();
        statusList.add((byte)20);
        statusList.add((byte)30);
        List<QueueStatisticDO> queueStatisticDOList = queueService.queueStatistics(statusList);
        queueStatisticDOList.size();
        return success("hello");
    }
}