新增申请单记录 Applyform 相关内容
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run

This commit is contained in:
lxd 2024-07-11 19:47:29 +08:00
parent 6ef2d3e97f
commit 633f93b526
10 changed files with 688 additions and 0 deletions

View File

@ -0,0 +1,96 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.applyform;
import org.springframework.web.bind.annotation.*;
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 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.applyregistration.controller.admin.applyform.vo.*;
import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO;
import cn.iocoder.yudao.module.applyregistration.service.applyform.ApplyformService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 申请登记记录")
@RestController
@RequestMapping("/applyregistration/applyform")
@Validated
public class ApplyformController {
@Resource
private ApplyformService applyformService;
@PostMapping("/create")
@Operation(summary = "创建申请登记记录")
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:create')")
public CommonResult<String> createApplyform(@Valid @RequestBody ApplyformSaveReqVO createReqVO) {
return success(applyformService.createApplyform(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新申请登记记录")
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:update')")
public CommonResult<Boolean> updateApplyform(@Valid @RequestBody ApplyformSaveReqVO updateReqVO) {
applyformService.updateApplyform(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除申请登记记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:delete')")
public CommonResult<Boolean> deleteApplyform(@RequestParam("id") String id) {
applyformService.deleteApplyform(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得申请登记记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:query')")
public CommonResult<ApplyformRespVO> getApplyform(@RequestParam("id") String id) {
ApplyformDO applyform = applyformService.getApplyform(id);
return success(BeanUtils.toBean(applyform, ApplyformRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得申请登记记录分页")
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:query')")
public CommonResult<PageResult<ApplyformRespVO>> getApplyformPage(@Valid ApplyformPageReqVO pageReqVO) {
PageResult<ApplyformDO> pageResult = applyformService.getApplyformPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ApplyformRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出申请登记记录 Excel")
@PreAuthorize("@ss.hasPermission('applyregistration:applyform:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportApplyformExcel(@Valid ApplyformPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ApplyformDO> list = applyformService.getApplyformPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "申请登记记录.xls", "数据", ApplyformRespVO.class,
BeanUtils.toBean(list, ApplyformRespVO.class));
}
}

View File

@ -0,0 +1,82 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo;
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
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ApplyformPageReqVO extends PageParam {
@Schema(description = "登记单号", example = "10624")
private String regId;
@Schema(description = "登记来源")
private String regSource;
@Schema(description = "检查ID", example = "17552")
private String examId;
@Schema(description = "患者姓名", example = "王五")
private String pName;
@Schema(description = "性别")
private String gender;
@Schema(description = "出生日期")
private LocalDateTime birthday;
@Schema(description = "检查日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] examDate;
@Schema(description = "检查项目名称", example = "张三")
private String examItemName;
@Schema(description = "检查设备ID", example = "26048")
private String deviceId;
@Schema(description = "检查设备名称", example = "张三")
private String deviceName;
@Schema(description = "患者联系电话")
private String contactTel;
@Schema(description = "登记时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] regDate;
@Schema(description = "分检时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] sortDate;
@Schema(description = "开单医生")
private String billgDoctor;
@Schema(description = "检查状态", example = "1")
private String examStatus;
@Schema(description = "开单医生科室")
private String billDoctorDepartment;
@Schema(description = "此条记录的创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createDate;
@Schema(description = "检查项目代码")
private String examItemCode;
@Schema(description = "机构ID", example = "31976")
private String orgId;
@Schema(description = "分检医生")
private String sortDoctor;
}

View File

@ -0,0 +1,100 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 ApplyformRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20234")
@ExcelProperty("主键")
private String id;
@Schema(description = "登记单号", example = "10624")
@ExcelProperty("登记单号")
private String regId;
@Schema(description = "登记来源")
@ExcelProperty("登记来源")
private String regSource;
@Schema(description = "检查ID", example = "17552")
@ExcelProperty("检查ID")
private String examId;
@Schema(description = "患者姓名", example = "王五")
@ExcelProperty("患者姓名")
private String pName;
@Schema(description = "性别")
@ExcelProperty("性别")
private String gender;
@Schema(description = "出生日期")
@ExcelProperty("出生日期")
private LocalDateTime birthday;
@Schema(description = "检查日期")
@ExcelProperty("检查日期")
private LocalDateTime examDate;
@Schema(description = "检查项目名称", example = "张三")
@ExcelProperty("检查项目名称")
private String examItemName;
@Schema(description = "检查设备ID", example = "26048")
@ExcelProperty("检查设备ID")
private String deviceId;
@Schema(description = "检查设备名称", example = "张三")
@ExcelProperty("检查设备名称")
private String deviceName;
@Schema(description = "患者联系电话")
@ExcelProperty("患者联系电话")
private String contactTel;
@Schema(description = "登记时间")
@ExcelProperty("登记时间")
private LocalDateTime regDate;
@Schema(description = "分检时间")
@ExcelProperty("分检时间")
private LocalDateTime sortDate;
@Schema(description = "开单医生")
@ExcelProperty("开单医生")
private String billgDoctor;
@Schema(description = "检查状态", example = "1")
@ExcelProperty("检查状态")
private String examStatus;
@Schema(description = "开单医生科室")
@ExcelProperty("开单医生科室")
private String billDoctorDepartment;
@Schema(description = "此条记录的创建时间")
@ExcelProperty("此条记录的创建时间")
private LocalDateTime createDate;
@Schema(description = "检查项目代码")
@ExcelProperty("检查项目代码")
private String examItemCode;
@Schema(description = "机构ID", example = "31976")
@ExcelProperty("机构ID")
private String orgId;
@Schema(description = "分检医生")
@ExcelProperty("分检医生")
private String sortDoctor;
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 申请登记记录新增/修改 Request VO")
@Data
public class ApplyformSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20234")
private String id;
@Schema(description = "登记单号", example = "10624")
private String regId;
@Schema(description = "登记来源")
private String regSource;
@Schema(description = "检查ID", example = "17552")
private String examId;
@Schema(description = "患者姓名", example = "王五")
private String pName;
@Schema(description = "性别")
private String gender;
@Schema(description = "出生日期")
private LocalDateTime birthday;
@Schema(description = "检查日期")
private LocalDateTime examDate;
@Schema(description = "检查项目名称", example = "张三")
private String examItemName;
@Schema(description = "检查设备ID", example = "26048")
private String deviceId;
@Schema(description = "检查设备名称", example = "张三")
private String deviceName;
@Schema(description = "患者联系电话")
private String contactTel;
@Schema(description = "登记时间")
private LocalDateTime regDate;
@Schema(description = "分检时间")
private LocalDateTime sortDate;
@Schema(description = "开单医生")
private String billgDoctor;
@Schema(description = "检查状态", example = "1")
private String examStatus;
@Schema(description = "开单医生科室")
private String billDoctorDepartment;
@Schema(description = "此条记录的创建时间")
private LocalDateTime createDate;
@Schema(description = "检查项目代码")
private String examItemCode;
@Schema(description = "机构ID", example = "31976")
private String orgId;
@Schema(description = "分检医生")
private String sortDoctor;
}

View File

@ -0,0 +1,143 @@
package cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
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_reglist")
@KeySequence("tb_reglist_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApplyformDO {
/**
* 主键
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* 登记单号
*/
@TableField("regId")
private String regId;
/**
* 登记来源
*/
@TableField("regSource")
private String regSource;
/**
* 检查ID
*/
@TableField("examId")
private String examId;
/**
* 患者姓名
*/
@TableField("pName")
private String pName;
/**
* 性别
*/
@TableField("gender")
private String gender;
/**
* 出生日期
*/
@TableField("birthday")
private LocalDateTime birthday;
/**
* 检查日期
*/
@TableField("examDate")
private LocalDateTime examDate;
/**
* 检查项目名称
*/
@TableField("examItemName")
private String examItemName;
/**
* 检查设备ID
*/
@TableField("deviceId")
private String deviceId;
/**
* 检查设备名称
*/
@TableField("deviceName")
private String deviceName;
/**
* 患者联系电话
*/
@TableField("contactTel")
private String contactTel;
/**
* 登记时间
*/
@TableField("regDate")
private LocalDateTime regDate;
/**
* 分检时间
*/
@TableField("sortDate")
private LocalDateTime sortDate;
/**
* 开单医生
*/
@TableField("billgDoctor")
private String billgDoctor;
/**
* 检查状态
*/
@TableField("examStatus")
private String examStatus;
/**
* 开单医生科室
*/
@TableField("billDoctorDepartment")
private String billDoctorDepartment;
/**
* 此条记录的创建时间
*/
@TableField("createDate")
private LocalDateTime createDate;
/**
* 检查项目代码
*/
@TableField("examItemCode")
private String examItemCode;
/**
* 机构ID
*/
@TableField("orgId")
private String orgId;
/**
* 分检医生
*/
@TableField("sortDoctor")
private String sortDoctor;
/**
* 执行科室
*/
@TableField("deviceDepartment")
private String deviceDepartment;
/**
* 执行科室代码
*/
@TableField("departmentCode")
private String departmentCode;
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.applyregistration.dal.mysql.applyform;
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.applyregistration.dal.dataobject.applyform.ApplyformDO;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*;
/**
* 申请登记记录 Mapper
*
* @author 李晓东
*/
@InterceptorIgnore(tenantLine = "true")
@Mapper
public interface ApplyformMapper extends BaseMapperX<ApplyformDO> {
default PageResult<ApplyformDO> selectPage(ApplyformPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ApplyformDO>()
.eqIfPresent(ApplyformDO::getRegId, reqVO.getRegId())
.eqIfPresent(ApplyformDO::getRegSource, reqVO.getRegSource())
.eqIfPresent(ApplyformDO::getExamId, reqVO.getExamId())
.likeIfPresent(ApplyformDO::getPName, reqVO.getPName())
.eqIfPresent(ApplyformDO::getGender, reqVO.getGender())
.eqIfPresent(ApplyformDO::getBirthday, reqVO.getBirthday())
.betweenIfPresent(ApplyformDO::getExamDate, reqVO.getExamDate())
.likeIfPresent(ApplyformDO::getExamItemName, reqVO.getExamItemName())
.eqIfPresent(ApplyformDO::getDeviceId, reqVO.getDeviceId())
.likeIfPresent(ApplyformDO::getDeviceName, reqVO.getDeviceName())
.eqIfPresent(ApplyformDO::getContactTel, reqVO.getContactTel())
.betweenIfPresent(ApplyformDO::getRegDate, reqVO.getRegDate())
.betweenIfPresent(ApplyformDO::getSortDate, reqVO.getSortDate())
.eqIfPresent(ApplyformDO::getBillgDoctor, reqVO.getBillgDoctor())
.eqIfPresent(ApplyformDO::getExamStatus, reqVO.getExamStatus())
.eqIfPresent(ApplyformDO::getBillDoctorDepartment, reqVO.getBillDoctorDepartment())
.betweenIfPresent(ApplyformDO::getCreateDate, reqVO.getCreateDate())
.eqIfPresent(ApplyformDO::getExamItemCode, reqVO.getExamItemCode())
.eqIfPresent(ApplyformDO::getOrgId, reqVO.getOrgId())
.eqIfPresent(ApplyformDO::getSortDoctor, reqVO.getSortDoctor())
.orderByDesc(ApplyformDO::getId));
}
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.applyregistration.service.applyform;
import java.util.*;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*;
import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 申请登记记录 Service 接口
*
* @author 李晓东
*/
public interface ApplyformService {
/**
* 创建申请登记记录
*
* @param createReqVO 创建信息
* @return 编号
*/
String createApplyform(@Valid ApplyformSaveReqVO createReqVO);
/**
* 更新申请登记记录
*
* @param updateReqVO 更新信息
*/
void updateApplyform(@Valid ApplyformSaveReqVO updateReqVO);
/**
* 删除申请登记记录
*
* @param id 编号
*/
void deleteApplyform(String id);
/**
* 获得申请登记记录
*
* @param id 编号
* @return 申请登记记录
*/
ApplyformDO getApplyform(String id);
/**
* 获得申请登记记录分页
*
* @param pageReqVO 分页查询
* @return 申请登记记录分页
*/
PageResult<ApplyformDO> getApplyformPage(ApplyformPageReqVO pageReqVO);
}

View File

@ -0,0 +1,76 @@
package cn.iocoder.yudao.module.applyregistration.service.applyform;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.applyregistration.controller.admin.applyform.vo.*;
import cn.iocoder.yudao.module.applyregistration.dal.dataobject.applyform.ApplyformDO;
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.applyregistration.dal.mysql.applyform.ApplyformMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 申请登记记录 Service 实现类
*
* @author 李晓东
*/
@Service
@Validated
public class ApplyformServiceImpl implements ApplyformService {
@Resource
private ApplyformMapper applyformMapper;
@Override
public String createApplyform(ApplyformSaveReqVO createReqVO) {
// 插入
ApplyformDO applyform = BeanUtils.toBean(createReqVO, ApplyformDO.class);
applyformMapper.insert(applyform);
// 返回
return applyform.getId();
}
@Override
public void updateApplyform(ApplyformSaveReqVO updateReqVO) {
// 校验存在
validateApplyformExists(updateReqVO.getId());
// 更新
ApplyformDO updateObj = BeanUtils.toBean(updateReqVO, ApplyformDO.class);
applyformMapper.updateById(updateObj);
}
@Override
public void deleteApplyform(String id) {
// 校验存在
validateApplyformExists(id);
// 删除
applyformMapper.deleteById(id);
}
private void validateApplyformExists(String id) {
if (applyformMapper.selectById(id) == null) {
throw exception(new ErrorCode(1,""));
}
}
@Override
public ApplyformDO getApplyform(String id) {
return applyformMapper.selectById(id);
}
@Override
public PageResult<ApplyformDO> getApplyformPage(ApplyformPageReqVO pageReqVO) {
return applyformMapper.selectPage(pageReqVO);
}
}

View File

@ -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.applyregistration.dal.mysql.applyform.ApplyformMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>