新增患者组件相关接口
This commit is contained in:
parent
2c893eeec3
commit
8f00d081e4
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.ecgdata;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -67,6 +68,13 @@ public class ecgdataController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/insertEcgPatientData")
|
||||
@Operation(summary = "插入动态心电数据表基础信息")
|
||||
public CommonResult<Boolean> insertEcgDataList(@RequestBody List<patientinfoRespVO> patientInfoList) {
|
||||
ecgdataService.insertEcgDataList(patientInfoList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得心电图动态数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
|
||||
@ -44,7 +44,7 @@ public class patientinfoRespVO {
|
||||
|
||||
@Schema(description = "性别:0-未知,1-男,2-女")
|
||||
@ExcelProperty("性别:0-未知,1-男,2-女")
|
||||
private Integer gender;
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
@ExcelProperty("出生日期")
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.ecgdata;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.ecgdata.ecgdataDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
@ -58,5 +59,8 @@ public interface ecgdataService {
|
||||
* @return 心电图动态数据分页
|
||||
*/
|
||||
PageResult<ecgdataDO> getecgdataPage(ecgdataPageReqVO pageReqVO);
|
||||
|
||||
/*
|
||||
* 插入ecgdata数据表基础信息
|
||||
* */
|
||||
void insertEcgDataList(List<patientinfoRespVO> patientInfoList);
|
||||
}
|
||||
@ -1,24 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.service.ecgdata;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.ecgdata.ecgdataDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.ecgdata.ecgdataMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 心电图动态数据 Service 实现类
|
||||
@ -86,5 +83,25 @@ public class ecgdataServiceImpl implements ecgdataService {
|
||||
public PageResult<ecgdataDO> getecgdataPage(ecgdataPageReqVO pageReqVO) {
|
||||
return ecgdataMapper.selectPage(pageReqVO);
|
||||
}
|
||||
@Override
|
||||
public void insertEcgDataList(List<patientinfoRespVO> patientInfoList) {
|
||||
if (CollUtil.isNotEmpty(patientInfoList)) {
|
||||
List<ecgdataDO> ecgDataList = new ArrayList<>();
|
||||
for (patientinfoRespVO patientInfo : patientInfoList) {
|
||||
ecgdataDO ecgdata = new ecgdataDO();
|
||||
|
||||
ecgdata.setRegid(patientInfo.getRegid());
|
||||
String examId = UUID.randomUUID().toString().replaceAll("-", ""); // 去除横线保持简洁
|
||||
ecgdata.setExamid(examId);
|
||||
ecgdata.setName(patientInfo.getName());
|
||||
ecgdata.setGender(patientInfo.getGender());
|
||||
// ecgdata.setAge(patientInfo.getAge())
|
||||
ecgdata.setOrgid(patientInfo.getOrgid());
|
||||
ecgdata.setOrgname(patientInfo.getOrgname());
|
||||
ecgDataList.add(ecgdata);
|
||||
}
|
||||
// 批量插入心电图数据
|
||||
ecgdataMapper.insertBatch(ecgDataList);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user