From cbfab93f4977c7f737938ffb4534560c4a003197 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 09 九月 2024 18:23:41 +0800
Subject: [PATCH] 作业记录功能
---
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/jobrecord/vo/JobRecordRespVO.java | 59 ++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordServiceImpl.java | 74 ++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/JobRecordController.java | 95 ++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/jobrecord/JobRecordDO.java | 68 +++++++
sql/mysql/jh.sql | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordSaveReqVO.java | 46 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordService.java | 55 ++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordPageReqVO.java | 50 +++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/jobrecord/JobRecordMapper.java | 35 +++
jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/jobrecord/JobRecordMapper.xml | 12 +
11 files changed, 497 insertions(+), 1 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 dca119d..4ae3b8c 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
@@ -26,4 +26,6 @@
ErrorCode DEV_MODEL_NOT_EXISTS = new ErrorCode(1_010_005_000, "璁惧鍨嬪彿涓嶅瓨鍦�");
ErrorCode DEVICE_NOT_EXISTS = new ErrorCode(1_010_005_001, "璁惧涓嶅瓨鍦�");
ErrorCode DEV_RENT_NOT_EXISTS = new ErrorCode(1_010_005_002, "绉熷�熶笉瀛樺湪");
+
+ ErrorCode JOB_RECORD_NOT_EXISTS = new ErrorCode(1_010_006_000, "宸ヤ綔璁板綍涓嶅瓨鍦�");
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/JobRecordController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/JobRecordController.java
new file mode 100644
index 0000000..a6c2d15
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/JobRecordController.java
@@ -0,0 +1,95 @@
+package cn.lihu.jh.module.ecg.controller.admin.jobrecord;
+
+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;
+
+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.jobrecord.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO;
+import cn.lihu.jh.module.ecg.service.jobrecord.JobRecordService;
+
+@Tag(name = "绠$悊鍚庡彴 - 宸ヤ綔璁板綍")
+@RestController
+@RequestMapping("/ecg/job-record")
+@Validated
+public class JobRecordController {
+
+ @Resource
+ private JobRecordService jobRecordService;
+
+ @PostMapping("/create")
+ @Operation(summary = "鍒涘缓宸ヤ綔璁板綍")
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:create')")
+ public CommonResult<Long> createJobRecord(@Valid @RequestBody JobRecordSaveReqVO createReqVO) {
+ return success(jobRecordService.createJobRecord(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "鏇存柊宸ヤ綔璁板綍")
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:update')")
+ public CommonResult<Boolean> updateJobRecord(@Valid @RequestBody JobRecordSaveReqVO updateReqVO) {
+ jobRecordService.updateJobRecord(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "鍒犻櫎宸ヤ綔璁板綍")
+ @Parameter(name = "id", description = "缂栧彿", required = true)
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:delete')")
+ public CommonResult<Boolean> deleteJobRecord(@RequestParam("id") Long id) {
+ jobRecordService.deleteJobRecord(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "鑾峰緱宸ヤ綔璁板綍")
+ @Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:query')")
+ public CommonResult<JobRecordRespVO> getJobRecord(@RequestParam("id") Long id) {
+ JobRecordDO jobRecord = jobRecordService.getJobRecord(id);
+ return success(BeanUtils.toBean(jobRecord, JobRecordRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "鑾峰緱宸ヤ綔璁板綍鍒嗛〉")
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:query')")
+ public CommonResult<PageResult<JobRecordRespVO>> getJobRecordPage(@Valid JobRecordPageReqVO pageReqVO) {
+ PageResult<JobRecordDO> pageResult = jobRecordService.getJobRecordPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, JobRecordRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "瀵煎嚭宸ヤ綔璁板綍 Excel")
+ @PreAuthorize("@ss.hasPermission('ecg:job-record:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportJobRecordExcel(@Valid JobRecordPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List<JobRecordDO> list = jobRecordService.getJobRecordPage(pageReqVO).getList();
+ // 瀵煎嚭 Excel
+ ExcelUtils.write(response, "宸ヤ綔璁板綍.xls", "鏁版嵁", JobRecordRespVO.class,
+ BeanUtils.toBean(list, JobRecordRespVO.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/jobrecord/vo/JobRecordPageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordPageReqVO.java
new file mode 100644
index 0000000..6c3862a
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordPageReqVO.java
@@ -0,0 +1,50 @@
+package cn.lihu.jh.module.ecg.controller.admin.jobrecord.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 JobRecordPageReqVO extends PageParam {
+
+ @Schema(description = "浣滀笟绫诲瀷", example = "1")
+ private Integer jobType;
+
+ @Schema(description = "鍖荤敓缂栧彿", example = "24197")
+ private Long docId;
+
+ @Schema(description = "鍖荤敓鍚嶇О", example = "璧靛叚")
+ private String docName;
+
+ @Schema(description = "璁惧缂栧彿", example = "9159")
+ private String devId;
+
+ @Schema(description = "鎮h�呯紪鍙�", example = "19193")
+ private String patId;
+
+ @Schema(description = "鎮h�呭悕绉�", example = "鑺嬭壙")
+ private String patName;
+
+ @Schema(description = "浣滀笟鏃堕棿")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] jobTime;
+
+ @Schema(description = "浣滀笟姒傝")
+ private Integer summary;
+
+ @Schema(description = "澶囨敞", example = "浣犵寽")
+ private String remark;
+
+ @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/jobrecord/vo/JobRecordRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordRespVO.java
new file mode 100644
index 0000000..3758e61
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordRespVO.java
@@ -0,0 +1,59 @@
+package cn.lihu.jh.module.ecg.controller.admin.jobrecord.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 JobRecordRespVO {
+
+ @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2037")
+ @ExcelProperty("id")
+ private Long id;
+
+ @Schema(description = "浣滀笟绫诲瀷", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty("浣滀笟绫诲瀷")
+ private Integer jobType;
+
+ @Schema(description = "鍖荤敓缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED, example = "24197")
+ @ExcelProperty("鍖荤敓缂栧彿")
+ private Long docId;
+
+ @Schema(description = "鍖荤敓鍚嶇О", example = "璧靛叚")
+ @ExcelProperty("鍖荤敓鍚嶇О")
+ private String docName;
+
+ @Schema(description = "璁惧缂栧彿", example = "9159")
+ @ExcelProperty("璁惧缂栧彿")
+ private String devId;
+
+ @Schema(description = "鎮h�呯紪鍙�", example = "19193")
+ @ExcelProperty("鎮h�呯紪鍙�")
+ private String patId;
+
+ @Schema(description = "鎮h�呭悕绉�", example = "鑺嬭壙")
+ @ExcelProperty("鎮h�呭悕绉�")
+ private String patName;
+
+ @Schema(description = "浣滀笟鏃堕棿")
+ @ExcelProperty("浣滀笟鏃堕棿")
+ private LocalDateTime jobTime;
+
+ @Schema(description = "浣滀笟姒傝")
+ @ExcelProperty("浣滀笟姒傝")
+ private Integer summary;
+
+ @Schema(description = "澶囨敞", example = "浣犵寽")
+ @ExcelProperty("澶囨敞")
+ private String remark;
+
+ @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/jobrecord/vo/JobRecordSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordSaveReqVO.java
new file mode 100644
index 0000000..781531c
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordSaveReqVO.java
@@ -0,0 +1,46 @@
+package cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import jakarta.validation.constraints.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "绠$悊鍚庡彴 - 宸ヤ綔璁板綍鏂板/淇敼 Request VO")
+@Data
+public class JobRecordSaveReqVO {
+
+ @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2037")
+ private Long id;
+
+ @Schema(description = "浣滀笟绫诲瀷", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "浣滀笟绫诲瀷涓嶈兘涓虹┖")
+ private Integer jobType;
+
+ @Schema(description = "鍖荤敓缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED, example = "24197")
+ @NotNull(message = "鍖荤敓缂栧彿涓嶈兘涓虹┖")
+ private Long docId;
+
+ @Schema(description = "鍖荤敓鍚嶇О", example = "璧靛叚")
+ private String docName;
+
+ @Schema(description = "璁惧缂栧彿", example = "9159")
+ private String devId;
+
+ @Schema(description = "鎮h�呯紪鍙�", example = "19193")
+ private String patId;
+
+ @Schema(description = "鎮h�呭悕绉�", example = "鑺嬭壙")
+ private String patName;
+
+ @Schema(description = "浣滀笟鏃堕棿")
+ private LocalDateTime jobTime;
+
+ @Schema(description = "浣滀笟姒傝")
+ private Integer summary;
+
+ @Schema(description = "澶囨敞", example = "浣犵寽")
+ private String remark;
+
+}
\ 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/jobrecord/JobRecordDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/jobrecord/JobRecordDO.java
new file mode 100644
index 0000000..4913927
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/jobrecord/JobRecordDO.java
@@ -0,0 +1,68 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.jobrecord;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+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("job_record")
+@KeySequence("job_record_seq") // 鐢ㄤ簬 Oracle銆丳ostgreSQL銆並ingbase銆丏B2銆丠2 鏁版嵁搴撶殑涓婚敭鑷銆傚鏋滄槸 MySQL 绛夋暟鎹簱锛屽彲涓嶅啓銆�
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class JobRecordDO extends BaseDO {
+
+ /**
+ * id
+ */
+ @TableId
+ private Long id;
+ /**
+ * 浣滀笟绫诲瀷
+ */
+ private Integer jobType;
+ /**
+ * 鍖荤敓缂栧彿
+ */
+ private Long docId;
+ /**
+ * 鍖荤敓鍚嶇О
+ */
+ private String docName;
+ /**
+ * 璁惧缂栧彿
+ */
+ private String devId;
+ /**
+ * 鎮h�呯紪鍙�
+ */
+ private String patId;
+ /**
+ * 鎮h�呭悕绉�
+ */
+ private String patName;
+ /**
+ * 浣滀笟鏃堕棿
+ */
+ private LocalDateTime jobTime;
+ /**
+ * 浣滀笟姒傝
+ */
+ private Integer summary;
+ /**
+ * 澶囨敞
+ */
+ private String remark;
+
+}
\ 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/jobrecord/JobRecordMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/jobrecord/JobRecordMapper.java
new file mode 100644
index 0000000..c18d63d
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/jobrecord/JobRecordMapper.java
@@ -0,0 +1,35 @@
+package cn.lihu.jh.module.ecg.dal.mysql.jobrecord;
+
+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.jobrecord.JobRecordDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.*;
+
+/**
+ * 宸ヤ綔璁板綍 Mapper
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+@Mapper
+public interface JobRecordMapper extends BaseMapperX<JobRecordDO> {
+
+ default PageResult<JobRecordDO> selectPage(JobRecordPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX<JobRecordDO>()
+ .eqIfPresent(JobRecordDO::getJobType, reqVO.getJobType())
+ .eqIfPresent(JobRecordDO::getDocId, reqVO.getDocId())
+ .likeIfPresent(JobRecordDO::getDocName, reqVO.getDocName())
+ .eqIfPresent(JobRecordDO::getDevId, reqVO.getDevId())
+ .eqIfPresent(JobRecordDO::getPatId, reqVO.getPatId())
+ .likeIfPresent(JobRecordDO::getPatName, reqVO.getPatName())
+ .betweenIfPresent(JobRecordDO::getJobTime, reqVO.getJobTime())
+ .eqIfPresent(JobRecordDO::getSummary, reqVO.getSummary())
+ .eqIfPresent(JobRecordDO::getRemark, reqVO.getRemark())
+ .betweenIfPresent(JobRecordDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(JobRecordDO::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/jobrecord/JobRecordService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordService.java
new file mode 100644
index 0000000..0faa3f6
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordService.java
@@ -0,0 +1,55 @@
+package cn.lihu.jh.module.ecg.service.jobrecord;
+
+import java.util.*;
+import jakarta.validation.*;
+import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO;
+import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.framework.common.pojo.PageParam;
+
+/**
+ * 宸ヤ綔璁板綍 Service 鎺ュ彛
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+public interface JobRecordService {
+
+ /**
+ * 鍒涘缓宸ヤ綔璁板綍
+ *
+ * @param createReqVO 鍒涘缓淇℃伅
+ * @return 缂栧彿
+ */
+ Long createJobRecord(@Valid JobRecordSaveReqVO createReqVO);
+
+ /**
+ * 鏇存柊宸ヤ綔璁板綍
+ *
+ * @param updateReqVO 鏇存柊淇℃伅
+ */
+ void updateJobRecord(@Valid JobRecordSaveReqVO updateReqVO);
+
+ /**
+ * 鍒犻櫎宸ヤ綔璁板綍
+ *
+ * @param id 缂栧彿
+ */
+ void deleteJobRecord(Long id);
+
+ /**
+ * 鑾峰緱宸ヤ綔璁板綍
+ *
+ * @param id 缂栧彿
+ * @return 宸ヤ綔璁板綍
+ */
+ JobRecordDO getJobRecord(Long id);
+
+ /**
+ * 鑾峰緱宸ヤ綔璁板綍鍒嗛〉
+ *
+ * @param pageReqVO 鍒嗛〉鏌ヨ
+ * @return 宸ヤ綔璁板綍鍒嗛〉
+ */
+ PageResult<JobRecordDO> getJobRecordPage(JobRecordPageReqVO 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/jobrecord/JobRecordServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordServiceImpl.java
new file mode 100644
index 0000000..3b45995
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordServiceImpl.java
@@ -0,0 +1,74 @@
+package cn.lihu.jh.module.ecg.service.jobrecord;
+
+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.jobrecord.vo.*;
+import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO;
+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.jobrecord.JobRecordMapper;
+
+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 JobRecordServiceImpl implements JobRecordService {
+
+ @Resource
+ private JobRecordMapper jobRecordMapper;
+
+ @Override
+ public Long createJobRecord(JobRecordSaveReqVO createReqVO) {
+ // 鎻掑叆
+ JobRecordDO jobRecord = BeanUtils.toBean(createReqVO, JobRecordDO.class);
+ jobRecordMapper.insert(jobRecord);
+ // 杩斿洖
+ return jobRecord.getId();
+ }
+
+ @Override
+ public void updateJobRecord(JobRecordSaveReqVO updateReqVO) {
+ // 鏍¢獙瀛樺湪
+ validateJobRecordExists(updateReqVO.getId());
+ // 鏇存柊
+ JobRecordDO updateObj = BeanUtils.toBean(updateReqVO, JobRecordDO.class);
+ jobRecordMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteJobRecord(Long id) {
+ // 鏍¢獙瀛樺湪
+ validateJobRecordExists(id);
+ // 鍒犻櫎
+ jobRecordMapper.deleteById(id);
+ }
+
+ private void validateJobRecordExists(Long id) {
+ if (jobRecordMapper.selectById(id) == null) {
+ throw exception(JOB_RECORD_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public JobRecordDO getJobRecord(Long id) {
+ return jobRecordMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult<JobRecordDO> getJobRecordPage(JobRecordPageReqVO pageReqVO) {
+ return jobRecordMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/jobrecord/JobRecordMapper.xml b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/jobrecord/JobRecordMapper.xml
new file mode 100644
index 0000000..0fdabf8
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/jobrecord/JobRecordMapper.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.jobrecord.JobRecordMapper">
+
+ <!--
+ 涓�鑸儏鍐典笅锛屽敖鍙兘浣跨敤 Mapper 杩涜 CRUD 澧炲垹鏀规煡鍗冲彲銆�
+ 鏃犳硶婊¤冻鐨勫満鏅紝渚嬪璇村琛ㄥ叧鑱旀煡璇紝鎵嶄娇鐢� XML 缂栧啓 SQL銆�
+ 浠g爜鐢熸垚鍣ㄦ殏鏃跺彧鐢熸垚 Mapper XML 鏂囦欢鏈韩锛屾洿澶氭帹鑽� MybatisX 蹇�熷紑鍙戞彃浠舵潵鐢熸垚鏌ヨ銆�
+ 鏂囨。鍙锛歨ttps://www.iocoder.cn/MyBatis/x-plugins/
+ -->
+
+</mapper>
\ No newline at end of file
diff --git a/sql/mysql/jh.sql b/sql/mysql/jh.sql
index cc27af2..dbef098 100644
--- a/sql/mysql/jh.sql
+++ b/sql/mysql/jh.sql
@@ -166,7 +166,7 @@
CREATE TABLE `job_record` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`job_type` int NOT NULL COMMENT '浣滀笟绫诲瀷',
- `doc_id` varchar(45) DEFAULT NULL COMMENT '鍖荤敓缂栧彿',
+ `doc_id` bigint NOT NULL COMMENT '鍖荤敓缂栧彿',
`doc_name` varchar(45) DEFAULT NULL COMMENT '鍖荤敓鍚嶇О',
`dev_id` varchar(45) DEFAULT NULL COMMENT '璁惧缂栧彿',
`pat_id` varchar(45) DEFAULT NULL COMMENT '鎮h�呯紪鍙�',
--
Gitblit v1.9.3