From 913587c63ac1a475b37e21b7f1fa160a23a286ef Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期三, 06 十一月 2024 18:16:02 +0800 Subject: [PATCH] 检查类型相关 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeService.java | 3 + sql/mysql/update.sql | 25 ++++++++++++ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/CheckTypeController.java | 9 ++-- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java | 1 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeServiceImpl.java | 5 +- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeRespVO.java | 3 - jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java | 12 ++++++ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/checktype/CheckTypeDO.java | 10 ++-- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypePageReqVO.java | 2 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeSaveReqVO.java | 4 - 10 files changed, 55 insertions(+), 19 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/CheckTypeController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/CheckTypeController.java index f3d5507..c77b2d0 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/CheckTypeController.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/CheckTypeController.java @@ -1,16 +1,12 @@ package cn.lihu.jh.module.ecg.controller.admin.checktype; import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.security.access.prepost.PreAuthorize; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; -import jakarta.validation.*; -import jakarta.servlet.http.*; import java.util.*; import java.io.IOException; @@ -29,6 +25,11 @@ import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.module.ecg.service.checktype.CheckTypeService; +import javax.annotation.Resource; +import javax.annotation.security.PermitAll; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + @Tag(name = "绠$悊鍚庡彴 - 妫�鏌ョ被鍨�") @RestController @RequestMapping("/ecg/check-type") diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypePageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypePageReqVO.java index 1e009a8..724b605 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypePageReqVO.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypePageReqVO.java @@ -47,6 +47,6 @@ private Integer timeslotReservedNum; @Schema(description = "浜插拰鐨勬鏌ョ被鍨�") - private String affinityCheckTypes; + private Integer[] affinityCheckTypes; } \ No newline at end of file diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeRespVO.java index 30fd1cf..e4fac1c 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeRespVO.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeRespVO.java @@ -61,6 +61,5 @@ @Schema(description = "浜插拰鐨勬鏌ョ被鍨�") @ExcelProperty("浜插拰鐨勬鏌ョ被鍨�") - private String affinityCheckTypes; - + private Integer[] affinityCheckTypes; } \ No newline at end of file diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeSaveReqVO.java index 516417c..34d2655 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeSaveReqVO.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/checktype/vo/CheckTypeSaveReqVO.java @@ -3,7 +3,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import jakarta.validation.constraints.*; @Schema(description = "绠$悊鍚庡彴 - 妫�鏌ョ被鍨嬫柊澧�/淇敼 Request VO") @Data @@ -40,6 +39,5 @@ private Integer timeslotReservedNum; @Schema(description = "浜插拰鐨勬鏌ョ被鍨�") - private String affinityCheckTypes; - + private Integer[] affinityCheckTypes; } \ No newline at end of file diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/checktype/CheckTypeDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/checktype/CheckTypeDO.java index e0d4d6d..cdc0428 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/checktype/CheckTypeDO.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/checktype/CheckTypeDO.java @@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.dal.dataobject.checktype; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; import java.util.*; import java.time.LocalDateTime; @@ -12,7 +13,7 @@ * * @author majianbo */ -@TableName("check_type") +@TableName(value="check_type", autoResultMap = true) @KeySequence("check_type_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆� @Data @EqualsAndHashCode(callSuper = true) @@ -42,7 +43,6 @@ /** * 闇�瑕佽澶囬鐢� * - * 鏋氫妇 {@link TODO infra_boolean_string 瀵瑰簲鐨勭被} */ private Integer needDevReady; /** @@ -68,6 +68,6 @@ /** * 浜插拰鐨勬鏌ョ被鍨� */ - private String affinityCheckTypes; - -} \ No newline at end of file + @TableField(typeHandler = JacksonTypeHandler.class) + private Integer[] affinityCheckTypes; +} diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeService.java index 4b3e7bf..0fbd3a6 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeService.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeService.java @@ -1,12 +1,13 @@ package cn.lihu.jh.module.ecg.service.checktype; import java.util.*; -import jakarta.validation.*; import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.*; import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.framework.common.pojo.PageResult; import cn.lihu.jh.framework.common.pojo.PageParam; +import javax.validation.Valid; + /** * 妫�鏌ョ被鍨� Service 鎺ュ彛 * diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeServiceImpl.java index 2cdecce..e9ad21e 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeServiceImpl.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/checktype/CheckTypeServiceImpl.java @@ -1,19 +1,18 @@ package cn.lihu.jh.module.ecg.service.checktype; import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.*; import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.framework.common.pojo.PageResult; -import cn.lihu.jh.framework.common.pojo.PageParam; import cn.lihu.jh.framework.common.util.object.BeanUtils; import cn.lihu.jh.module.ecg.dal.mysql.checktype.CheckTypeMapper; +import javax.annotation.Resource; + import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*; diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java index 521e266..fb866e2 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceImpl.java @@ -268,6 +268,7 @@ queueServiceTxFunctions.resetRoom(needCloseBed); queueServiceTxFunctions.bedReload(); queueServiceTxFunctions.monitorInfo(); + queueServiceTxFunctions.resetQueueSequenceTable(); }); } diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java index bc4b4ef..1d2cd35 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/QueueServiceTxFunctions.java @@ -16,6 +16,7 @@ import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; import cn.lihu.jh.module.ecg.enums.BedStatusEnum; import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; +import cn.lihu.jh.module.infra.api.config.ConfigApi; import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -29,6 +30,7 @@ import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.lihu.jh.framework.common.pojo.CommonResult.error; +import static cn.lihu.jh.module.ecg.Constants.*; import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*; /** @@ -40,6 +42,9 @@ @Validated @Slf4j public class QueueServiceTxFunctions { + + @Resource + private ConfigApi configApi; @Resource private OAuth2TokenApi oAuth2TokenApi; @@ -454,6 +459,13 @@ log.info(" opening " + openingFlag.get() + " " + monitorInfoVO.getQueueNum() + " " + monitorInfoVO.getActiveQueueNum() + " " + monitorInfoVO.getCheckTypeBedInfo().toString() ); } + public void resetQueueSequenceTable() { + String strBookTimeslotLength = configApi.getConfigValueByKey(BOOK_TIMESLOT_LENGTH); + String strBookTimeslotList = configApi.getConfigValueByKey(BOOK_TIMESLOT_LIST); + + + } + private Integer getBedReadyMax(Long roomId, String bedNo) { RoomDO roomDO = roomMapper.getRoom(roomId, bedNo); Integer[] checkTypes = roomDO.getCheckTypes(); diff --git a/sql/mysql/update.sql b/sql/mysql/update.sql new file mode 100644 index 0000000..b52b196 --- /dev/null +++ b/sql/mysql/update.sql @@ -0,0 +1,25 @@ +ALTER TABLE `lihu`.`check_type` +ADD COLUMN `display_barcode` INT NULL DEFAULT 0 COMMENT '鏄惁鏄剧ず鎮h�呮潯鐮�' AFTER `deleted`, +ADD COLUMN `expense_recognition` INT NULL DEFAULT 0 COMMENT '鏄惁闇�瑕佺‘璐�' AFTER `display_barcode`, +ADD COLUMN `timeslot_book_num` INT NULL DEFAULT 0 COMMENT '鏃舵棰勭害瑙勫畾浜烘暟' AFTER `expense_recognition`, +ADD COLUMN `timeslot_reserved_num` INT NULL DEFAULT 0 COMMENT '姣忔椂娈甸鐣欎汉鏁�' AFTER `timeslot_book_num`, +ADD COLUMN `affinity_check_types` VARCHAR(45) NULL DEFAULT '' COMMENT '浜插拰鐨勬鏌ョ被鍨�' AFTER `timeslot_reserved_num`; + +CREATE TABLE `queue_sequence` ( + `id` int NOT NULL AUTO_INCREMENT, + `check_type` int DEFAULT NULL, + `time_slot` int DEFAULT NULL, + `queue_no` int DEFAULT NULL, + `queue_vip_no` int DEFAULT NULL, + `queue_full` int DEFAULT NULL, + `queue_vip_full` int DEFAULT NULL, + `creator` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT '', + `create_time` datetime NOT NULL, + `updater` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT '', + `update_time` datetime NOT NULL, + `deleted` bit(1) DEFAULT b'0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +SELECT * FROM lihu.check_type; + + -- Gitblit v1.9.3