From dc902484cd4d304ee02a3ce88f54e266cd40fdad Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 26 九月 2024 16:18:04 +0800
Subject: [PATCH] 数据录入功能
---
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/DevRentStateEnum.java | 1
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java | 4 ++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java | 9 ++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevCancelReqVO.java | 4 ++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java | 4 ++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java | 3 +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java | 4 ++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java | 37 +++++++++++++++++-
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 43 +++++++++++++++++++++
9 files changed, 107 insertions(+), 2 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/DevRentStateEnum.java b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/DevRentStateEnum.java
index 3a530af..9913f0d 100644
--- a/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/DevRentStateEnum.java
+++ b/jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/DevRentStateEnum.java
@@ -19,6 +19,7 @@
READY(5, "宸查鍙�"),
INSTALLED(10, "宸茶鏈�"),
DISMANTLED(20, "宸叉媶鏈�"),
+ DATAENTERED(25, "宸插綍鍏�"),
CANCELLED(30, "宸叉斁寮�"),
LOST(40, "宸查仐澶�");
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
index 7a56e68..bbfc4ab 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -86,6 +86,20 @@
}
}
+ @PostMapping("/dev-data-entry")
+ @Operation(summary = "鏁版嵁褰曞叆")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<Long> devDataEntry(@Valid @RequestBody DevRentSaveReqVO createReqVO) {
+ try {
+ devRentService.dataEntryOperation(createReqVO);
+ return CommonResult.success(0L);
+ } catch ( RuntimeException runtimeException ) {
+ String err = ExceptionUtils.formatException( runtimeException );
+ log.error("devDismantle: " + err);
+ return CommonResult.error(DEV_DISMANTLE_EXCEPTION);
+ }
+ }
+
@PostMapping("/dev-cancel")
@Operation(summary = "鍙栨秷瑁呮満")
@PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
@@ -176,7 +190,7 @@
}
@GetMapping("/get-ready-rent")
- @Operation(summary = "鑾峰彇鎮h�呰澶囩殑鏈�杩戠璧佹儏鍐�")
+ @Operation(summary = "鑾峰彇宸查鍙栫璧佹儏鍐�")
@PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
public CommonResult<DevRentRespVO> getReadyRent( @Valid DevRentSearchReqVO searchReqVO )
{
@@ -197,7 +211,7 @@
}
@GetMapping("/get-installed-rent")
- @Operation(summary = "鑾峰彇鎮h�呰澶囩殑鏈�杩戠璧佹儏鍐�")
+ @Operation(summary = "鑾峰彇宸插畨瑁呯璧佹儏鍐�")
@PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
public CommonResult<DevRentRespVO> getInstalledRent( @Valid DevRentSearchReqVO searchReqVO )
{
@@ -214,4 +228,23 @@
devRentRespVO.setModel( deviceDO.getModel() );
return CommonResult.success(devRentRespVO);
}
+
+ @GetMapping("/get-dismantled-rent")
+ @Operation(summary = "鑾峰彇宸叉媶鍗哥璧佹儏鍐�")
+ @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
+ public CommonResult<DevRentRespVO> getDismantledRent( @Valid DevRentSearchReqVO searchReqVO )
+ {
+ DevRentDO devRent = devRentService.getDismantledRent( searchReqVO );
+ if (null == devRent) {
+ return CommonResult.success(null);
+ }
+
+ DeviceDO deviceDO = deviceService.getDevice( devRent.getDevId() );
+
+ DevRentRespVO devRentRespVO = BeanUtils.toBean(devRent, DevRentRespVO.class);
+ devRentRespVO.setCategory( deviceDO.getCategory() );
+ devRentRespVO.setBrand( deviceDO.getBrand() );
+ devRentRespVO.setModel( deviceDO.getModel() );
+ return CommonResult.success(devRentRespVO);
+ }
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevCancelReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevCancelReqVO.java
index 73b2041..b191139 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevCancelReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevCancelReqVO.java
@@ -1,5 +1,6 @@
package cn.lihu.jh.module.ecg.controller.admin.devrent.vo;
+import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -30,6 +31,9 @@
@Schema(description = "鎷嗘満鏃堕棿")
private LocalDateTime returnTime;
+ @Schema(description = "褰曞叆鏃堕棿")
+ private LocalDateTime entryTime;
+
@Schema(description = "骞叉壈鏁�")
private Integer interference;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java
index 7bc89a0..196948e 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java
@@ -33,6 +33,10 @@
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] returnTime;
+ @Schema(description = "褰曞叆鏃堕棿")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] entryTime;
+
@Schema(description = "骞叉壈鏁�")
private Integer interference;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
index 52c82fc..cac4e41 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
@@ -36,6 +36,10 @@
@ExcelProperty("鎷嗘満鏃堕棿")
private LocalDateTime returnTime;
+ @Schema(description = "褰曞叆鏃堕棿")
+ @ExcelProperty("褰曞叆鏃堕棿")
+ private LocalDateTime entryTime;
+
@Schema(description = "骞叉壈鏁�")
@ExcelProperty("骞叉壈鏁�")
private Integer interference;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
index 1fc8f39..b3a3d4a 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
@@ -32,6 +32,9 @@
@Schema(description = "鎷嗘満鏃堕棿")
private LocalDateTime returnTime;
+ @Schema(description = "褰曞叆鏃堕棿")
+ private LocalDateTime entryTime;
+
@Schema(description = "骞叉壈鏁�")
private Integer interference;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
index 644ac22..5df61a4 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
@@ -52,6 +52,10 @@
*/
private LocalDateTime returnTime;
/**
+ * 鏁版嵁褰曞叆鏃堕棿
+ */
+ private LocalDateTime entryTime;
+ /**
* 骞叉壈鏁�
*/
private Integer interference;
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java
index 93733c6..b26af12 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java
@@ -47,6 +47,14 @@
Long dismantleOperation(@Valid DevRentSaveReqVO createReqVO);
/**
+ * 鏁版嵁褰曞叆
+ *
+ * @param createReqVO 鍒涘缓淇℃伅
+ * @return 缂栧彿
+ */
+ Long dataEntryOperation(@Valid DevRentSaveReqVO createReqVO);
+
+ /**
* 瑁呮満
*
* @param cancelReqVO 鍒涘缓淇℃伅
@@ -102,4 +110,5 @@
DevRentDO getInstalledOrCancelledRent(DevRentSearchReqVO searchReqVO);
DevRentDO getReadyOrCancelledRent(DevRentSearchReqVO searchReqVO);
+ DevRentDO getDismantledRent(DevRentSearchReqVO searchReqVO);
}
\ 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/devrent/DevRentServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
index 4ccd1fd..12e8e4b 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -213,6 +213,41 @@
}
@Override
+ public Long dataEntryOperation(DevRentSaveReqVO updateReqVO) {
+ updateReqVO.setState( DevRentStateEnum.DATAENTERED.getState() );
+ updateDevRent( updateReqVO );
+
+ Long userId = SecurityFrameworkUtils.getLoginUserId();
+ String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
+
+ JobRecordDO jobRecordDO = jobRecordMapper.selectByRentIdDocId(updateReqVO.getId(), userId);
+ if (jobRecordDO == null) {
+ JobRecordSaveReqVO jobRecordSaveReqVO = new JobRecordSaveReqVO();
+ jobRecordSaveReqVO.setRentId( updateReqVO.getId() );
+ jobRecordSaveReqVO.setDevId( updateReqVO.getDevId() );
+ jobRecordSaveReqVO.setDocId( userId );
+ jobRecordSaveReqVO.setDocName( userNickname );
+ jobRecordSaveReqVO.setPatId( updateReqVO.getPatId() );
+ jobRecordSaveReqVO.setPatName( updateReqVO.getPatName() );
+ jobRecordSaveReqVO.setJobTime( updateReqVO.getReturnTime() );
+ jobRecordSaveReqVO.setJobType( DevRentStateEnum.DATAENTERED.getState() );
+ jobRecordSaveReqVO.setRemark( updateReqVO.getRemark() );
+ jobRecordSaveReqVO.setSummary( updateReqVO.getInterference() + " " + updateReqVO.getBaseline() + " " + updateReqVO.getDetachment() );
+ JobRecordDO jobRecord = BeanUtils.toBean(jobRecordSaveReqVO, JobRecordDO.class);
+ jobRecordMapper.insert(jobRecord);
+ } else {
+ jobRecordDO.setJobType( DevRentStateEnum.DATAENTERED.getState() );
+ jobRecordDO.setJobTime( updateReqVO.getReturnTime() );
+ jobRecordDO.setRemark( updateReqVO.getRemark() );
+ jobRecordDO.setSummary( updateReqVO.getInterference() + " " + updateReqVO.getBaseline() + " " + updateReqVO.getDetachment() );
+ jobRecordDO.setUpdater( String.valueOf(userId) );
+ jobRecordDO.setUpdateTime( LocalDateTime.now() );
+ jobRecordMapper.updateById(jobRecordDO);
+ }
+ return updateReqVO.getId();
+ }
+
+ @Override
@Transactional
public CommonResult<Long> cancelOperation(DevCancelReqVO cancelReqVO) {
Long userId = SecurityFrameworkUtils.getLoginUserId();
@@ -372,6 +407,14 @@
return devRentMapper.getRentByState(searchReqVO);
}
+ @Override
+ public DevRentDO getDismantledRent(DevRentSearchReqVO searchReqVO) {
+ List<Integer> stateList = new ArrayList<>();
+ stateList.add( DevRentStateEnum.DISMANTLED.getState() );
+ searchReqVO.setStateList( stateList );
+ return devRentMapper.getRentByState(searchReqVO);
+ }
+
private Integer markDevRecieved(String devId) {
// 璁惧鏍囨敞 宸查鍙�
DeviceDO deviveDO = deviceMapper.getDeviceByDevId(devId);
--
Gitblit v1.9.3