From fc8492c1a1143ef2466c8dca219b82fc5bf6550c Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期六, 12 十月 2024 15:56:14 +0800
Subject: [PATCH] 队列状态 更新逻辑调整
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java | 49 ++++++++++++++-----------------------------------
1 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
index 329f324..e95b414 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/callingscreen/CallingScreenController.java
+++ b/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,17 +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 );
@@ -70,28 +53,24 @@
@GetMapping("/room-screen-data")
@Operation(summary = "璇婇棿灞忔暟鎹�")
@PermitAll
- public CommonResult<List<CallingRespVO>> callingDataRoom(HttpServletRequest request)
+ public CommonResult<Map<Integer, List<ScreenQueueRespVO>>> callingDataRoom(HttpServletRequest request)
{
String reqIp = ServletUtil.getClientIP(request);
List<Byte> queueStatusList = new ArrayList<>();
+ queueStatusList.add(QueueStatusEnum.RECALLED.getStatus());
queueStatusList.add(QueueStatusEnum.READY.getStatus());
queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus());
queueStatusList.add(QueueStatusEnum.PASSED.getStatus());
-
List<QueueDO> queueDOList = callingScreenService.getRoomQueue(reqIp, queueStatusList);
- return success(BeanUtils.toBean(queueDOList, CallingRespVO.class));
+
+ List<QueueDO> passedList = queueDOList.stream().filter(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus()).toList();
+ queueDOList.removeIf(queue -> queue.getStatus() == QueueStatusEnum.PASSED.getStatus());
+
+ 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);
- }
}
--
Gitblit v1.9.3