From 28e699e3e1886ff4f08590857aaf08a62567c3f3 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 07 十一月 2024 09:54:15 +0800
Subject: [PATCH] 新增 queue_sequence 表操作代码
---
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequencePageReqVO.java | 40 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queuesequence/QueueSequenceDO.java | 55 ++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queuesequence/QueueSequenceMapper.java | 32 ++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/QueueSequenceController.java | 95 +++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceRespVO.java | 47 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java | 75 +++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceService.java | 56 +++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceSaveReqVO.java | 32 ++++
jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/queuesequence/QueueSequenceMapper.xml | 12 +
10 files changed, 446 insertions(+), 0 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
index 0469332..45783c6 100644
--- a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
+++ b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
@@ -54,4 +54,6 @@
ErrorCode CALL_NOT_EXISTS = new ErrorCode(1_010_008_000, "鍙彿涓嶅瓨鍦�");
ErrorCode CHECK_TYPE_NOT_EXISTS = new ErrorCode(1_010_009_000, "妫�鏌ョ被鍨嬩笉瀛樺湪");
+
+ ErrorCode QUEUE_SEQUENCE_NOT_EXISTS = new ErrorCode(1_010_010_000, "褰撳ぉ搴忓彿涓嶅瓨鍦�");
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/QueueSequenceController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/QueueSequenceController.java
new file mode 100644
index 0000000..082e42f
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/QueueSequenceController.java
@@ -0,0 +1,95 @@
+package cn.lihu.jh.module.ecg.controller.admin.queuesequence;
+
+import org.springframework.web.bind.annotation.*;
+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 java.util.*;
+import java.io.IOException;
+
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.CommonResult;
+import cn.lihu.jh.framework.common.util.object.BeanUtils;
+import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
+
+import cn.lihu.jh.framework.excel.core.util.ExcelUtils;
+
+import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.queuesequence.QueueSequenceDO;
+import cn.lihu.jh.module.ecg.service.queuesequence.QueueSequenceService;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+@Tag(name = "绠$悊鍚庡彴 - 褰撳ぉ搴忓彿")
+@RestController
+@RequestMapping("/ecg/queue-sequence")
+@Validated
+public class QueueSequenceController {
+
+ @Resource
+ private QueueSequenceService queueSequenceService;
+
+ @PostMapping("/create")
+ @Operation(summary = "鍒涘缓褰撳ぉ搴忓彿")
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:create')")
+ public CommonResult<Integer> createQueueSequence(@Valid @RequestBody QueueSequenceSaveReqVO createReqVO) {
+ return success(queueSequenceService.createQueueSequence(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "鏇存柊褰撳ぉ搴忓彿")
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:update')")
+ public CommonResult<Boolean> updateQueueSequence(@Valid @RequestBody QueueSequenceSaveReqVO updateReqVO) {
+ queueSequenceService.updateQueueSequence(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "鍒犻櫎褰撳ぉ搴忓彿")
+ @Parameter(name = "id", description = "缂栧彿", required = true)
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:delete')")
+ public CommonResult<Boolean> deleteQueueSequence(@RequestParam("id") Integer id) {
+ queueSequenceService.deleteQueueSequence(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "鑾峰緱褰撳ぉ搴忓彿")
+ @Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:query')")
+ public CommonResult<QueueSequenceRespVO> getQueueSequence(@RequestParam("id") Integer id) {
+ QueueSequenceDO queueSequence = queueSequenceService.getQueueSequence(id);
+ return success(BeanUtils.toBean(queueSequence, QueueSequenceRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "鑾峰緱褰撳ぉ搴忓彿鍒嗛〉")
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:query')")
+ public CommonResult<PageResult<QueueSequenceRespVO>> getQueueSequencePage(@Valid QueueSequencePageReqVO pageReqVO) {
+ PageResult<QueueSequenceDO> pageResult = queueSequenceService.getQueueSequencePage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, QueueSequenceRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "瀵煎嚭褰撳ぉ搴忓彿 Excel")
+ @PreAuthorize("@ss.hasPermission('ecg:queue-sequence:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportQueueSequenceExcel(@Valid QueueSequencePageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List<QueueSequenceDO> list = queueSequenceService.getQueueSequencePage(pageReqVO).getList();
+ // 瀵煎嚭 Excel
+ ExcelUtils.write(response, "褰撳ぉ搴忓彿.xls", "鏁版嵁", QueueSequenceRespVO.class,
+ BeanUtils.toBean(list, QueueSequenceRespVO.class));
+ }
+
+}
\ 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/queuesequence/vo/QueueSequencePageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequencePageReqVO.java
new file mode 100644
index 0000000..6ee268b
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequencePageReqVO.java
@@ -0,0 +1,40 @@
+package cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "绠$悊鍚庡彴 - 褰撳ぉ搴忓彿鍒嗛〉 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class QueueSequencePageReqVO extends PageParam {
+
+ @Schema(description = "妫�鏌ョ被鍨�", example = "2")
+ private Integer checkType;
+
+ @Schema(description = "鏃舵")
+ private Integer timeSlot;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿")
+ private Integer queueNo;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿")
+ private Integer queueVipNo;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿婊�")
+ private Integer queueFull;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿婊�")
+ private Integer queueVipFull;
+
+ @Schema(description = "鍒涘缓鏃堕棿")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ 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/queuesequence/vo/QueueSequenceRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceRespVO.java
new file mode 100644
index 0000000..46806a3
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceRespVO.java
@@ -0,0 +1,47 @@
+package cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "绠$悊鍚庡彴 - 褰撳ぉ搴忓彿 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class QueueSequenceRespVO {
+
+ @Schema(description = "DB 涓婚敭", requiredMode = Schema.RequiredMode.REQUIRED, example = "11958")
+ @ExcelProperty("DB 涓婚敭")
+ private Integer id;
+
+ @Schema(description = "妫�鏌ョ被鍨�", example = "2")
+ @ExcelProperty("妫�鏌ョ被鍨�")
+ private Integer checkType;
+
+ @Schema(description = "鏃舵")
+ @ExcelProperty("鏃舵")
+ private Integer timeSlot;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿")
+ @ExcelProperty("璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿")
+ private Integer queueNo;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿")
+ @ExcelProperty("璇ユ椂娈� vip 搴忓彿")
+ private Integer queueVipNo;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿婊�")
+ @ExcelProperty("璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿婊�")
+ private Integer queueFull;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿婊�")
+ @ExcelProperty("璇ユ椂娈� vip 搴忓彿婊�")
+ private Integer queueVipFull;
+
+ @Schema(description = "鍒涘缓鏃堕棿", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("鍒涘缓鏃堕棿")
+ private LocalDateTime createTime;
+
+}
\ 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/queuesequence/vo/QueueSequenceSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceSaveReqVO.java
new file mode 100644
index 0000000..7d62e6f
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queuesequence/vo/QueueSequenceSaveReqVO.java
@@ -0,0 +1,32 @@
+package cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+
+@Schema(description = "绠$悊鍚庡彴 - 褰撳ぉ搴忓彿鏂板/淇敼 Request VO")
+@Data
+public class QueueSequenceSaveReqVO {
+
+ @Schema(description = "DB 涓婚敭", requiredMode = Schema.RequiredMode.REQUIRED, example = "11958")
+ private Integer id;
+
+ @Schema(description = "妫�鏌ョ被鍨�", example = "2")
+ private Integer checkType;
+
+ @Schema(description = "鏃舵")
+ private Integer timeSlot;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿")
+ private Integer queueNo;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿")
+ private Integer queueVipNo;
+
+ @Schema(description = "璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿婊�")
+ private Integer queueFull;
+
+ @Schema(description = "璇ユ椂娈� vip 搴忓彿婊�")
+ private Integer queueVipFull;
+
+}
\ 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/queuesequence/QueueSequenceDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queuesequence/QueueSequenceDO.java
new file mode 100644
index 0000000..e1eab6a
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queuesequence/QueueSequenceDO.java
@@ -0,0 +1,55 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.queuesequence;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.lihu.jh.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 褰撳ぉ搴忓彿 DO
+ *
+ * @author 閲戝崕鍖婚櫌
+ */
+@TableName("queue_sequence")
+@KeySequence("queue_sequence_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class QueueSequenceDO extends BaseDO {
+
+ /**
+ * DB 涓婚敭
+ */
+ @TableId
+ private Integer id;
+ /**
+ * 妫�鏌ョ被鍨�
+ */
+ private Integer checkType;
+ /**
+ * 鏃舵
+ */
+ private Integer timeSlot;
+ /**
+ * 璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿
+ */
+ private Integer queueNo;
+ /**
+ * 璇ユ椂娈� vip 搴忓彿
+ */
+ private Integer queueVipNo;
+ /**
+ * 璇ユ椂娈� 鏅�氭偅鑰� 搴忓彿婊�
+ */
+ private Integer queueFull;
+ /**
+ * 璇ユ椂娈� vip 搴忓彿婊�
+ */
+ private Integer queueVipFull;
+
+}
\ 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/mysql/queuesequence/QueueSequenceMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queuesequence/QueueSequenceMapper.java
new file mode 100644
index 0000000..2a5ddf6
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queuesequence/QueueSequenceMapper.java
@@ -0,0 +1,32 @@
+package cn.lihu.jh.module.ecg.dal.mysql.queuesequence;
+
+import java.util.*;
+
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
+import cn.lihu.jh.module.ecg.dal.dataobject.queuesequence.QueueSequenceDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo.*;
+
+/**
+ * 褰撳ぉ搴忓彿 Mapper
+ *
+ * @author 閲戝崕鍖婚櫌
+ */
+@Mapper
+public interface QueueSequenceMapper extends BaseMapperX<QueueSequenceDO> {
+
+ default PageResult<QueueSequenceDO> selectPage(QueueSequencePageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX<QueueSequenceDO>()
+ .eqIfPresent(QueueSequenceDO::getCheckType, reqVO.getCheckType())
+ .eqIfPresent(QueueSequenceDO::getTimeSlot, reqVO.getTimeSlot())
+ .eqIfPresent(QueueSequenceDO::getQueueNo, reqVO.getQueueNo())
+ .eqIfPresent(QueueSequenceDO::getQueueVipNo, reqVO.getQueueVipNo())
+ .eqIfPresent(QueueSequenceDO::getQueueFull, reqVO.getQueueFull())
+ .eqIfPresent(QueueSequenceDO::getQueueVipFull, reqVO.getQueueVipFull())
+ .betweenIfPresent(QueueSequenceDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(QueueSequenceDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceService.java
new file mode 100644
index 0000000..d26a588
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceService.java
@@ -0,0 +1,56 @@
+package cn.lihu.jh.module.ecg.service.queuesequence;
+
+import java.util.*;
+import cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.queuesequence.QueueSequenceDO;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+
+import javax.validation.Valid;
+
+/**
+ * 褰撳ぉ搴忓彿 Service 鎺ュ彛
+ *
+ * @author 閲戝崕鍖婚櫌
+ */
+public interface QueueSequenceService {
+
+ /**
+ * 鍒涘缓褰撳ぉ搴忓彿
+ *
+ * @param createReqVO 鍒涘缓淇℃伅
+ * @return 缂栧彿
+ */
+ Integer createQueueSequence(@Valid QueueSequenceSaveReqVO createReqVO);
+
+ /**
+ * 鏇存柊褰撳ぉ搴忓彿
+ *
+ * @param updateReqVO 鏇存柊淇℃伅
+ */
+ void updateQueueSequence(@Valid QueueSequenceSaveReqVO updateReqVO);
+
+ /**
+ * 鍒犻櫎褰撳ぉ搴忓彿
+ *
+ * @param id 缂栧彿
+ */
+ void deleteQueueSequence(Integer id);
+
+ /**
+ * 鑾峰緱褰撳ぉ搴忓彿
+ *
+ * @param id 缂栧彿
+ * @return 褰撳ぉ搴忓彿
+ */
+ QueueSequenceDO getQueueSequence(Integer id);
+
+ /**
+ * 鑾峰緱褰撳ぉ搴忓彿鍒嗛〉
+ *
+ * @param pageReqVO 鍒嗛〉鏌ヨ
+ * @return 褰撳ぉ搴忓彿鍒嗛〉
+ */
+ PageResult<QueueSequenceDO> getQueueSequencePage(QueueSequencePageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java
new file mode 100644
index 0000000..0c6fffb
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queuesequence/QueueSequenceServiceImpl.java
@@ -0,0 +1,75 @@
+package cn.lihu.jh.module.ecg.service.queuesequence;
+
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.lihu.jh.module.ecg.controller.admin.queuesequence.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.queuesequence.QueueSequenceDO;
+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.queuesequence.QueueSequenceMapper;
+
+import javax.annotation.Resource;
+
+import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
+
+/**
+ * 褰撳ぉ搴忓彿 Service 瀹炵幇绫�
+ *
+ * @author 閲戝崕鍖婚櫌
+ */
+@Service
+@Validated
+public class QueueSequenceServiceImpl implements QueueSequenceService {
+
+ @Resource
+ private QueueSequenceMapper queueSequenceMapper;
+
+ @Override
+ public Integer createQueueSequence(QueueSequenceSaveReqVO createReqVO) {
+ // 鎻掑叆
+ QueueSequenceDO queueSequence = BeanUtils.toBean(createReqVO, QueueSequenceDO.class);
+ queueSequenceMapper.insert(queueSequence);
+ // 杩斿洖
+ return queueSequence.getId();
+ }
+
+ @Override
+ public void updateQueueSequence(QueueSequenceSaveReqVO updateReqVO) {
+ // 鏍¢獙瀛樺湪
+ validateQueueSequenceExists(updateReqVO.getId());
+ // 鏇存柊
+ QueueSequenceDO updateObj = BeanUtils.toBean(updateReqVO, QueueSequenceDO.class);
+ queueSequenceMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteQueueSequence(Integer id) {
+ // 鏍¢獙瀛樺湪
+ validateQueueSequenceExists(id);
+ // 鍒犻櫎
+ queueSequenceMapper.deleteById(id);
+ }
+
+ private void validateQueueSequenceExists(Integer id) {
+ if (queueSequenceMapper.selectById(id) == null) {
+ throw exception(QUEUE_SEQUENCE_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public QueueSequenceDO getQueueSequence(Integer id) {
+ return queueSequenceMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult<QueueSequenceDO> getQueueSequencePage(QueueSequencePageReqVO pageReqVO) {
+ return queueSequenceMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/queuesequence/QueueSequenceMapper.xml b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/queuesequence/QueueSequenceMapper.xml
new file mode 100644
index 0000000..4550018
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/queuesequence/QueueSequenceMapper.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.lihu.jh.module.ecg.dal.mysql.queuesequence.QueueSequenceMapper">
+
+ <!--
+ 涓�鑸儏鍐典笅锛屽敖鍙兘浣跨敤 Mapper 杩涜 CRUD 澧炲垹鏀规煡鍗冲彲銆�
+ 鏃犳硶婊¤冻鐨勫満鏅紝渚嬪璇村琛ㄥ叧鑱旀煡璇紝鎵嶄娇鐢� XML 缂栧啓 SQL銆�
+ 浠g爜鐢熸垚鍣ㄦ殏鏃跺彧鐢熸垚 Mapper XML 鏂囦欢鏈韩锛屾洿澶氭帹鑽� MybatisX 蹇�熷紑鍙戞彃浠舵潵鐢熸垚鏌ヨ銆�
+ 鏂囨。鍙锛歨ttps://www.iocoder.cn/MyBatis/x-plugins/
+ -->
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.9.3