From 9c04b21f03d19b1d5b2c053adae4f38f70260050 Mon Sep 17 00:00:00 2001 From: "LAPTOP-0SF788NU\\admin" <3306174053@qq.com> Date: Thu, 14 Sep 2023 11:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E9=89=B4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/enums/ErrorCodeConstants.java | 2 + .../authenticate/AuthenticateController.java | 125 ++++++++++++++++++ .../authenticate/vo/AuthenticateBaseVO.java | 66 +++++++++ .../vo/AuthenticateCreateReqVO.java | 14 ++ .../authenticate/vo/AuthenticateExcelVO.java | 69 ++++++++++ .../vo/AuthenticateExportReqVO.java | 63 +++++++++ .../vo/AuthenticatePageReqVO.java | 65 +++++++++ .../authenticate/vo/AuthenticateRespVO.java | 19 +++ .../vo/AuthenticateUpdateReqVO.java | 18 +++ .../authenticate/AuthenticateConvert.java | 34 +++++ .../authenticate/AuthenticateDO.java | 89 +++++++++++++ .../authenticate/AuthenticateMapper.java | 60 +++++++++ .../authenticate/AuthenticateService.java | 70 ++++++++++ .../authenticate/AuthenticateServiceImpl.java | 82 ++++++++++++ .../authenticate/AuthenticateMapper.xml | 12 ++ 15 files changed, 788 insertions(+) create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/AuthenticateController.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateBaseVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateCreateReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExcelVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExportReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticatePageReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateRespVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateUpdateReqVO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/authenticate/AuthenticateConvert.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/authenticate/AuthenticateDO.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/authenticate/AuthenticateMapper.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateService.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateServiceImpl.java create mode 100644 yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/authenticate/AuthenticateMapper.xml diff --git a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java index 6746d127..21060ec4 100644 --- a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java +++ b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ErrorCodeConstants.java @@ -6,4 +6,6 @@ public interface ErrorCodeConstants { ErrorCode CODE_RULE_NOT_EXISTS = new ErrorCode(300100, "编码不存在"); ErrorCode BORROW_APPLY_NOT_EXISTS = new ErrorCode(300200,"借阅申请不存在"); + + ErrorCode AUTHENTICATE_NOT_EXISTS = new ErrorCode(300300,"档案鉴定历史不存在"); } \ No newline at end of file diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/AuthenticateController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/AuthenticateController.java new file mode 100644 index 00000000..3131fccf --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/AuthenticateController.java @@ -0,0 +1,125 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate; + +import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordPageReqVO; +import cn.iocoder.yudao.module.archives.controller.admin.record.vo.RecordUpdateReqVO; +import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; +import cn.iocoder.yudao.module.archives.service.record.RecordService; +import org.apache.poi.hssf.record.Record; +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.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; +import cn.iocoder.yudao.module.archives.convert.authenticate.AuthenticateConvert; +import cn.iocoder.yudao.module.archives.service.authenticate.AuthenticateService; + +@Tag(name = "管理后台 - 档案鉴定历史") +@RestController +@RequestMapping("/archives/authenticate") +@Validated +public class AuthenticateController { + + @Resource + private AuthenticateService authenticateService; + + @Resource + private RecordService recordService; + + + /** + * 获取档案鉴定列表 + * @param recordPageReqVO + * @return + */ + @GetMapping("/get") + @Operation(summary = "获得档案鉴定列表") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('archives:authenticate:query')") + public PageResultgetRecordList(RecordPageReqVO recordPageReqVO){ + recordPageReqVO.setFileStatus("1");//查询已归档的档案 + return recordService.getRecordPage(recordPageReqVO); + } + + @PostMapping("/create") + @Operation(summary = "创建档案鉴定历史") + @PreAuthorize("@ss.hasPermission('archives:authenticate:create')") + public CommonResult createAuthenticate(@Valid @RequestBody AuthenticateCreateReqVO createReqVO) { + return success(authenticateService.createAuthenticate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新档案鉴定历史") + @PreAuthorize("@ss.hasPermission('archives:authenticate:update')") + public CommonResult updateAuthenticate(@Valid @RequestBody AuthenticateUpdateReqVO updateReqVO) { + authenticateService.updateAuthenticate(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除档案鉴定历史") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('archives:authenticate:delete')") + public CommonResult deleteAuthenticate(@RequestParam("id") Long id) { + authenticateService.deleteAuthenticate(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得档案鉴定历史") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('archives:authenticate:query')") + public CommonResult getAuthenticate(@RequestParam("id") Long id) { + AuthenticateDO authenticate = authenticateService.getAuthenticate(id); + return success(AuthenticateConvert.INSTANCE.convert(authenticate)); + } + + @GetMapping("/list") + @Operation(summary = "获得档案鉴定历史列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('archives:authenticate:query')") + public CommonResult> getAuthenticateList(@RequestParam("ids") Collection ids) { + List list = authenticateService.getAuthenticateList(ids); + return success(AuthenticateConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得档案鉴定历史分页") + @PreAuthorize("@ss.hasPermission('archives:authenticate:query')") + public CommonResult> getAuthenticatePage(@Valid AuthenticatePageReqVO pageVO) { + PageResult pageResult = authenticateService.getAuthenticatePage(pageVO); + return success(AuthenticateConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出档案鉴定历史 Excel") + @PreAuthorize("@ss.hasPermission('archives:authenticate:export')") + @OperateLog(type = EXPORT) + public void exportAuthenticateExcel(@Valid AuthenticateExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = authenticateService.getAuthenticateList(exportReqVO); + // 导出 Excel + List datas = AuthenticateConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "档案鉴定.xls", "数据", AuthenticateExcelVO.class, datas); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateBaseVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateBaseVO.java new file mode 100644 index 00000000..d12f610c --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateBaseVO.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +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 java.time.LocalDateTime; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 档案鉴定 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class AuthenticateBaseVO { + + @Schema(description = "档案类型", example = "2") + private String type; + + @Schema(description = "鉴定时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime date; + + @Schema(description = "档案位置") + private String position; + + @Schema(description = "保存期限") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime timeLimit; + + @Schema(description = "归档id", example = "4386") + private Integer recordId; + + @Schema(description = "鉴定人", example = "27064") + private Long userId; + + @Schema(description = "鉴定人名称", example = "李四") + private String userName; + + @Schema(description = "归档名称", example = "李四") + private String recordName; + + @Schema(description = "创建人") + private String createBy; + + @Schema(description = "部门id", example = "5631") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "业务实体id", example = "25023") + private Long companyId; + + @Schema(description = "业务实体名称") + private String company; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateCreateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateCreateReqVO.java new file mode 100644 index 00000000..213e4a3f --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 档案鉴定创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AuthenticateCreateReqVO extends AuthenticateBaseVO { + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExcelVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExcelVO.java new file mode 100644 index 00000000..6f3eb844 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExcelVO.java @@ -0,0 +1,69 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +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 java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 档案鉴定 Excel VO + * + * @author 芋道源码 + */ +@Data +public class AuthenticateExcelVO { + + @ExcelProperty("id") + private Long id; + + @ExcelProperty("档案类型") + private String type; + + @ExcelProperty("鉴定时间") + private LocalDateTime date; + + @ExcelProperty("档案位置") + private String position; + + @ExcelProperty("保存期限") + private LocalDateTime timeLimit; + + @ExcelProperty("归档id") + private Integer recordId; + + @ExcelProperty("鉴定人") + private Long userId; + + @ExcelProperty("鉴定人名称") + private String userName; + + @ExcelProperty("归档名称") + private String recordName; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("创建人") + private String createBy; + + @ExcelProperty("部门id") + private Long deptId; + + @ExcelProperty("部门名称") + private String deptName; + + @ExcelProperty("业务实体id") + private Long companyId; + + @ExcelProperty("业务实体名称") + private String company; + + @ExcelProperty("备注") + private String remark; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExportReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExportReqVO.java new file mode 100644 index 00000000..47e74c22 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateExportReqVO.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 档案鉴定 Excel 导出 Request VO,参数和 AuthenticatePageReqVO 是一致的") +@Data +public class AuthenticateExportReqVO { + + @Schema(description = "档案类型", example = "2") + private String type; + + @Schema(description = "鉴定时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] date; + + @Schema(description = "档案位置") + private String position; + + @Schema(description = "保存期限") + private LocalDateTime timeLimit; + + @Schema(description = "归档id", example = "4386") + private Integer recordId; + + @Schema(description = "鉴定人", example = "27064") + private Long userId; + + @Schema(description = "鉴定人名称", example = "李四") + private String userName; + + @Schema(description = "归档名称", example = "李四") + private String recordName; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "创建人") + private String createBy; + + @Schema(description = "部门id", example = "5631") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "业务实体id", example = "25023") + private Long companyId; + + @Schema(description = "业务实体名称") + private String company; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticatePageReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticatePageReqVO.java new file mode 100644 index 00000000..799a42a4 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticatePageReqVO.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.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 AuthenticatePageReqVO extends PageParam { + + @Schema(description = "档案类型", example = "2") + private String type; + + @Schema(description = "鉴定时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] date; + + @Schema(description = "档案位置") + private String position; + + @Schema(description = "保存期限") + private LocalDateTime timeLimit; + + @Schema(description = "归档id", example = "4386") + private Integer recordId; + + @Schema(description = "鉴定人", example = "27064") + private Long userId; + + @Schema(description = "鉴定人名称", example = "李四") + private String userName; + + @Schema(description = "归档名称", example = "李四") + private String recordName; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "创建人") + private String createBy; + + @Schema(description = "部门id", example = "5631") + private Long deptId; + + @Schema(description = "部门名称", example = "张三") + private String deptName; + + @Schema(description = "业务实体id", example = "25023") + private Long companyId; + + @Schema(description = "业务实体名称") + private String company; + + @Schema(description = "备注", example = "你猜") + private String remark; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateRespVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateRespVO.java new file mode 100644 index 00000000..65fdeed2 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 档案鉴定 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AuthenticateRespVO extends AuthenticateBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23874") + private Long id; + + @Schema(description = "创建时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateUpdateReqVO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateUpdateReqVO.java new file mode 100644 index 00000000..fd96a36f --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/authenticate/vo/AuthenticateUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 档案鉴定更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AuthenticateUpdateReqVO extends AuthenticateBaseVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23874") + @NotNull(message = "id不能为空") + private Long id; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/authenticate/AuthenticateConvert.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/authenticate/AuthenticateConvert.java new file mode 100644 index 00000000..5f98978a --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/convert/authenticate/AuthenticateConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.archives.convert.authenticate; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; + +/** + * 档案鉴定 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface AuthenticateConvert { + + AuthenticateConvert INSTANCE = Mappers.getMapper(AuthenticateConvert.class); + + AuthenticateDO convert(AuthenticateCreateReqVO bean); + + AuthenticateDO convert(AuthenticateUpdateReqVO bean); + + AuthenticateRespVO convert(AuthenticateDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/authenticate/AuthenticateDO.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/authenticate/AuthenticateDO.java new file mode 100644 index 00000000..fa22b5fb --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/dataobject/authenticate/AuthenticateDO.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.archives.dal.dataobject.authenticate; + +import lombok.*; +import java.util.*; +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("archives_authenticate") +@KeySequence("archives_authenticate_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AuthenticateDO extends BaseDO { + + /** + * id + */ + @TableId + private Long id; + /** + * 档案类型 + */ + private String type; + /** + * 鉴定时间 + */ + private LocalDateTime date; + /** + * 档案位置 + */ + private String position; + /** + * 保存期限 + */ + private LocalDateTime timeLimit; + /** + * 归档id + */ + private Integer recordId; + /** + * 鉴定人 + */ + private Long userId; + /** + * 鉴定人名称 + */ + private String userName; + /** + * 归档名称 + */ + private String recordName; + /** + * 创建人 + */ + private String createBy; + /** + * 部门id + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体名称 + */ + private String company; + /** + * 备注 + */ + private String remark; + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/authenticate/AuthenticateMapper.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/authenticate/AuthenticateMapper.java new file mode 100644 index 00000000..e7032afa --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/authenticate/AuthenticateMapper.java @@ -0,0 +1,60 @@ +package cn.iocoder.yudao.module.archives.dal.mysql.authenticate; + +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.archives.dal.dataobject.authenticate.AuthenticateDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; + +/** + * 档案鉴定 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface AuthenticateMapper extends BaseMapperX { + + default PageResult selectPage(AuthenticatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(AuthenticateDO::getType, reqVO.getType()) + .betweenIfPresent(AuthenticateDO::getDate, reqVO.getDate()) + .eqIfPresent(AuthenticateDO::getPosition, reqVO.getPosition()) + .eqIfPresent(AuthenticateDO::getTimeLimit, reqVO.getTimeLimit()) + .eqIfPresent(AuthenticateDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(AuthenticateDO::getUserId, reqVO.getUserId()) + .likeIfPresent(AuthenticateDO::getUserName, reqVO.getUserName()) + .likeIfPresent(AuthenticateDO::getRecordName, reqVO.getRecordName()) + .betweenIfPresent(AuthenticateDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(AuthenticateDO::getCreateBy, reqVO.getCreateBy()) + .eqIfPresent(AuthenticateDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(AuthenticateDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(AuthenticateDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(AuthenticateDO::getCompany, reqVO.getCompany()) + .eqIfPresent(AuthenticateDO::getRemark, reqVO.getRemark()) + .orderByDesc(AuthenticateDO::getId)); + } + + default List selectList(AuthenticateExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(AuthenticateDO::getType, reqVO.getType()) + .betweenIfPresent(AuthenticateDO::getDate, reqVO.getDate()) + .eqIfPresent(AuthenticateDO::getPosition, reqVO.getPosition()) + .eqIfPresent(AuthenticateDO::getTimeLimit, reqVO.getTimeLimit()) + .eqIfPresent(AuthenticateDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(AuthenticateDO::getUserId, reqVO.getUserId()) + .likeIfPresent(AuthenticateDO::getUserName, reqVO.getUserName()) + .likeIfPresent(AuthenticateDO::getRecordName, reqVO.getRecordName()) + .betweenIfPresent(AuthenticateDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(AuthenticateDO::getCreateBy, reqVO.getCreateBy()) + .eqIfPresent(AuthenticateDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(AuthenticateDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(AuthenticateDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(AuthenticateDO::getCompany, reqVO.getCompany()) + .eqIfPresent(AuthenticateDO::getRemark, reqVO.getRemark()) + .orderByDesc(AuthenticateDO::getId)); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateService.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateService.java new file mode 100644 index 00000000..b9b1cb9c --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.archives.service.authenticate; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 档案鉴定 Service 接口 + * + * @author 芋道源码 + */ +public interface AuthenticateService { + + /** + * 创建档案鉴定历史 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createAuthenticate(@Valid AuthenticateCreateReqVO createReqVO); + + /** + * 更新档案鉴定历史 + * + * @param updateReqVO 更新信息 + */ + void updateAuthenticate(@Valid AuthenticateUpdateReqVO updateReqVO); + + /** + * 删除档案鉴定历史 + * + * @param id 编号 + */ + void deleteAuthenticate(Long id); + + /** + * 获得档案鉴定历史 + * + * @param id 编号 + * @return 档案鉴定 + */ + AuthenticateDO getAuthenticate(Long id); + + /** + * 获得档案鉴定历史列表 + * + * @param ids 编号 + * @return 档案鉴定列表 + */ + List getAuthenticateList(Collection ids); + + /** + * 获得档案鉴定历史分页 + * + * @param pageReqVO 分页查询 + * @return 档案鉴定历史分页 + */ + PageResult getAuthenticatePage(AuthenticatePageReqVO pageReqVO); + + /** + * 获得档案鉴定历史列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 档案鉴定历史列表 + */ + List getAuthenticateList(AuthenticateExportReqVO exportReqVO); + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateServiceImpl.java new file mode 100644 index 00000000..178943f3 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/authenticate/AuthenticateServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.archives.service.authenticate; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.archives.controller.admin.authenticate.vo.*; +import cn.iocoder.yudao.module.archives.dal.dataobject.authenticate.AuthenticateDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.archives.convert.authenticate.AuthenticateConvert; +import cn.iocoder.yudao.module.archives.dal.mysql.authenticate.AuthenticateMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.archives.enums.ErrorCodeConstants.*; + +/** + * 档案鉴定 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class AuthenticateServiceImpl implements AuthenticateService { + + @Resource + private AuthenticateMapper authenticateMapper; + + @Override + public Long createAuthenticate(AuthenticateCreateReqVO createReqVO) { + // 插入 + AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(createReqVO); + authenticateMapper.insert(authenticate); + // 返回 + return authenticate.getId(); + } + + @Override + public void updateAuthenticate(AuthenticateUpdateReqVO updateReqVO) { + // 校验存在 + validateAuthenticateExists(updateReqVO.getId()); + // 更新 + AuthenticateDO updateObj = AuthenticateConvert.INSTANCE.convert(updateReqVO); + authenticateMapper.updateById(updateObj); + } + + @Override + public void deleteAuthenticate(Long id) { + // 校验存在 + validateAuthenticateExists(id); + // 删除 + authenticateMapper.deleteById(id); + } + + private void validateAuthenticateExists(Long id) { + if (authenticateMapper.selectById(id) == null) { + throw exception(AUTHENTICATE_NOT_EXISTS); + } + } + + @Override + public AuthenticateDO getAuthenticate(Long id) { + return authenticateMapper.selectById(id); + } + + @Override + public List getAuthenticateList(Collection ids) { + return authenticateMapper.selectBatchIds(ids); + } + + @Override + public PageResult getAuthenticatePage(AuthenticatePageReqVO pageReqVO) { + return authenticateMapper.selectPage(pageReqVO); + } + + @Override + public List getAuthenticateList(AuthenticateExportReqVO exportReqVO) { + return authenticateMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/authenticate/AuthenticateMapper.xml b/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/authenticate/AuthenticateMapper.xml new file mode 100644 index 00000000..95cc22a3 --- /dev/null +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/resources/mapper/authenticate/AuthenticateMapper.xml @@ -0,0 +1,12 @@ + + + + + + +