jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
@@ -1,41 +1,25 @@ package cn.lihu.jh.module.ecg.controller.admin.callingscreen; import cn.hutool.extra.servlet.ServletUtil; import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog; import cn.lihu.jh.framework.common.exception.ErrorCode; import cn.lihu.jh.framework.common.pojo.CommonResult; import cn.lihu.jh.framework.common.pojo.PageParam; import cn.lihu.jh.framework.common.pojo.PageResult; import cn.lihu.jh.framework.common.util.object.BeanUtils; import cn.lihu.jh.framework.excel.core.util.ExcelUtils; import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueuePageReqVO; import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueRespVO; 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.enums.QueueStatusEnum; import cn.lihu.jh.module.ecg.service.callingscreen.CallingScreenService; import cn.lihu.jh.module.ecg.service.config.EcgConfigService; import cn.lihu.jh.module.ecg.service.queue.QueueService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; 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 javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS; import static cn.lihu.jh.framework.common.pojo.CommonResult.error; import static cn.lihu.jh.framework.common.pojo.CommonResult.success; @@ -51,16 +35,16 @@ @Resource private EcgConfigService ecgConfigService; @GetMapping("/calling-data") @GetMapping("/big-screen-data") @Operation(summary = "大å±å«å·æ°æ®") @PermitAll public CommonResult<Map<Integer, List<CallingRespVO>>> callingData() public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingData() { Map<Integer, List<QueueDO>> map = callingScreenService.callingData(); Map<Integer, List<CallingRespVO>> mapVO = new HashMap<>(); Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>(); map.keySet().forEach( key -> { mapVO.put(key, BeanUtils.toBean(map.get(key), CallingRespVO.class)); mapVO.put(key, BeanUtils.toBean(map.get(key), ScreenQueueRespVO.class)); }); return success( mapVO ); @@ -69,7 +53,7 @@ @GetMapping("/room-screen-data") @Operation(summary = "è¯é´å±æ°æ®") @PermitAll public CommonResult<Map<Integer, List<CallingRespVO>>> callingDataRoom(HttpServletRequest request) public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingDataRoom(HttpServletRequest request) { String reqIp = ServletUtil.getClientIP(request); @@ -83,21 +67,10 @@ List<QueueDO> passedList = queueDOList.stream().filter(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus()).toList(); queueDOList.removeIf(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus()); Map<Integer, List<CallingRespVO>> mapVO = new HashMap<>(); mapVO.put(1, BeanUtils.toBean(queueDOList, CallingRespVO.class)); mapVO.put(2, BeanUtils.toBean(passedList, CallingRespVO.class)); Map<Integer, List<ScreenQueueRespVO>> mapVO = new HashMap<>(); mapVO.put(1, BeanUtils.toBean(queueDOList, ScreenQueueRespVO.class)); mapVO.put(2, BeanUtils.toBean(passedList, ScreenQueueRespVO.class)); return success( mapVO ); } @GetMapping("/mark-called") @Operation(summary = "è¯é´å±æ°æ®") @PermitAll public CommonResult<Integer> markCalled(@RequestParam("patId") String patId) { ErrorCode result = callingScreenService.markCalled(patId); if (result.equals(SUCCESS)) return success(0); return error(result); } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/ScreenQueueRespVO.java
ÎļþÃû´Ó jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingRespVO.java ÐÞ¸Ä @@ -1,17 +1,14 @@ package cn.lihu.jh.module.ecg.controller.admin.callingscreen; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.models.security.SecurityScheme; import lombok.Data; import java.time.LocalDate; import java.time.LocalDateTime; @Schema(description = "å«å·å±æ°æ®") @Data public class CallingRespVO { public class ScreenQueueRespVO { @Schema(description = "æ£è ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "30473") @ExcelProperty("æ£è ç¼å·") @@ -51,10 +48,6 @@ @Schema(description = "é¢çº¦è¿ææ è®°", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("é¢çº¦è¿ææ è®°") private Byte expired; @Schema(description = "è¯é³å«å·æ è®°", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("è¯é³å«å·æ è®°") private Integer called; @Schema(description = "æéæ è®°", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("æéæ è®°") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
@@ -67,10 +67,6 @@ */ private Byte expired; /** * è¯é³å«å·æ è®° */ private Integer called; /** * æéæ è®° */ private Byte jumpFlag; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
@@ -104,9 +104,6 @@ "</script>") List<QueueDO> getDoctorQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList); @Update( "update lihu.queue set called = 1 where pat_id = #{patId}" ) Integer markCalled(@Param("patId")String patId); @Update("update lihu.queue set status = #{newStatus} where seq_num = \n" + "(select a.min_seq_num from \n" + " (select min(seq_num) as min_seq_num from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus}) a )") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenService.java
@@ -26,6 +26,4 @@ Map<Integer, List<QueueDO>> callingData(); List<QueueDO> getRoomQueue(String ip, List<Byte> statusList); ErrorCode markCalled(String patientId); } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/callingscreen/CallingScreenServiceImpl.java
@@ -99,13 +99,4 @@ return queueDOList; } @Override public ErrorCode markCalled(String patientId) { Integer rowNum = queueMapper.markCalled(patientId); if (rowNum == 1) return GlobalErrorCodeConstants.SUCCESS; return PATIENT_NOT_EXISTS; } } sql/mysql/jh.sql
@@ -54,7 +54,6 @@ `status` tinyint NOT NULL COMMENT '10:æéä¸ 20:åè¯åå¤ 30:å°±è¯ä¸ 40:å°±è¯å®æ 50:è¿å· 60:è¿æ', `passed` tinyint DEFAULT '0' COMMENT 'è¿å·æ è®°', `expired` tinyint DEFAULT '0' COMMENT 'é¢çº¦è¿ææ è®°', `called` int DEFAULT '0' COMMENT 'å«å·ç¶æ 0 æªæ 1 å·²æ ', `jump_flag` tinyint DEFAULT '0' COMMENT 'æéæ è®°', `room_id` bigint DEFAULT '0' COMMENT 'è¯å®¤ç¼å·', `room_name` varchar(10) DEFAULT '' COMMENT 'è¯å®¤åç§°', @@ -70,7 +69,7 @@ KEY `idx_status` (`status`) USING BTREE, KEY `idx_seq_num` (`seq_num`) USING BTREE, KEY `idx_room_bed_status` (`room_id`,`bed_no`,`status`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='æé表'; ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='æé表'; -- ---------------------------- -- Table structure for clinic_room @@ -178,6 +177,7 @@ `summary` varchar(200) DEFAULT NULL COMMENT 'ä½ä¸æ¦è¦', `remark` varchar(100) DEFAULT NULL COMMENT '夿³¨', `cancelled` int DEFAULT '0' COMMENT 'æªå®è£ ', `lost` int DEFAULT '0', `tenant_id` int DEFAULT '1' COMMENT 'ç§æ·ç¼å·', `creator` varchar(10) DEFAULT '' COMMENT 'å建è ', `create_time` datetime NOT NULL COMMENT 'å建æ¶é´', @@ -186,11 +186,12 @@ `deleted` bit(1) DEFAULT b'0' COMMENT 'å 餿 è®°', PRIMARY KEY (`id`), KEY `idx_pat_job` (`pat_id`,`job_time`,`job_type`), KEY `idx_rent_id` (`rent_id`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='å·¥ä½è®°å½è¡¨'; KEY `idx_rent_id` (`rent_id`), KEY `idx_rent_doc_job` (`job_time`,`doc_id`,`job_type`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='å·¥ä½è®°å½è¡¨'; -- ---------------------------- -- Table structure for call -- Table structure for call_patient -- ---------------------------- DROP TABLE IF EXISTS `call_patient`; SELECT * FROM lihu.call_patient;CREATE TABLE `call_patient` (