新增动态血氧界面的相关功能
This commit is contained in:
parent
a6412faf18
commit
82cafc166b
@ -0,0 +1,138 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.spo2info;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.ecgdataSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.upecgdatawearstarttime;
|
||||
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;
|
||||
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 javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.spo2info.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.spo2info.Spo2infoDO;
|
||||
import cn.iocoder.yudao.module.system.service.spo2info.Spo2infoService;
|
||||
|
||||
@Tag(name = "管理后台 - 血氧信息")
|
||||
@RestController
|
||||
@RequestMapping("/system/spo2info")
|
||||
@Validated
|
||||
public class Spo2infoController {
|
||||
|
||||
@Resource
|
||||
private Spo2infoService spo2infoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建血氧信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:create')")
|
||||
public CommonResult<Integer> createSpo2info(@Valid @RequestBody Spo2infoSaveReqVO createReqVO) {
|
||||
return success(spo2infoService.createSpo2info(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新血氧信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:update')")
|
||||
public CommonResult<Boolean> updateSpo2info(@Valid @RequestBody Spo2infoSaveReqVO updateReqVO) {
|
||||
spo2infoService.updateSpo2info(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/insert-spo2-data-list")
|
||||
@Operation(summary = "插入动态血氧数据表基础信息")
|
||||
public CommonResult<Boolean> insertSpo2DataList(@Valid @RequestBody List<patientinfoRespVO> patientInfoList) {
|
||||
spo2infoService.insertSpo2DataList(patientInfoList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除血氧信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:delete')")
|
||||
public CommonResult<Boolean> deleteSpo2info(@RequestParam("id") Integer id) {
|
||||
spo2infoService.deleteSpo2info(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/apply-superior-review")
|
||||
@Operation(summary = "申请上级审核")
|
||||
public CommonResult<Boolean> applySuperiorReview(@RequestParam("id") Integer id,@RequestParam("orgid") String orgid) {
|
||||
spo2infoService.applySuperiorReview(id,orgid);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updevice")
|
||||
@Operation(summary = "更新设备信息")
|
||||
public CommonResult<Boolean> updevice( @Valid @RequestBody updeviceinfo updeviceinfo) {
|
||||
spo2infoService.updevice(updeviceinfo.getId(),updeviceinfo.getDeviceid(),updeviceinfo.getDevicename());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-wearstarttime")
|
||||
@Operation(summary = "更新佩戴时间")
|
||||
public CommonResult<Boolean> updateecgdatawearstarttime(@Valid @RequestBody upecgdatawearstarttime updateReqVO) {
|
||||
spo2infoService.updateecgdatawearstarttime(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除血氧信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:delete')")
|
||||
public CommonResult<Boolean> deleteSpo2infoList(@RequestParam("ids") List<Integer> ids) {
|
||||
spo2infoService.deleteSpo2infoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得血氧信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:query')")
|
||||
public CommonResult<Spo2infoRespVO> getSpo2info(@RequestParam("id") Integer id) {
|
||||
Spo2infoDO spo2info = spo2infoService.getSpo2info(id);
|
||||
return success(BeanUtils.toBean(spo2info, Spo2infoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得血氧信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:query')")
|
||||
public CommonResult<PageResult<Spo2infoRespVO>> getSpo2infoPage(@Valid Spo2infoPageReqVO pageReqVO) {
|
||||
PageResult<Spo2infoDO> pageResult = spo2infoService.getSpo2infoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, Spo2infoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出血氧信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:spo2info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSpo2infoExcel(@Valid Spo2infoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<Spo2infoDO> list = spo2infoService.getSpo2infoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "血氧信息.xls", "数据", Spo2infoRespVO.class,
|
||||
BeanUtils.toBean(list, Spo2infoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.spo2info.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 血氧信息分页 Request VO")
|
||||
@Data
|
||||
public class Spo2infoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "注册ID", example = "16770")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "3832")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "姓名", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] weartime;
|
||||
|
||||
@Schema(description = "设备ID", example = "4425")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "机构ID", example = "17686")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "上级请求")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updatetime;
|
||||
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String idcard;
|
||||
|
||||
@Schema(description = "诊断内容")
|
||||
private String diagnosis;
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.spo2info.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 Spo2infoRespVO {
|
||||
|
||||
@Schema(description = "主键ID,自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "25060")
|
||||
@ExcelProperty("主键ID,自增")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "注册ID", example = "16770")
|
||||
@ExcelProperty("注册ID")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "3832")
|
||||
@ExcelProperty("检查ID")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "姓名", example = "王五")
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
@ExcelProperty("性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@ExcelProperty("年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
@ExcelProperty("佩戴时间")
|
||||
private LocalDateTime weartime;
|
||||
|
||||
@Schema(description = "设备ID", example = "4425")
|
||||
@ExcelProperty("设备ID")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
@ExcelProperty("设备名称")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
@ExcelProperty("管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "机构ID", example = "17686")
|
||||
@ExcelProperty("机构ID")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
@ExcelProperty("机构名称")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "上级请求")
|
||||
@ExcelProperty("上级请求")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
@ExcelProperty("身份证")
|
||||
private String idcard;
|
||||
|
||||
@Schema(description = "诊断内容")
|
||||
private String diagnosis;
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.spo2info.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 血氧信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class Spo2infoSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID,自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "25060")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "注册ID", example = "16770")
|
||||
private String regid;
|
||||
|
||||
@Schema(description = "检查ID", example = "3832")
|
||||
private String examid;
|
||||
|
||||
@Schema(description = "姓名", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "佩戴时间")
|
||||
|
||||
private LocalDateTime weartime;
|
||||
|
||||
@Schema(description = "设备ID", example = "4425")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "芋艿")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "管理机构")
|
||||
private String managerorg;
|
||||
|
||||
@Schema(description = "机构ID", example = "17686")
|
||||
private String orgid;
|
||||
|
||||
@Schema(description = "机构名称", example = "张三")
|
||||
private String orgname;
|
||||
|
||||
@Schema(description = "上级请求")
|
||||
private Integer superiorrequest;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String idcard;
|
||||
|
||||
@Schema(description = "诊断内容")
|
||||
private String diagnosis;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.spo2info.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class updeviceinfo {
|
||||
@Schema(description = "id")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
|
||||
private String devicename;
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.spo2info;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 血氧信息 DO
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@TableName("tb_spo2info")
|
||||
@KeySequence("tb_spo2info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Spo2infoDO {
|
||||
|
||||
/**
|
||||
* 主键ID,自增
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 注册ID
|
||||
*/
|
||||
@TableField("regid")
|
||||
private String regid;
|
||||
/**
|
||||
* 检查ID
|
||||
*/
|
||||
@TableField("examid")
|
||||
private String examid;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableField("name")
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@TableField("gender")
|
||||
private String gender;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@TableField("age")
|
||||
private Integer age;
|
||||
/**
|
||||
* 佩戴时间
|
||||
*/
|
||||
@TableField("weartime")
|
||||
private LocalDateTime weartime;
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableField("deviceid")
|
||||
private String deviceid;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("devicename")
|
||||
private String devicename;
|
||||
/**
|
||||
* 管理机构
|
||||
*/
|
||||
@TableField("managerorg")
|
||||
private String managerorg;
|
||||
/**
|
||||
* 机构ID
|
||||
*/
|
||||
@TableField("orgid")
|
||||
private String orgid;
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@TableField("orgname")
|
||||
private String orgname;
|
||||
/**
|
||||
* 上级请求
|
||||
*/
|
||||
@TableField("superiorrequest")
|
||||
private Integer superiorrequest;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createtime")
|
||||
private LocalDateTime createtime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updatetime")
|
||||
private LocalDateTime updatetime;
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
@TableField("idcard")
|
||||
private String idcard;
|
||||
|
||||
@TableField("diagnosis")
|
||||
private String diagnosis;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.spo2info;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.spo2info.Spo2infoDO;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.spo2info.vo.*;
|
||||
|
||||
/**
|
||||
* 血氧信息 Mapper
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@Mapper
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
public interface Spo2infoMapper extends BaseMapperX<Spo2infoDO> {
|
||||
|
||||
default PageResult<Spo2infoDO> selectPage(Spo2infoPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<Spo2infoDO>()
|
||||
.eqIfPresent(Spo2infoDO::getRegid, reqVO.getRegid())
|
||||
.eqIfPresent(Spo2infoDO::getExamid, reqVO.getExamid())
|
||||
.likeIfPresent(Spo2infoDO::getName, reqVO.getName())
|
||||
.eqIfPresent(Spo2infoDO::getGender, reqVO.getGender())
|
||||
.eqIfPresent(Spo2infoDO::getAge, reqVO.getAge())
|
||||
.betweenIfPresent(Spo2infoDO::getWeartime, reqVO.getWeartime())
|
||||
.eqIfPresent(Spo2infoDO::getDeviceid, reqVO.getDeviceid())
|
||||
.likeIfPresent(Spo2infoDO::getDevicename, reqVO.getDevicename())
|
||||
.eqIfPresent(Spo2infoDO::getManagerorg, reqVO.getManagerorg())
|
||||
.eqIfPresent(Spo2infoDO::getOrgid, reqVO.getOrgid())
|
||||
.likeIfPresent(Spo2infoDO::getOrgname, reqVO.getOrgname())
|
||||
.eqIfPresent(Spo2infoDO::getSuperiorrequest, reqVO.getSuperiorrequest())
|
||||
.betweenIfPresent(Spo2infoDO::getCreatetime, reqVO.getCreatetime())
|
||||
.betweenIfPresent(Spo2infoDO::getUpdatetime, reqVO.getUpdatetime())
|
||||
.orderByDesc(Spo2infoDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.system.service.spo2info;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.upecgdatawearstarttime;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.spo2info.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.spo2info.Spo2infoDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 血氧信息 Service 接口
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
public interface Spo2infoService {
|
||||
|
||||
/**
|
||||
* 创建血氧信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createSpo2info(@Valid Spo2infoSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新血氧信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSpo2info(@Valid Spo2infoSaveReqVO updateReqVO);
|
||||
/*
|
||||
* 批量新增血氧数据
|
||||
* */
|
||||
void insertSpo2DataList(List<patientinfoRespVO> patientInfoList);
|
||||
|
||||
/**
|
||||
* 删除血氧信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSpo2info(Integer id);
|
||||
/*
|
||||
* 更新上级机构字段和状态
|
||||
*
|
||||
* */
|
||||
void applySuperiorReview(Integer id, String orgid);
|
||||
/*
|
||||
* 更新设备ID 设备名称
|
||||
* */
|
||||
void updevice(Integer id, String deviceid, String devicename);
|
||||
/*
|
||||
* 更新佩戴时间
|
||||
* */
|
||||
void updateecgdatawearstarttime(upecgdatawearstarttime wearstarttimevo);
|
||||
|
||||
/**
|
||||
* 批量删除血氧信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteSpo2infoListByIds(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得血氧信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 血氧信息
|
||||
*/
|
||||
Spo2infoDO getSpo2info(Integer id);
|
||||
|
||||
/**
|
||||
* 获得血氧信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 血氧信息分页
|
||||
*/
|
||||
PageResult<Spo2infoDO> getSpo2infoPage(Spo2infoPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package cn.iocoder.yudao.module.system.service.spo2info;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.ecgdata.vo.upecgdatawearstarttime;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.patientinfo.vo.patientinfoRespVO;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.spo2info.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.spo2info.Spo2infoDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.spo2info.Spo2infoMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
/**
|
||||
* 血氧信息 Service 实现类
|
||||
*
|
||||
* @author 艾康菲
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class Spo2infoServiceImpl implements Spo2infoService {
|
||||
|
||||
@Resource
|
||||
private Spo2infoMapper spo2infoMapper;
|
||||
|
||||
@Override
|
||||
public Integer createSpo2info(Spo2infoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
Spo2infoDO spo2info = BeanUtils.toBean(createReqVO, Spo2infoDO.class);
|
||||
spo2infoMapper.insert(spo2info);
|
||||
// 返回
|
||||
return spo2info.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSpo2info(Spo2infoSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSpo2infoExists(updateReqVO.getId());
|
||||
// 更新
|
||||
Spo2infoDO updateObj = BeanUtils.toBean(updateReqVO, Spo2infoDO.class);
|
||||
spo2infoMapper.updateById(updateObj);
|
||||
}
|
||||
@Override
|
||||
public void insertSpo2DataList(List<patientinfoRespVO> patientInfoList) {
|
||||
if (CollUtil.isNotEmpty(patientInfoList)) {
|
||||
List<Spo2infoDO> spo2infoDOList = new ArrayList<>();
|
||||
for (patientinfoRespVO patientInfo : patientInfoList) {
|
||||
Spo2infoDO spo2infoDO = new Spo2infoDO();
|
||||
|
||||
spo2infoDO.setRegid(patientInfo.getRegid());
|
||||
String examId = UUID.randomUUID().toString().replaceAll("-", ""); // 去除横线保持简洁
|
||||
spo2infoDO.setExamid(examId);
|
||||
spo2infoDO.setName(patientInfo.getName());
|
||||
spo2infoDO.setGender(patientInfo.getGender());
|
||||
// 根据身份证号计算年龄
|
||||
String idCard = patientInfo.getIdcard();
|
||||
if (StringUtils.isNotBlank(idCard)) {
|
||||
Integer age = NumberUtils.calculateAgeFromIdCard(idCard);
|
||||
spo2infoDO.setAge(age);
|
||||
}
|
||||
spo2infoDO.setOrgid(patientInfo.getOrgid());
|
||||
spo2infoDO.setOrgname(patientInfo.getOrgname());
|
||||
spo2infoDOList.add(spo2infoDO);
|
||||
}
|
||||
// 批量插入血氧数据
|
||||
spo2infoMapper.insertBatch(spo2infoDOList);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void deleteSpo2info(Integer id) {
|
||||
// 校验存在
|
||||
validateSpo2infoExists(id);
|
||||
// 删除
|
||||
spo2infoMapper.deleteById(id);
|
||||
}
|
||||
@Override
|
||||
public void applySuperiorReview(Integer id, String orgid)
|
||||
{
|
||||
Spo2infoSaveReqVO updateReqVO = new Spo2infoSaveReqVO();
|
||||
updateReqVO.setId(id);
|
||||
updateReqVO.setManagerorg(orgid);
|
||||
updateReqVO.setSuperiorrequest(1);
|
||||
Spo2infoDO updateObj = BeanUtils.toBean(updateReqVO, Spo2infoDO.class);
|
||||
spo2infoMapper.updateById(updateObj);
|
||||
}
|
||||
@Override
|
||||
public void updevice(Integer id, String deviceid, String devicename)
|
||||
{
|
||||
Spo2infoSaveReqVO updateReqVO = new Spo2infoSaveReqVO();
|
||||
updateReqVO.setId(id);
|
||||
updateReqVO.setDeviceid(deviceid);
|
||||
updateReqVO.setDevicename(devicename);
|
||||
Spo2infoDO updateObj = BeanUtils.toBean(updateReqVO, Spo2infoDO.class);
|
||||
spo2infoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateecgdatawearstarttime(upecgdatawearstarttime wearstarttimevo)
|
||||
{
|
||||
Spo2infoSaveReqVO updateReqVO = new Spo2infoSaveReqVO();
|
||||
updateReqVO.setId(wearstarttimevo.getId());
|
||||
updateReqVO.setWeartime(wearstarttimevo.getWearstarttime());
|
||||
Spo2infoDO updateObj = BeanUtils.toBean(updateReqVO, Spo2infoDO.class);
|
||||
spo2infoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSpo2infoListByIds(List<Integer> ids) {
|
||||
// 校验存在
|
||||
validateSpo2infoExists(ids);
|
||||
// 删除
|
||||
spo2infoMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateSpo2infoExists(List<Integer> ids) {
|
||||
List<Spo2infoDO> list = spo2infoMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void validateSpo2infoExists(Integer id) {
|
||||
if (spo2infoMapper.selectById(id) == null) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spo2infoDO getSpo2info(Integer id) {
|
||||
return spo2infoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<Spo2infoDO> getSpo2infoPage(Spo2infoPageReqVO pageReqVO) {
|
||||
return spo2infoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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.iocoder.yudao.module.system.dal.mysql.spo2info.Spo2infoMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user