jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/vo/DeviceRespVO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.controller.admin.devmanage.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -68,4 +69,8 @@ @Schema(description = "æè£ ç¼å·") @ExcelProperty("æè£ ç¼å·") private Long rentId; @Schema(description = "æ£è 详æ ") @ExcelProperty("æ£è 详æ ") private PatDetails patDetails; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.controller.admin.devrent.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -30,7 +31,7 @@ @Schema(description = "æ£è 详æ ", requiredMode = Schema.RequiredMode.REQUIRED, example = "èè¿") @ExcelProperty("æ£è 详æ ") private String patDetails; private PatDetails patDetails; @Schema(description = "è£ æºæ¶é´") @ExcelProperty("è£ æºæ¶é´") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSaveReqVO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.controller.admin.devrent.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -7,6 +8,7 @@ import javax.validation.constraints.NotEmpty; import java.time.LocalDateTime; import java.util.Map; @Schema(description = "管çåå° - è£ æºææºæ°å¢/ä¿®æ¹ Request VO") @Data @@ -62,4 +64,7 @@ @Schema(description = "è¯åºç¼å·") String bedNo; @Schema(description = "æ£è 详æ ") PatDetails patDetails; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueuePageReqVO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.controller.admin.queue.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import lombok.*; import io.swagger.v3.oas.annotations.media.Schema; import cn.lihu.jh.framework.common.pojo.PageParam; @@ -7,6 +8,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -26,7 +28,7 @@ private Boolean patGender; @Schema(description = "æ£è 详æ ") private String patDetails; private PatDetails patDetails; @Schema(description = "é¢çº¦æ¥æ") private LocalDate bookDate; jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueRespVO.java
@@ -1,10 +1,13 @@ package cn.lihu.jh.module.ecg.controller.admin.queue.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; import com.alibaba.excel.annotation.*; @Schema(description = "管çåå° - æé Response VO") @@ -30,7 +33,7 @@ @Schema(description = "æ£è 详æ ") @ExcelProperty("æ£è 详æ ") private String patDetails; private PatDetails patDetails; @Schema(description = "é¢çº¦æ¥æ") @ExcelProperty("é¢çº¦æ¥æ") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/queue/vo/QueueSaveReqVO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.controller.admin.queue.vo; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import io.swagger.v3.oas.annotations.media.Schema; @@ -9,6 +10,7 @@ import javax.validation.constraints.NotNull; import java.time.LocalDate; import java.util.List; import java.util.Map; @Schema(description = "管çåå° - æéæ°å¢/ä¿®æ¹ Request VO") @@ -30,7 +32,7 @@ private Byte patGender; @Schema(description = "æ£è 详æ ") private String patDetails; private PatDetails patDetails; @Schema(description = "é¢çº¦æ¥æ", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "é¢çº¦æ¥æä¸è½ä¸ºç©º") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devmanage/DeviceDO.java
@@ -1,5 +1,7 @@ package cn.lihu.jh.module.ecg.dal.dataobject.devmanage; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; import java.time.LocalDate; @@ -14,7 +16,7 @@ * * @author majianbo */ @TableName("device") @TableName(value="device", autoResultMap = true) @KeySequence("device_seq") // ç¨äº OracleãPostgreSQLãKingbaseãDB2ãH2 æ°æ®åºç主é®èªå¢ãå¦ææ¯ MySQL çæ°æ®åºï¼å¯ä¸åã @Data @EqualsAndHashCode(callSuper = true) @@ -75,4 +77,7 @@ @TableField(updateStrategy = FieldStrategy.ALWAYS) private Long rentId; @TableField(typeHandler = JacksonTypeHandler.class) private PatDetails patDetails; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/devrent/DevRentDO.java
@@ -1,6 +1,8 @@ package cn.lihu.jh.module.ecg.dal.dataobject.devrent; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import cn.lihu.jh.module.ecg.enums.DevRentStateEnum; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; import java.util.*; import java.time.LocalDateTime; @@ -15,7 +17,7 @@ * * @author èéæºç */ @TableName("dev_rent") @TableName(value="dev_rent", autoResultMap = true) @KeySequence("dev_rent_seq") // ç¨äº OracleãPostgreSQLãKingbaseãDB2ãH2 æ°æ®åºç主é®èªå¢ãå¦ææ¯ MySQL çæ°æ®åºï¼å¯ä¸åã @Data @EqualsAndHashCode(callSuper = true) @@ -41,7 +43,8 @@ /** * æ£è 详æ */ private String patDetails; @TableField(typeHandler = JacksonTypeHandler.class) private PatDetails patDetails; /** * æ£æ¥ç±»å */ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/patient/PatDetails.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ package cn.lihu.jh.module.ecg.dal.dataobject.patient; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class PatDetails { String Id; String Name; String mobile; String deptCode; String deptDesc; String wardCode; String wardDesc; String bedNo; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueDO.java
@@ -1,5 +1,6 @@ package cn.lihu.jh.module.ecg.dal.dataobject.queue; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; import lombok.*; import com.baomidou.mybatisplus.annotation.*; @@ -7,6 +8,7 @@ import java.time.LocalDate; import java.util.List; import java.util.Map; /** * æé DO @@ -43,7 +45,8 @@ /** * æ£è 详æ */ private String patDetails; @TableField(typeHandler = JacksonTypeHandler.class) private PatDetails patDetails; /** * é¢çº¦æ¥æ */ jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
@@ -10,11 +10,8 @@ import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO; import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceStatisticDO; import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.*; import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; /** * è®¾å¤ Mapper @@ -37,6 +34,9 @@ } @Select("select * from lihu.device where dev_id=#{devId}") @Results({ @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class) }) DeviceDO getDeviceByDevId(@Param("devId") String devId); @Update("update lihu.device set state=#{state}, state_date=#{stateDate} where dev_id=#{devId}") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
@@ -6,10 +6,8 @@ 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 org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.*; import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; /** * è£ æºææº Mapper @@ -56,6 +54,9 @@ "order by create_time desc " + "limit 1 " + "</script>") @Results({ @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class) }) DevRentDO getRentByState(DevRentSearchReqVO reqVO ); @Select("select * from lihu.dev_rent where state=#{state} and pat_id=#{patId} and check_type=#{checkType} and to_days(create_time)=to_days(now())") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
@@ -175,6 +175,9 @@ " </foreach> ) " + " order by status desc, seq_num " + "</script>") @Results({ @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class) }) List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList); @Select("SELECT * from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus} order by seq_num, create_time limit 1") jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/appointment/AppointmentServiceImpl.java
@@ -4,6 +4,7 @@ import cn.lihu.jh.framework.common.util.date.LocalDateTimeUtils; import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO; import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import cn.lihu.jh.module.ecg.feign.RemoteDataService; import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo; import cn.lihu.jh.module.ecg.feign.RestApiResult; @@ -31,7 +32,9 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.lihu.jh.framework.common.pojo.CommonResult.error; @@ -241,7 +244,7 @@ queueSaveReqVO.setIsVip( confirmReqVO.getIsVip() ); queueSaveReqVO.setPassed((byte) 0); queueSaveReqVO.setExpired((byte) 0); queueSaveReqVO.setPatDetails( appointment.getPatDeptDesc() + "-" + appointment.getPatWardDesc() + "-" + appointment.getPatBedNo()); queueSaveReqVO.setPatDetails( getPatDetails(appointment) ); queueService.queue(queueSaveReqVO); } catch (DuplicateKeyException duplicateKeyException) { throw exception(APPOINTMENT_HAVE_QUEUED); @@ -297,4 +300,18 @@ return 0; } } private PatDetails getPatDetails(AppointmentDO appointment) { PatDetails patDetails = new PatDetails(); patDetails.setId( appointment.getPatId() ); patDetails.setName( appointment.getPatName() ); patDetails.setMobile( appointment.getPatMobile() ); patDetails.setDeptCode( appointment.getPatDeptCode() ); patDetails.setDeptDesc( appointment.getPatDeptDesc() ); patDetails.setWardCode( appointment.getPatWardCode() ); patDetails.setWardDesc( appointment.getPatWardDesc() ); patDetails.setBedNo( appointment.getPatBedNo() ); return patDetails; } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -6,6 +6,7 @@ import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO; import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO; import cn.lihu.jh.module.ecg.dal.dataobject.patient.PatDetails; import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; import cn.lihu.jh.module.ecg.dal.mysql.devmanage.DeviceMapper; import cn.lihu.jh.module.ecg.dal.mysql.jobrecord.JobRecordMapper; @@ -22,6 +23,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*; import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO; @@ -155,7 +157,7 @@ Long rent_id = createReqVO.getId(); // dev_rent 表çID // æ æ³¨è®¾å¤ å·²é¢å Integer ret = markDevRecieved(createReqVO.getDevId(), rent_id); Integer ret = markDevRecieved(createReqVO.getDevId(), rent_id, createReqVO.getPatDetails()); if (null == ret || 0 == ret) { throw exception(DEVICE_NOT_FREE); } @@ -706,13 +708,14 @@ } // æ è®° 设å¤å·²è¢«é¢å private Integer markDevRecieved(String devId, Long rentId) { private Integer markDevRecieved(String devId, Long rentId, PatDetails patDetails) { // è®¾å¤æ 注 å·²é¢å DeviceDO deviceDO = deviceMapper.getDeviceByDevId(devId); if (null != deviceDO && DevStateEnum.FREE.isEqual(deviceDO.getState())) { deviceDO.setState( DevStateEnum.RECEIVED.getState() ); deviceDO.setRentId( rentId ); deviceDO.setStateDate( LocalDate.now() ); deviceDO.setPatDetails( patDetails ); return deviceMapper.updateById(deviceDO); } @@ -760,6 +763,7 @@ deviceDO.setState( DevStateEnum.FREE.getState() ); deviceDO.setStateDate( LocalDate.now() ); deviceDO.setRentId(null); deviceDO.setPatDetails(null); return deviceMapper.updateById(deviceDO); }