diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-api/src/main/java/cn/iocoder/yudao/module/applyregistration/enums/ErrorCodeConstants_手动操作.java b/yudao-module-applyregistration/yudao-module-applyregistration-api/src/main/java/cn/iocoder/yudao/module/applyregistration/enums/ErrorCodeConstants_手动操作.java new file mode 100644 index 000000000..e69de29bb diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java new file mode 100644 index 000000000..bbcbb45a4 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/ApplyformController.java @@ -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 createApplyform(@Valid @RequestBody ApplyformSaveReqVO createReqVO) { + return success(applyformService.createApplyform(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新申请登记记录") + @PreAuthorize("@ss.hasPermission('applyregistration:applyform:update')") + public CommonResult 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 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 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> getApplyformPage(@Valid ApplyformPageReqVO pageReqVO) { + PageResult 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 list = applyformService.getApplyformPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "申请登记记录.xls", "数据", ApplyformRespVO.class, + BeanUtils.toBean(list, ApplyformRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformPageReqVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformPageReqVO.java new file mode 100644 index 000000000..8736a1534 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformRespVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformRespVO.java new file mode 100644 index 000000000..872634667 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformSaveReqVO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformSaveReqVO.java new file mode 100644 index 000000000..51d543dd4 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/controller/admin/applyform/vo/ApplyformSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/dataobject/applyform/ApplyformDO.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/dataobject/applyform/ApplyformDO.java new file mode 100644 index 000000000..08dd319b2 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/dataobject/applyform/ApplyformDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/mysql/applyform/ApplyformMapper.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/mysql/applyform/ApplyformMapper.java new file mode 100644 index 000000000..d555d8f33 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/mysql/applyform/ApplyformMapper.java @@ -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 { + + default PageResult selectPage(ApplyformPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java new file mode 100644 index 000000000..d5d9b7bbe --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformService.java @@ -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 getApplyformPage(ApplyformPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java new file mode 100644 index 000000000..a8ea03313 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/ApplyformServiceImpl.java @@ -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 getApplyformPage(ApplyformPageReqVO pageReqVO) { + return applyformMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/resources/mapper/applyform/ApplyformMapper.xml b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/resources/mapper/applyform/ApplyformMapper.xml new file mode 100644 index 000000000..fd5c24718 --- /dev/null +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/resources/mapper/applyform/ApplyformMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file