From 86bb056b91af5c9c99a482eaac114c4f6214d7c4 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 26 九月 2024 17:49:40 +0800
Subject: [PATCH] 设备准备-确费功能
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/jobrecord/vo/JobRecordRespVO.java | 5 ++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/jobrecord/JobRecordServiceImpl.java | 18 ++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java | 12 ++++++
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/dal/dataobject/devmanage/DeviceDO.java | 2
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentPageReqVO.java | 3 +
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/dal/dataobject/jobrecord/JobRecordDO.java | 4 +
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java | 6 +-
10 files changed, 53 insertions(+), 8 deletions(-)
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 196948e..350d7b7 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
@@ -52,6 +52,9 @@
@Schema(description = "鐘舵��")
private Integer state;
+ @Schema(description = "宸蹭粯娆�")
+ private Integer paid;
+
@Schema(description = "鍒涘缓鏃堕棿")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
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 cac4e41..e42ab71 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
@@ -60,6 +60,10 @@
@ExcelProperty("鐘舵��")
private Integer state;
+ @Schema(description = "宸蹭粯娆�")
+ @ExcelProperty("宸蹭粯娆�")
+ private Integer paid;
+
@Schema(description = "鍒涘缓鏃堕棿", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("鍒涘缓鏃堕棿")
private LocalDateTime createTime;
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 b3a3d4a..7dcc3b3 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
@@ -49,4 +49,7 @@
@Schema(description = "鐘舵��")
private Integer state;
+
+ @Schema(description = "宸蹭粯娆�")
+ private Integer paid;
}
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
index fde9212..f0015b1 100644
--- 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
@@ -60,4 +60,7 @@
@ExcelProperty("瀵瑰簲绉熻祦缂栧彿")
private Long rentId;
-}
\ No newline at end of file
+ @Schema(description = "宸茬即璐�", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty("宸茬即璐�")
+ private Integer paid;
+}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
index f281703..fa7ab6a 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
@@ -53,7 +53,7 @@
/**
* 閬楀け鏃ユ湡
*/
- @TableField(updateStrategy = FieldStrategy.IGNORED)
+ @TableField(updateStrategy = FieldStrategy.ALWAYS)
private LocalDate loseDate;
/**
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 5df61a4..e6116dd 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
@@ -33,7 +33,7 @@
/**
* 璁惧缂栧彿
*/
- @TableField(updateStrategy = FieldStrategy.IGNORED)
+ @TableField(updateStrategy = FieldStrategy.ALWAYS)
private String devId;
/**
* 鎮h�呯紪鍙�
@@ -76,4 +76,6 @@
* @see DevRentStateEnum
*/
private Integer state;
+
+ private Integer paid;
}
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
index b6bb350..5d7f73c 100644
--- 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
@@ -43,7 +43,7 @@
/**
* 璁惧缂栧彿
*/
- @TableField(updateStrategy = FieldStrategy.IGNORED)
+ @TableField(updateStrategy = FieldStrategy.ALWAYS)
private String devId;
/**
* 鎮h�呯紪鍙�
@@ -71,4 +71,6 @@
*/
private Long rentId;
+ @TableField(exist = false)
+ private Integer paid;
}
\ 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/devrent/DevRentMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
index 87ed479..fa98d89 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
@@ -6,6 +6,7 @@
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.devrent.DevRentDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
import org.apache.ibatis.annotations.Param;
@@ -38,4 +39,15 @@
@Select("select * from lihu.dev_rent where state=#{state} and pat_id=#{patId}")
List<DevRentDO> selectByPatIdAndState(@Param("patId") String patId, @Param("state") Integer state);
+
+
+ @Select("<script>" +
+ "SELECT paid FROM lihu.dev_rent " +
+ "where id in (" +
+ " <foreach collection='rentIdList' separator=',' item='rentId'>" +
+ " #{rentId} " +
+ " </foreach> )" +
+ "</script>")
+ List<Integer> getPaidInfo(@Param("rentIdList")List<Long> rentIdList);
+
}
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 12e8e4b..12bcbc7 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
@@ -229,7 +229,7 @@
jobRecordSaveReqVO.setDocName( userNickname );
jobRecordSaveReqVO.setPatId( updateReqVO.getPatId() );
jobRecordSaveReqVO.setPatName( updateReqVO.getPatName() );
- jobRecordSaveReqVO.setJobTime( updateReqVO.getReturnTime() );
+ jobRecordSaveReqVO.setJobTime( updateReqVO.getEntryTime() );
jobRecordSaveReqVO.setJobType( DevRentStateEnum.DATAENTERED.getState() );
jobRecordSaveReqVO.setRemark( updateReqVO.getRemark() );
jobRecordSaveReqVO.setSummary( updateReqVO.getInterference() + " " + updateReqVO.getBaseline() + " " + updateReqVO.getDetachment() );
@@ -237,11 +237,11 @@
jobRecordMapper.insert(jobRecord);
} else {
jobRecordDO.setJobType( DevRentStateEnum.DATAENTERED.getState() );
- jobRecordDO.setJobTime( updateReqVO.getReturnTime() );
+ jobRecordDO.setJobTime( updateReqVO.getEntryTime() );
jobRecordDO.setRemark( updateReqVO.getRemark() );
jobRecordDO.setSummary( updateReqVO.getInterference() + " " + updateReqVO.getBaseline() + " " + updateReqVO.getDetachment() );
jobRecordDO.setUpdater( String.valueOf(userId) );
- jobRecordDO.setUpdateTime( LocalDateTime.now() );
+ //jobRecordDO.setUpdateTime( LocalDateTime.now() );
jobRecordMapper.updateById(jobRecordDO);
}
return updateReqVO.getId();
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
index a04aeb5..1c439bb 100644
--- 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
@@ -1,6 +1,8 @@
package cn.lihu.jh.module.ecg.service.jobrecord;
+import cn.lihu.jh.module.ecg.controller.admin.appointment.vo.AppointmentRespVO;
import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO;
+import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
@@ -18,6 +20,7 @@
import javax.annotation.Resource;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.lihu.jh.framework.common.pojo.CommonResult.success;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
/**
@@ -31,6 +34,9 @@
@Resource
private JobRecordMapper jobRecordMapper;
+
+ @Resource
+ private DevRentMapper devRentMapper;
@Override
public Long createJobRecord(JobRecordSaveReqVO createReqVO) {
@@ -71,7 +77,17 @@
@Override
public PageResult<JobRecordDO> getJobRecordPage(JobRecordPageReqVO pageReqVO) {
- return jobRecordMapper.selectPage(pageReqVO);
+ PageResult<JobRecordDO> pageResult = jobRecordMapper.selectPage(pageReqVO);
+
+ List<JobRecordDO> jobRecordDOList = pageResult.getList();
+ List<Long> rentIdList = jobRecordDOList.stream().map(item -> item.getRentId()).toList();
+ List<Integer> paidInfoList = devRentMapper.getPaidInfo( rentIdList );
+
+ for (int i = 0; i < jobRecordDOList.size(); i++) {
+ jobRecordDOList.get(i).setPaid(paidInfoList.get(i));
+ }
+
+ return pageResult;
}
@Override
--
Gitblit v1.9.3