eight
2024-08-13 7660fe12273a6b132256a2fa83ca1b11d6b2381f
update
已修改13个文件
143 ■■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-biz/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/room/RoomDO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-api/src/main/java/cn/lihu/jh/module/system/api/dept/DeptApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/api/dept/DeptApiImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/service/dept/DeptService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/service/dept/DeptServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/mysql/jh.sql 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/pom.xml
@@ -27,6 +27,11 @@
            <artifactId>jh-module-infra-api</artifactId>
            <version>${revision}</version>
        </dependency>
        <dependency>
            <groupId>cn.lihu</groupId>
            <artifactId>jh-module-system-api</artifactId>
            <version>${revision}</version>
        </dependency>
        <!-- 业务组件 -->
        <dependency>
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
@@ -1,6 +1,7 @@
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.feign.RemoteDataService;
@@ -8,6 +9,8 @@
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.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 +26,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;
@@ -60,6 +64,9 @@
    @Resource
    private RemoteDataService remoteDataService;
    @Resource
    private DeptApi deptApi;
    @PostMapping("/create")
    @Operation(summary = "创建预约")
@@ -174,6 +181,34 @@
        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
        return success("hello");
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/RoomController.java
@@ -1,10 +1,13 @@
package cn.lihu.jh.module.ecg.controller.admin.room;
import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
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 org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@@ -41,6 +44,9 @@
    @Resource
    private RoomService roomService;
    @Resource
    private DeptApi deptApi;
    @PostMapping("/create")
    @Operation(summary = "创建诊室和诊疗床")
@@ -96,4 +102,35 @@
                        BeanUtils.toBean(list, RoomRespVO.class));
    }
    @GetMapping(value = {"/list-all-simple", "/simple-list"})
    @Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
    public CommonResult<List<RoomRespVO>> getSimpleDeptList() {
        List<DeptRespDTO> deptRespDTOList = deptApi.getSimpleDeptList();
        Optional<DeptRespDTO> ecgDept = deptRespDTOList.stream()
                .filter(a -> a.getName().equals("ECG"))
                .findAny();
        List<DeptRespDTO> list2 = new ArrayList<DeptRespDTO>();
        if (ecgDept.isPresent()){
            System.out.println(ecgDept.get().getName());
            list2 = deptRespDTOList.stream()
                    .filter(a -> Objects.equals(a.getParentId(), ecgDept.get().getId()))
                    .toList();
            list2.forEach(System.out::println);
            list2.size();
        }
        List<RoomRespVO> list3 = list2.stream().map(item -> {
            RoomRespVO roomRespVO = new RoomRespVO();
            roomRespVO.setRoomId( item.getId() );
            roomRespVO.setRoomName( item.getName() );
            return roomRespVO;
        }).toList();
        //return success(BeanUtils.toBean(list2, RoomRespVO.class));
        return success(list3);
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomPageReqVO.java
@@ -16,7 +16,10 @@
public class RoomPageReqVO extends PageParam {
    @Schema(description = "诊室编号")
    private String roomNo;
    private Long roomId;
    @Schema(description = "诊室名称")
    private String roomName;
    @Schema(description = "诊疗床编号")
    private String bedNo;
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomRespVO.java
@@ -18,7 +18,11 @@
    @Schema(description = "诊室编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("诊室编号")
    private String roomNo;
    private Long roomId;
    @Schema(description = "诊室名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("诊室名称")
    private String roomName;
    @Schema(description = "诊疗床编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("诊疗床编号")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/room/vo/RoomSaveReqVO.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.util.*;
@@ -14,8 +15,12 @@
    private Integer id;
    @Schema(description = "诊室编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "诊室编号不能为空")
    private String roomNo;
    @Min(value = 0, message = "诊室编号不能为空")
    private Long roomId;
    @Schema(description = "诊室名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "诊室名称不能为空")
    private String roomName;
    @Schema(description = "诊疗床编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "诊疗床编号不能为空")
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/room/RoomDO.java
@@ -30,7 +30,11 @@
    /**
     * 诊室编号
     */
    private String roomNo;
    private Long roomId;
    /**
     * 诊室名称
     */
    private String roomName;
    /**
     * 诊疗床编号
     */
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
@@ -20,7 +20,7 @@
    default PageResult<RoomDO> selectPage(RoomPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RoomDO>()
                .eqIfPresent(RoomDO::getRoomNo, reqVO.getRoomNo())
                .eqIfPresent(RoomDO::getRoomId, reqVO.getRoomId())
                .eqIfPresent(RoomDO::getBedNo, reqVO.getBedNo())
                .betweenIfPresent(RoomDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RoomDO::getId));
jh-module-system/jh-module-system-api/src/main/java/cn/lihu/jh/module/system/api/dept/DeptApi.java
@@ -1,11 +1,16 @@
package cn.lihu.jh.module.system.api.dept;
import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.framework.common.util.collection.CollectionUtils;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
/**
 * 部门 API 接口
@@ -58,4 +63,9 @@
     */
    List<DeptRespDTO> getChildDeptList(Long id);
    /**
     *
     */
    List<DeptRespDTO> getSimpleDeptList();
}
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/api/dept/DeptApiImpl.java
@@ -1,5 +1,6 @@
package cn.lihu.jh.module.system.api.dept;
import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO;
import cn.lihu.jh.module.system.dal.dataobject.dept.DeptDO;
@@ -10,6 +11,8 @@
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
/**
 * 部门 API 实现类
@@ -45,4 +48,10 @@
        return BeanUtils.toBean(childDeptList, DeptRespDTO.class);
    }
    @Override
    public List<DeptRespDTO> getSimpleDeptList() {
        List<DeptDO> depts = deptService.getSimpleDeptList();
        return BeanUtils.toBean(depts, DeptRespDTO.class);
    }
}
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/service/dept/DeptService.java
@@ -64,6 +64,14 @@
    List<DeptDO> getDeptList(DeptListReqVO reqVO);
    /**
     * 获取所有启用部门简易列表
     *
     * @param
     * @return 部门列表
     */
    List<DeptDO> getSimpleDeptList();
    /**
     * 获得指定编号的部门 Map
     *
     * @param ids 部门编号数组
jh-module-system/jh-module-system-biz/src/main/java/cn/lihu/jh/module/system/service/dept/DeptServiceImpl.java
@@ -170,6 +170,14 @@
    }
    @Override
    public List<DeptDO> getSimpleDeptList() {
        DeptListReqVO reqVO = new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus());
        List<DeptDO> list = deptMapper.selectList(reqVO);
        list.sort(Comparator.comparing(DeptDO::getSort));
        return list;
    }
    @Override
    public List<DeptDO> getChildDeptList(Long id) {
        List<DeptDO> children = new LinkedList<>();
        // 遍历每一层
sql/mysql/jh.sql
@@ -72,7 +72,8 @@
DROP TABLE IF EXISTS `clinic_room`;
CREATE TABLE `clinic_room` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `room_no` varchar(10) NOT NULL COMMENT '诊室编号',
  `room_id` BIGINT NOT NULL COMMENT '诊室编号',
  `room_name` varchar(10) NOT NULL COMMENT '诊室名称',
  `bed_no` varchar(10) NOT NULL COMMENT '诊疗床编号',
  `tenant_id` int NOT NULL COMMENT '租户编号',
  `creator` varchar(10) DEFAULT '' COMMENT '创建者',